diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-05 00:50:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-05 00:50:57 +0000 |
commit | ca91f265c445ad56eefef61ce35dbf2b2f82a6c4 (patch) | |
tree | b8824496c4614ffac1c30b94d2a9e0b56aa553d9 /llvm/lib/Transforms | |
parent | 05d93dd73d4913f63e30ef9152c7ca0f09b7f8c0 (diff) | |
download | bcm5719-llvm-ca91f265c445ad56eefef61ce35dbf2b2f82a6c4.tar.gz bcm5719-llvm-ca91f265c445ad56eefef61ce35dbf2b2f82a6c4.zip |
fix a bug where the bswap matcher could match a case involving
ashr. It should only apply to lshr.
llvm-svn: 57089
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 4f489718f6f..95ed49d5262 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3912,9 +3912,12 @@ static bool CollectBSwapParts(Value *V, SmallVector<Value*, 8> &ByteValues) { 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 |