aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 4f489718f6..95ed49d526 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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