1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

pass TD to constant folding apis

llvm-svn: 33674
This commit is contained in:
Chris Lattner 2007-01-30 23:16:15 +00:00
parent 116b82d058
commit d1acbffe1b

View 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;