aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-03-26 19:13:57 +0000
committerChris Lattner <sabre@nondot.org>2012-03-26 19:13:57 +0000
commitde813b7108de64829ab006e6b998a7b38d119ecc (patch)
tree1d4cd497878f4aa19e998c8e9c3002440c3aa020
parentef18cd381cb8513a53baba2b0062159323b13056 (diff)
downloadexternal_llvm-de813b7108de64829ab006e6b998a7b38d119ecc.zip
external_llvm-de813b7108de64829ab006e6b998a7b38d119ecc.tar.gz
external_llvm-de813b7108de64829ab006e6b998a7b38d119ecc.tar.bz2
eliminate an unneeded branch, part of PR12357
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153458 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/InstCombine/InstCombineAndOrXor.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 1165660..0dbe11d 100644
--- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -1362,13 +1362,8 @@ static bool CollectBSwapParts(Value *V, int OverallLeftShift, uint32_t ByteMask,
// part of the value (e.g. byte 3) then it must be shifted right. If from the
// low part, it must be shifted left.
unsigned DestByteNo = InputByteNo + OverallLeftShift;
- if (InputByteNo < ByteValues.size()/2) {
- if (ByteValues.size()-1-DestByteNo != InputByteNo)
- return true;
- } else {
- if (ByteValues.size()-1-DestByteNo != InputByteNo)
- return true;
- }
+ if (ByteValues.size()-1-DestByteNo != InputByteNo)
+ return true;
// If the destination byte value is already defined, the values are or'd
// together, which isn't a bswap (unless it's an or of the same bits).