forked from OSchip/llvm-project
[IndVars] Fix adding trunc instructions to unwind blocks
Truncate instruction must not be inserted before landing pads. The insertion point is fixed.
This commit is contained in:
parent
d3bf0bb189
commit
f0e3d1d6ca
|
@ -1654,7 +1654,7 @@ bool WidenIV::widenWithVariantUse(WidenIV::NarrowIVDefUse DU) {
|
|||
assert(LoopExitingBlock && L->contains(LoopExitingBlock) &&
|
||||
"Not a LCSSA Phi?");
|
||||
WidePN->addIncoming(WideBO, LoopExitingBlock);
|
||||
Builder.SetInsertPoint(User->getParent()->getFirstNonPHI());
|
||||
Builder.SetInsertPoint(&*User->getParent()->getFirstInsertionPt());
|
||||
auto *TruncPN = Builder.CreateTrunc(WidePN, User->getType());
|
||||
User->replaceAllUsesWith(TruncPN);
|
||||
DeadInsts.emplace_back(User);
|
||||
|
|
Loading…
Reference in New Issue