1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[LV] Ensure fixNonInductionPHIs uses a valid insertion point.

In some cases, Builder's insertion point may be invalidated before using
it in VPTransformState::get. Make sure the insertion point is
up-to-date.

This should fix various sanitizer errors, like
https://lab.llvm.org/buildbot/#/builders/5/builds/4933/steps/9/logs/stdio
This commit is contained in:
Florian Hahn 2021-02-23 17:46:22 +00:00
parent a7e8ccf5c2
commit ff2fdde1f2

View File

@ -4374,6 +4374,8 @@ void InnerLoopVectorizer::fixNonInductionPHIs(VPTransformState &State) {
VPWidenPHIRecipe *VPPhi =
cast<VPWidenPHIRecipe>(State.Plan->getVPValue(OrigPhi));
PHINode *NewPhi = cast<PHINode>(State.get(VPPhi, 0));
// Make sure the builder has a valid insert point.
Builder.SetInsertPoint(NewPhi);
for (unsigned i = 0; i < VPPhi->getNumOperands(); ++i) {
VPValue *Inc = VPPhi->getIncomingValue(i);
VPBasicBlock *VPBB = VPPhi->getIncomingBlock(i);