diff options
author | Vedant Kumar <vsk@apple.com> | 2018-01-25 23:48:29 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-01-25 23:48:29 +0000 |
commit | 6394df9fc48b26c65cf525d92500c5b43ba81fdc (patch) | |
tree | 4c90e7cf91be3e94164476ef1aa153b0e599c663 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 0115844c2f150205a441a97d915dce8030f4fa76 (diff) | |
download | bcm5719-llvm-6394df9fc48b26c65cf525d92500c5b43ba81fdc.tar.gz bcm5719-llvm-6394df9fc48b26c65cf525d92500c5b43ba81fdc.zip |
[Debug] LCSSA: Insert dbg.value at the first available insertion point
Inserting a dbg.value instruction at the start of a basic block with a
landingpad instruction triggers a verifier failure. We should be OK if
we insert the instruction a bit later.
Speculative fix for the bot failure described here:
https://reviews.llvm.org/D42551
llvm-svn: 323482
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index a7eaffd1a7a..337ee0e9ef5 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1373,7 +1373,9 @@ void llvm::insertDebugValuesForPHIs(BasicBlock *BB, auto PhiMAV = MetadataAsValue::get(C, ValueAsMetadata::get(PHI)); NewDbgII->setOperand(0, PhiMAV); BasicBlock *Parent = PHI->getParent(); - NewDbgII->insertBefore(Parent->getFirstNonPHIOrDbgOrLifetime()); + auto InsertionPt = Parent->getFirstInsertionPt(); + assert(InsertionPt != Parent->end() && "Ill-formed basic block"); + NewDbgII->insertBefore(&*InsertionPt); } } } |