Re: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll

2006-10-20 Thread Reid Spencer
Bill,

After updating to the head, this test case is failing for me on Linux.

Reid.

On Thu, 2006-10-19 at 18:22 -0500, Bill Wendling wrote:
 
 Changes in directory llvm/test/Regression/CodeGen/X86:
 
 2006-10-19-SwitchUnnecessaryBranching.ll added (r1.1)
 ---
 Log message:
 
 Testcase for P926
 
 
 ---
 Diffs of the changes:  (+27 -0)
 
  2006-10-19-SwitchUnnecessaryBranching.ll |   27 +++
  1 files changed, 27 insertions(+)
 
 
 Index: 
 llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll
 diff -c /dev/null 
 llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.1
 *** /dev/null Thu Oct 19 18:22:09 2006
 --- llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll 
 Thu Oct 19 18:21:59 2006
 ***
 *** 0 
 --- 1,27 
 + ; RUN: llvm-as  %s | llc -march=x86 | %prcontext jg LBB1_5 1 | grep 
 LBB1_4:

Are you sure that grep is right? 

 + 
 + %str = internal constant [14 x sbyte] cHello world!\0A\00 ; [14 
 x sbyte]* [#uses=1]
 + %str = internal constant [13 x sbyte] cBlah world!\0A\00  ; [13 
 x sbyte]* [#uses=1]
 + 
 + implementation   ; Functions:
 + 
 + int %main(int %argc, sbyte** %argv) {
 + entry:
 + switch int %argc, label %UnifiedReturnBlock [
 +  int 1, label %bb
 +  int 2, label %bb2
 + ]
 + 
 + bb: ; preds = %entry
 + %tmp1 = tail call int (sbyte*, ...)* %printf( sbyte* getelementptr ([14 
 x sbyte]* %str, int 0, uint 0) ); int [#uses=0]
 + ret int 0
 + 
 + bb2:; preds = %entry
 + %tmp4 = tail call int (sbyte*, ...)* %printf( sbyte* getelementptr ([13 
 x sbyte]* %str, int 0, uint 0) ); int [#uses=0]
 + ret int 0
 + 
 + UnifiedReturnBlock: ; preds = %entry
 + ret int 0
 + }
 + 
 + declare int %printf(sbyte*, ...)
 
 
 
 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Target/X86:

X86IntelAsmPrinter.cpp updated: 1.60 - 1.61
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+1 -1)

 X86IntelAsmPrinter.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.60 
llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.61
--- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.60 Wed Oct  4 22:01:21 2006
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp  Fri Oct 20 02:07:24 2006
@@ -474,7 +474,7 @@
 unsigned len = 0;
 bool inString = false;
 for (unsigned i = 0; i  NumElts; i++) {
-  int n = castConstantInt(CVA-getOperand(i))-getRawValue()  255;
+  int n = castConstantInt(CVA-getOperand(i))-getZExtValue()  255;
   if (len == 0)
 O  \tdb ;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.124 - 1.125
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+6 -6)

 Writer.cpp |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.124 
llvm/lib/Bytecode/Writer/Writer.cpp:1.125
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.124   Thu Sep 14 13:23:26 2006
+++ llvm/lib/Bytecode/Writer/Writer.cpp Fri Oct 20 02:07:24 2006
@@ -293,7 +293,7 @@
 assert(CE-getNumOperands()  0  ConstantExpr with 0 operands);
 assert(CE-getNumOperands() != 1 || CE-getOpcode() == Instruction::Cast);
 output_vbr(1+CE-getNumOperands());   // flags as an expr
-output_vbr(CE-getOpcode());// flags as an expr
+output_vbr(CE-getOpcode());  // Put out the CE op code
 
 for (User::const_op_iterator OI = CE-op_begin(); OI != CE-op_end(); 
++OI){
   int Slot = Table.getSlot(*OI);
@@ -307,7 +307,7 @@
 output_vbr(1U);   // 1 - UndefValue constant.
 return;
   } else {
-output_vbr(0U);   // flag as not a ConstantExpr
+output_vbr(0U);   // flag as not a ConstantExpr (i.e. 0 operands)
   }
 
   switch (CPV-getType()-getTypeID()) {
@@ -322,14 +322,14 @@
   case Type::UShortTyID:
   case Type::UIntTyID:
   case Type::ULongTyID:
-output_vbr(castConstantUInt(CPV)-getValue());
+output_vbr(castConstantInt(CPV)-getZExtValue());
 break;
 
   case Type::SByteTyID:   // Signed integer types...
   case Type::ShortTyID:
   case Type::IntTyID:
   case Type::LongTyID:
-output_vbr(castConstantSInt(CPV)-getValue());
+output_vbr(castConstantInt(CPV)-getSExtValue());
 break;
 
   case Type::ArrayTyID: {
@@ -881,11 +881,11 @@
   // FIXME: Most slabs only have 1 or 2 entries!  We should encode this much
   // more compactly.
 
-  // Output type header: [num entries][type id number]
+  // Put out type header: [num entries][type id number]
   //
   output_vbr(NC);
 
-  // Output the Type ID Number...
+  // Put out the Type ID Number...
   int Slot = Table.getSlot(Plane.front()-getType());
   assert (Slot != -1  Type in constant pool but not in function!!);
   output_typeid((unsigned)Slot);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/tools/llvm2cpp:

CppWriter.cpp updated: 1.16 - 1.17
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+5 -6)

 CppWriter.cpp |   11 +--
 1 files changed, 5 insertions(+), 6 deletions(-)


Index: llvm/tools/llvm2cpp/CppWriter.cpp
diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.16 
llvm/tools/llvm2cpp/CppWriter.cpp:1.17
--- llvm/tools/llvm2cpp/CppWriter.cpp:1.16  Thu Sep 28 18:24:48 2006
+++ llvm/tools/llvm2cpp/CppWriter.cpp   Fri Oct 20 02:07:24 2006
@@ -678,12 +678,11 @@
   if (const ConstantBool *CB = dyn_castConstantBool(CV)) {
 Out  ConstantBool*   constName   = ConstantBool::get( 
  (CB-getValue() ? true : false)  );;
-  } else if (const ConstantSInt *CI = dyn_castConstantSInt(CV)) {
-Out  ConstantSInt*   constName   = ConstantSInt::get( 
- typeName  ,   CI-getValue()  );;
-  } else if (const ConstantUInt *CI = dyn_castConstantUInt(CV)) {
-Out  ConstantUInt*   constName   = ConstantUInt::get( 
- typeName  ,   CI-getValue()  );;
+  } else if (const ConstantInt *CI = dyn_castConstantInt(CV)) {
+Out  ConstantInt*   constName   = ConstantInt::get( 
+ typeName  ,  
+ (CV-getType()-isSigned() ? CI-getSExtValue() : 
CI-getZExtValue())
+ );;
   } else if (isaConstantAggregateZero(CV)) {
 Out  ConstantAggregateZero*   constName 
   = ConstantAggregateZero::get(  typeName  );;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp Local.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSwitch.cpp SimplifyCFG.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Transforms/Utils:

CodeExtractor.cpp updated: 1.40 - 1.41
Local.cpp updated: 1.58 - 1.59
LowerAllocations.cpp updated: 1.61 - 1.62
LowerInvoke.cpp updated: 1.41 - 1.42
LowerSwitch.cpp updated: 1.24 - 1.25
SimplifyCFG.cpp updated: 1.100 - 1.101
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+27 -26)

 CodeExtractor.cpp|   14 +++---
 Local.cpp|   14 +++---
 LowerAllocations.cpp |4 ++--
 LowerInvoke.cpp  |8 
 LowerSwitch.cpp  |   11 ++-
 SimplifyCFG.cpp  |2 +-
 6 files changed, 27 insertions(+), 26 deletions(-)


Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp
diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.40 
llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.41
--- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.40Thu Sep 28 17:58:25 2006
+++ llvm/lib/Transforms/Utils/CodeExtractor.cpp Fri Oct 20 02:07:24 2006
@@ -305,7 +305,7 @@
 if (AggregateArgs) {
   std::vectorValue* Indices;
   Indices.push_back(Constant::getNullValue(Type::UIntTy));
-  Indices.push_back(ConstantUInt::get(Type::UIntTy, i));
+  Indices.push_back(ConstantInt::get(Type::UIntTy, i));
   std::string GEPname = gep_ + inputs[i]-getName();
   TerminatorInst *TI = newFunction-begin()-getTerminator();
   GetElementPtrInst *GEP = new GetElementPtrInst(AI, Indices, GEPname, TI);
@@ -392,7 +392,7 @@
 for (unsigned i = 0, e = inputs.size(); i != e; ++i) {
   std::vectorValue* Indices;
   Indices.push_back(Constant::getNullValue(Type::UIntTy));
-  Indices.push_back(ConstantUInt::get(Type::UIntTy, i));
+  Indices.push_back(ConstantInt::get(Type::UIntTy, i));
   GetElementPtrInst *GEP =
 new GetElementPtrInst(Struct, Indices,
   gep_ + StructValues[i]-getName());
@@ -418,7 +418,7 @@
 if (AggregateArgs) {
   std::vectorValue* Indices;
   Indices.push_back(Constant::getNullValue(Type::UIntTy));
-  Indices.push_back(ConstantUInt::get(Type::UIntTy, FirstOut + i));
+  Indices.push_back(ConstantInt::get(Type::UIntTy, FirstOut + i));
   GetElementPtrInst *GEP
 = new GetElementPtrInst(Struct, Indices,
 gep_reload_ + outputs[i]-getName());
@@ -439,7 +439,7 @@
 
   // Now we can emit a switch statement using the call as a value.
   SwitchInst *TheSwitch =
-new SwitchInst(ConstantUInt::getNullValue(Type::UShortTy),
+new SwitchInst(ConstantInt::getNullValue(Type::UShortTy),
codeReplacer, 0, codeReplacer);
 
   // Since there may be multiple exits from the original region, make the new
@@ -473,14 +473,14 @@
 brVal = ConstantBool::get(!SuccNum);
 break;
   default:
-brVal = ConstantUInt::get(Type::UShortTy, SuccNum);
+brVal = ConstantInt::get(Type::UShortTy, SuccNum);
 break;
   }
 
   ReturnInst *NTRet = new ReturnInst(brVal, NewTarget);
 
   // Update the switch instruction.
-  TheSwitch-addCase(ConstantUInt::get(Type::UShortTy, SuccNum),
+  TheSwitch-addCase(ConstantInt::get(Type::UShortTy, SuccNum),
  OldTarget);
 
   // Restore values just before we exit
@@ -519,7 +519,7 @@
   if (AggregateArgs) {
 std::vectorValue* Indices;
 Indices.push_back(Constant::getNullValue(Type::UIntTy));
-
Indices.push_back(ConstantUInt::get(Type::UIntTy,FirstOut+out));
+Indices.push_back(ConstantInt::get(Type::UIntTy,FirstOut+out));
 GetElementPtrInst *GEP =
   new GetElementPtrInst(OAI, Indices,
 gep_ + outputs[out]-getName(),


Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.58 
llvm/lib/Transforms/Utils/Local.cpp:1.59
--- llvm/lib/Transforms/Utils/Local.cpp:1.58Fri May 26 20:18:04 2006
+++ llvm/lib/Transforms/Utils/Local.cpp Fri Oct 20 02:07:24 2006
@@ -272,10 +272,10 @@
   gep_type_iterator I = gep_type_begin(CE), E = gep_type_end(CE);
   for (++I; I != E; ++I)
 if (const StructType *STy = dyn_castStructType(*I)) {
-  ConstantUInt *CU = castConstantUInt(I.getOperand());
-  assert(CU-getValue()  STy-getNumElements() 
+  ConstantInt *CU = castConstantInt(I.getOperand());
+  assert(CU-getZExtValue()  STy-getNumElements() 
  Struct index out of range!);
-  unsigned El = (unsigned)CU-getValue();
+  unsigned El = (unsigned)CU-getZExtValue();
   if (ConstantStruct *CS = dyn_castConstantStruct(C)) {
 C = CS-getOperand(El);
   } else if (isaConstantAggregateZero(C)) {
@@ -287,10 +287,10 @@
  

[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/ExecutionEngine/JIT:

JIT.cpp updated: 1.80 - 1.81
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+12 -12)

 JIT.cpp |   24 
 1 files changed, 12 insertions(+), 12 deletions(-)


Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.80 
llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.81
--- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.80   Sun Sep  3 23:14:57 2006
+++ llvm/lib/ExecutionEngine/JIT/JIT.cppFri Oct 20 02:07:24 2006
@@ -196,22 +196,22 @@
 switch (ArgTy-getTypeID()) {
 default: assert(0  Unknown argument type for function call!);
 case Type::BoolTyID:   C = ConstantBool::get(AV.BoolVal); break;
-case Type::SByteTyID:  C = ConstantSInt::get(ArgTy, AV.SByteVal);  break;
-case Type::UByteTyID:  C = ConstantUInt::get(ArgTy, AV.UByteVal);  break;
-case Type::ShortTyID:  C = ConstantSInt::get(ArgTy, AV.ShortVal);  break;
-case Type::UShortTyID: C = ConstantUInt::get(ArgTy, AV.UShortVal); break;
-case Type::IntTyID:C = ConstantSInt::get(ArgTy, AV.IntVal);break;
-case Type::UIntTyID:   C = ConstantUInt::get(ArgTy, AV.UIntVal);   break;
-case Type::LongTyID:   C = ConstantSInt::get(ArgTy, AV.LongVal);   break;
-case Type::ULongTyID:  C = ConstantUInt::get(ArgTy, AV.ULongVal);  break;
-case Type::FloatTyID:  C = ConstantFP  ::get(ArgTy, AV.FloatVal);  break;
-case Type::DoubleTyID: C = ConstantFP  ::get(ArgTy, AV.DoubleVal); break;
+case Type::SByteTyID:  C = ConstantInt::get(ArgTy, AV.SByteVal);  break;
+case Type::UByteTyID:  C = ConstantInt::get(ArgTy, AV.UByteVal);  break;
+case Type::ShortTyID:  C = ConstantInt::get(ArgTy, AV.ShortVal);  break;
+case Type::UShortTyID: C = ConstantInt::get(ArgTy, AV.UShortVal); break;
+case Type::IntTyID:C = ConstantInt::get(ArgTy, AV.IntVal);break;
+case Type::UIntTyID:   C = ConstantInt::get(ArgTy, AV.UIntVal);   break;
+case Type::LongTyID:   C = ConstantInt::get(ArgTy, AV.LongVal);   break;
+case Type::ULongTyID:  C = ConstantInt::get(ArgTy, AV.ULongVal);  break;
+case Type::FloatTyID:  C = ConstantFP ::get(ArgTy, AV.FloatVal);  break;
+case Type::DoubleTyID: C = ConstantFP ::get(ArgTy, AV.DoubleVal); break;
 case Type::PointerTyID:
   void *ArgPtr = GVTOP(AV);
   if (sizeof(void*) == 4) {
-C = ConstantSInt::get(Type::IntTy, (int)(intptr_t)ArgPtr);
+C = ConstantInt::get(Type::IntTy, (int)(intptr_t)ArgPtr);
   } else {
-C = ConstantSInt::get(Type::LongTy, (intptr_t)ArgPtr);
+C = ConstantInt::get(Type::LongTy, (intptr_t)ArgPtr);
   }
   C = ConstantExpr::getCast(C, ArgTy);  // Cast the integer to pointer
   break;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp ProfilingUtils.cpp RSProfiling.cpp TraceBasicBlocks.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Transforms/Instrumentation:

EmitFunctions.cpp updated: 1.25 - 1.26
ProfilingUtils.cpp updated: 1.7 - 1.8
RSProfiling.cpp updated: 1.7 - 1.8
TraceBasicBlocks.cpp updated: 1.15 - 1.16
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+15 -15)

 EmitFunctions.cpp|2 +-
 ProfilingUtils.cpp   |4 ++--
 RSProfiling.cpp  |   22 +++---
 TraceBasicBlocks.cpp |2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp
diff -u llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.25 
llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.26
--- llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.25  Sun Aug 27 
17:42:52 2006
+++ llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp   Fri Oct 20 
02:07:24 2006
@@ -110,7 +110,7 @@
 
   M.getGlobalList().push_back(funcArray);
 
-  ConstantInt *cnst = ConstantSInt::get(Type::IntTy, counter);
+  ConstantInt *cnst = ConstantInt::get(Type::IntTy, counter);
   GlobalVariable *fnCount = new GlobalVariable(Type::IntTy, true,
GlobalValue::ExternalLinkage,
cnst, llvmFunctionCount);


Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.7 
llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.8
--- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.7  Sat Oct 22 
23:37:20 2005
+++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp  Fri Oct 20 
02:07:24 2006
@@ -51,7 +51,7 @@
 // pass null.
 Args[2] = ConstantPointerNull::get(UIntPtr);
   }
-  Args[3] = ConstantUInt::get(Type::UIntTy, NumElements);
+  Args[3] = ConstantInt::get(Type::UIntTy, NumElements);
 
   Instruction *InitCall = new CallInst(InitFn, Args, newargc, InsertPos);
 
@@ -96,7 +96,7 @@
   // Create the getelementptr constant expression
   std::vectorConstant* Indices(2);
   Indices[0] = Constant::getNullValue(Type::IntTy);
-  Indices[1] = ConstantSInt::get(Type::IntTy, CounterNum);
+  Indices[1] = ConstantInt::get(Type::IntTy, CounterNum);
   Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices);
 
   // Load, increment and store the value back.


Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.7 
llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.8
--- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.7 Sun Aug 27 
19:42:29 2006
+++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Fri Oct 20 02:07:24 2006
@@ -188,10 +188,10 @@
   
 GlobalRandomCounter::GlobalRandomCounter(Module M, const Type* t, 
  uint64_t resetval) : T(t) {
+  ConstantInt* Init = ConstantInt::get(T, resetval); 
+  ResetValue = Init;
   Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage,
-   ConstantUInt::get(T, resetval),
-   RandomSteeringCounter, M);
-  ResetValue = ConstantUInt::get(T, resetval);
+   Init, RandomSteeringCounter, M);
 }
 
 GlobalRandomCounter::~GlobalRandomCounter() {}
@@ -205,7 +205,7 @@
   LoadInst* l = new LoadInst(Counter, counter, t);
   
   SetCondInst* s = new SetCondInst(Instruction::SetEQ, l, 
-  ConstantUInt::get(T, 0), 
+  ConstantInt::get(T, 0), 
countercc, t);
   Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1),
  counternew, t);
@@ -225,10 +225,10 @@
 GlobalRandomCounterOpt::GlobalRandomCounterOpt(Module M, const Type* t, 
uint64_t resetval) 
   : AI(0), T(t) {
+  ConstantInt* Init = ConstantInt::get(T, resetval);
+  ResetValue  = Init;
   Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage,
-   ConstantUInt::get(T, resetval),
-   RandomSteeringCounter, M);
-  ResetValue = ConstantUInt::get(T, resetval);
+   Init, RandomSteeringCounter, M);
 }
 
 GlobalRandomCounterOpt::~GlobalRandomCounterOpt() {}
@@ -278,7 +278,7 @@
   LoadInst* l = new LoadInst(AI, counter, t);
   
   SetCondInst* s = new SetCondInst(Instruction::SetEQ, l, 
-  ConstantUInt::get(T, 0), 
+  ConstantInt::get(T, 0), 
countercc, t);
   Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1),
  counternew, t);
@@ -309,11 

[llvm-commits] CVS: llvm/docs/ProgrammersManual.html Stacker.html

2006-10-20 Thread Reid Spencer


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.94 - 1.95
Stacker.html updated: 1.20 - 1.21
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+14 -19)

 ProgrammersManual.html |   21 -
 Stacker.html   |   12 ++--
 2 files changed, 14 insertions(+), 19 deletions(-)


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.94 
llvm/docs/ProgrammersManual.html:1.95
--- llvm/docs/ProgrammersManual.html:1.94   Wed Oct 11 13:00:22 2006
+++ llvm/docs/ProgrammersManual.htmlFri Oct 20 02:07:23 2006
@@ -2390,8 +2390,8 @@
 div class=doc_text
 
 pConstant represents a base class for different types of constants. It
-is subclassed by ConstantBool, ConstantInt, ConstantSInt, ConstantUInt,
-ConstantArray etc for representing the various types of Constants./p
+is subclassed by ConstantBool, ConstantInt, ConstantArray etc for representing 
+the various types of Constants./p
 
 /div
 
@@ -2406,17 +2406,12 @@
 div class=doc_subsubsectionImportant Subclasses of Constant /div
 div class=doc_text
 ul
-  liConstantSInt : This subclass of Constant represents a signed integer 
-  constant.
+  liConstantInt : This subclass of Constant represents an integer constant.
 ul
-  littint64_t getValue() const/tt: Returns the underlying value of
-  this constant. /li
-/ul
-  /li
-  liConstantUInt : This class represents an unsigned integer.
-ul
-  littuint64_t getValue() const/tt: Returns the underlying value of 
-  this constant. /li
+  littint64_t getSExtValue() const/tt: Returns the underlying value 
of
+  this constant as a sign extended signed integer value./li
+  littuint64_t getZExtValue() const/tt: Returns the underlying value 
+  of this constant as a zero extended unsigned integer value./li
 /ul
   /li
   liConstantFP : This class represents a floating point constant.
@@ -2559,7 +2554,7 @@
   a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2006/10/11 18:00:22 $
+  Last modified: $Date: 2006/10/20 07:07:23 $
 /address
 
 /body


Index: llvm/docs/Stacker.html
diff -u llvm/docs/Stacker.html:1.20 llvm/docs/Stacker.html:1.21
--- llvm/docs/Stacker.html:1.20 Mon Mar 13 23:39:39 2006
+++ llvm/docs/Stacker.html  Fri Oct 20 02:07:23 2006
@@ -139,7 +139,7 @@
 Value* 
 expression(BasicBlock* bb, Value* a, Value* b, Value* x, Value* y )
 {
-ConstantSInt* one = ConstantSInt::get(Type::IntTy, 1);
+ConstantInt* one = ConstantInt::get(Type::IntTy, 1);
 BinaryOperator* or1 = BinaryOperator::createOr(a, b, , bb);
 BinaryOperator* add1 = BinaryOperator::createAdd(x, one, , bb);
 BinaryOperator* add2 = BinaryOperator::createAdd(y, one, , bb);
@@ -308,7 +308,7 @@
 /p
 pre
 std::vectorlt;Value*gt; index_vector;
-index_vector.push_back( ConstantSInt::get( Type::LongTy, 0 );
+index_vector.push_back( ConstantInt::get( Type::LongTy, 0 );
 // ... push other indices ...
 GetElementPtrInst* gep = new GetElementPtrInst( ptr, index_vector );
 /pre
@@ -367,9 +367,9 @@
 ul
  liConstants are Values like anything else and can be operands of 
instructions/li
  liInteger constants, frequently needed, can be created using the static 
get
- methods of the ConstantInt, ConstantSInt, and ConstantUInt classes. The nice 
thing
- about these is that you can get any kind of integer quickly./li
- liThere's a special method on Constant class which allows you to get the 
null 
+ methods of the ConstantInt class. The nice thing about these is that you can 
+ get any kind of integer quickly./li
+ liThere's a special method on Constant class which allows you to get the 
null
  constant for emany/em type. This is really handy for initializing large 
  arrays or structures, etc./li
 /ul
@@ -1405,7 +1405,7 @@
 
   a href=mailto:[EMAIL PROTECTED]Reid Spencer/abr
   a href=http://llvm.org;LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2006/03/14 05:39:39 $
+  Last modified: $Date: 2006/10/20 07:07:23 $
 /address
 
 /body



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Constants.h IntrinsicInst.h Value.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Constants.h updated: 1.88 - 1.89
IntrinsicInst.h updated: 1.18 - 1.19
Value.h updated: 1.84 - 1.85
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+42 -113)

 Constants.h |  148 ++--
 IntrinsicInst.h |4 -
 Value.h |3 -
 3 files changed, 42 insertions(+), 113 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.88 llvm/include/llvm/Constants.h:1.89
--- llvm/include/llvm/Constants.h:1.88  Thu Sep 28 18:36:21 2006
+++ llvm/include/llvm/Constants.h   Fri Oct 20 02:07:23 2006
@@ -41,22 +41,14 @@
 /// @brief An abstract class for integer constants.
 class ConstantIntegral : public Constant {
 protected:
-  union {
-int64_t  Signed;
-uint64_t Unsigned;
-  } Val;
+  uint64_t Val;
   ConstantIntegral(const Type *Ty, ValueTy VT, uint64_t V);
 public:
-
-  /// @brief Return the raw value of the constant as a 64-bit integer value.
-  inline uint64_t getRawValue() const { return Val.Unsigned; }
-  
   /// Return the constant as a 64-bit unsigned integer value after it
   /// has been zero extended as appropriate for the type of this constant.
   /// @brief Return the zero extended value.
   inline uint64_t getZExtValue() const {
-unsigned Size = getType()-getPrimitiveSizeInBits();
-return Val.Unsigned  (~uint64_t(0UL)  (64-Size));
+return Val;
   }
 
   /// Return the constant as a 64-bit integer value after it has been sign
@@ -64,7 +56,7 @@
   /// @brief Return the sign extended value.
   inline int64_t getSExtValue() const {
 unsigned Size = getType()-getPrimitiveSizeInBits();
-return (Val.Signed  (64-Size))  (64-Size);
+return (int64_t(Val)  (64-Size))  (64-Size);
   }
   
   /// This function is implemented by subclasses and will return true iff this
@@ -111,8 +103,7 @@
   static inline bool classof(const ConstantIntegral *) { return true; }
   static bool classof(const Value *V) {
 return V-getValueType() == ConstantBoolVal ||
-   V-getValueType() == ConstantSIntVal ||
-   V-getValueType() == ConstantUIntVal;
+   V-getValueType() == ConstantIntVal;
   }
 };
 
@@ -147,7 +138,7 @@
 
   /// @returns the value of this ConstantBool
   /// @brief return the boolean value of this constant.
-  inline bool getValue() const { return static_castbool(getRawValue()); }
+  inline bool getValue() const { return static_castbool(getZExtValue()); }
 
   /// @see ConstantIntegral for details
   /// @brief Implement overrides
@@ -165,13 +156,15 @@
 
 
 
//===--===//
-/// This is the abstract superclass of ConstantSInt  ConstantUInt, to make 
-/// dealing with integral constants easier when sign is irrelevant.
-/// @brief Abstract clas for constant integers.
+/// This is concrete integer subclass of ConstantIntegral that represents 
+/// both signed and unsigned integral constants, other than boolean.
+/// @brief Class for constant integers.
 class ConstantInt : public ConstantIntegral {
 protected:
   ConstantInt(const ConstantInt );  // DO NOT IMPLEMENT
-  ConstantInt(const Type *Ty, ValueTy VT, uint64_t V);
+  ConstantInt(const Type *Ty, uint64_t V);
+  ConstantInt(const Type *Ty, int64_t V);
+  friend struct ConstantCreatorConstantInt, Type, uint64_t;
 public:
   /// A helper method that can be used to determine if the constant contained 
   /// within is equal to a constant.  This only works for very small values, 
@@ -180,48 +173,15 @@
   bool equalsInt(unsigned char V) const {
 assert(V = 127 
equalsInt: Can only be used with very small positive constants!);
-return Val.Unsigned == V;
+return Val == V;
   }
 
   /// Return a ConstantInt with the specified value for the specified type. 
-  /// This only works for very small values, because this is all that can be 
-  /// represented with all types integer types.
+  /// Overloads for ll the integer types are provided to ensure that implicit
+  /// conversions don't bite us and to get around compiler errors where the 
+  /// compiler can't find a suitable overload for a given integer value.
   /// @brief Get a ConstantInt for a specific value.
-  static ConstantInt *get(const Type *Ty, unsigned char V);
-
-  /// @returns true if this is the null integer value.
-  /// @see ConstantIntegral for details
-  /// @brief Implement override.
-  virtual bool isNullValue() const { return Val.Unsigned == 0; }
-
-  /// @brief Methods to support type inquiry through isa, cast, and dyn_cast.
-  static inline bool classof(const ConstantInt *) { return true; }
-  static bool classof(const Value *V) {
-return V-getValueType() == ConstantSIntVal ||
-   

[llvm-commits] CVS: llvm/lib/Debugger/ProgramInfo.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Debugger:

ProgramInfo.cpp updated: 1.17 - 1.18
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+4 -4)

 ProgramInfo.cpp |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/Debugger/ProgramInfo.cpp
diff -u llvm/lib/Debugger/ProgramInfo.cpp:1.17 
llvm/lib/Debugger/ProgramInfo.cpp:1.18
--- llvm/lib/Debugger/ProgramInfo.cpp:1.17  Fri Jul 28 17:03:44 2006
+++ llvm/lib/Debugger/ProgramInfo.cpp   Fri Oct 20 02:07:24 2006
@@ -114,8 +114,8 @@
   if (Desc  Desc-hasInitializer())
 if (ConstantStruct *CS = dyn_castConstantStruct(Desc-getInitializer()))
   if (CS-getNumOperands()  4) {
-if (ConstantUInt *CUI = dyn_castConstantUInt(CS-getOperand(1)))
-  Version = CUI-getValue();
+if (ConstantInt *CUI = dyn_castConstantInt(CS-getOperand(1)))
+  Version = CUI-getZExtValue();
 
 BaseName  = CS-getOperand(3)-getStringValue();
 Directory = CS-getOperand(4)-getStringValue();
@@ -237,8 +237,8 @@
   if (Desc  Desc-hasInitializer())
 if (ConstantStruct *CS = dyn_castConstantStruct(Desc-getInitializer()))
   if (CS-getNumOperands()  2)
-if (ConstantUInt *CUI = dyn_castConstantUInt(CS-getOperand(2)))
-  LangID = CUI-getValue();
+if (ConstantInt *CUI = dyn_castConstantInt(CS-getOperand(2)))
+  LangID = CUI-getZExtValue();
 
   const SourceLanguage Lang = SourceLanguage::get(LangID);
   SourceFileInfo *New = Lang.createSourceFileInfo(Desc, *this);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/ExecutionEngine:

ExecutionEngine.cpp updated: 1.85 - 1.86
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+13 -13)

 ExecutionEngine.cpp |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)


Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.85 
llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.86
--- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.85   Thu Sep 14 13:23:26 2006
+++ llvm/lib/ExecutionEngine/ExecutionEngine.cppFri Oct 20 02:07:24 2006
@@ -390,19 +390,19 @@
   }
 
   switch (C-getType()-getTypeID()) {
-#define GET_CONST_VAL(TY, CTY, CLASS) \
-  case Type::TY##TyID: Result.TY##Val = (CTY)castCLASS(C)-getValue(); break
-GET_CONST_VAL(Bool   , bool  , ConstantBool);
-GET_CONST_VAL(UByte  , unsigned char , ConstantUInt);
-GET_CONST_VAL(SByte  , signed char   , ConstantSInt);
-GET_CONST_VAL(UShort , unsigned short, ConstantUInt);
-GET_CONST_VAL(Short  , signed short  , ConstantSInt);
-GET_CONST_VAL(UInt   , unsigned int  , ConstantUInt);
-GET_CONST_VAL(Int, signed int, ConstantSInt);
-GET_CONST_VAL(ULong  , uint64_t  , ConstantUInt);
-GET_CONST_VAL(Long   , int64_t   , ConstantSInt);
-GET_CONST_VAL(Float  , float , ConstantFP);
-GET_CONST_VAL(Double , double, ConstantFP);
+#define GET_CONST_VAL(TY, CTY, CLASS, GETMETH) \
+  case Type::TY##TyID: Result.TY##Val = (CTY)castCLASS(C)-GETMETH(); break
+GET_CONST_VAL(Bool   , bool  , ConstantBool, getValue);
+GET_CONST_VAL(UByte  , unsigned char , ConstantInt, getZExtValue);
+GET_CONST_VAL(SByte  , signed char   , ConstantInt, getSExtValue);
+GET_CONST_VAL(UShort , unsigned short, ConstantInt, getZExtValue);
+GET_CONST_VAL(Short  , signed short  , ConstantInt, getSExtValue);
+GET_CONST_VAL(UInt   , unsigned int  , ConstantInt, getZExtValue);
+GET_CONST_VAL(Int, signed int, ConstantInt, getSExtValue);
+GET_CONST_VAL(ULong  , uint64_t  , ConstantInt, getZExtValue);
+GET_CONST_VAL(Long   , int64_t   , ConstantInt, getSExtValue);
+GET_CONST_VAL(Float  , float , ConstantFP, getValue);
+GET_CONST_VAL(Double , double, ConstantFP, getValue);
 #undef GET_CONST_VAL
   case Type::PointerTyID:
 if (isaConstantPointerNull(C))



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/projects/Stacker/lib/compiler:

StackerCompiler.cpp updated: 1.18 - 1.19
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+8 -8)

 StackerCompiler.cpp |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)


Index: llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp
diff -u llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.18 
llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.19
--- llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.18 Fri Aug 18 
04:07:54 2006
+++ llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp  Fri Oct 20 
02:07:24 2006
@@ -463,7 +463,7 @@
 StackerCompiler::push_integer(BasicBlock* bb, int64_t value )
 {
 // Just push a constant integer value
-return push_value( bb, ConstantSInt::get( Type::LongTy, value ) );
+return push_value( bb, ConstantInt::get( Type::LongTy, value ) );
 }
 
 Instruction*
@@ -721,7 +721,7 @@
 
 // Compare the condition against 0
 SetCondInst* cond_inst = new SetCondInst( Instruction::SetNE, cond,
-ConstantSInt::get( Type::LongTy, 0) );
+ConstantInt::get( Type::LongTy, 0) );
 bb-getInstList().push_back( cond_inst );
 
 // Create an exit block
@@ -805,7 +805,7 @@
 
 // Compare the condition against 0
 SetCondInst* cond_inst = new SetCondInst(
-Instruction::SetNE, cond, ConstantSInt::get( Type::LongTy, 0) );
+Instruction::SetNE, cond, ConstantInt::get( Type::LongTy, 0));
 test-getInstList().push_back( cond_inst );
 
 // Add the branch instruction
@@ -1019,7 +1019,7 @@
 if (echo) bb-setName(DECR);
 LoadInst* op1 = castLoadInst(pop_integer(bb));
 BinaryOperator* subop = BinaryOperator::create( Instruction::Sub, op1,
-ConstantSInt::get( Type::LongTy, 1 ) );
+ConstantInt::get( Type::LongTy, 1 ) );
 bb-getInstList().push_back( subop );
 push_value( bb, subop );
 break;
@@ -1089,7 +1089,7 @@
 // bb-getInstList().push_back( negop );
 // So we'll multiply by -1 (ugh)
 BinaryOperator* multop = BinaryOperator::create( Instruction::Mul, op1,
-ConstantSInt::get( Type::LongTy, -1 ) );
+ConstantInt::get( Type::LongTy, -1 ) );
 bb-getInstList().push_back( multop );
 push_value( bb, multop );
 break;
@@ -1601,7 +1601,7 @@
 bb-getInstList().push_back( format_gep );
 
 // Get the character to print (a tab)
-ConstantSInt* newline = ConstantSInt::get(Type::IntTy,
+ConstantInt* newline = ConstantInt::get(Type::IntTy,
 static_castint('\t'));
 
 // Call printf
@@ -1623,7 +1623,7 @@
 bb-getInstList().push_back( format_gep );
 
 // Get the character to print (a space)
-ConstantSInt* newline = ConstantSInt::get(Type::IntTy,
+ConstantInt* newline = ConstantInt::get(Type::IntTy,
 static_castint(' '));
 
 // Call printf
@@ -1645,7 +1645,7 @@
 bb-getInstList().push_back( format_gep );
 
 // Get the character to print (a newline)
-ConstantSInt* newline = ConstantSInt::get(Type::IntTy,
+ConstantInt* newline = ConstantInt::get(Type::IntTy,
 static_castint('\n'));
 
 // Call printf



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/examples/ModuleMaker/ModuleMaker.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/examples/ModuleMaker:

ModuleMaker.cpp updated: 1.8 - 1.9
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+2 -2)

 ModuleMaker.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/examples/ModuleMaker/ModuleMaker.cpp
diff -u llvm/examples/ModuleMaker/ModuleMaker.cpp:1.8 
llvm/examples/ModuleMaker/ModuleMaker.cpp:1.9
--- llvm/examples/ModuleMaker/ModuleMaker.cpp:1.8   Fri Jul 28 17:08:23 2006
+++ llvm/examples/ModuleMaker/ModuleMaker.cpp   Fri Oct 20 02:07:23 2006
@@ -40,8 +40,8 @@
   BasicBlock *BB = new BasicBlock(EntryBlock, F);
 
   // Get pointers to the constant integers...
-  Value *Two = ConstantSInt::get(Type::IntTy, 2);
-  Value *Three = ConstantSInt::get(Type::IntTy, 3);
+  Value *Two = ConstantInt::get(Type::IntTy, 2);
+  Value *Three = ConstantInt::get(Type::IntTy, 3);
 
   // Create the add instruction... does not insert...
   Instruction *Add = BinaryOperator::create(Instruction::Add, Two, Three,



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp ConstantFolding.cpp Constants.cpp Instructions.cpp Type.cpp Verifier.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.208 - 1.209
ConstantFolding.cpp updated: 1.93 - 1.94
Constants.cpp updated: 1.164 - 1.165
Instructions.cpp updated: 1.42 - 1.43
Type.cpp updated: 1.147 - 1.148
Verifier.cpp updated: 1.164 - 1.165
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+229 -233)

 AsmWriter.cpp   |9 -
 ConstantFolding.cpp |  309 
 Constants.cpp   |  122 +++-
 Instructions.cpp|   14 +-
 Type.cpp|6 -
 Verifier.cpp|2 
 6 files changed, 229 insertions(+), 233 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.208 llvm/lib/VMCore/AsmWriter.cpp:1.209
--- llvm/lib/VMCore/AsmWriter.cpp:1.208 Tue Oct 17 21:21:12 2006
+++ llvm/lib/VMCore/AsmWriter.cpp   Fri Oct 20 02:07:24 2006
@@ -422,10 +422,11 @@
   static std::string Indent = \n;
   if (const ConstantBool *CB = dyn_castConstantBool(CV)) {
 Out  (CB-getValue() ? true : false);
-  } else if (const ConstantSInt *CI = dyn_castConstantSInt(CV)) {
-Out  CI-getValue();
-  } else if (const ConstantUInt *CI = dyn_castConstantUInt(CV)) {
-Out  CI-getValue();
+  } else if (const ConstantInt *CI = dyn_castConstantInt(CV)) {
+if (CI-getType()-isSigned())
+  Out  CI-getSExtValue();
+else
+  Out  CI-getZExtValue();
   } else if (const ConstantFP *CFP = dyn_castConstantFP(CV)) {
 // We would like to output the FP constant value in exponential notation,
 // but we cannot do this if doing so will lose precision.  Check here to


Index: llvm/lib/VMCore/ConstantFolding.cpp
diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.93 
llvm/lib/VMCore/ConstantFolding.cpp:1.94
--- llvm/lib/VMCore/ConstantFolding.cpp:1.93Fri Oct 13 12:22:21 2006
+++ llvm/lib/VMCore/ConstantFolding.cpp Fri Oct 20 02:07:24 2006
@@ -271,14 +271,14 @@
   }
 
   DEF_CAST(Bool  , ConstantBool, bool)
-  DEF_CAST(SByte , ConstantSInt, signed char)
-  DEF_CAST(UByte , ConstantUInt, unsigned char)
-  DEF_CAST(Short , ConstantSInt, signed short)
-  DEF_CAST(UShort, ConstantUInt, unsigned short)
-  DEF_CAST(Int   , ConstantSInt, signed int)
-  DEF_CAST(UInt  , ConstantUInt, unsigned int)
-  DEF_CAST(Long  , ConstantSInt, int64_t)
-  DEF_CAST(ULong , ConstantUInt, uint64_t)
+  DEF_CAST(SByte , ConstantInt, signed char)
+  DEF_CAST(UByte , ConstantInt, unsigned char)
+  DEF_CAST(Short , ConstantInt, signed short)
+  DEF_CAST(UShort, ConstantInt, unsigned short)
+  DEF_CAST(Int   , ConstantInt, signed int)
+  DEF_CAST(UInt  , ConstantInt, unsigned int)
+  DEF_CAST(Long  , ConstantInt, int64_t)
+  DEF_CAST(ULong , ConstantInt, uint64_t)
   DEF_CAST(Float , ConstantFP  , float)
   DEF_CAST(Double, ConstantFP  , double)
 #undef DEF_CAST
@@ -303,28 +303,28 @@
 return ConstantBool::getFalse();
   }
   static Constant *CastToSByte (const Constant *V) {
-return ConstantSInt::get(Type::SByteTy, 0);
+return ConstantInt::get(Type::SByteTy, 0);
   }
   static Constant *CastToUByte (const Constant *V) {
-return ConstantUInt::get(Type::UByteTy, 0);
+return ConstantInt::get(Type::UByteTy, 0);
   }
   static Constant *CastToShort (const Constant *V) {
-return ConstantSInt::get(Type::ShortTy, 0);
+return ConstantInt::get(Type::ShortTy, 0);
   }
   static Constant *CastToUShort(const Constant *V) {
-return ConstantUInt::get(Type::UShortTy, 0);
+return ConstantInt::get(Type::UShortTy, 0);
   }
   static Constant *CastToInt   (const Constant *V) {
-return ConstantSInt::get(Type::IntTy, 0);
+return ConstantInt::get(Type::IntTy, 0);
   }
   static Constant *CastToUInt  (const Constant *V) {
-return ConstantUInt::get(Type::UIntTy, 0);
+return ConstantInt::get(Type::UIntTy, 0);
   }
   static Constant *CastToLong  (const Constant *V) {
-return ConstantSInt::get(Type::LongTy, 0);
+return ConstantInt::get(Type::LongTy, 0);
   }
   static Constant *CastToULong (const Constant *V) {
-return ConstantUInt::get(Type::ULongTy, 0);
+return ConstantInt::get(Type::ULongTy, 0);
   }
   static Constant *CastToFloat (const Constant *V) {
 return ConstantFP::get(Type::FloatTy, 0);
@@ -428,49 +428,46 @@
 
 
 
//===--===//
-// DirectRules Class
+//   DirectIntRules Class
 
//===--===//
 //
-// DirectRules provides a concrete base classes of ConstRules for a variety of
-// different types.  This allows the C++ compiler to automatically generate our
-// constant handling operations in a typesafe and accurate manner.
+// DirectIntRules provides implementations of 

[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.198 - 1.199
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+11 -13)

 Reader.cpp |   24 +++-
 1 files changed, 11 insertions(+), 13 deletions(-)


Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.198 
llvm/lib/Bytecode/Reader/Reader.cpp:1.199
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.198   Thu Sep 14 13:23:26 2006
+++ llvm/lib/Bytecode/Reader/Reader.cpp Fri Oct 20 02:07:24 2006
@@ -1010,8 +1010,9 @@
 
   // Convert ubyte struct indices into uint struct indices.
   if (isaStructType(TopTy)  hasRestrictedGEPTypes)
-if (ConstantUInt *C = dyn_castConstantUInt(Idx.back()))
-  Idx[Idx.size()-1] = ConstantExpr::getCast(C, Type::UIntTy);
+if (ConstantInt *C = dyn_castConstantInt(Idx.back()))
+  if (C-getType() == Type::UByteTy)
+Idx[Idx.size()-1] = ConstantExpr::getCast(C, Type::UIntTy);
 
   NextTy = GetElementPtrInst::getIndexedType(InstTy, Idx, true);
 }
@@ -1549,15 +1550,15 @@
   case Type::UShortTyID:
   case Type::UIntTyID: {
 unsigned Val = read_vbr_uint();
-if (!ConstantUInt::isValueValidForType(Ty, Val))
+if (!ConstantInt::isValueValidForType(Ty, uint64_t(Val)))
   error(Invalid unsigned byte/short/int read.);
-Result = ConstantUInt::get(Ty, Val);
+Result = ConstantInt::get(Ty, Val);
 if (Handler) Handler-handleConstantValue(Result);
 break;
   }
 
   case Type::ULongTyID:
-Result = ConstantUInt::get(Ty, read_vbr_uint64());
+Result = ConstantInt::get(Ty, read_vbr_uint64());
 if (Handler) Handler-handleConstantValue(Result);
 break;
 
@@ -1566,9 +1567,9 @@
   case Type::IntTyID:
   case Type::LongTyID: {
 int64_t Val = read_vbr_int64();
-if (!ConstantSInt::isValueValidForType(Ty, Val))
+if (!ConstantInt::isValueValidForType(Ty, Val))
   error(Invalid signed byte/short/int/long read.);
-Result = ConstantSInt::get(Ty, Val);
+Result = ConstantInt::get(Ty, Val);
 if (Handler) Handler-handleConstantValue(Result);
 break;
   }
@@ -1699,12 +1700,9 @@
 read_data(Data, Data+ATy-getNumElements());
 
 std::vectorConstant* Elements(ATy-getNumElements());
-if (ATy-getElementType() == Type::SByteTy)
-  for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i)
-Elements[i] = ConstantSInt::get(Type::SByteTy, (signed char)Data[i]);
-else
-  for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i)
-Elements[i] = ConstantUInt::get(Type::UByteTy, (unsigned char)Data[i]);
+const Type* ElemType = ATy-getElementType();
+for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i)
+  Elements[i] = ConstantInt::get(ElemType, (unsigned char)Data[i]);
 
 // Create the constant, inserting it as needed.
 Constant *C = ConstantArray::get(ATy, Elements);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Analysis/DataStructure:

Local.cpp updated: 1.154 - 1.155
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+1 -1)

 Local.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.154 
llvm/lib/Analysis/DataStructure/Local.cpp:1.155
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.154 Fri Oct 13 12:38:22 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp   Fri Oct 20 02:07:24 2006
@@ -407,7 +407,7 @@
I != E; ++I)
 if (const StructType *STy = dyn_castStructType(*I)) {
   unsigned FieldNo =
-   (unsigned)castConstantUInt(I.getOperand())-getValue();
+   (unsigned)castConstantInt(I.getOperand())-getZExtValue();
   Offset += (unsigned)TD.getStructLayout(STy)-MemberOffsets[FieldNo];
 } else if (const PointerType *PTy = dyn_castPointerType(*I)) {
   if (!isaConstant(I.getOperand()) ||



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Target/Alpha:

AlphaISelDAGToDAG.cpp updated: 1.58 - 1.59
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+1 -2)

 AlphaISelDAGToDAG.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.58 
llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.59
--- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.58Wed Oct 11 11:24:51 2006
+++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Fri Oct 20 02:07:24 2006
@@ -317,8 +317,7 @@
   break; //(zext (LDAH (LDA)))
 //Else use the constant pool
 MachineConstantPool *CP = BB-getParent()-getConstantPool();
-ConstantUInt *C =
-  ConstantUInt::get(Type::getPrimitiveType(Type::ULongTyID) , uval);
+ConstantInt *C = ConstantInt::get(Type::ULongTy, uval);
 SDOperand CPI = CurDAG-getTargetConstantPool(C, MVT::i64);
 SDNode *Tmp = CurDAG-getTargetNode(Alpha::LDAHr, MVT::i64, CPI,
 getGlobalBaseReg());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp IntrinsicLowering.cpp MachineDebugInfo.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.111 - 1.112
IntrinsicLowering.cpp updated: 1.43 - 1.44
MachineDebugInfo.cpp updated: 1.50 - 1.51
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+45 -42)

 AsmPrinter.cpp|   23 ---
 IntrinsicLowering.cpp |   35 ++-
 MachineDebugInfo.cpp  |   29 +++--
 3 files changed, 45 insertions(+), 42 deletions(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.111 
llvm/lib/CodeGen/AsmPrinter.cpp:1.112
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.111   Tue Oct 17 12:17:24 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp Fri Oct 20 02:07:24 2006
@@ -393,14 +393,15 @@
   else if (const ConstantBool *CB = dyn_castConstantBool(CV)) {
 assert(CB-getValue());
 O  1;
-  } else if (const ConstantSInt *CI = dyn_castConstantSInt(CV))
-if (((CI-getValue()  32)  32) == CI-getValue())
-  O  CI-getValue();
-else
-  O  (uint64_t)CI-getValue();
-  else if (const ConstantUInt *CI = dyn_castConstantUInt(CV))
-O  CI-getValue();
-  else if (const GlobalValue *GV = dyn_castGlobalValue(CV)) {
+  } else if (const ConstantInt *CI = dyn_castConstantInt(CV)) {
+if (CI-getType()-isSigned()) {
+  if (((CI-getSExtValue()  32)  32) == CI-getSExtValue())
+O  CI-getSExtValue();
+  else
+O  (uint64_t)CI-getSExtValue();
+} else 
+  O  CI-getZExtValue();
+  } else if (const GlobalValue *GV = dyn_castGlobalValue(CV)) {
 // This is a constant address for a global variable or function. Use the
 // name of the variable or function as the address value, possibly
 // decorating it with GlobalVarAddrPrefix/Suffix or
@@ -492,7 +493,7 @@
   O  \;
   for (unsigned i = 0; i != LastElt; ++i) {
 unsigned char C =
-(unsigned char)castConstantInt(CVA-getOperand(i))-getRawValue();
+(unsigned char)castConstantInt(CVA-getOperand(i))-getZExtValue();
 
 if (C == '') {
   O  \\\;
@@ -524,7 +525,7 @@
 void AsmPrinter::EmitString(const ConstantArray *CVA) const {
   unsigned NumElts = CVA-getNumOperands();
   if (TAI-getAscizDirective()  NumElts  
-  castConstantInt(CVA-getOperand(NumElts-1))-getRawValue() == 0) {
+  castConstantInt(CVA-getOperand(NumElts-1))-getZExtValue() == 0) {
 O  TAI-getAscizDirective();
 printAsCString(O, CVA, NumElts-1);
   } else {
@@ -604,7 +605,7 @@
 }
   } else if (CV-getType() == Type::ULongTy || CV-getType() == Type::LongTy) {
 if (const ConstantInt *CI = dyn_castConstantInt(CV)) {
-  uint64_t Val = CI-getRawValue();
+  uint64_t Val = CI-getZExtValue();
 
   if (TAI-getData64bitsDirective())
 O  TAI-getData64bitsDirective()  Val  \n;


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.43 
llvm/lib/CodeGen/IntrinsicLowering.cpp:1.44
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.43 Thu Mar 23 12:06:46 2006
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp  Fri Oct 20 02:07:24 2006
@@ -166,10 +166,10 @@
 Value *Tmp1 = new ShiftInst(Instruction::Shr, V,
   ConstantInt::get(Type::UByteTy,24),bswap.1, 
IP);
 Tmp3 = BinaryOperator::createAnd(Tmp3, 
- ConstantUInt::get(Type::UIntTy, 0xFF),
+ ConstantInt::get(Type::UIntTy, 0xFF),
  bswap.and3, IP);
 Tmp2 = BinaryOperator::createAnd(Tmp2, 
- ConstantUInt::get(Type::UIntTy, 0xFF00),
+ ConstantInt::get(Type::UIntTy, 0xFF00),
  bswap.and2, IP);
 Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, bswap.or1, IP);
 Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, bswap.or2, IP);
@@ -194,23 +194,24 @@
 Value *Tmp1 = new ShiftInst(Instruction::Shr, V,
   ConstantInt::get(Type::UByteTy,56),bswap.1, 
IP);
 Tmp7 = BinaryOperator::createAnd(Tmp7,
-  ConstantUInt::get(Type::ULongTy, 
0xFFULL),
-  bswap.and7, IP);
+ ConstantInt::get(Type::ULongTy, 
+   0xFFULL),
+ bswap.and7, IP);
 Tmp6 = BinaryOperator::createAnd(Tmp6,
-ConstantUInt::get(Type::ULongTy, 
0xFF00ULL),
-bswap.and6, IP);
+ ConstantInt::get(Type::ULongTy, 
0xFF00ULL),
+ bswap.and6, IP);
 Tmp5 = BinaryOperator::createAnd(Tmp5,
-  ConstantUInt::get(Type::ULongTy, 

[llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp ConstantFolding.cpp ConstantRange.cpp ScalarEvolution.cpp ScalarEvolutionExpander.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Analysis:

BasicAliasAnalysis.cpp updated: 1.86 - 1.87
ConstantFolding.cpp updated: 1.4 - 1.5
ConstantRange.cpp updated: 1.15 - 1.16
ScalarEvolution.cpp updated: 1.53 - 1.54
ScalarEvolutionExpander.cpp updated: 1.3 - 1.4
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+30 -30)

 BasicAliasAnalysis.cpp  |   15 +++
 ConstantFolding.cpp |   11 ++-
 ConstantRange.cpp   |4 ++--
 ScalarEvolution.cpp |   28 ++--
 ScalarEvolutionExpander.cpp |2 +-
 5 files changed, 30 insertions(+), 30 deletions(-)


Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.86 
llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.87
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.86   Wed Oct  4 16:52:35 2006
+++ llvm/lib/Analysis/BasicAliasAnalysis.cppFri Oct 20 02:07:24 2006
@@ -468,11 +468,10 @@
 /// CheckGEPInstructions - Check two GEP instructions with known must-aliasing
 /// base pointers.  This checks to see if the index expressions preclude the
 /// pointers from aliasing...
-AliasAnalysis::AliasResult BasicAliasAnalysis::
-CheckGEPInstructions(const Type* BasePtr1Ty, std::vectorValue* GEP1Ops,
- unsigned G1S,
- const Type *BasePtr2Ty, std::vectorValue* GEP2Ops,
- unsigned G2S) {
+AliasAnalysis::AliasResult 
+BasicAliasAnalysis::CheckGEPInstructions(
+  const Type* BasePtr1Ty, std::vectorValue* GEP1Ops, unsigned G1S,
+  const Type *BasePtr2Ty, std::vectorValue* GEP2Ops, unsigned G2S) {
   // We currently can't handle the case when the base pointers have different
   // primitive types.  Since this is uncommon anyway, we are happy being
   // extremely conservative.
@@ -670,7 +669,7 @@
 if (const ConstantInt *Op1C = dyn_castConstantInt(Op1)) {
   // If this is an array index, make sure the array element is in 
range.
   if (const ArrayType *AT = dyn_castArrayType(BasePtr1Ty))
-if (Op1C-getRawValue() = AT-getNumElements())
+if (Op1C-getZExtValue() = AT-getNumElements())
   return MayAlias;  // Be conservative with out-of-range accesses
 
 } else {
@@ -685,7 +684,7 @@
   // value possible.
   //
   if (const ArrayType *AT = dyn_castArrayType(BasePtr1Ty))
-GEP1Ops[i] = 
ConstantSInt::get(Type::LongTy,AT-getNumElements()-1);
+GEP1Ops[i] = ConstantInt::get(Type::LongTy, 
AT-getNumElements()-1);
 }
   }
 
@@ -693,7 +692,7 @@
 if (const ConstantInt *Op2C = dyn_castConstantInt(Op2)) {
   // If this is an array index, make sure the array element is in 
range.
   if (const ArrayType *AT = dyn_castArrayType(BasePtr1Ty))
-if (Op2C-getRawValue() = AT-getNumElements())
+if (Op2C-getZExtValue() = AT-getNumElements())
   return MayAlias;  // Be conservative with out-of-range accesses
 } else {  // Conservatively assume the minimum value for this index
   GEP2Ops[i] = Constant::getNullValue(Op2-getType());


Index: llvm/lib/Analysis/ConstantFolding.cpp
diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.4 
llvm/lib/Analysis/ConstantFolding.cpp:1.5
--- llvm/lib/Analysis/ConstantFolding.cpp:1.4   Sat Jun 17 13:17:52 2006
+++ llvm/lib/Analysis/ConstantFolding.cpp   Fri Oct 20 02:07:24 2006
@@ -163,14 +163,15 @@
 default:
   break;
   }
-} else if (ConstantUInt *Op = dyn_castConstantUInt(Operands[0])) {
-  uint64_t V = Op-getValue();
+} else if (ConstantInt *Op = dyn_castConstantInt(Operands[0])) {
+  assert(Op-getType()-isUnsigned()  bswap args must be unsigned);
+  uint64_t V = Op-getZExtValue();
   if (Name == llvm.bswap.i16)
-return ConstantUInt::get(Ty, ByteSwap_16(V));
+return ConstantInt::get(Ty, ByteSwap_16(V));
   else if (Name == llvm.bswap.i32)
-return ConstantUInt::get(Ty, ByteSwap_32(V));
+return ConstantInt::get(Ty, ByteSwap_32(V));
   else if (Name == llvm.bswap.i64)
-return ConstantUInt::get(Ty, ByteSwap_64(V));
+return ConstantInt::get(Ty, ByteSwap_64(V));
 }
   } else if (Operands.size() == 2) {
 if (ConstantFP *Op1 = dyn_castConstantFP(Operands[0])) {


Index: llvm/lib/Analysis/ConstantRange.cpp
diff -u llvm/lib/Analysis/ConstantRange.cpp:1.15 
llvm/lib/Analysis/ConstantRange.cpp:1.16
--- llvm/lib/Analysis/ConstantRange.cpp:1.15Thu Sep 28 18:14:29 2006
+++ llvm/lib/Analysis/ConstantRange.cpp Fri Oct 20 02:07:24 2006
@@ -161,7 +161,7 @@
 
   // Simply subtract the bounds...
   Constant *Result = ConstantExpr::getSub(Upper, Lower);
-  return castConstantInt(Result)-getRawValue();
+  return 

[llvm-commits] CVS: llvm/examples/Fibonacci/fibonacci.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/examples/Fibonacci:

fibonacci.cpp updated: 1.11 - 1.12
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+2 -2)

 fibonacci.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/examples/Fibonacci/fibonacci.cpp
diff -u llvm/examples/Fibonacci/fibonacci.cpp:1.11 
llvm/examples/Fibonacci/fibonacci.cpp:1.12
--- llvm/examples/Fibonacci/fibonacci.cpp:1.11  Thu Mar 23 21:11:31 2006
+++ llvm/examples/Fibonacci/fibonacci.cpp   Fri Oct 20 02:07:23 2006
@@ -45,8 +45,8 @@
   BasicBlock *BB = new BasicBlock(EntryBlock, FibF);
 
   // Get pointers to the constants.
-  Value *One = ConstantSInt::get(Type::IntTy, 1);
-  Value *Two = ConstantSInt::get(Type::IntTy, 2);
+  Value *One = ConstantInt::get(Type::IntTy, 1);
+  Value *Two = ConstantInt::get(Type::IntTy, 2);
 
   // Get pointer to the integer argument of the add1 function...
   Argument *ArgX = FibF-arg_begin();   // Get the arg.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/ExecutionEngine/Interpreter:

Execution.cpp updated: 1.139 - 1.140
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+2 -2)

 Execution.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.139 
llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.140
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.139Mon Feb  6 
23:29:44 2006
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp  Fri Oct 20 02:07:24 2006
@@ -735,8 +735,8 @@
 if (const StructType *STy = dyn_castStructType(*I)) {
   const StructLayout *SLO = TD.getStructLayout(STy);
 
-  const ConstantUInt *CPU = castConstantUInt(I.getOperand());
-  unsigned Index = unsigned(CPU-getValue());
+  const ConstantInt *CPU = castConstantInt(I.getOperand());
+  unsigned Index = unsigned(CPU-getZExtValue());
 
   Total += (PointerTy)SLO-MemberOffsets[Index];
 } else {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/tools/bugpoint:

ExtractFunction.cpp updated: 1.52 - 1.53
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+3 -3)

 ExtractFunction.cpp |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/tools/bugpoint/ExtractFunction.cpp
diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.52 
llvm/tools/bugpoint/ExtractFunction.cpp:1.53
--- llvm/tools/bugpoint/ExtractFunction.cpp:1.52Tue Aug 29 18:38:20 2006
+++ llvm/tools/bugpoint/ExtractFunction.cpp Fri Oct 20 02:07:24 2006
@@ -181,7 +181,7 @@
   std::vectorConstant* ArrayElts;
   for (unsigned i = 0, e = TorList.size(); i != e; ++i) {
 std::vectorConstant* Elts;
-Elts.push_back(ConstantSInt::get(Type::IntTy, TorList[i].second));
+Elts.push_back(ConstantInt::get(Type::IntTy, TorList[i].second));
 Elts.push_back(TorList[i].first);
 ArrayElts.push_back(ConstantStruct::get(Elts));
   }
@@ -210,8 +210,8 @@
   if (CS-getOperand(1)-isNullValue())
 break;  // Found a null terminator, stop here.
   
-  ConstantSInt *CI = dyn_castConstantSInt(CS-getOperand(0));
-  int Priority = CI ? CI-getValue() : 0;
+  ConstantInt *CI = dyn_castConstantInt(CS-getOperand(0));
+  int Priority = CI ? CI-getSExtValue() : 0;
   
   Constant *FP = CS-getOperand(1);
   if (ConstantExpr *CE = dyn_castConstantExpr(FP))



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Target:

TargetData.cpp updated: 1.70 - 1.71
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+2 -2)

 TargetData.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.70 llvm/lib/Target/TargetData.cpp:1.71
--- llvm/lib/Target/TargetData.cpp:1.70 Fri Jun 16 13:22:52 2006
+++ llvm/lib/Target/TargetData.cpp  Fri Oct 20 02:07:24 2006
@@ -330,7 +330,7 @@
   for (unsigned CurIDX = 0; CurIDX != Idx.size(); ++CurIDX, ++TI) {
 if (const StructType *STy = dyn_castStructType(*TI)) {
   assert(Idx[CurIDX]-getType() == Type::UIntTy  Illegal struct idx);
-  unsigned FieldNo = castConstantUInt(Idx[CurIDX])-getValue();
+  unsigned FieldNo = castConstantInt(Idx[CurIDX])-getZExtValue();
 
   // Get structure layout information...
   const StructLayout *Layout = getStructLayout(STy);
@@ -346,7 +346,7 @@
   Ty = castSequentialType(Ty)-getElementType();
 
   // Get the array index and the size of each array element.
-  int64_t arrayIdx = castConstantInt(Idx[CurIDX])-getRawValue();
+  int64_t arrayIdx = castConstantInt(Idx[CurIDX])-getSExtValue();
   Result += arrayIdx * (int64_t)getTypeSize(Ty);
 }
   }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAGISel.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.412 - 1.413
SelectionDAGISel.cpp updated: 1.290 - 1.291
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+39 -37)

 LegalizeDAG.cpp  |6 ++--
 SelectionDAGISel.cpp |   70 ++-
 2 files changed, 39 insertions(+), 37 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.412 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.413
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.412 Fri Oct 13 16:12:22 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Fri Oct 20 02:07:24 2006
@@ -3562,7 +3562,7 @@
 CV.push_back(ConstantFP::get(OpNTy, V-getValue()));
   } else if (ConstantSDNode *V = 
  dyn_castConstantSDNode(Node-getOperand(i))) {
-CV.push_back(ConstantUInt::get(OpNTy, V-getValue()));
+CV.push_back(ConstantInt::get(OpNTy, V-getValue()));
   } else {
 assert(Node-getOperand(i).getOpcode() == ISD::UNDEF);
 CV.push_back(UndefValue::get(OpNTy));
@@ -3915,7 +3915,7 @@
   SignSet, Four, Zero);
 uint64_t FF = 0x5f80ULL;
 if (TLI.isLittleEndian()) FF = 32;
-static Constant *FudgeFactor = ConstantUInt::get(Type::ULongTy, FF);
+static Constant *FudgeFactor = ConstantInt::get(Type::ULongTy, FF);
 
 SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
 CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
@@ -4046,7 +4046,7 @@
   case MVT::i64: FF = 0x5F80ULL; break;  // 2^64 (as a float)
   }
   if (TLI.isLittleEndian()) FF = 32;
-  static Constant *FudgeFactor = ConstantUInt::get(Type::ULongTy, FF);
+  static Constant *FudgeFactor = ConstantInt::get(Type::ULongTy, FF);
 
   SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy());
   CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.290 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.291
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.290Thu Oct 19 
16:46:38 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Fri Oct 20 02:07:24 2006
@@ -236,21 +236,22 @@
   Function::iterator BB = Fn.begin(), EB = Fn.end();
   for (BasicBlock::iterator I = BB-begin(), E = BB-end(); I != E; ++I)
 if (AllocaInst *AI = dyn_castAllocaInst(I))
-  if (ConstantUInt *CUI = dyn_castConstantUInt(AI-getArraySize())) {
+  if (ConstantInt *CUI = dyn_castConstantInt(AI-getArraySize())) {
 const Type *Ty = AI-getAllocatedType();
 uint64_t TySize = TLI.getTargetData()-getTypeSize(Ty);
 unsigned Align = 
   std::max((unsigned)TLI.getTargetData()-getTypeAlignment(Ty),
AI-getAlignment());
 
-// If the alignment of the value is smaller than the size of the value,
-// and if the size of the value is particularly small (= 8 bytes),
-// round up to the size of the value for potentially better 
performance.
+// If the alignment of the value is smaller than the size of the 
+// value, and if the size of the value is particularly small 
+// (= 8 bytes), round up to the size of the value for potentially 
+// better performance.
 //
 // FIXME: This could be made better with a preferred alignment hook in
 // TargetData.  It serves primarily to 8-byte align doubles for X86.
 if (Align  TySize  TySize = 8) Align = TySize;
-TySize *= CUI-getValue();   // Get total allocated size.
+TySize *= CUI-getZExtValue();   // Get total allocated size.
 if (TySize == 0) TySize = 1; // Don't create zero-sized stack objects.
 StaticAllocaMap[AI] =
   MF.getFrameInfo()-CreateStackObject((unsigned)TySize, Align);
@@ -393,11 +394,13 @@
   /// The comparison function for sorting Case values.
   struct CaseCmp {
 bool operator () (const Case C1, const Case C2) {
-  if (const ConstantUInt* U1 = dyn_castconst ConstantUInt(C1.first))
-return U1-getValue()  castconst ConstantUInt(C2.first)-getValue();
+  if (const ConstantInt* I1 = dyn_castconst ConstantInt(C1.first))
+if (I1-getType()-isUnsigned())
+  return I1-getZExtValue() 
+castconst ConstantInt(C2.first)-getZExtValue();
   
-  const ConstantSInt* S1 = dyn_castconst ConstantSInt(C1.first);
-  return S1-getValue()  castconst ConstantSInt(C2.first)-getValue();
+  return castconst ConstantInt(C1.first)-getSExtValue() 
+ castconst 

[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Target/ARM:

ARMISelDAGToDAG.cpp updated: 1.76 - 1.77
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+1 -2)

 ARMISelDAGToDAG.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.76 
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.77
--- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.76Thu Oct 19 07:06:50 2006
+++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Fri Oct 20 02:07:24 2006
@@ -810,8 +810,7 @@
   case ISD::Constant: {
 uint32_t val = castConstantSDNode(N)-getValue();
 if(!isRotInt8Immediate(val)) {
-  const Type  *t =  MVT::getTypeForValueType(MVT::i32);
-  Constant*C = ConstantUInt::get(t, val);
+  Constant*C = ConstantInt::get(Type::UIntTy, val);
   int  alignment = 2;
   SDOperand Addr = CurDAG-getTargetConstantPool(C, MVT::i32, alignment);
   SDOperandZ = CurDAG-getTargetConstant(0, MVT::i32);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/examples/HowToUseJIT/HowToUseJIT.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/examples/HowToUseJIT:

HowToUseJIT.cpp updated: 1.11 - 1.12
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+2 -2)

 HowToUseJIT.cpp |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/examples/HowToUseJIT/HowToUseJIT.cpp
diff -u llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.11 
llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.12
--- llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.11  Thu Mar 23 21:11:31 2006
+++ llvm/examples/HowToUseJIT/HowToUseJIT.cpp   Fri Oct 20 02:07:23 2006
@@ -60,7 +60,7 @@
   BasicBlock *BB = new BasicBlock(EntryBlock, Add1F);
 
   // Get pointers to the constant `1'.
-  Value *One = ConstantSInt::get(Type::IntTy, 1);
+  Value *One = ConstantInt::get(Type::IntTy, 1);
 
   // Get pointers to the integer argument of the add1 function...
   assert(Add1F-arg_begin() != Add1F-arg_end()); // Make sure there's an arg
@@ -84,7 +84,7 @@
   BB = new BasicBlock(EntryBlock, FooF);
 
   // Get pointers to the constant `10'.
-  Value *Ten = ConstantSInt::get(Type::IntTy, 10);
+  Value *Ten = ConstantInt::get(Type::IntTy, 10);
 
   // Pass Ten to the call call:
   std::vectorValue* Params;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/TransformInternals.cpp TransformInternals.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Transforms:

TransformInternals.cpp updated: 1.50 - 1.51
TransformInternals.h updated: 1.27 - 1.28
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+6 -5)

 TransformInternals.cpp |9 +
 TransformInternals.h   |2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/TransformInternals.cpp
diff -u llvm/lib/Transforms/TransformInternals.cpp:1.50 
llvm/lib/Transforms/TransformInternals.cpp:1.51
--- llvm/lib/Transforms/TransformInternals.cpp:1.50 Fri Oct 28 23:41:30 2005
+++ llvm/lib/Transforms/TransformInternals.cpp  Fri Oct 20 02:07:24 2006
@@ -34,7 +34,7 @@
  (i == SL-MemberOffsets.size()-1 || Offset  SL-MemberOffsets[i+1]));
 
   // Make sure to save the current index...
-  Indices.push_back(ConstantUInt::get(Type::UIntTy, i));
+  Indices.push_back(ConstantInt::get(Type::UIntTy, i));
   Offset = SL-MemberOffsets[i];
   return STy-getContainedType(i);
 }
@@ -73,10 +73,11 @@
 
 NextType = ATy-getElementType();
 unsigned ChildSize = (unsigned)TD.getTypeSize(NextType);
-if (ConstantSInt::isValueValidForType(Type::IntTy, Offset/ChildSize))
-  Indices.push_back(ConstantSInt::get(Type::IntTy, Offset/ChildSize));
+if (ConstantInt::isValueValidForType(Type::IntTy, 
+ uint64_t(Offset/ChildSize)))
+  Indices.push_back(ConstantInt::get(Type::IntTy, Offset/ChildSize));
 else
-  Indices.push_back(ConstantSInt::get(Type::LongTy, Offset/ChildSize));
+  Indices.push_back(ConstantInt::get(Type::LongTy, Offset/ChildSize));
 ThisOffset = (Offset/ChildSize)*ChildSize;
   } else {
 Offset = 0;   // Return the offset that we were able to achieve


Index: llvm/lib/Transforms/TransformInternals.h
diff -u llvm/lib/Transforms/TransformInternals.h:1.27 
llvm/lib/Transforms/TransformInternals.h:1.28
--- llvm/lib/Transforms/TransformInternals.h:1.27   Tue Jul 26 11:38:28 2005
+++ llvm/lib/Transforms/TransformInternals.hFri Oct 20 02:07:24 2006
@@ -25,7 +25,7 @@
 namespace llvm {
 
 static inline int64_t getConstantValue(const ConstantInt *CPI) {
-  return (int64_t)castConstantInt(CPI)-getRawValue();
+  return (int64_t)castConstantInt(CPI)-getZExtValue();
 }
 
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/examples/ParallelJIT/ParallelJIT.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/examples/ParallelJIT:

ParallelJIT.cpp updated: 1.5 - 1.6
---
Log message:

For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


---
Diffs of the changes:  (+3 -3)

 ParallelJIT.cpp |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/examples/ParallelJIT/ParallelJIT.cpp
diff -u llvm/examples/ParallelJIT/ParallelJIT.cpp:1.5 
llvm/examples/ParallelJIT/ParallelJIT.cpp:1.6
--- llvm/examples/ParallelJIT/ParallelJIT.cpp:1.5   Thu Mar 23 21:11:31 2006
+++ llvm/examples/ParallelJIT/ParallelJIT.cpp   Fri Oct 20 02:07:23 2006
@@ -42,7 +42,7 @@
   BasicBlock *BB = new BasicBlock(EntryBlock, Add1F);
 
   // Get pointers to the constant `1'.
-  Value *One = ConstantSInt::get(Type::IntTy, 1);
+  Value *One = ConstantInt::get(Type::IntTy, 1);
 
   // Get pointers to the integer argument of the add1 function...
   assert(Add1F-arg_begin() != Add1F-arg_end()); // Make sure there's an arg
@@ -70,8 +70,8 @@
   BasicBlock *BB = new BasicBlock(EntryBlock, FibF);
 
   // Get pointers to the constants.
-  Value *One = ConstantSInt::get(Type::IntTy, 1);
-  Value *Two = ConstantSInt::get(Type::IntTy, 2);
+  Value *One = ConstantInt::get(Type::IntTy, 1);
+  Value *Two = ConstantInt::get(Type::IntTy, 2);
 
   // Get pointer to the integer argument of the add1 function...
   Argument *ArgX = FibF-arg_begin();   // Get the arg.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll

2006-10-20 Thread Bill Wendling
On Oct 19, 2006, at 11:56 PM, Reid Spencer wrote:

 Bill,

 After updating to the head, this test case is failing for me on Linux.

 --- llvm/test/Regression/CodeGen/X86/2006-10-19- 
 SwitchUnnecessaryBranching.llThu Oct 19 18:21:59 2006
 ***
 *** 0 
 --- 1,27 
 + ; RUN: llvm-as  %s | llc -march=x86 | %prcontext jg LBB1_5 1  
 | grep LBB1_4:

 Are you sure that grep is right?

Dang. I was afraid of this. I'd like a way to match something like  
this (in Perl):

$line !~ /jmp\s+([:alpha:][:alnum:]*)[^\n]*\n+$1:/;

Does anyone know of a way I can do this with grep, awk, sed,  
prcontext, or ??? Are we allowed to use Perl in the testcases?

-bw
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [llvm-gcc4] path for Constant[SU]Int - ConstantInt

2006-10-20 Thread Reid Spencer
Index: llvm-abi.h
===
--- llvm-abi.h  (revision 184)
+++ llvm-abi.h  (working copy)
@@ -199,7 +199,7 @@
 } else if (TREE_CODE(type) == RECORD_TYPE) {
   for (tree Field = TYPE_FIELDS(type); Field; Field =
TREE_CHAIN(Field))
 if (TREE_CODE(Field) == FIELD_DECL) {
-  unsigned FNo =
castConstantUInt(DECL_LLVM(Field))-getValue();
+  unsigned FNo =
castConstantInt(DECL_LLVM(Field))-getZExtValue();
   assert(FNo != ~0U  Case not handled yet!);
   
   C.EnterField(FNo, Ty);
Index: llvm-backend.cpp
===
--- llvm-backend.cpp(revision 184)
+++ llvm-backend.cpp(working copy)
@@ -333,7 +333,7 @@
   std::vectorConstant* StructInit;
   StructInit.resize(2);
   for (unsigned i = 0, e = Tors.size(); i != e; ++i) {
-StructInit[0] = ConstantSInt::get(Type::IntTy, Tors[i].second);
+StructInit[0] = ConstantInt::get(Type::IntTy, Tors[i].second);
 StructInit[1] = Tors[i].first;
 InitList.push_back(ConstantStruct::get(StructInit));
   }
Index: llvm-convert.cpp
===
--- llvm-convert.cpp(revision 184)
+++ llvm-convert.cpp(working copy)
@@ -229,7 +229,7 @@
   NameStack.push_back(NameStack.back()+.+utostr(FieldNo));
   
   Constant *Zero = Constant::getNullValue(Type::UIntTy);
-  Constant *FIdx = ConstantUInt::get(Type::UIntTy, FieldNo);
+  Constant *FIdx = ConstantInt::get(Type::UIntTy, FieldNo);
   Value *Loc = LocStack.back();
   if (castPointerType(Loc-getType())-getElementType() !=
StructTy)
 Loc = new CastInst(Loc, PointerType::get(StructTy), tmp,
CurBB);
@@ -730,18 +730,18 @@
 Value *V = new LoadInst(SrcPtr, tmp, isSrcVolatile, CurBB);
 new StoreInst(V, DestPtr, isDstVolatile, CurBB);
   } else if (const StructType *STy = dyn_castStructType(ElTy)) {
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = STy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp,
CurBB);
   Value *SElPtr = new GetElementPtrInst(SrcPtr, Zero, Idx, tmp,
CurBB);
   CopyAggregate(DElPtr, SElPtr, isDstVolatile, isSrcVolatile,
CurBB);
 }
   } else {
 const ArrayType *ATy = castArrayType(ElTy);
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp,
CurBB);
   Value *SElPtr = new GetElementPtrInst(SrcPtr, Zero, Idx, tmp,
CurBB);
   CopyAggregate(DElPtr, SElPtr, isDstVolatile, isSrcVolatile,
CurBB);
@@ -800,17 +800,17 @@
   if (ElTy-isFirstClassType()) {
 new StoreInst(Constant::getNullValue(ElTy), DestPtr, CurBB);
   } else if (const StructType *STy = dyn_castStructType(ElTy)) {
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = STy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp,
CurBB);
   ZeroAggregate(DElPtr, CurBB);
 }
   } else {
 const ArrayType *ATy = castArrayType(ElTy);
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp,
CurBB);
   ZeroAggregate(DElPtr, CurBB);
 }
@@ -834,7 +834,7 @@
   }
 
   unsigned Alignment = TYPE_ALIGN_OK(type) ? (TYPE_ALIGN_UNIT(type) 
~0U) : 0;
-  EmitMemSet(DestPtr, ConstantUInt::get(Type::UByteTy, 0),
+  EmitMemSet(DestPtr, ConstantInt::get(Type::UByteTy, 0),
  Emit(TYPE_SIZE_UNIT(type), 0), Alignment);
 }
 
@@ -854,7 +854,7 @@
   Ops.push_back(CastToType(DestPtr, SBP));
   Ops.push_back(CastToType(SrcPtr, SBP));
   Ops.push_back(CastToType(Size, IntPtr));
-  Ops.push_back(ConstantUInt::get(Type::UIntTy, Align));
+  Ops.push_back(ConstantInt::get(Type::UIntTy, Align));
   new CallInst(MemCpy, Ops, , CurBB);
 }
 
@@ -873,7 +873,7 @@
   Ops.push_back(CastToType(DestPtr, SBP));
   Ops.push_back(CastToType(SrcPtr, SBP));
   Ops.push_back(CastToType(Size, IntPtr));
-  Ops.push_back(ConstantUInt::get(Type::UIntTy, 

[llvm-commits] CVS: llvm/include/llvm/Constants.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Constants.h updated: 1.89 - 1.90
---
Log message:

Fix a comment to be accurate.


---
Diffs of the changes:  (+4 -4)

 Constants.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.89 llvm/include/llvm/Constants.h:1.90
--- llvm/include/llvm/Constants.h:1.89  Fri Oct 20 02:07:23 2006
+++ llvm/include/llvm/Constants.h   Fri Oct 20 02:24:55 2006
@@ -176,10 +176,10 @@
 return Val == V;
   }
 
-  /// Return a ConstantInt with the specified value for the specified type. 
-  /// Overloads for ll the integer types are provided to ensure that implicit
-  /// conversions don't bite us and to get around compiler errors where the 
-  /// compiler can't find a suitable overload for a given integer value.
+  /// Return a ConstantInt with the specified value for the specified type. The
+  /// value V will be canonicalized to a uint64_t but accessing it with either
+  /// getSExtValue() or getZExtValue() (ConstantIntegral) will yield the 
correct
+  /// sized/signed value for the type Ty.
   /// @brief Get a ConstantInt for a specific value.
   static ConstantInt *get(const Type *Ty, int64_t V);
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/VMCore/Constants.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.163.2.4 - 1.163.2.5
---
Log message:

The forgotten patches. These should have been committed and tagged with the
ST_iter_1 tag, but they weren't, so we're commiting them now.


---
Diffs of the changes:  (+5 -32)

 Constants.cpp |   37 +
 1 files changed, 5 insertions(+), 32 deletions(-)


Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.163.2.4 
llvm/lib/VMCore/Constants.cpp:1.163.2.5
--- llvm/lib/VMCore/Constants.cpp:1.163.2.4 Thu Oct 19 23:27:18 2006
+++ llvm/lib/VMCore/Constants.cpp   Fri Oct 20 02:33:53 2006
@@ -200,8 +200,7 @@
 // Normal Constructors
 
 ConstantIntegral::ConstantIntegral(const Type *Ty, ValueTy VT, uint64_t V)
-  : Constant(Ty, VT, 0, 0) {
-  Val.Unsigned = V;
+  : Constant(Ty, VT, 0, 0), Val(V) {
 }
 
 ConstantBool::ConstantBool(bool V) 
@@ -573,44 +572,18 @@
   case Type::SByteTyID:
 return (Val = INT8_MAX  Val = INT8_MIN);
   case Type::UByteTyID:
-return (Val  0)  (Val = UINT8_MAX);
+return (Val = 0)  (Val = UINT8_MAX);
   case Type::ShortTyID:
 return (Val = INT16_MAX  Val = INT16_MIN);
   case Type::UShortTyID:
-return (Val  0)  (Val = UINT16_MAX);
+return (Val = 0)  (Val = UINT16_MAX);
   case Type::IntTyID:
 return (Val = int(INT32_MAX)  Val = int(INT32_MIN));
   case Type::UIntTyID:
-return (Val  0)  (Val = UINT32_MAX);
+return (Val = 0)  (Val = UINT32_MAX);
   case Type::LongTyID:
-return true; // always true, has to fit in largest type
-  case Type::ULongTyID:
-return (Val = 0);
-  }
-}
-
-bool ConstantInt::isValueValidForType(const Type *Ty, uint64_t Val) {
-  switch (Ty-getTypeID()) {
-  default:
-return false; // These can't be represented as integers!!!
-
-// Unsigned types...
-  case Type::UByteTyID:
-return (Val = UINT8_MAX);
-  case Type::SByteTyID:
-return (Val = INT8_MAX);
-  case Type::UShortTyID:
-return (Val = UINT16_MAX);
-  case Type::ShortTyID:
-return (Val = INT16_MAX);
-  case Type::UIntTyID:
-return (Val = UINT32_MAX);
-  case Type::IntTyID:
-return (Val = INT32_MAX);
   case Type::ULongTyID:
-return true;  // This is the largest type...
-  case Type::LongTyID:
-return (Val = INT64_MAX);
+return true; // always true, has to fit in largest type
   }
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/Transforms/TransformInternals.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Transforms:

TransformInternals.cpp updated: 1.50.8.1 - 1.50.8.2
---
Log message:

The forgotten patches. These should have been committed and tagged with the
ST_iter_1 tag, but they weren't, so we're commiting them now.


---
Diffs of the changes:  (+1 -1)

 TransformInternals.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/TransformInternals.cpp
diff -u llvm/lib/Transforms/TransformInternals.cpp:1.50.8.1 
llvm/lib/Transforms/TransformInternals.cpp:1.50.8.2
--- llvm/lib/Transforms/TransformInternals.cpp:1.50.8.1 Wed Oct 18 22:57:56 2006
+++ llvm/lib/Transforms/TransformInternals.cpp  Fri Oct 20 02:33:53 2006
@@ -34,7 +34,7 @@
  (i == SL-MemberOffsets.size()-1 || Offset  SL-MemberOffsets[i+1]));
 
   // Make sure to save the current index...
-  Indices.push_back(ConstantInt::get(Type::UIntTy, uint32_t(i)));
+  Indices.push_back(ConstantInt::get(Type::UIntTy, i));
   Offset = SL-MemberOffsets[i];
   return STy-getContainedType(i);
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/include/llvm/Constants.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Constants.h updated: 1.88.2.3 - 1.88.2.4
---
Log message:

Undo S/UDiv patch for tag purposes.


---
Diffs of the changes:  (+2 -2)

 Constants.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.88.2.3 
llvm/include/llvm/Constants.h:1.88.2.4
--- llvm/include/llvm/Constants.h:1.88.2.3  Fri Oct 20 02:33:52 2006
+++ llvm/include/llvm/Constants.h   Fri Oct 20 02:35:53 2006
@@ -544,8 +544,8 @@
   static Constant *getAdd(Constant *C1, Constant *C2);
   static Constant *getSub(Constant *C1, Constant *C2);
   static Constant *getMul(Constant *C1, Constant *C2);
-  static Constant *getUDiv(Constant *C1, Constant *C2);
-  static Constant *getSDiv(Constant *C1, Constant *C2);
+  static Constant *getDiv(Constant *C1, Constant *C2);
+  static Constant *getDiv(Constant *C1, Constant *C2);
   static Constant *getRem(Constant *C1, Constant *C2);
   static Constant *getAnd(Constant *C1, Constant *C2);
   static Constant *getOr(Constant *C1, Constant *C2);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/Target/TargetData.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Target:

TargetData.cpp updated: 1.70.4.2 - 1.70.4.3
---
Log message:

The forgotten patches. These should have been committed and tagged with the
ST_iter_1 tag, but they weren't, so we're commiting them now.


---
Diffs of the changes:  (+1 -1)

 TargetData.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.70.4.2 
llvm/lib/Target/TargetData.cpp:1.70.4.3
--- llvm/lib/Target/TargetData.cpp:1.70.4.2 Thu Oct 19 19:34:43 2006
+++ llvm/lib/Target/TargetData.cpp  Fri Oct 20 02:33:53 2006
@@ -346,7 +346,7 @@
   Ty = castSequentialType(Ty)-getElementType();
 
   // Get the array index and the size of each array element.
-  int64_t arrayIdx = castConstantInt(Idx[CurIDX])-getZExtValue();
+  int64_t arrayIdx = castConstantInt(Idx[CurIDX])-getSExtValue();
   Result += arrayIdx * (int64_t)getTypeSize(Ty);
 }
   }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/include/llvm/Constants.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Constants.h updated: 1.88.2.2 - 1.88.2.3
---
Log message:

The forgotten patches. These should have been committed and tagged with the
ST_iter_1 tag, but they weren't, so we're commiting them now.


---
Diffs of the changes:  (+6 -22)

 Constants.h |   28 ++--
 1 files changed, 6 insertions(+), 22 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.88.2.2 
llvm/include/llvm/Constants.h:1.88.2.3
--- llvm/include/llvm/Constants.h:1.88.2.2  Thu Oct 19 23:27:17 2006
+++ llvm/include/llvm/Constants.h   Fri Oct 20 02:33:52 2006
@@ -41,23 +41,15 @@
 /// @brief An abstract class for integer constants.
 class ConstantIntegral : public Constant {
 protected:
-  union {
-int64_t  Signed;
-uint64_t Unsigned;
-  } Val;
+  uint64_t Val;
   ConstantIntegral(const Type *Ty, ValueTy VT, uint64_t V);
-  ConstantIntegral(const Type *Ty, ValueTy VT, int64_t V);
 public:
 
-  /// @brief Return the raw value of the constant as a 64-bit integer value.
-  inline uint64_t getRawValue() const { return Val.Unsigned; }
-  
   /// Return the constant as a 64-bit unsigned integer value after it
   /// has been zero extended as appropriate for the type of this constant.
   /// @brief Return the zero extended value.
   inline uint64_t getZExtValue() const {
-unsigned Size = getType()-getPrimitiveSizeInBits();
-return Val.Unsigned  (~uint64_t(0UL)  (64-Size));
+return Val;
   }
 
   /// Return the constant as a 64-bit integer value after it has been sign
@@ -65,7 +57,7 @@
   /// @brief Return the sign extended value.
   inline int64_t getSExtValue() const {
 unsigned Size = getType()-getPrimitiveSizeInBits();
-return (Val.Signed  (64-Size))  (64-Size);
+return (int64_t(Val)  (64-Size))  (64-Size);
   }
   
   /// This function is implemented by subclasses and will return true iff this
@@ -147,7 +139,7 @@
 
   /// @returns the value of this ConstantBool
   /// @brief return the boolean value of this constant.
-  inline bool getValue() const { return static_castbool(getRawValue()); }
+  inline bool getValue() const { return static_castbool(getZExtValue()); }
 
   /// @see ConstantIntegral for details
   /// @brief Implement overrides
@@ -182,7 +174,7 @@
   bool equalsInt(unsigned char V) const {
 assert(V = 127 
equalsInt: Can only be used with very small positive constants!);
-return Val.Unsigned == V;
+return Val == V;
   }
 
   /// Return a ConstantInt with the specified value for the specified type. 
@@ -190,13 +182,6 @@
   /// conversions don't bite us and to get around compiler errors where the 
   /// compiler can't find a suitable overload for a given integer value.
   /// @brief Get a ConstantInt for a specific value.
-  static ConstantInt *get(const Type *Ty, int8_t V);
-  static ConstantInt *get(const Type *Ty, uint8_t V);
-  static ConstantInt *get(const Type *Ty, int16_t V);
-  static ConstantInt *get(const Type *Ty, uint16_t V);
-  static ConstantInt *get(const Type *Ty, int32_t V);
-  static ConstantInt *get(const Type *Ty, uint32_t V);
-  static ConstantInt *get(const Type *Ty, uint64_t V);
   static ConstantInt *get(const Type *Ty, int64_t V);
 
   /// This static method returns true if the type Ty is big enough to 
@@ -205,12 +190,11 @@
   /// @returns true if V is a valid value for type Ty
   /// @brief Determine if the value is in range for the given type.
   static bool isValueValidForType(const Type *Ty, int64_t V);
-  static bool isValueValidForType(const Type *Ty, uint64_t V);
 
   /// @returns true if this is the null integer value.
   /// @see ConstantIntegral for details
   /// @brief Implement override.
-  virtual bool isNullValue() const { return Val.Unsigned == 0; }
+  virtual bool isNullValue() const { return Val == 0; }
 
   /// @returns true iff this constant's bits are all set to true.
   /// @see ConstantIntegral



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/VMCore/Constants.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.163.2.6 - 1.163.2.7
---
Log message:

Restore the Div - S/UDiv after tag was set.


---
Diffs of the changes:  (+6 -3)

 Constants.cpp |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.163.2.6 
llvm/lib/VMCore/Constants.cpp:1.163.2.7
--- llvm/lib/VMCore/Constants.cpp:1.163.2.6 Fri Oct 20 02:39:50 2006
+++ llvm/lib/VMCore/Constants.cpp   Fri Oct 20 02:41:24 2006
@@ -419,8 +419,11 @@
 Constant *ConstantExpr::getMul(Constant *C1, Constant *C2) {
   return get(Instruction::Mul, C1, C2);
 }
-Constant *ConstantExpr::getDiv(Constant *C1, Constant *C2) {
-  return get(Instruction::Div, C1, C2);
+Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2) {
+  return get(Instruction::UDiv, C1, C2);
+}
+Constant *ConstantExpr::getSDiv(Constant *C1, Constant *C2) {
+  return get(Instruction::SDiv, C1, C2);
 }
 Constant *ConstantExpr::getRem(Constant *C1, Constant *C2) {
   return get(Instruction::Rem, C1, C2);
@@ -1410,7 +1413,7 @@
 #ifndef NDEBUG
   switch (Opcode) {
   case Instruction::Add: case Instruction::Sub:
-  case Instruction::Mul: case Instruction::Div:
+  case Instruction::Mul: case Instruction::UDiv: case Instruction::SDiv:
   case Instruction::Rem:
 assert(C1-getType() == C2-getType()  Op types should be identical!);
 assert((C1-getType()-isInteger() || C1-getType()-isFloatingPoint() ||



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/include/llvm/Constants.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Constants.h updated: 1.88.2.4 - 1.88.2.5
---
Log message:

Remove duplicate method name.


---
Diffs of the changes:  (+0 -1)

 Constants.h |1 -
 1 files changed, 1 deletion(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.88.2.4 
llvm/include/llvm/Constants.h:1.88.2.5
--- llvm/include/llvm/Constants.h:1.88.2.4  Fri Oct 20 02:35:53 2006
+++ llvm/include/llvm/Constants.h   Fri Oct 20 02:45:02 2006
@@ -545,7 +545,6 @@
   static Constant *getSub(Constant *C1, Constant *C2);
   static Constant *getMul(Constant *C1, Constant *C2);
   static Constant *getDiv(Constant *C1, Constant *C2);
-  static Constant *getDiv(Constant *C1, Constant *C2);
   static Constant *getRem(Constant *C1, Constant *C2);
   static Constant *getAnd(Constant *C1, Constant *C2);
   static Constant *getOr(Constant *C1, Constant *C2);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/include/llvm/Constants.h

2006-10-20 Thread Reid Spencer


Changes in directory llvm/include/llvm:

Constants.h updated: 1.88.2.5 - 1.88.2.6
---
Log message:

Restore Div - S/UDiv changes.


---
Diffs of the changes:  (+2 -1)

 Constants.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.88.2.5 
llvm/include/llvm/Constants.h:1.88.2.6
--- llvm/include/llvm/Constants.h:1.88.2.5  Fri Oct 20 02:45:02 2006
+++ llvm/include/llvm/Constants.h   Fri Oct 20 02:47:21 2006
@@ -544,7 +544,8 @@
   static Constant *getAdd(Constant *C1, Constant *C2);
   static Constant *getSub(Constant *C1, Constant *C2);
   static Constant *getMul(Constant *C1, Constant *C2);
-  static Constant *getDiv(Constant *C1, Constant *C2);
+  static Constant *getUDiv(Constant *C1, Constant *C2);
+  static Constant *getSDiv(Constant *C1, Constant *C2);
   static Constant *getRem(Constant *C1, Constant *C2);
   static Constant *getAnd(Constant *C1, Constant *C2);
   static Constant *getOr(Constant *C1, Constant *C2);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/VMCore/ConstantFolding.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

ConstantFolding.cpp updated: 1.93.2.4 - 1.93.2.5
---
Log message:

Make this compile after Constants.h interface changes.


---
Diffs of the changes:  (+4 -4)

 ConstantFolding.cpp |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/VMCore/ConstantFolding.cpp
diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.93.2.4 
llvm/lib/VMCore/ConstantFolding.cpp:1.93.2.5
--- llvm/lib/VMCore/ConstantFolding.cpp:1.93.2.4Thu Oct 19 23:27:18 2006
+++ llvm/lib/VMCore/ConstantFolding.cpp Fri Oct 20 03:01:26 2006
@@ -505,10 +505,10 @@
 if (V2-isNullValue()) 
   return 0;
 if (V2-isAllOnesValue()   // MIN_INT / -1
-(BuiltinType)V1-getRawValue() == -(BuiltinType)V1-getRawValue())
+(BuiltinType)V1-getZExtValue() == -(BuiltinType)V1-getZExtValue())
   return 0;
 BuiltinType R = 
-  (BuiltinType)V1-getRawValue() / (BuiltinType)V2-getRawValue();
+  (BuiltinType)V1-getZExtValue() / (BuiltinType)V2-getZExtValue();
 return ConstantInt::get(*Ty, R);
   }
 
@@ -516,10 +516,10 @@
 if (V2-isNullValue()) 
   return 0;
 if (V2-isAllOnesValue()   // MIN_INT / -1
-(BuiltinType)V1-getZExtValue() == -(BuiltinType)V1-getZExtValue())
+(BuiltinType)V1-getSExtValue() == -(BuiltinType)V1-getSExtValue())
   return 0;
 BuiltinType R = 
-  (BuiltinType)V1-getZExtValue() / (BuiltinType)V2-getZExtValue();
+  (BuiltinType)V1-getSExtValue() / (BuiltinType)V2-getSExtValue();
 return ConstantInt::get(*Ty, R);
   }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.289.2.3 - 1.289.2.4
---
Log message:

Committing Remainder of Div - SDiv/UDiv changes so the tree builds again.


---
Diffs of the changes:  (+2 -6)

 SelectionDAGISel.cpp |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.289.2.3 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.289.2.4
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.289.2.3Thu Oct 
19 19:43:17 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  Fri Oct 20 03:19:49 2006
@@ -508,12 +508,8 @@
   void visitMul(User I) { 
 visitBinary(I, ISD::MUL, ISD::FMUL, ISD::VMUL); 
   }
-  void visitDiv(User I) {
-const Type *Ty = I.getType();
-visitBinary(I,
-Ty-isSigned() ? ISD::SDIV : ISD::UDIV, ISD::FDIV,
-Ty-isSigned() ? ISD::VSDIV : ISD::VUDIV);
-  }
+  void visitUDiv(User I) { visitBinary(I, ISD::UDIV, ISD::FDIV, ISD::VUDIV); }
+  void visitSDiv(User I) { visitBinary(I, ISD::SDIV, ISD::FDIV, ISD::VSDIV); }
   void visitRem(User I) {
 const Type *Ty = I.getType();
 visitBinary(I, Ty-isSigned() ? ISD::SREM : ISD::UREM, ISD::FREM, 0);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/ExecutionEngine/Interpreter:

Execution.cpp updated: 1.139.6.1 - 1.139.6.2
---
Log message:

Committing Remainder of Div - SDiv/UDiv changes so the tree builds again.


---
Diffs of the changes:  (+4 -2)

 Execution.cpp |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.139.6.1 
llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.139.6.2
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.139.6.1Wed Oct 
18 22:57:56 2006
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp  Fri Oct 20 03:19:49 2006
@@ -89,7 +89,8 @@
 return executeMulInst(getOperandValue(CE-getOperand(0), SF),
   getOperandValue(CE-getOperand(1), SF),
   CE-getOperand(0)-getType());
-  case Instruction::Div:
+  case Instruction::SDiv:
+  case Instruction::UDiv:
 return executeDivInst(getOperandValue(CE-getOperand(0), SF),
   getOperandValue(CE-getOperand(1), SF),
   CE-getOperand(0)-getType());
@@ -504,7 +505,8 @@
   case Instruction::Add:   R = executeAddInst  (Src1, Src2, Ty); break;
   case Instruction::Sub:   R = executeSubInst  (Src1, Src2, Ty); break;
   case Instruction::Mul:   R = executeMulInst  (Src1, Src2, Ty); break;
-  case Instruction::Div:   R = executeDivInst  (Src1, Src2, Ty); break;
+  case Instruction::SDiv:  R = executeDivInst  (Src1, Src2, Ty); break;
+  case Instruction::UDiv:  R = executeDivInst  (Src1, Src2, Ty); break;
   case Instruction::Rem:   R = executeRemInst  (Src1, Src2, Ty); break;
   case Instruction::And:   R = executeAndInst  (Src1, Src2, Ty); break;
   case Instruction::Or:R = executeOrInst   (Src1, Src2, Ty); break;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/lib/Target/CBackend/Writer.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.272.2.2 - 1.272.2.3
---
Log message:

Committing Remainder of Div - SDiv/UDiv changes so the tree builds again.


---
Diffs of the changes:  (+6 -3)

 Writer.cpp |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.272.2.2 
llvm/lib/Target/CBackend/Writer.cpp:1.272.2.3
--- llvm/lib/Target/CBackend/Writer.cpp:1.272.2.2   Thu Oct 19 19:34:44 2006
+++ llvm/lib/Target/CBackend/Writer.cpp Fri Oct 20 03:19:49 2006
@@ -586,7 +586,8 @@
 case Instruction::Add:
 case Instruction::Sub:
 case Instruction::Mul:
-case Instruction::Div:
+case Instruction::SDiv:
+case Instruction::UDiv:
 case Instruction::Rem:
 case Instruction::And:
 case Instruction::Or:
@@ -605,7 +606,8 @@
   case Instruction::Add: Out   + ; break;
   case Instruction::Sub: Out   - ; break;
   case Instruction::Mul: Out   * ; break;
-  case Instruction::Div: Out   / ; break;
+  case Instruction::UDiv: 
+  case Instruction::SDiv: Out   / ; break;
   case Instruction::Rem: Out   % ; break;
   case Instruction::And: Out; break;
   case Instruction::Or:  Out   | ; break;
@@ -1648,7 +1650,8 @@
 case Instruction::Add: Out   + ; break;
 case Instruction::Sub: Out   - ; break;
 case Instruction::Mul: Out  '*'; break;
-case Instruction::Div: Out  '/'; break;
+case Instruction::UDiv:
+case Instruction::SDiv: Out  '/'; break;
 case Instruction::Rem: Out  '%'; break;
 case Instruction::And: Out; break;
 case Instruction::Or: Out   | ; break;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [SignlessTypes] CVS: llvm/tools/llvm2cpp/CppWriter.cpp

2006-10-20 Thread Reid Spencer


Changes in directory llvm/tools/llvm2cpp:

CppWriter.cpp updated: 1.16.2.1 - 1.16.2.2
---
Log message:

Div - SDiv/UDiv


---
Diffs of the changes:  (+6 -3)

 CppWriter.cpp |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/tools/llvm2cpp/CppWriter.cpp
diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.16.2.1 
llvm/tools/llvm2cpp/CppWriter.cpp:1.16.2.2
--- llvm/tools/llvm2cpp/CppWriter.cpp:1.16.2.1  Wed Oct 18 22:57:56 2006
+++ llvm/tools/llvm2cpp/CppWriter.cpp   Fri Oct 20 03:22:22 2006
@@ -773,7 +773,8 @@
 case Instruction::Add:Out  getAdd;  break;
 case Instruction::Sub:Out  getSub; break;
 case Instruction::Mul:Out  getMul; break;
-case Instruction::Div:Out  getDiv; break;
+case Instruction::UDiv:   Out  getUDiv; break;
+case Instruction::SDiv:   Out  getSDiv; break;
 case Instruction::Rem:Out  getRem; break;
 case Instruction::And:Out  getAnd; break;
 case Instruction::Or: Out  getOr; break;
@@ -1021,7 +1022,8 @@
 case Instruction::Add:
 case Instruction::Sub:
 case Instruction::Mul:
-case Instruction::Div:
+case Instruction::UDiv:
+case Instruction::SDiv:
 case Instruction::Rem:
 case Instruction::And:
 case Instruction::Or:
@@ -1033,7 +1035,8 @@
 case Instruction::Add: Out  Instruction::Add; break;
 case Instruction::Sub: Out  Instruction::Sub; break;
 case Instruction::Mul: Out  Instruction::Mul; break;
-case Instruction::Div: Out  Instruction::Div; break;
+case Instruction::UDiv:Out  Instruction::UDiv; break;
+case Instruction::SDiv:Out  Instruction::SDiv; break;
 case Instruction::Rem: Out  Instruction::Rem; break;
 case Instruction::And: Out  Instruction::And; break;
 case Instruction::Or:  Out  Instruction::Or;  break;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] [llvm-gcc4] path for Constant[SU]Int - ConstantInt

2006-10-20 Thread Reid Spencer
Attached is the patch for updating llvm-gcc4 for the ConstantInt change.

Reid.

On Fri, 2006-10-20 at 11:34 -0300, Rafael Espíndola wrote:
 Could you please send the patch attached to the mailing list? The
 inline one has some additional line brakes that make it very hard to
 apply.
 
 Thanks,
 Rafael
Index: llvm-abi.h
===
--- llvm-abi.h	(revision 184)
+++ llvm-abi.h	(working copy)
@@ -199,7 +199,7 @@
 } else if (TREE_CODE(type) == RECORD_TYPE) {
   for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field))
 if (TREE_CODE(Field) == FIELD_DECL) {
-  unsigned FNo = castConstantUInt(DECL_LLVM(Field))-getValue();
+  unsigned FNo = castConstantInt(DECL_LLVM(Field))-getZExtValue();
   assert(FNo != ~0U  Case not handled yet!);
   
   C.EnterField(FNo, Ty);
Index: llvm-backend.cpp
===
--- llvm-backend.cpp	(revision 184)
+++ llvm-backend.cpp	(working copy)
@@ -333,7 +333,7 @@
   std::vectorConstant* StructInit;
   StructInit.resize(2);
   for (unsigned i = 0, e = Tors.size(); i != e; ++i) {
-StructInit[0] = ConstantSInt::get(Type::IntTy, Tors[i].second);
+StructInit[0] = ConstantInt::get(Type::IntTy, Tors[i].second);
 StructInit[1] = Tors[i].first;
 InitList.push_back(ConstantStruct::get(StructInit));
   }
Index: llvm-convert.cpp
===
--- llvm-convert.cpp	(revision 184)
+++ llvm-convert.cpp	(working copy)
@@ -229,7 +229,7 @@
   NameStack.push_back(NameStack.back()+.+utostr(FieldNo));
   
   Constant *Zero = Constant::getNullValue(Type::UIntTy);
-  Constant *FIdx = ConstantUInt::get(Type::UIntTy, FieldNo);
+  Constant *FIdx = ConstantInt::get(Type::UIntTy, FieldNo);
   Value *Loc = LocStack.back();
   if (castPointerType(Loc-getType())-getElementType() != StructTy)
 Loc = new CastInst(Loc, PointerType::get(StructTy), tmp, CurBB);
@@ -730,18 +730,18 @@
 Value *V = new LoadInst(SrcPtr, tmp, isSrcVolatile, CurBB);
 new StoreInst(V, DestPtr, isDstVolatile, CurBB);
   } else if (const StructType *STy = dyn_castStructType(ElTy)) {
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = STy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp, CurBB);
   Value *SElPtr = new GetElementPtrInst(SrcPtr, Zero, Idx, tmp, CurBB);
   CopyAggregate(DElPtr, SElPtr, isDstVolatile, isSrcVolatile, CurBB);
 }
   } else {
 const ArrayType *ATy = castArrayType(ElTy);
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp, CurBB);
   Value *SElPtr = new GetElementPtrInst(SrcPtr, Zero, Idx, tmp, CurBB);
   CopyAggregate(DElPtr, SElPtr, isDstVolatile, isSrcVolatile, CurBB);
@@ -800,17 +800,17 @@
   if (ElTy-isFirstClassType()) {
 new StoreInst(Constant::getNullValue(ElTy), DestPtr, CurBB);
   } else if (const StructType *STy = dyn_castStructType(ElTy)) {
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = STy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp, CurBB);
   ZeroAggregate(DElPtr, CurBB);
 }
   } else {
 const ArrayType *ATy = castArrayType(ElTy);
-Constant *Zero = ConstantUInt::get(Type::UIntTy, 0);
+Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
 for (unsigned i = 0, e = ATy-getNumElements(); i != e; ++i) {
-  Constant *Idx = ConstantUInt::get(Type::UIntTy, i);
+  Constant *Idx = ConstantInt::get(Type::UIntTy, i);
   Value *DElPtr = new GetElementPtrInst(DestPtr, Zero, Idx, tmp, CurBB);
   ZeroAggregate(DElPtr, CurBB);
 }
@@ -834,7 +834,7 @@
   }
 
   unsigned Alignment = TYPE_ALIGN_OK(type) ? (TYPE_ALIGN_UNIT(type)  ~0U) : 0;
-  EmitMemSet(DestPtr, ConstantUInt::get(Type::UByteTy, 0),
+  EmitMemSet(DestPtr, ConstantInt::get(Type::UByteTy, 0),
  Emit(TYPE_SIZE_UNIT(type), 0), Alignment);
 }
 
@@ -854,7 +854,7 @@
   Ops.push_back(CastToType(DestPtr, SBP));
   Ops.push_back(CastToType(SrcPtr, SBP));
   Ops.push_back(CastToType(Size, IntPtr));
-  Ops.push_back(ConstantUInt::get(Type::UIntTy, Align));
+  

Re: [llvm-commits] [llvm-gcc4] path for Constant[SU]Int - ConstantInt

2006-10-20 Thread Jim Laskey

In addition to build on PPC.

Index: gcc/config/rs6000/rs6000.h
===
--- gcc/config/rs6000/rs6000.h  (revision 119086)
+++ gcc/config/rs6000/rs6000.h  (working copy)
@@ -3812,7 +3812,7 @@
 return  
false; \
   case  
ALTIVEC_BUILTIN_VSPLTB:\
 if (ConstantInt *Elt = dyn_castConstantInt(OPS[1]))  
{   \
-  int EV = Elt-getRawValue 
();\
+  int EV = Elt-getZExtValue 
();   \
   RESULT = BuildVectorShuffle(OPS[0], OPS 
[0], \
   EV, EV, EV, EV, EV, EV, EV,  
EV, \
   EV, EV, EV, EV, EV, EV, EV,  
EV);\

@@ -3821,7 +3821,7 @@
 return  
false; \
   case  
ALTIVEC_BUILTIN_VSPLTH:\
 if (ConstantInt *Elt = dyn_castConstantInt(OPS[1]))  
{   \
-  int EV = Elt-getRawValue 
();\
+  int EV = Elt-getZExtValue 
();   \
   RESULT = BuildVectorShuffle(OPS[0], OPS 
[0], \
   EV, EV, EV, EV, EV, EV, EV,  
EV);\
   return  
true;\

@@ -3829,7 +3829,7 @@
 return  
false; \
   case  
ALTIVEC_BUILTIN_VSPLTW:\
 if (ConstantInt *Elt = dyn_castConstantInt(OPS[1]))  
{   \
-  int EV = Elt-getRawValue 
();\
+  int EV = Elt-getZExtValue 
();   \
   RESULT = BuildVectorShuffle(OPS[0], OPS[0], EV, EV, EV,  
EV);\
   return  
true;\
 }  
\

@@ -3840,7 +3840,7 @@
   case  
ALTIVEC_BUILTIN_VSLDOI_4SF:\
 if (ConstantInt *Elt = dyn_castConstantInt(OPS[2]))  
{   \
   /* Map all of these to a shuffle.  
*/\
-  unsigned Amt = Elt-getRawValue()   
15; \
+  unsigned Amt = Elt-getZExtValue()   
15;\
   PackedType *v16i8 = PackedType::get(Type::SByteTy,  
16); \
   OPS[0] = CastToType(OPS[0],  
v16i8); \
   OPS[1] = CastToType(OPS[1],  
v16i8); \

@@ -3890,7 +3890,7 @@
 /* and out sign bits  
*/   \
 PackedType *v4i32 = PackedType::get(Type::IntTy,  
4);  \
 OPS[0] = new CastInst(OPS[0], v4i32, OPS[0]-getName(),  
CurBB);   \
-Constant *C = ConstantSInt::get(Type::IntTy,  
0x7FFF); \
+Constant *C = ConstantInt::get(Type::IntTy,  
0x7FFF);  \
 C = ConstantPacked::get(std::vectorConstant*(4,  
C));\
 RESULT = BinaryOperator::createAnd(OPS[0], C, tmp,  
CurBB);  \
 RESULT = new CastInst(RESULT, DESTTY, tmp,  
CurBB);  \


On Oct 20, 2006, at 4:17 AM, Reid Spencer wrote:


Index: llvm-abi.h
===
--- llvm-abi.h  (revision 184)
+++ llvm-abi.h  (working copy)
@@ -199,7 +199,7 @@
 } else if (TREE_CODE(type) == RECORD_TYPE) {
   for (tree Field = TYPE_FIELDS(type); Field; Field =
TREE_CHAIN(Field))
 if (TREE_CODE(Field) == FIELD_DECL) {
-  unsigned FNo =
castConstantUInt(DECL_LLVM(Field))-getValue();
+  unsigned FNo =
castConstantInt(DECL_LLVM(Field))-getZExtValue();
   assert(FNo != ~0U  Case not handled yet!);

   C.EnterField(FNo, Ty);
Index: llvm-backend.cpp
===
--- llvm-backend.cpp(revision 184)
+++ llvm-backend.cpp(working copy)
@@ -333,7 +333,7 @@
   std::vectorConstant* StructInit;
   StructInit.resize(2);
   for (unsigned i = 0, e = Tors.size(); i != e; ++i) {
-StructInit[0] = ConstantSInt::get(Type::IntTy, Tors[i].second);
+StructInit[0] = ConstantInt::get(Type::IntTy, Tors[i].second);
 StructInit[1] = Tors[i].first;
 InitList.push_back(ConstantStruct::get(StructInit));
   }
Index: llvm-convert.cpp
===
--- llvm-convert.cpp(revision 184)
+++ llvm-convert.cpp(working copy)
@@ -229,7 

Re: [llvm-commits] [llvm-gcc4] path for Constant[SU]Int - ConstantInt

2006-10-20 Thread Reid Spencer
Here's that PPC/Altivec patch as an attachment.

Reid.

On Fri, 2006-10-20 at 13:26 -0300, Jim Laskey wrote:
 In addition to build on PPC.
 
 Index: gcc/config/rs6000/rs6000.h
 ===
 --- gcc/config/rs6000/rs6000.h(revision 119086)
 +++ gcc/config/rs6000/rs6000.h(working copy)
 @@ -3812,7 +3812,7 @@
   return  
 false; \
 case  
 ALTIVEC_BUILTIN_VSPLTB:\
   if (ConstantInt *Elt = dyn_castConstantInt(OPS[1]))  
 {   \
 -  int EV = Elt-getRawValue 
 ();\
 +  int EV = Elt-getZExtValue 
 ();   \
 RESULT = BuildVectorShuffle(OPS[0], OPS 
 [0], \
 EV, EV, EV, EV, EV, EV, EV,  
 EV, \
 EV, EV, EV, EV, EV, EV, EV,  
 EV);\
 @@ -3821,7 +3821,7 @@
   return  
 false; \
 case  
 ALTIVEC_BUILTIN_VSPLTH:\
   if (ConstantInt *Elt = dyn_castConstantInt(OPS[1]))  
 {   \
 -  int EV = Elt-getRawValue 
 ();\
 +  int EV = Elt-getZExtValue 
 ();   \
 RESULT = BuildVectorShuffle(OPS[0], OPS 
 [0], \
 EV, EV, EV, EV, EV, EV, EV,  
 EV);\
 return  
 true;\
 @@ -3829,7 +3829,7 @@
   return  
 false; \
 case  
 ALTIVEC_BUILTIN_VSPLTW:\
   if (ConstantInt *Elt = dyn_castConstantInt(OPS[1]))  
 {   \
 -  int EV = Elt-getRawValue 
 ();\
 +  int EV = Elt-getZExtValue 
 ();   \
 RESULT = BuildVectorShuffle(OPS[0], OPS[0], EV, EV, EV,  
 EV);\
 return  
 true;\
   }  
  \
 @@ -3840,7 +3840,7 @@
 case  
 ALTIVEC_BUILTIN_VSLDOI_4SF:\
   if (ConstantInt *Elt = dyn_castConstantInt(OPS[2]))  
 {   \
 /* Map all of these to a shuffle.  
 */\
 -  unsigned Amt = Elt-getRawValue()   
 15; \
 +  unsigned Amt = Elt-getZExtValue()   
 15;\
 PackedType *v16i8 = PackedType::get(Type::SByteTy,  
 16); \
 OPS[0] = CastToType(OPS[0],  
 v16i8); \
 OPS[1] = CastToType(OPS[1],  
 v16i8); \
 @@ -3890,7 +3890,7 @@
   /* and out sign bits  
 */   \
   PackedType *v4i32 = PackedType::get(Type::IntTy,  
 4);  \
   OPS[0] = new CastInst(OPS[0], v4i32, OPS[0]-getName(),  
 CurBB);   \
 -Constant *C = ConstantSInt::get(Type::IntTy,  
 0x7FFF); \
 +Constant *C = ConstantInt::get(Type::IntTy,  
 0x7FFF);  \
   C = ConstantPacked::get(std::vectorConstant*(4,  
 C));\
   RESULT = BinaryOperator::createAnd(OPS[0], C, tmp,  
 CurBB);  \
   RESULT = new CastInst(RESULT, DESTTY, tmp,  
 CurBB);  \
 
 On Oct 20, 2006, at 4:17 AM, Reid Spencer wrote:
 
  Index: llvm-abi.h
  ===
  --- llvm-abi.h  (revision 184)
  +++ llvm-abi.h  (working copy)
  @@ -199,7 +199,7 @@
   } else if (TREE_CODE(type) == RECORD_TYPE) {
 for (tree Field = TYPE_FIELDS(type); Field; Field =
  TREE_CHAIN(Field))
   if (TREE_CODE(Field) == FIELD_DECL) {
  -  unsigned FNo =
  castConstantUInt(DECL_LLVM(Field))-getValue();
  +  unsigned FNo =
  castConstantInt(DECL_LLVM(Field))-getZExtValue();
 assert(FNo != ~0U  Case not handled yet!);
 
 C.EnterField(FNo, Ty);
  Index: llvm-backend.cpp
  ===
  --- llvm-backend.cpp(revision 184)
  +++ llvm-backend.cpp(working copy)
  @@ -333,7 +333,7 @@
 std::vectorConstant* StructInit;
 StructInit.resize(2);
 for (unsigned i = 0, e = Tors.size(); i != e; ++i) {
  -StructInit[0] = ConstantSInt::get(Type::IntTy, Tors[i].second);
  +StructInit[0] = 

Re: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll

2006-10-20 Thread Chris Lattner

 *** 0 
 --- 1,27 
 + ; RUN: llvm-as  %s | llc -march=x86 | %prcontext jg LBB1_5 1  
 | grep LBB1_4:

 Are you sure that grep is right?

Ah, the problem is that L is the prefix for darwin, linux uses .  
IIRC.  Try changing the greps to jg .*LBB1_5 and BB1_4:.

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h X86InstrInfo.cpp X86InstrInfo.h

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.276 - 1.277
X86ISelLowering.h updated: 1.75 - 1.76
X86InstrInfo.cpp updated: 1.63 - 1.64
X86InstrInfo.h updated: 1.56 - 1.57
---
Log message:

Implement branch analysis/xform hooks required by the branch folding pass.


---
Diffs of the changes:  (+229 -87)

 X86ISelLowering.cpp |  107 ++--
 X86ISelLowering.h   |   22 ---
 X86InstrInfo.cpp|  151 
 X86InstrInfo.h  |   36 
 4 files changed, 229 insertions(+), 87 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.276 
llvm/lib/Target/X86/X86ISelLowering.cpp:1.277
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.276   Mon Oct 16 01:36:00 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri Oct 20 12:42:20 2006
@@ -2317,30 +2317,6 @@
   return std::make_pair(Result, Chain);
 }
 
-/// getCondBrOpcodeForX86CC - Returns the X86 conditional branch opcode
-/// which corresponds to the condition code.
-static unsigned getCondBrOpcodeForX86CC(unsigned X86CC) {
-  switch (X86CC) {
-  default: assert(0  Unknown X86 conditional code!);
-  case X86ISD::COND_A:  return X86::JA;
-  case X86ISD::COND_AE: return X86::JAE;
-  case X86ISD::COND_B:  return X86::JB;
-  case X86ISD::COND_BE: return X86::JBE;
-  case X86ISD::COND_E:  return X86::JE;
-  case X86ISD::COND_G:  return X86::JG;
-  case X86ISD::COND_GE: return X86::JGE;
-  case X86ISD::COND_L:  return X86::JL;
-  case X86ISD::COND_LE: return X86::JLE;
-  case X86ISD::COND_NE: return X86::JNE;
-  case X86ISD::COND_NO: return X86::JNO;
-  case X86ISD::COND_NP: return X86::JNP;
-  case X86ISD::COND_NS: return X86::JNS;
-  case X86ISD::COND_O:  return X86::JO;
-  case X86ISD::COND_P:  return X86::JP;
-  case X86ISD::COND_S:  return X86::JS;
-  }
-}
-
 /// translateX86CC - do a one to one translation of a ISD::CondCode to the X86
 /// specific condition code. It returns a false if it cannot do a direct
 /// translation. X86CC is the translated CondCode.  LHS/RHS are modified as
@@ -2348,33 +2324,33 @@
 static bool translateX86CC(ISD::CondCode SetCCOpcode, bool isFP,
unsigned X86CC, SDOperand LHS, SDOperand RHS,
SelectionDAG DAG) {
-  X86CC = X86ISD::COND_INVALID;
+  X86CC = X86::COND_INVALID;
   if (!isFP) {
 if (ConstantSDNode *RHSC = dyn_castConstantSDNode(RHS)) {
   if (SetCCOpcode == ISD::SETGT  RHSC-isAllOnesValue()) {
 // X  -1   - X == 0, jump !sign.
 RHS = DAG.getConstant(0, RHS.getValueType());
-X86CC = X86ISD::COND_NS;
+X86CC = X86::COND_NS;
 return true;
   } else if (SetCCOpcode == ISD::SETLT  RHSC-isNullValue()) {
 // X  0   - X == 0, jump on sign.
-X86CC = X86ISD::COND_S;
+X86CC = X86::COND_S;
 return true;
   }
 }
 
 switch (SetCCOpcode) {
 default: break;
-case ISD::SETEQ:  X86CC = X86ISD::COND_E;  break;
-case ISD::SETGT:  X86CC = X86ISD::COND_G;  break;
-case ISD::SETGE:  X86CC = X86ISD::COND_GE; break;
-case ISD::SETLT:  X86CC = X86ISD::COND_L;  break;
-case ISD::SETLE:  X86CC = X86ISD::COND_LE; break;
-case ISD::SETNE:  X86CC = X86ISD::COND_NE; break;
-case ISD::SETULT: X86CC = X86ISD::COND_B;  break;
-case ISD::SETUGT: X86CC = X86ISD::COND_A;  break;
-case ISD::SETULE: X86CC = X86ISD::COND_BE; break;
-case ISD::SETUGE: X86CC = X86ISD::COND_AE; break;
+case ISD::SETEQ:  X86CC = X86::COND_E;  break;
+case ISD::SETGT:  X86CC = X86::COND_G;  break;
+case ISD::SETGE:  X86CC = X86::COND_GE; break;
+case ISD::SETLT:  X86CC = X86::COND_L;  break;
+case ISD::SETLE:  X86CC = X86::COND_LE; break;
+case ISD::SETNE:  X86CC = X86::COND_NE; break;
+case ISD::SETULT: X86CC = X86::COND_B;  break;
+case ISD::SETUGT: X86CC = X86::COND_A;  break;
+case ISD::SETULE: X86CC = X86::COND_BE; break;
+case ISD::SETUGE: X86CC = X86::COND_AE; break;
 }
   } else {
 // On a floating point condition, the flags are set as follows:
@@ -2387,29 +2363,29 @@
 switch (SetCCOpcode) {
 default: break;
 case ISD::SETUEQ:
-case ISD::SETEQ: X86CC = X86ISD::COND_E;  break;
+case ISD::SETEQ: X86CC = X86::COND_E;  break;
 case ISD::SETOLT: Flip = true; // Fallthrough
 case ISD::SETOGT:
-case ISD::SETGT: X86CC = X86ISD::COND_A;  break;
+case ISD::SETGT: X86CC = X86::COND_A;  break;
 case ISD::SETOLE: Flip = true; // Fallthrough
 case ISD::SETOGE:
-case ISD::SETGE: X86CC = X86ISD::COND_AE; break;
+case ISD::SETGE: X86CC = X86::COND_AE; break;
 case ISD::SETUGT: Flip = true; // Fallthrough
 case ISD::SETULT:
-case ISD::SETLT: X86CC = X86ISD::COND_B;  break;
+case ISD::SETLT: X86CC = X86::COND_B;  break;
 case ISD::SETUGE: Flip = true; // Fallthrough
 case ISD::SETULE:
-case 

Re: [llvm-commits] [llvm-gcc4] path for Constant[SU]Int - ConstantInt

2006-10-20 Thread Reid Spencer
Please use the patch I just sent with NEW in the subject line.

Reid.

On Fri, 2006-10-20 at 14:53 -0300, Rafael Espíndola wrote:
 On 10/20/06, Reid Spencer [EMAIL PROTECTED] wrote:
  Attached is the patch for updating llvm-gcc4 for the ConstantInt change.
 
 Thank you.
 I also needed the attached patch to replace getRawValue with getZExtValue.
 
  Reid.
 
 Rafael

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

2006-10-20 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.188 - 1.189
---
Log message:

add method


---
Diffs of the changes:  (+11 -2)

 MachineInstr.h |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.188 
llvm/include/llvm/CodeGen/MachineInstr.h:1.189
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.188  Thu Oct  5 20:16:29 2006
+++ llvm/include/llvm/CodeGen/MachineInstr.hFri Oct 20 13:00:03 2006
@@ -70,9 +70,18 @@
   MachineOperand(const MachineOperand M) {
 *this = M;
   }
-
+  
   ~MachineOperand() {}
-
+  
+  static MachineOperand CreateImm(int64_t Val) {
+MachineOperand Op;
+Op.opType = MachineOperand::MO_Immediate;
+Op.contents.immedVal = Val;
+Op.IsDef = false;
+Op.offset = 0;
+return Op;
+  }
+  
   const MachineOperand operator=(const MachineOperand MO) {
 contents = MO.contents;
 IsDef= MO.IsDef;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGPrinter.cpp updated: 1.40 - 1.41
---
Log message:

Make flag and chain edges visually distinguishable from value edges in DOT
output.


---
Diffs of the changes:  (+16 -1)

 SelectionDAGPrinter.cpp |   17 -
 1 files changed, 16 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.40 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.41
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp:1.40  Tue Oct 17 
16:18:26 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp   Fri Oct 20 
13:06:09 2006
@@ -41,6 +41,20 @@
 const SelectionDAG *Graph) {
   return true;
 }
+
+/// If you want to override the dot attributes printed for a particular
+/// edge, override this method.
+templatetypename EdgeIter
+static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
+  SDOperand Op = EI.getNode()-getOperand(EI.getOperand());
+  MVT::ValueType VT = Op.getValueType();
+  if (VT == MVT::Flag)
+return color=red,style=bold;
+  else if (VT == MVT::Other)
+return style=dashed;
+  return ;
+}
+
 
 static std::string getNodeLabel(const SDNode *Node,
 const SelectionDAG *Graph);
@@ -114,7 +128,8 @@
   Op += LBB-getName();
 //Op +=   + (const void*)BBDN-getBasicBlock();
   } else if (const RegisterSDNode *R = dyn_castRegisterSDNode(Node)) {
-if (G  R-getReg() != 0  
MRegisterInfo::isPhysicalRegister(R-getReg())) {
+if (G  R-getReg() != 0 
+MRegisterInfo::isPhysicalRegister(R-getReg())) {
   Op = Op +   + G-getTarget().getRegisterInfo()-getName(R-getReg());
 } else {
   Op +=  # + utostr(R-getReg());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-10-20-mask.ll

2006-10-20 Thread Devang Patel


Changes in directory llvm/test/Regression/Transforms/InstCombine:

2006-10-20-mask.ll added (r1.1)
---
Log message:

Test case for
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061016/038780.html


---
Diffs of the changes:  (+8 -0)

 2006-10-20-mask.ll |8 
 1 files changed, 8 insertions(+)


Index: llvm/test/Regression/Transforms/InstCombine/2006-10-20-mask.ll
diff -c /dev/null 
llvm/test/Regression/Transforms/InstCombine/2006-10-20-mask.ll:1.1
*** /dev/null   Fri Oct 20 13:06:47 2006
--- llvm/test/Regression/Transforms/InstCombine/2006-10-20-mask.ll  Fri Oct 
20 13:06:37 2006
***
*** 0 
--- 1,8 
+ ;  RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep 'and'
+ ulong %foo(ulong %tmp, ulong %tmp2) {
+   %tmp = cast ulong %tmp to uint
+   %tmp2 = cast ulong %tmp2 to uint
+   %tmp3 = and uint %tmp, %tmp2
+   %tmp4 = cast uint %tmp3 to ulong
+   ret ulong %tmp4
+ }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] [llvm-gcc] NEW Patch for ConstantInt Changes

2006-10-20 Thread Jim Laskey

These patches will be reflected on the opensource mirror tomorrow.

Cheers,

-- Jim

On Oct 20, 2006, at 2:51 PM, Reid Spencer wrote:

The attached patch incorporates changes in config/i386/i386.h as  
well as
config/rs6000/rs6000.h that were missing previously. It also gets  
rid of

a few more getRawValue() calls.  This should be the final patch for
llvm-gcc to make it work with the new LLVM after the ConstantInt
changes.

Reid.
llvm-gcc-patch.txt
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




smime.p7s
Description: S/MIME cryptographic signature
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll

2006-10-20 Thread Bill Wendling


Changes in directory llvm/test/Regression/CodeGen/X86:

2006-10-19-SwitchUnnecessaryBranching.ll updated: 1.1 - 1.2
---
Log message:

Changed the pattern matching so that it will hopefully work on Linux.


---
Diffs of the changes:  (+1 -1)

 2006-10-19-SwitchUnnecessaryBranching.ll |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll
diff -u 
llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.1 
llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.2
--- 
llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll:1.1   
Thu Oct 19 18:21:59 2006
+++ llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll   
Fri Oct 20 13:15:24 2006
@@ -1,4 +1,4 @@
-; RUN: llvm-as  %s | llc -march=x86 | %prcontext jg LBB1_5 1 | grep 
LBB1_4:
+; RUN: llvm-as  %s | llc -march=x86 | %prcontext jg.*BB1_5 1 | grep BB1_4:
 
 %str = internal constant [14 x sbyte] cHello world!\0A\00; [14 
x sbyte]* [#uses=1]
 %str = internal constant [13 x sbyte] cBlah world!\0A\00 ; [13 
x sbyte]* [#uses=1]



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.526 - 1.527
---
Log message:

Fix miscompilation of MallocBench/espresso which code review pointed out
but apparently didn't make it into the final patch.


---
Diffs of the changes:  (+1 -1)

 InstructionCombining.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.526 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.527
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.526   Fri Oct 20 
02:07:24 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Oct 20 13:20:21 2006
@@ -4913,7 +4913,7 @@
   // shr int -1, X = -1   (for any arithmetic shift rights of ~0)
   if (!isLeftShift)
 if (ConstantInt *CSI = dyn_castConstantInt(Op0))
-  if (CSI-isAllOnesValue())
+  if (CSI-isAllOnesValue()  Op0-getType()-isSigned())
 return ReplaceInstUsesWith(I, CSI);
 
   // Try to fold constant and into select arguments.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2006-10-20 Thread Reid Spencer
Oops .. sorry about that.

On Fri, 2006-10-20 at 13:20 -0500, Chris Lattner wrote:
 
 Changes in directory llvm/lib/Transforms/Scalar:
 
 InstructionCombining.cpp updated: 1.526 - 1.527
 ---
 Log message:
 
 Fix miscompilation of MallocBench/espresso which code review pointed out
 but apparently didn't make it into the final patch.
 
 
 ---
 Diffs of the changes:  (+1 -1)
 
  InstructionCombining.cpp |2 +-
  1 files changed, 1 insertion(+), 1 deletion(-)
 
 
 Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
 diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.526 
 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.527
 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.526 Fri Oct 20 
 02:07:24 2006
 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp   Fri Oct 20 
 13:20:21 2006
 @@ -4913,7 +4913,7 @@
// shr int -1, X = -1   (for any arithmetic shift rights of ~0)
if (!isLeftShift)
  if (ConstantInt *CSI = dyn_castConstantInt(Op0))
 -  if (CSI-isAllOnesValue())
 +  if (CSI-isAllOnesValue()  Op0-getType()-isSigned())
  return ReplaceInstUsesWith(I, CSI);
  
// Try to fold constant and into select arguments.
 
 
 
 ___
 llvm-commits mailing list
 llvm-commits@cs.uiuc.edu
 http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-10-19-SwitchUnnecessaryBranching.ll

2006-10-20 Thread Bill Wendling
Okay. I've submitted a patch to fix this. Cross fingers!

-bw

On 10/20/06, Chris Lattner [EMAIL PROTECTED] wrote:

  *** 0 
  --- 1,27 
  + ; RUN: llvm-as  %s | llc -march=x86 | %prcontext jg LBB1_5 1
  | grep LBB1_4:
 
  Are you sure that grep is right?

 Ah, the problem is that L is the prefix for darwin, linux uses .
 IIRC.  Try changing the greps to jg .*LBB1_5 and BB1_4:.

 -Chris

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.82 - 1.83
---
Log message:

Correct newly failing attempt #1.

---
Diffs of the changes:  (+58 -13)

 ProgramResults.php |   71 +++--
 1 files changed, 58 insertions(+), 13 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.82 
nightlytest-serverside/ProgramResults.php:1.83
--- nightlytest-serverside/ProgramResults.php:1.82  Tue Sep 19 17:07:32 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 14:46:09 2006
@@ -387,31 +387,42 @@
 
 
 /*
- * Return reason why a llvm test failed.
+ * Return reasons why a llvm test failed as an array.
  */
-function getFailReasons($test_result) {
-  $result = ;
+function getFailReasonsAsList($test_result) {
+  $result = array();
   $phases = split(, , $test_result);
   
   for ($i = 0; $i  count($phases); $i++) {
 $phase = $phases[$i];
 if (strpos($phase, *) !== false) {
   list($tool, $tool_result) = split(: , $phase);
-  if (strcmp($result, ) != 0) {
-$result .= , ;
-  }
-  $result .= $tool;
+  array_push($result, $tool);
 }
   }
   
-  if (strcmp($result, ) != 0) {
-$result =  [ . $result . ];
+  return $result;
+}
+
+/*
+ * Return reasons why a llvm test failed as a string.
+ */
+function FailReasonsAsString($reasons) {
+  if (count($reasons) != 0) {
+$result =  [;
+for ($i = 0; $i  count($reasons); $i++) {
+  if ($i != 0) {
+$result .= , ;
+  }
+  $result .= $reasons[$i];
+}
+
+$result .= ] ;
   }
   
   return $result;
 }
 
-
 /*
  * Trim test path to exclude redundant info.
  */
@@ -447,7 +458,7 @@
   $test_result = $row['result'];
   if (!isTestPass($test_result)) {
 $program = trimTestPath($row['program']);
-$reasons = getFailReasons($test_result);
+$reasons = FailReasonsAsString(getFailReasonsAsList($test_result));

 $result .= $program . $reasons . \n;
   }
 }
@@ -604,6 +615,7 @@
  */
 function getTestFailSet($id) {
   $test_hash = array();
+  
   $query = SELECT program, result, measure FROM tests WHERE night=$id AND 
result=\FAIL\ ORDER BY program ASC, measure ASC;
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
@@ -613,9 +625,25 @@
 $test_hash[$key] = true;
   }
   mysql_free_result($program_query);
+  
+  $query = SELECT program, result FROM program WHERE night=$night_id ORDER BY 
program ASC;
+  $program_query = mysql_query($query) or die (mysql_error());
+  while($row = mysql_fetch_assoc($program_query)) {
+$program = trimTestPath($row['program']);
+$test_result = $row['result'];
+$reasons = getFailReasonsAsList($test_result);
+
+if (count($reasons) != 0) {
+  $test_hash[$program] = $reasons;
+}
+  }
+  mysql_free_result($program_query);
+  
+  
   return $test_hash;
 }
 
+
 /*
  * Get list of newly passing tests
  *
@@ -635,6 +663,23 @@
 }
   }
   mysql_free_result($program_query);
+  
+  $query = SELECT program, result FROM program WHERE night=$night_id ORDER BY 
program ASC;
+  $program_query = mysql_query($query) or die (mysql_error());
+  while($row = mysql_fetch_assoc($program_query)) {
+$program = trimTestPath($row['program']);
+$test_result = $row['result'];
+$new_reasons = getFailReasonsAsList($test_result);
+$old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
+$diff_reasons = array_diff($old_reasons, $new_reasons);
+$now_passing_reasons = array_intersect($diff_reasons, $old_reasons);
+
+if (count($now_passing_reasons)  0) {
+  $reasons .= $program . FailReasonsAsString($now_passing_reasons) . \n; 
  
+}
+  }
+  mysql_free_result($program_query);
+  
   return $passing;
 }
 
@@ -716,10 +761,10 @@
  *
  */
 function getEmailReport($cur_id, $prev_id) {
-  $added = getNewTests($cur_id, $prev_id);
-  $removed = getRemovedTests($cur_id, $prev_id);
   $passing = getFixedTests($cur_id, $prev_id);
   $failing = getBrokenTests($cur_id, $prev_id);
+  $added = getNewTests($cur_id, $prev_id);
+  $removed = getRemovedTests($cur_id, $prev_id);
   
   $email = ;
   if (strcmp($passing, ) == 0) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.83 - 1.84
---
Log message:

Correct newly failing attempt #2.

---
Diffs of the changes:  (+13 -58)

 ProgramResults.php |   71 +
 1 files changed, 13 insertions(+), 58 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.83 
nightlytest-serverside/ProgramResults.php:1.84
--- nightlytest-serverside/ProgramResults.php:1.83  Fri Oct 20 14:46:09 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 14:51:39 2006
@@ -387,42 +387,31 @@
 
 
 /*
- * Return reasons why a llvm test failed as an array.
+ * Return reason why a llvm test failed.
  */
-function getFailReasonsAsList($test_result) {
-  $result = array();
+function getFailReasons($test_result) {
+  $result = ;
   $phases = split(, , $test_result);
   
   for ($i = 0; $i  count($phases); $i++) {
 $phase = $phases[$i];
 if (strpos($phase, *) !== false) {
   list($tool, $tool_result) = split(: , $phase);
-  array_push($result, $tool);
-}
-  }
-  
-  return $result;
-}
-
-/*
- * Return reasons why a llvm test failed as a string.
- */
-function FailReasonsAsString($reasons) {
-  if (count($reasons) != 0) {
-$result =  [;
-for ($i = 0; $i  count($reasons); $i++) {
-  if ($i != 0) {
+  if (strcmp($result, ) != 0) {
 $result .= , ;
   }
-  $result .= $reasons[$i];
+  $result .= $tool;
 }
-
-$result .= ] ;
+  }
+  
+  if (strcmp($result, ) != 0) {
+$result =  [ . $result . ];
   }
   
   return $result;
 }
 
+
 /*
  * Trim test path to exclude redundant info.
  */
@@ -458,7 +447,7 @@
   $test_result = $row['result'];
   if (!isTestPass($test_result)) {
 $program = trimTestPath($row['program']);
-$reasons = FailReasonsAsString(getFailReasonsAsList($test_result));

+$reasons = getFailReasons($test_result);
 $result .= $program . $reasons . \n;
   }
 }
@@ -615,7 +604,6 @@
  */
 function getTestFailSet($id) {
   $test_hash = array();
-  
   $query = SELECT program, result, measure FROM tests WHERE night=$id AND 
result=\FAIL\ ORDER BY program ASC, measure ASC;
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
@@ -625,25 +613,9 @@
 $test_hash[$key] = true;
   }
   mysql_free_result($program_query);
-  
-  $query = SELECT program, result FROM program WHERE night=$night_id ORDER BY 
program ASC;
-  $program_query = mysql_query($query) or die (mysql_error());
-  while($row = mysql_fetch_assoc($program_query)) {
-$program = trimTestPath($row['program']);
-$test_result = $row['result'];
-$reasons = getFailReasonsAsList($test_result);
-
-if (count($reasons) != 0) {
-  $test_hash[$program] = $reasons;
-}
-  }
-  mysql_free_result($program_query);
-  
-  
   return $test_hash;
 }
 
-
 /*
  * Get list of newly passing tests
  *
@@ -663,23 +635,6 @@
 }
   }
   mysql_free_result($program_query);
-  
-  $query = SELECT program, result FROM program WHERE night=$night_id ORDER BY 
program ASC;
-  $program_query = mysql_query($query) or die (mysql_error());
-  while($row = mysql_fetch_assoc($program_query)) {
-$program = trimTestPath($row['program']);
-$test_result = $row['result'];
-$new_reasons = getFailReasonsAsList($test_result);
-$old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
-$diff_reasons = array_diff($old_reasons, $new_reasons);
-$now_passing_reasons = array_intersect($diff_reasons, $old_reasons);
-
-if (count($now_passing_reasons)  0) {
-  $reasons .= $program . FailReasonsAsString($now_passing_reasons) . \n; 
  
-}
-  }
-  mysql_free_result($program_query);
-  
   return $passing;
 }
 
@@ -761,10 +716,10 @@
  *
  */
 function getEmailReport($cur_id, $prev_id) {
-  $passing = getFixedTests($cur_id, $prev_id);
-  $failing = getBrokenTests($cur_id, $prev_id);
   $added = getNewTests($cur_id, $prev_id);
   $removed = getRemovedTests($cur_id, $prev_id);
+  $passing = getFixedTests($cur_id, $prev_id);
+  $failing = getBrokenTests($cur_id, $prev_id);
   
   $email = ;
   if (strcmp($passing, ) == 0) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.132 - 1.133
---
Log message:

Fix an ugly problem in SCCP.  This fixes Benchmarks/Misc-C++/mandel-text.cpp



---
Diffs of the changes:  (+3 -2)

 SCCP.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.132 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.133
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.132   Thu Sep 28 18:35:21 2006
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Oct 20 15:19:08 2006
@@ -1032,7 +1032,7 @@
 if (BI-isConditional()) {
   LatticeVal BCValue = getValueState(BI-getCondition());
   if (BCValue.isUndefined()) {
-BI-setCondition(ConstantBool::getTrue());
+BCValue.markOverdefined();
 BranchesResolved = true;
 visit(BI);
   }
@@ -1041,7 +1041,8 @@
 LatticeVal SCValue = getValueState(SI-getCondition());
 if (SCValue.isUndefined()) {
   const Type *CondTy = SI-getCondition()-getType();
-  SI-setCondition(Constant::getNullValue(CondTy));
+  // Pick and arbitrary direction for the switch to go.
+  SCValue.markOverdefined();
   BranchesResolved = true;
   visit(SI);
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.cpp updated: 1.64 - 1.65
---
Log message:

bugfix


---
Diffs of the changes:  (+1 -1)

 X86InstrInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.64 
llvm/lib/Target/X86/X86InstrInfo.cpp:1.65
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.64   Fri Oct 20 12:42:20 2006
+++ llvm/lib/Target/X86/X86InstrInfo.cppFri Oct 20 15:44:34 2006
@@ -381,7 +381,7 @@
 return;
   }
   
-  assert(Cond.size() == 2  PPC branch conditions have two components!);
+  assert(Cond.size() == 1  X86 branch conditions have two components!);
   
   // Conditional branch.
   unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.85 - 1.86
---
Log message:

Correct newly failing attempt #4.

---
Diffs of the changes:  (+1 -2)

 ProgramResults.php |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.85 
nightlytest-serverside/ProgramResults.php:1.86
--- nightlytest-serverside/ProgramResults.php:1.85  Fri Oct 20 15:46:32 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 15:48:17 2006
@@ -668,10 +668,9 @@
 $test_result = $row['result'];
 $new_reasons = getFailReasonsAsList($test_result);
 $diff_reasons = array_diff($old_reasons, $new_reasons);
-$now_passing_reasons = array_intersect($diff_reasons, $old_reasons);
 
 if (count($now_passing_reasons)  0) {
-  $reasons .= $program . FailReasonsAsString($now_passing_reasons) . \n; 
  
+  $reasons .= $program . FailReasonsAsString($diff_reasons) . \n;   
 }
   }
   mysql_free_result($program_query);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.86 - 1.87
---
Log message:

Correct newly failing attempt #5.

---
Diffs of the changes:  (+1 -0)

 ProgramResults.php |1 +
 1 files changed, 1 insertion(+)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.86 
nightlytest-serverside/ProgramResults.php:1.87
--- nightlytest-serverside/ProgramResults.php:1.86  Fri Oct 20 15:48:17 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 15:50:25 2006
@@ -667,6 +667,7 @@
 $program = trimTestPath($row['program']);
 $test_result = $row['result'];
 $new_reasons = getFailReasonsAsList($test_result);
+$old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
 $diff_reasons = array_diff($old_reasons, $new_reasons);
 
 if (count($now_passing_reasons)  0) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.87 - 1.88
---
Log message:

Correct newly failing attempt #6.

---
Diffs of the changes:  (+1 -1)

 ProgramResults.php |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.87 
nightlytest-serverside/ProgramResults.php:1.88
--- nightlytest-serverside/ProgramResults.php:1.87  Fri Oct 20 15:50:25 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 15:51:55 2006
@@ -670,7 +670,7 @@
 $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
 $diff_reasons = array_diff($old_reasons, $new_reasons);
 
-if (count($now_passing_reasons)  0) {
+if (count($diff_reasons)  0) {
   $reasons .= $program . FailReasonsAsString($diff_reasons) . \n;   
 }
   }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.88 - 1.89
---
Log message:

Correct newly failing attempt #7.

---
Diffs of the changes:  (+8 -0)

 ProgramResults.php |8 
 1 files changed, 8 insertions(+)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.88 
nightlytest-serverside/ProgramResults.php:1.89
--- nightlytest-serverside/ProgramResults.php:1.88  Fri Oct 20 15:51:55 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 15:56:51 2006
@@ -669,6 +669,14 @@
 $new_reasons = getFailReasonsAsList($test_result);
 $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
 $diff_reasons = array_diff($old_reasons, $new_reasons);
+
+print $new_reasons;
+print BR;
+print $old_reasons;
+print BR;
+print $diff_reasons;
+print BR;
+print BR;
 
 if (count($diff_reasons)  0) {
   $reasons .= $program . FailReasonsAsString($diff_reasons) . \n;   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.89 - 1.90
---
Log message:

Correct newly failing attempt #8.

---
Diffs of the changes:  (+3 -3)

 ProgramResults.php |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.89 
nightlytest-serverside/ProgramResults.php:1.90
--- nightlytest-serverside/ProgramResults.php:1.89  Fri Oct 20 15:56:51 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 15:58:11 2006
@@ -670,11 +670,11 @@
 $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
 $diff_reasons = array_diff($old_reasons, $new_reasons);
 
-print $new_reasons;
+print FailReasonsAsString($new_reasons);
 print BR;
-print $old_reasons;
+print FailReasonsAsString($old_reasons);
 print BR;
-print $diff_reasons;
+print FailReasonsAsString($diff_reasons);
 print BR;
 print BR;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.90 - 1.91
---
Log message:

Correct newly failing attempt #9.

---
Diffs of the changes:  (+3 -3)

 ProgramResults.php |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.90 
nightlytest-serverside/ProgramResults.php:1.91
--- nightlytest-serverside/ProgramResults.php:1.90  Fri Oct 20 15:58:11 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 15:59:58 2006
@@ -670,11 +670,11 @@
 $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
 $diff_reasons = array_diff($old_reasons, $new_reasons);
 
-print FailReasonsAsString($new_reasons);
+print New reasons:  . FailReasonsAsString($new_reasons);
 print BR;
-print FailReasonsAsString($old_reasons);
+print Old reasons:  . FailReasonsAsString($old_reasons);
 print BR;
-print FailReasonsAsString($diff_reasons);
+print Diff reasons:  . FailReasonsAsString($diff_reasons);
 print BR;
 print BR;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.91 - 1.92
---
Log message:

Correct newly failing attempt #10.

---
Diffs of the changes:  (+1 -1)

 ProgramResults.php |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.91 
nightlytest-serverside/ProgramResults.php:1.92
--- nightlytest-serverside/ProgramResults.php:1.91  Fri Oct 20 15:59:58 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 16:01:58 2006
@@ -668,7 +668,7 @@
 $test_result = $row['result'];
 $new_reasons = getFailReasonsAsList($test_result);
 $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
-$diff_reasons = array_diff($old_reasons, $new_reasons);
+$diff_reasons = array_diff($new_reasons, $old_reasons);
 
 print New reasons:  . FailReasonsAsString($new_reasons);
 print BR;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.92 - 1.93
---
Log message:

Correct newly failing attempt #11.

---
Diffs of the changes:  (+2 -0)

 ProgramResults.php |2 ++
 1 files changed, 2 insertions(+)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.92 
nightlytest-serverside/ProgramResults.php:1.93
--- nightlytest-serverside/ProgramResults.php:1.92  Fri Oct 20 16:01:58 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 16:04:00 2006
@@ -676,6 +676,8 @@
 print BR;
 print Diff reasons:  . FailReasonsAsString($diff_reasons);
 print BR;
+print  count($diff_reasons);
+print BR;
 print BR;
 
 if (count($diff_reasons)  0) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

2006-10-20 Thread Jim Laskey


Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.93 - 1.94
---
Log message:

Correct newly failing attempt #12, d'oh.

---
Diffs of the changes:  (+1 -11)

 ProgramResults.php |   12 +---
 1 files changed, 1 insertion(+), 11 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.93 
nightlytest-serverside/ProgramResults.php:1.94
--- nightlytest-serverside/ProgramResults.php:1.93  Fri Oct 20 16:04:00 2006
+++ nightlytest-serverside/ProgramResults.php   Fri Oct 20 16:05:37 2006
@@ -669,19 +669,9 @@
 $new_reasons = getFailReasonsAsList($test_result);
 $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : 
array();
 $diff_reasons = array_diff($new_reasons, $old_reasons);
-
-print New reasons:  . FailReasonsAsString($new_reasons);
-print BR;
-print Old reasons:  . FailReasonsAsString($old_reasons);
-print BR;
-print Diff reasons:  . FailReasonsAsString($diff_reasons);
-print BR;
-print  count($diff_reasons);
-print BR;
-print BR;
 
 if (count($diff_reasons)  0) {
-  $reasons .= $program . FailReasonsAsString($diff_reasons) . \n;   
+  $passing .= $program . FailReasonsAsString($diff_reasons) . \n;   
 }
   }
   mysql_free_result($program_query);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/IPO/ExtractFunction.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/IPO:

ExtractFunction.cpp updated: 1.13 - 1.14
---
Log message:

llvm-extract should remove module-level asm


---
Diffs of the changes:  (+3 -3)

 ExtractFunction.cpp |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp
diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.13 
llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.14
--- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.13Thu Apr 21 18:39:37 2005
+++ llvm/lib/Transforms/IPO/ExtractFunction.cpp Fri Oct 20 16:35:41 2006
@@ -33,11 +33,11 @@
 Named = M.getMainFunction();
 if (Named == 0) return false;  // No function to extract
   }
-
+  
   if (deleteFunc)
 return deleteFunction();
-  else
-return isolateFunction(M);
+  M.setModuleInlineAsm();
+  return isolateFunction(M);
 }
 
 bool deleteFunction() {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

2006-10-20 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.189 - 1.190
---
Log message:

add isIdenticalTo method to machineinstr/operand.


---
Diffs of the changes:  (+19 -0)

 MachineInstr.h |   19 +++
 1 files changed, 19 insertions(+)


Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.189 
llvm/include/llvm/CodeGen/MachineInstr.h:1.190
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.189  Fri Oct 20 13:00:03 2006
+++ llvm/include/llvm/CodeGen/MachineInstr.hFri Oct 20 17:39:36 2006
@@ -118,6 +118,10 @@
 assert(isImm()  Wrong MachineOperand accessor);
 return contents.immedVal;
   }
+  MachineBasicBlock *getMBB() const {
+assert(isMachineBasicBlock()  Wrong MachineOperand accessor);
+return contents.MBB;
+  }
   MachineBasicBlock *getMachineBasicBlock() const {
 assert(isMachineBasicBlock()  Wrong MachineOperand accessor);
 return contents.MBB;
@@ -203,6 +207,9 @@
 contents.immedVal = Idx;
   }
   
+  /// isIdenticalTo - Return true if this operand is identical to the specified
+  /// operand.
+  bool isIdenticalTo(const MachineOperand Other) const;
   
   /// ChangeToImmediate - Replace this operand with a new immediate operand of
   /// the specified value.  If an operand is known to be an immediate already,
@@ -279,6 +286,18 @@
 return Operands[i];
   }
 
+  
+  /// isIdenticalTo - Return true if this instruction is identical to (same
+  /// opcode and same operands as) the specified instruction.
+  bool isIdenticalTo(const MachineInstr *Other) const {
+if (Other-getOpcode() != getOpcode() ||
+getNumOperands() != getNumOperands())
+  return false;
+for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
+  if (!getOperand(i).isIdenticalTo(Other-getOperand(i)))
+return false;
+return true;
+  }
 
   /// clone - Create a copy of 'this' instruction that is identical in
   /// all ways except the the instruction has no parent, prev, or next.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

MachineInstr.cpp updated: 1.125 - 1.126
---
Log message:

implement MachineOperand::isIdenticalTo


---
Diffs of the changes:  (+29 -0)

 MachineInstr.cpp |   29 +
 1 files changed, 29 insertions(+)


Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.125 
llvm/lib/CodeGen/MachineInstr.cpp:1.126
--- llvm/lib/CodeGen/MachineInstr.cpp:1.125 Tue Sep  5 15:19:27 2006
+++ llvm/lib/CodeGen/MachineInstr.cpp   Fri Oct 20 17:39:59 2006
@@ -97,6 +97,35 @@
   return false;
 }
 
+/// isIdenticalTo - Return true if this operand is identical to the specified
+/// operand.
+bool MachineOperand::isIdenticalTo(const MachineOperand Other) const {
+  if (getType() != Other.getType()) return false;
+  
+  switch (getType()) {
+  default: assert(0  Unrecognized operand type);
+  case MachineOperand::MO_Register:
+return getReg() == Other.getReg()  isDef() == Other.isDef();
+  case MachineOperand::MO_Immediate:
+return getImm() == Other.getImm();
+  case MachineOperand::MO_MachineBasicBlock:
+return getMBB() == Other.getMBB();
+  case MachineOperand::MO_FrameIndex:
+return getFrameIndex() == Other.getFrameIndex();
+  case MachineOperand::MO_ConstantPoolIndex:
+return getConstantPoolIndex() == Other.getConstantPoolIndex() 
+   getOffset() == Other.getOffset();
+  case MachineOperand::MO_JumpTableIndex:
+return getJumpTableIndex() == Other.getJumpTableIndex();
+  case MachineOperand::MO_GlobalAddress:
+return getGlobal() == Other.getGlobal()  getOffset() == 
Other.getOffset();
+  case MachineOperand::MO_ExternalSymbol:
+return getSymbolName() == Other.getSymbolName() 
+   getOffset() == Other.getOffset();
+  }
+}
+
+
 void MachineInstr::dump() const {
   std::cerr  *this;
 }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

2006-10-20 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.190 - 1.191
---
Log message:

typo


---
Diffs of the changes:  (+1 -1)

 MachineInstr.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.190 
llvm/include/llvm/CodeGen/MachineInstr.h:1.191
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.190  Fri Oct 20 17:39:36 2006
+++ llvm/include/llvm/CodeGen/MachineInstr.hFri Oct 20 17:44:45 2006
@@ -291,7 +291,7 @@
   /// opcode and same operands as) the specified instruction.
   bool isIdenticalTo(const MachineInstr *Other) const {
 if (Other-getOpcode() != getOpcode() ||
-getNumOperands() != getNumOperands())
+Other-getNumOperands() != getNumOperands())
   return false;
 for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
   if (!getOperand(i).isIdenticalTo(Other-getOperand(i)))



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.14 - 1.15
---
Log message:

Add an experimental cross-jumping implementation.
This is currently disabled by default and limited in several ways, but does
have a positive effect.



---
Diffs of the changes:  (+232 -14)

 BranchFolding.cpp |  246 ++
 1 files changed, 232 insertions(+), 14 deletions(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.14 
llvm/lib/CodeGen/BranchFolding.cpp:1.15
--- llvm/lib/CodeGen/BranchFolding.cpp:1.14 Tue Oct 17 18:17:27 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp  Fri Oct 20 19:47:49 2006
@@ -22,9 +22,16 @@
 #include llvm/CodeGen/MachineJumpTableInfo.h
 #include llvm/Target/TargetInstrInfo.h
 #include llvm/Target/TargetMachine.h
+#include llvm/Support/CommandLine.h
+#include llvm/ADT/Statistic.h
 #include llvm/ADT/STLExtras.h
 using namespace llvm;
 
+static Statistic NumDeadBlocks(branchfold, Number of dead blocks 
removed);
+static Statistic NumBranchOpts(branchfold, Number of branches optimized);
+static Statistic NumTailMerge (branchfold, Number of block tails merged);
+static cl::optbool EnableTailMerge(enable-tail-merge);
+
 namespace {
   struct BranchFolder : public MachineFunctionPass {
 virtual bool runOnMachineFunction(MachineFunction MF);
@@ -33,6 +40,13 @@
 MachineDebugInfo *MDI;
 bool MadeChange;
   private:
+// Tail Merging.
+bool TailMergeBlocks(MachineFunction MF);
+void ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
+ MachineBasicBlock *NewDest);
+
+// Branch optzn.
+bool OptimizeBranches(MachineFunction MF);
 void OptimizeBlock(MachineFunction::iterator MBB);
 void RemoveDeadBlock(MachineBasicBlock *MBB);
   };
@@ -77,26 +91,228 @@
   MDI = getAnalysisToUpdateMachineDebugInfo();
   
   bool EverMadeChange = false;
-  MadeChange = true;
-  while (MadeChange) {
-MadeChange = false;
-
-for (MachineFunction::iterator I = ++MF.begin(), E = MF.end(); I != E; ) {
-  MachineBasicBlock *MBB = I++;
-  OptimizeBlock(MBB);
+  bool MadeChangeThisIteration = true;
+  while (MadeChangeThisIteration) {
+MadeChangeThisIteration = false;
+MadeChangeThisIteration |= TailMergeBlocks(MF);
+MadeChangeThisIteration |= OptimizeBranches(MF);
+EverMadeChange |= MadeChangeThisIteration;
+  }
+
+  return EverMadeChange;
+}
+
+//===--===//
+//  Tail Merging of Blocks
+//===--===//
+
+/// HashMachineInstr - Compute a hash value for MI and its operands.
+static unsigned HashMachineInstr(const MachineInstr *MI) {
+  unsigned Hash = MI-getOpcode();
+  for (unsigned i = 0, e = MI-getNumOperands(); i != e; ++i) {
+const MachineOperand Op = MI-getOperand(i);
+
+// Merge in bits from the operand if easy.
+unsigned OperandHash = 0;
+switch (Op.getType()) {
+case MachineOperand::MO_Register:  OperandHash = Op.getReg(); 
break;
+case MachineOperand::MO_Immediate: OperandHash = Op.getImm(); 
break;
+case MachineOperand::MO_MachineBasicBlock:
+  OperandHash = Op.getMachineBasicBlock()-getNumber();
+  break;
+case MachineOperand::MO_FrameIndex: OperandHash = Op.getFrameIndex(); 
break;
+case MachineOperand::MO_ConstantPoolIndex:
+  OperandHash = Op.getConstantPoolIndex();
+  break;
+case MachineOperand::MO_JumpTableIndex:
+  OperandHash = Op.getJumpTableIndex();
+  break;
+case MachineOperand::MO_GlobalAddress:
+case MachineOperand::MO_ExternalSymbol:
+  // Global address / external symbol are too hard, don't bother, but do
+  // pull in the offset.
+  OperandHash = Op.getOffset();
+  break;
+default: break;
+}
+
+Hash += ((OperandHash  3) | Op.getType())  (i31);
+  }
+  return Hash;
+}
+
+/// HashEndOfMBB - Hash the last two instructions in the MBB.  We hash two
+/// instructions, because cross-jumping only saves code when at least two
+/// instructions are removed (since a branch must be inserted).
+static unsigned HashEndOfMBB(const MachineBasicBlock *MBB) {
+  MachineBasicBlock::const_iterator I = MBB-end();
+  if (I == MBB-begin())
+return 0;   // Empty MBB.
+  
+  --I;
+  unsigned Hash = HashMachineInstr(I);
+
+  if (I == MBB-begin())
+return Hash;   // Single instr MBB.
+  
+  --I;
+  // Hash in the second-to-last instruction.
+  Hash ^= HashMachineInstr(I)  2;
+  return Hash;
+}
+
+/// ComputeCommonTailLength - Given two machine basic blocks, compute the 
number
+/// of instructions they actually have in common together at their end.  Return
+/// iterators for the first shared instruction in each block.
+static unsigned ComputeCommonTailLength(MachineBasicBlock *MBB1,
+MachineBasicBlock *MBB2,
+   

[llvm-commits] CVS: llvm-test/Makefile.programs

2006-10-20 Thread Chris Lattner


Changes in directory llvm-test:

Makefile.programs updated: 1.231 - 1.232
---
Log message:

make tail merging be llc beta tonight


---
Diffs of the changes:  (+1 -1)

 Makefile.programs |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.231 llvm-test/Makefile.programs:1.232
--- llvm-test/Makefile.programs:1.231   Thu Oct 12 11:01:18 2006
+++ llvm-test/Makefile.programs Fri Oct 20 19:50:08 2006
@@ -193,7 +193,7 @@
 endif#DISABLE_DIFFS
 
 ifeq ($(ARCH),PowerPC)
-LLCBETAOPTION := -combiner-alias-analysis
+LLCBETAOPTION := -enable-tail-merge
 endif
 ifeq ($(ARCH),Alpha)
 LLCBETAOPTION := -sched=list-td 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/Makefile.programs

2006-10-20 Thread Chris Lattner


Changes in directory llvm-test:

Makefile.programs updated: 1.232 - 1.233
---
Log message:

enable tail merging for X86 llcbeta tonight


---
Diffs of the changes:  (+1 -1)

 Makefile.programs |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.232 llvm-test/Makefile.programs:1.233
--- llvm-test/Makefile.programs:1.232   Fri Oct 20 19:50:08 2006
+++ llvm-test/Makefile.programs Fri Oct 20 22:16:58 2006
@@ -203,7 +203,7 @@
 LLCBETAOPTION := -sched=simple 
 endif
 ifeq ($(ARCH),x86)
-LLCBETAOPTION := -combiner-alias-analysis
+LLCBETAOPTION := -enable-tail-merge
 endif
 ifeq ($(ARCH),Sparc)
 LLCBETAOPTION := -enable-sparc-v9-insts



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.cpp updated: 1.65 - 1.66
---
Log message:

update assert message


---
Diffs of the changes:  (+1 -1)

 X86InstrInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.65 
llvm/lib/Target/X86/X86InstrInfo.cpp:1.66
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.65   Fri Oct 20 15:44:34 2006
+++ llvm/lib/Target/X86/X86InstrInfo.cppFri Oct 20 23:42:29 2006
@@ -381,7 +381,7 @@
 return;
   }
   
-  assert(Cond.size() == 1  X86 branch conditions have two components!);
+  assert(Cond.size() == 1  X86 branch conditions have one component!);
   
   // Conditional branch.
   unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.15 - 1.16
---
Log message:

Three changes:
1. Remove a bunch of ifdef'd code.
2. When a block just contains an uncond branch, change all blocks branching
   to it to jump to the destination instead.
3. If branch analysis tells us some edges in the machinecfg are not actually
   possible, remove them.

#2 triggers a suprisingly large number of times.


---
Diffs of the changes:  (+117 -117)

 BranchFolding.cpp |  234 +++---
 1 files changed, 117 insertions(+), 117 deletions(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.15 
llvm/lib/CodeGen/BranchFolding.cpp:1.16
--- llvm/lib/CodeGen/BranchFolding.cpp:1.15 Fri Oct 20 19:47:49 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp  Sat Oct 21 00:08:28 2006
@@ -184,7 +184,8 @@
 }
 
 /// ReplaceTailWithBranchTo - Delete the instruction OldInst and everything
-/// after it, replacing it with an unconditional branch to NewDest.
+/// after it, replacing it with an unconditional branch to NewDest.  This
+/// returns true if OldInst's block is modified, false if NewDest is modified.
 void BranchFolder::ReplaceTailWithBranchTo(MachineBasicBlock::iterator OldInst,
MachineBasicBlock *NewDest) {
   MachineBasicBlock *OldBB = OldInst-getParent();
@@ -196,7 +197,9 @@
   // Remove all the dead instructions from the end of OldBB.
   OldBB-erase(OldInst, OldBB-end());
 
-  TII-InsertBranch(*OldBB, NewDest, 0, std::vectorMachineOperand());
+  // If OldBB isn't immediately before OldBB, insert a branch to it.
+  if (++MachineFunction::iterator(OldBB) != MachineFunction::iterator(NewDest))
+TII-InsertBranch(*OldBB, NewDest, 0, std::vectorMachineOperand());
   OldBB-addSuccessor(NewDest);
   ++NumTailMerge;
 }
@@ -313,6 +316,58 @@
 }
 
 
+/// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in the
+/// CFG to be inserted.  If we have proven that MBB can only branch to DestA 
and
+/// DestB, remove any other MBB successors from the CFG.  DestA and DestB can
+/// be null.
+static bool CorrectExtraCFGEdges(MachineBasicBlock MBB, 
+ MachineBasicBlock *DestA,
+ MachineBasicBlock *DestB,
+ bool isCond, 
+ MachineFunction::iterator FallThru) {
+  bool MadeChange = false;
+  bool AddedFallThrough = false;
+  
+  // If this block ends with a conditional branch that falls through to its
+  // successor, set DestB as the successor.
+  if (isCond) {
+if (DestB == 0  FallThru != MBB.getParent()-end()) {
+  DestB = FallThru;
+  AddedFallThrough = true;
+}
+  } else {
+// If this is an unconditional branch with no explicit dest, it must just 
be
+// a fallthrough into DestB.
+if (DestA == 0  FallThru != MBB.getParent()-end()) {
+  DestA = FallThru;
+  AddedFallThrough = true;
+}
+  }
+  
+  MachineBasicBlock::pred_iterator SI = MBB.succ_begin();
+  while (SI != MBB.succ_end()) {
+if (*SI == DestA) {
+  DestA = 0;
+  ++SI;
+} else if (*SI == DestB) {
+  DestB = 0;
+  ++SI;
+} else {
+  // Otherwise, this is a superfluous edge, remove it.
+  MBB.removeSuccessor(SI);
+  MadeChange = true;
+}
+  }
+  if (!AddedFallThrough) {
+assert(DestA == 0  DestB == 0 
+   MachineCFG is missing edges!);
+  } else if (isCond) {
+assert(DestA == 0  MachineCFG is missing edges!);
+  }
+  return MadeChange;
+}
+
+
 /// ReplaceUsesOfBlockWith - Given a machine basic block 'BB' that branched to
 /// 'Old', change the code and CFG so that it branches to 'New' instead.
 static void ReplaceUsesOfBlockWith(MachineBasicBlock *BB,
@@ -349,7 +404,8 @@
   // If this block is empty, make everyone use its fall-through, not the block
   // explicitly.
   if (MBB-empty()) {
-if (MBB-pred_empty()) return;  // dead block?  Leave for cleanup later.
+// Dead block?  Leave for cleanup later.
+if (MBB-pred_empty()) return;
 
 MachineFunction::iterator FallThrough = next(MBB);
 
@@ -378,14 +434,20 @@
 
   MachineBasicBlock *PriorTBB = 0, *PriorFBB = 0;
   std::vectorMachineOperand PriorCond;
-  if (!TII-AnalyzeBranch(PrevBB, PriorTBB, PriorFBB, PriorCond)) {
+  bool PriorUnAnalyzable = false;
+  PriorUnAnalyzable = TII-AnalyzeBranch(PrevBB, PriorTBB, PriorFBB, 
PriorCond);
+  if (!PriorUnAnalyzable) {
+// If the CFG for the prior block has extra edges, remove them.
+MadeChange |= CorrectExtraCFGEdges(PrevBB, PriorTBB, PriorFBB,
+   !PriorCond.empty(), MBB);
+
 // If the previous branch is conditional and both conditions go to the same
 // destination, remove the branch, replacing it with an unconditional one.
 if (PriorTBB  PriorTBB == PriorFBB) {
-  TII-RemoveBranch(*prior(MBB));
+  

[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.cpp updated: 1.66 - 1.67
---
Log message:

allow insertion of a conditional branch with fall-through


---
Diffs of the changes:  (+12 -6)

 X86InstrInfo.cpp |   18 --
 1 files changed, 12 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.66 
llvm/lib/Target/X86/X86InstrInfo.cpp:1.67
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.66   Fri Oct 20 23:42:29 2006
+++ llvm/lib/Target/X86/X86InstrInfo.cppSat Oct 21 00:34:23 2006
@@ -374,15 +374,21 @@
 const std::vectorMachineOperand Cond) const 
{
   // Shouldn't be a fall through.
   assert(TBB  InsertBranch must not be told to insert a fallthrough);
-  
-  // Unconditional branch?
-  if (FBB == 0) {
-BuildMI(MBB, X86::JMP, 1).addMBB(TBB);
+  assert((Cond.size() == 1 || Cond.size() == 0) 
+ X86 branch conditions have one component!);
+
+  if (FBB == 0) { // One way branch.
+if (Cond.empty()) {
+  // Unconditional branch?
+  BuildMI(MBB, X86::JMP, 1).addMBB(TBB);
+} else {
+  // Conditional branch.
+  unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
+  BuildMI(MBB, Opc, 1).addMBB(TBB);
+}
 return;
   }
   
-  assert(Cond.size() == 1  X86 branch conditions have one component!);
-  
   // Conditional branch.
   unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
   BuildMI(MBB, Opc, 1).addMBB(TBB);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCInstrInfo.cpp updated: 1.25 - 1.26
---
Log message:

implement support for inserting a cond branch


---
Diffs of the changes:  (+8 -4)

 PPCInstrInfo.cpp |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.25 
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.26
--- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.25   Tue Oct 17 13:06:55 2006
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.cppSat Oct 21 00:36:13 2006
@@ -240,15 +240,19 @@
 const std::vectorMachineOperand Cond) const 
{
   // Shouldn't be a fall through.
   assert(TBB  InsertBranch must not be told to insert a fallthrough);
+  assert((Cond.size() == 2 || Cond.size() == 0)  
+ PPC branch conditions have two components!);
   
-  // Unconditional branch?
+  // One-way branch.
   if (FBB == 0) {
-BuildMI(MBB, PPC::B, 1).addMBB(TBB);
+if (Cond.empty())   // Unconditional branch
+  BuildMI(MBB, PPC::B, 1).addMBB(TBB);
+else// Conditional branch
+  BuildMI(MBB, PPC::COND_BRANCH, 3)
+.addReg(Cond[0].getReg()).addImm(Cond[1].getImm()).addMBB(TBB);
 return;
   }
   
-  assert(Cond.size() == 2  PPC branch conditions have two components!);
-  
   // Conditional branch
   BuildMI(MBB, PPC::COND_BRANCH, 3)
 .addReg(Cond[0].getReg()).addImm(Cond[1].getImm()).addMBB(TBB);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCInstrInfo.cpp updated: 1.26 - 1.27
---
Log message:

Simplify code, no functionality change


---
Diffs of the changes:  (+2 -4)

 PPCInstrInfo.cpp |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.26 
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.27
--- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.26   Sat Oct 21 00:36:13 2006
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.cppSat Oct 21 00:42:09 2006
@@ -253,12 +253,10 @@
 return;
   }
   
-  // Conditional branch
+  // Two-way Conditional Branch.
   BuildMI(MBB, PPC::COND_BRANCH, 3)
 .addReg(Cond[0].getReg()).addImm(Cond[1].getImm()).addMBB(TBB);
-  
-  if (FBB)  // Two-way branch.
-BuildMI(MBB, PPC::B, 1).addMBB(FBB);
+  BuildMI(MBB, PPC::B, 1).addMBB(FBB);
 }
 
 bool PPCInstrInfo::



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86InstrInfo.cpp updated: 1.67 - 1.68
---
Log message:

Simplify code, no functionality change


---
Diffs of the changes:  (+2 -4)

 X86InstrInfo.cpp |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/X86/X86InstrInfo.cpp
diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.67 
llvm/lib/Target/X86/X86InstrInfo.cpp:1.68
--- llvm/lib/Target/X86/X86InstrInfo.cpp:1.67   Sat Oct 21 00:34:23 2006
+++ llvm/lib/Target/X86/X86InstrInfo.cppSat Oct 21 00:42:09 2006
@@ -389,12 +389,10 @@
 return;
   }
   
-  // Conditional branch.
+  // Two-way Conditional branch.
   unsigned Opc = GetCondBranchFromCond((X86::CondCode)Cond[0].getImm());
   BuildMI(MBB, Opc, 1).addMBB(TBB);
-  
-  if (FBB)  // Two-way branch.
-BuildMI(MBB, X86::JMP, 1).addMBB(FBB);
+  BuildMI(MBB, X86::JMP, 1).addMBB(FBB);
 }
 
 bool X86InstrInfo::



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.16 - 1.17
---
Log message:

Transform code like:

  jle FOO
  jmp BAR
BAR:

into:

  jle FOO
BAR:

... whoa!



---
Diffs of the changes:  (+13 -2)

 BranchFolding.cpp |   15 +--
 1 files changed, 13 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.16 
llvm/lib/CodeGen/BranchFolding.cpp:1.17
--- llvm/lib/CodeGen/BranchFolding.cpp:1.16 Sat Oct 21 00:08:28 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp  Sat Oct 21 00:43:30 2006
@@ -30,7 +30,7 @@
 static Statistic NumDeadBlocks(branchfold, Number of dead blocks 
removed);
 static Statistic NumBranchOpts(branchfold, Number of branches optimized);
 static Statistic NumTailMerge (branchfold, Number of block tails merged);
-static cl::optbool EnableTailMerge(enable-tail-merge);
+static cl::optbool EnableTailMerge(enable-tail-merge, cl::init(false));
 
 namespace {
   struct BranchFolder : public MachineFunctionPass {
@@ -442,7 +442,8 @@
!PriorCond.empty(), MBB);
 
 // If the previous branch is conditional and both conditions go to the same
-// destination, remove the branch, replacing it with an unconditional one.
+// destination, remove the branch, replacing it with an unconditional one 
or
+// a fall-through.
 if (PriorTBB  PriorTBB == PriorFBB) {
   TII-RemoveBranch(PrevBB);
   PriorCond.clear(); 
@@ -461,6 +462,16 @@
   ++NumBranchOpts;
   return OptimizeBlock(MBB);
 }
+
+// If the prior block branches somewhere else on the condition and here if
+// the condition is false, remove the uncond second branch.
+if (PriorFBB == *MBB) {
+  TII-RemoveBranch(PrevBB);
+  TII-InsertBranch(PrevBB, PriorTBB, 0, PriorCond);
+  MadeChange = true;
+  ++NumBranchOpts;
+  return OptimizeBlock(MBB);
+}
   }
   
   // Analyze the branch in the current block.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp

2006-10-20 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.17 - 1.18
---
Log message:

Use branch reversal to do stuff like this:

call L_strcmp$stub
testl %eax, %eax
-   jne LBB26_208   #cond_true6020
-   jmp LBB26_227   #bb7119
+   je LBB26_227#bb7119
 LBB26_208: #cond_true6020
movl $l31_str14, 4(%esp)

testl %eax, %eax
-   jne LBB26_704   #cond_true13042
-   jmp LBB26_713   #bb13151
+   je LBB26_713#bb13151
 LBB26_704: #cond_true13042
movl $_str52, 4(%esp)

cmpl 76(%ecx), %eax
-   jge LBB26_1628  #cond_false63.i.i
-   jmp LBB26_1769  #_Z8makeGridP13mrSurfaceListidiidd.exit.i
+   jl LBB26_1769   #_Z8makeGridP13mrSurfaceListidiidd.exit.i
 LBB26_1628:#cond_false63.i.i
movl $0, 48964(%esp)




---
Diffs of the changes:  (+14 -0)

 BranchFolding.cpp |   14 ++
 1 files changed, 14 insertions(+)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.17 
llvm/lib/CodeGen/BranchFolding.cpp:1.18
--- llvm/lib/CodeGen/BranchFolding.cpp:1.17 Sat Oct 21 00:43:30 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp  Sat Oct 21 00:54:00 2006
@@ -472,6 +472,20 @@
   ++NumBranchOpts;
   return OptimizeBlock(MBB);
 }
+
+// If the prior block branches here on true and somewhere else on false, 
and
+// if the branch condition is reversible, reverse the branch to create a
+// fall-through.
+if (PriorTBB == *MBB) {
+  std::vectorMachineOperand NewPriorCond(PriorCond);
+  if (!TII-ReverseBranchCondition(NewPriorCond)) {
+TII-RemoveBranch(PrevBB);
+TII-InsertBranch(PrevBB, PriorFBB, 0, NewPriorCond);
+MadeChange = true;
+++NumBranchOpts;
+return OptimizeBlock(MBB);
+  }
+}
   }
   
   // Analyze the branch in the current block.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits