summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChangpeng Fang <changpeng.fang@gmail.com>2017-03-07 23:29:36 +0000
committerChangpeng Fang <changpeng.fang@gmail.com>2017-03-07 23:29:36 +0000
commit6b49fa4ca71433de71dcc2f31e4b381b91e608e1 (patch)
tree699505013f39e30cfafe82fc5109740e87acb245 /llvm/lib
parentfe9705149bfd53080256686ce7135db2b146f4cf (diff)
downloadbcm5719-llvm-6b49fa4ca71433de71dcc2f31e4b381b91e608e1.tar.gz
bcm5719-llvm-6b49fa4ca71433de71dcc2f31e4b381b91e608e1.zip
AMDGPU/SI: Do not insert EndCf in an unreachable block
Reviewers: arsenm Differential Revision: http://reviews.llvm.org/D22025 llvm-svn: 297243
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
index fa4a03b8848..ae182bd947d 100644
--- a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
+++ b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
@@ -372,8 +372,9 @@ void SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) {
}
Value *Exec = popSaved();
- if (!isa<UndefValue>(Exec))
- CallInst::Create(EndCf, Exec, "", &*BB->getFirstInsertionPt());
+ Instruction *FirstInsertionPt = &*BB->getFirstInsertionPt();
+ if (!isa<UndefValue>(Exec) && !isa<UnreachableInst>(FirstInsertionPt))
+ CallInst::Create(EndCf, Exec, "", FirstInsertionPt);
}
/// \brief Annotate the control flow with intrinsics so the backend can
OpenPOWER on IntegriCloud