summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 0aea1edb0d0..bc8b0496ec7 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -1494,8 +1494,9 @@ static Value *getSelectCondition(Value *A, Value *B,
// If both operands are constants, see if the constants are inverse bitmasks.
Constant *AC, *BC;
if (match(A, m_Constant(AC)) && match(B, m_Constant(BC)) &&
- areInverseVectorBitmasks(AC, BC))
- return ConstantExpr::getTrunc(AC, CmpInst::makeCmpResultType(Ty));
+ areInverseVectorBitmasks(AC, BC)) {
+ return Builder.CreateZExtOrTrunc(AC, CmpInst::makeCmpResultType(Ty));
+ }
// If both operands are xor'd with constants using the same sexted boolean
// operand, see if the constants are inverse bitmasks.
OpenPOWER on IntegriCloud