summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-09 03:21:29 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-09 03:21:29 +0000
commita420562257acb28e7083b88644a3819525fa6d4e (patch)
tree5e5b331513bbd6cdf3d0e66e4be4afa8dcfa5b2a /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
parentf08b38cbe15890db5fac9523a0e6a6e4c084a437 (diff)
downloadbcm5719-llvm-a420562257acb28e7083b88644a3819525fa6d4e.tar.gz
bcm5719-llvm-a420562257acb28e7083b88644a3819525fa6d4e.zip
[InstCombine] Pass a proper context instruction to all of the calls into InstSimplify
Summary: This matches the behavior we already had for compares and makes us consistent everywhere. Reviewers: dberlin, hfinkel, spatel Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33604 llvm-svn: 305049
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 229d59a15c2..b9674d85634 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -1121,7 +1121,8 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
Value *FalseVal = SI.getFalseValue();
Type *SelType = SI.getType();
- if (Value *V = SimplifySelectInst(CondVal, TrueVal, FalseVal, SQ))
+ if (Value *V = SimplifySelectInst(CondVal, TrueVal, FalseVal,
+ SQ.getWithInstruction(&SI)))
return replaceInstUsesWith(SI, V);
if (Instruction *I = canonicalizeSelectToShuffle(SI))
OpenPOWER on IntegriCloud