pass TD to constant folding apis
authorChris Lattner <sabre@nondot.org>
Tue, 30 Jan 2007 23:16:15 +0000 (23:16 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 30 Jan 2007 23:16:15 +0000 (23:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33674 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index dce56c1acb3a88b05b6b789a1d0314e8e29621de..fc5b5f18964d671b25c27f7bf5d4b1f2f8d56981 100644 (file)
@@ -9167,7 +9167,7 @@ static void AddReachableCodeToWorklist(BasicBlock *BB,
     }
     
     // ConstantProp instruction if trivially constant.
-    if (Constant *C = ConstantFoldInstruction(Inst)) {
+    if (Constant *C = ConstantFoldInstruction(Inst, TD)) {
       if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
         C = OptimizeConstantExpr(CE, TD);
       DOUT << "IC: ConstFold to: " << *C << " from: " << *Inst;
@@ -9258,7 +9258,7 @@ bool InstCombiner::runOnFunction(Function &F) {
     }
 
     // Instruction isn't dead, see if we can constant propagate it.
-    if (Constant *C = ConstantFoldInstruction(I)) {
+    if (Constant *C = ConstantFoldInstruction(I, TD)) {
       if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
         C = OptimizeConstantExpr(CE, TD);
       DOUT << "IC: ConstFold to: " << *C << " from: " << *I;