[llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 11 23:54:01 PST 2004


Changes in directory llvm/lib/Transforms/Utils:

Local.cpp updated: 1.17 -> 1.18

---
Log message:

Add constant folding wrapper support for select instructions.


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

Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.17 llvm/lib/Transforms/Utils/Local.cpp:1.18
--- llvm/lib/Transforms/Utils/Local.cpp:1.17	Mon Jan 12 13:56:36 2004
+++ llvm/lib/Transforms/Utils/Local.cpp	Thu Mar 11 23:53:03 2004
@@ -79,6 +79,10 @@
   default: return 0;
   case Instruction::Cast:
     return ConstantExpr::getCast(Op0, I->getType());
+  case Instruction::Select:
+    if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
+      return ConstantExpr::getSelect(Op0, Op1, Op2);
+    return 0;
   case Instruction::GetElementPtr:
     std::vector<Constant*> IdxList;
     IdxList.reserve(I->getNumOperands()-1);





More information about the llvm-commits mailing list