Changes in directory llvm/lib/Analysis:
ScalarEvolution.cpp updated: 1.105 -> 1.106 --- Log message: Treat xor of signbit like an add. --- Diffs of the changes: (+10 -1) ScalarEvolution.cpp | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.105 llvm/lib/Analysis/ScalarEvolution.cpp:1.106 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.105 Sat Mar 3 19:25:35 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Mon Apr 2 00:41:38 2007 @@ -1427,7 +1427,16 @@ } } break; - + case Instruction::Xor: + // If the RHS of the xor is a signbit, then this is just an add. + // Instcombine turns add of signbit into xor as a strength reduction step. + if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) { + if (CI->getValue().isSignBit()) + return SCEVAddExpr::get(getSCEV(I->getOperand(0)), + getSCEV(I->getOperand(1))); + } + break; + case Instruction::Shl: // Turn shift left of a constant amount into a multiply. if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits