Apply llvm fix for assertion/crash building archivers/c-blosc2

Merge commit 88ce403c6aab from llvm git (by Florian Hahn):

  [LV] Add new block to place recurrence splice, if needed.

  In some cases, a recurrence splice instructions needs to be inserted
  between to regions, for example if the regions get re-arranged during
  sinking.

  Fixes #56146.

PR:		264979
Reported by:	Robert Clausecker <fuz@fuz.su>
MFC after:	3 days
This commit is contained in:
Dimitry Andric 2022-07-02 01:13:46 +02:00
parent c0d14b0220
commit 836d47d38e

View File

@ -9266,7 +9266,11 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
VPBasicBlock *InsertBlock = PrevRecipe->getParent();
auto *Region = GetReplicateRegion(PrevRecipe);
if (Region)
InsertBlock = cast<VPBasicBlock>(Region->getSingleSuccessor());
InsertBlock = dyn_cast<VPBasicBlock>(Region->getSingleSuccessor());
if (!InsertBlock) {
InsertBlock = new VPBasicBlock(Region->getName() + ".succ");
VPBlockUtils::insertBlockAfter(InsertBlock, Region);
}
if (Region || PrevRecipe->isPhi())
Builder.setInsertPoint(InsertBlock, InsertBlock->getFirstNonPhi());
else