diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-10-08 03:46:20 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-10-08 03:46:20 +0000 |
| commit | 44bd392cbff238e75d84ee757189d5f62cf91679 (patch) | |
| tree | 5227ecb983e19d0fa47b48c9a20590d1da1abd64 /llvm/lib | |
| parent | 7bfe4032fcaa44f4fec6faf19544ef5f83a95f5c (diff) | |
| download | bcm5719-llvm-44bd392cbff238e75d84ee757189d5f62cf91679.tar.gz bcm5719-llvm-44bd392cbff238e75d84ee757189d5f62cf91679.zip | |
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.
llvm-svn: 16834
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 767fc9582b0..3febd1dd46f 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2496,6 +2496,9 @@ Instruction *InstCombiner::visitShiftInst(ShiftInst &I) { 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; |

