[llvm-commits] [llvm] r57089 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner sabre at nondot.org
Sat Oct 4 17:50:58 PDT 2008


Author: lattner
Date: Sat Oct  4 19:50:57 2008
New Revision: 57089

URL: http://llvm.org/viewvc/llvm-project?rev=57089&view=rev
Log:
fix a bug where the bswap matcher could match a case involving
ashr.  It should only apply to lshr.

Modified:
    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=57089&r1=57088&r2=57089&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sat Oct  4 19:50:57 2008
@@ -3912,9 +3912,12 @@
     if (I->getOpcode() == Instruction::Shl) {
       // X << 24 defines the top byte with the lowest of the input bytes.
       DestNo = ByteValues.size()-1;
-    } else {
+    } else if (I->getOpcode() == Instruction::LShr) {
       // X >>u 24 defines the low byte with the highest of the input bytes.
       DestNo = 0;
+    } else {
+      // Arithmetic shift right may have the top bits set.
+      return true;
     }
     
     // If the destination byte value is already defined, the values are or'd





More information about the llvm-commits mailing list