[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 7 20:46:34 PDT 2004



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.261 -> 1.262
---
Log message:

Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)

This triggers in cases of bitfield additions, opening opportunities for
future improvements.



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

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.261 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.262
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.261	Wed Oct  6 10:08:25 2004
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Thu Oct  7 22:46:20 2004
@@ -2496,6 +2496,9 @@
 
           switch (Op0BO->getOpcode()) {
           default: isValid = false; break;   // Do not perform transform!
+          case Instruction::Add:
+            isValid = isLeftShift;
+            break;
           case Instruction::Or:
           case Instruction::Xor:
             highBitSet = false;






More information about the llvm-commits mailing list