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

Reid Spencer reid at x10sys.com
Thu Feb 1 18:17:37 PST 2007



Changes in directory llvm/lib/Analysis:

ConstantFolding.cpp updated: 1.15 -> 1.16
ScalarEvolution.cpp updated: 1.92 -> 1.93
---
Log message:

Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to 
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


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

 ConstantFolding.cpp |    4 ----
 ScalarEvolution.cpp |    2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)


Index: llvm/lib/Analysis/ConstantFolding.cpp
diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.15 llvm/lib/Analysis/ConstantFolding.cpp:1.16
--- llvm/lib/Analysis/ConstantFolding.cpp:1.15	Wed Jan 31 12:04:55 2007
+++ llvm/lib/Analysis/ConstantFolding.cpp	Thu Feb  1 20:16:21 2007
@@ -216,10 +216,6 @@
   case Instruction::FCmp:
     return ConstantExpr::getCompare(cast<CmpInst>(I)->getPredicate(), Ops[0], 
                                     Ops[1]);
-  case Instruction::Shl:
-  case Instruction::LShr:
-  case Instruction::AShr:
-    return ConstantExpr::get(Opc, Ops[0], Ops[1]);
   case Instruction::Trunc:
   case Instruction::ZExt:
   case Instruction::SExt:


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.92 llvm/lib/Analysis/ScalarEvolution.cpp:1.93
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.92	Tue Jan 30 17:52:44 2007
+++ llvm/lib/Analysis/ScalarEvolution.cpp	Thu Feb  1 20:16:21 2007
@@ -1736,7 +1736,7 @@
 /// CanConstantFold - Return true if we can constant fold an instruction of the
 /// specified type, assuming that all operands were constants.
 static bool CanConstantFold(const Instruction *I) {
-  if (isa<BinaryOperator>(I) || isa<ShiftInst>(I) || isa<CmpInst>(I) ||
+  if (isa<BinaryOperator>(I) || isa<CmpInst>(I) ||
       isa<SelectInst>(I) || isa<CastInst>(I) || isa<GetElementPtrInst>(I))
     return true;
 






More information about the llvm-commits mailing list