diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-06-09 03:21:29 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-06-09 03:21:29 +0000 |
commit | a420562257acb28e7083b88644a3819525fa6d4e (patch) | |
tree | 5e5b331513bbd6cdf3d0e66e4be4afa8dcfa5b2a /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | |
parent | f08b38cbe15890db5fac9523a0e6a6e4c084a437 (diff) | |
download | bcm5719-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.cpp | 3 |
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)) |