[llvm] [LV] Reuse VPReplicateRecipe to handle scalar stores in exit block. (PR #106342)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 13:18:25 PDT 2024


================
@@ -2388,8 +2388,8 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
     AC->registerAssumption(II);
 
   // End if-block.
-  bool IfPredicateInstr = RepRecipe->getParent()->getParent()->isReplicator();
-  if (IfPredicateInstr)
+  const VPRegionBlock *Region = RepRecipe->getParent()->getParent();
+  if (Region && Region->isReplicator())
----------------
fhahn wrote:

Can we assert here that we either have a region or a store with an address defined outside the loop to start with? and maybe that it is uniform? And possibly also that the stored operand `isVectorToScalar` VPInstruction?

To guard against unintentional mis-use for now

https://github.com/llvm/llvm-project/pull/106342


More information about the llvm-commits mailing list