summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-03-10 05:25:49 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-03-10 05:25:49 +0000
commita3bdd8f27b0991387fd03568379a942b01cddfcd (patch)
tree9a14e6f3346e4afa097fc05da84a0fdb5327d84e /llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
parent5ac9179f6ceb30c4901825d839b4310b56809792 (diff)
downloadbcm5719-llvm-a3bdd8f27b0991387fd03568379a942b01cddfcd.tar.gz
bcm5719-llvm-a3bdd8f27b0991387fd03568379a942b01cddfcd.zip
AMDGPU: Fix insertion point when reducing load intrinsics
The insertion point may be later than the next instruction, so it is necessary to set it when replacing the call. llvm-svn: 297439
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 78ee9d5de3f..843ca7fedfc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -1584,6 +1584,9 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
for (unsigned I = 0, E = II->getNumArgOperands(); I != E; ++I)
Args.push_back(II->getArgOperand(I));
+ IRBuilderBase::InsertPointGuard Guard(*Builder);
+ Builder->SetInsertPoint(II);
+
CallInst *NewCall = Builder->CreateCall(NewIntrin, Args);
NewCall->takeName(II);
NewCall->copyMetadata(*II);
OpenPOWER on IntegriCloud