summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-09-01 21:27:29 +0000
committerCraig Topper <craig.topper@intel.com>2017-09-01 21:27:29 +0000
commit085c1f4deacaee22ff6bc09e35bc5044988f8359 (patch)
treea62b2b0c8fb6c70afa17f3cf668c98aaab0a447f /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parentf4425e9a66bb16df5f7857bfa7dbd504829cc0d0 (diff)
downloadbcm5719-llvm-085c1f4deacaee22ff6bc09e35bc5044988f8359.tar.gz
bcm5719-llvm-085c1f4deacaee22ff6bc09e35bc5044988f8359.zip
[InstCombine] When converting decomposeBitTestICmp's APInt return to ConstantInt, make sure we use the type from the Value* that was also returned from decomposeBitTestICmp.
Previously we used the type from the LHS of the compare, but a future patch will change decomposeBitTestICmp to look through truncates so it will return a pretruncated Value* and the type needs to match that. llvm-svn: 312380
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 4b5e53cab10..4a6c46ddaab 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -299,8 +299,8 @@ static bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pre
if (!llvm::decomposeBitTestICmp(LHS, RHS, Pred, X, Mask))
return false;
- Y = ConstantInt::get(LHS->getType(), Mask);
- Z = ConstantInt::get(RHS->getType(), 0);
+ Y = ConstantInt::get(X->getType(), Mask);
+ Z = ConstantInt::get(X->getType(), 0);
return true;
}
OpenPOWER on IntegriCloud