[llvm] [VPlan] Move auxiliary declarations out of VPlan.h (NFC). (PR #124104)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 04:18:10 PST 2025


================
@@ -39,6 +42,58 @@ using namespace llvm;
 // Number of levels to look ahead when re-ordering multi node operands.
 static unsigned LookaheadMaxDepth = 5;
 
+void VPInterleavedAccessInfo::visitRegion(VPRegionBlock *Region,
+                                          Old2NewTy &Old2New,
+                                          InterleavedAccessInfo &IAI) {
+  ReversePostOrderTraversal<VPBlockShallowTraversalWrapper<VPBlockBase *>> RPOT(
+      Region->getEntry());
+  for (VPBlockBase *Base : RPOT) {
+    visitBlock(Base, Old2New, IAI);
+  }
+}
+
+void VPInterleavedAccessInfo::visitBlock(VPBlockBase *Block, Old2NewTy &Old2New,
+                                         InterleavedAccessInfo &IAI) {
+  if (VPBasicBlock *VPBB = dyn_cast<VPBasicBlock>(Block)) {
+    for (VPRecipeBase &VPI : *VPBB) {
+      if (isa<VPWidenPHIRecipe>(&VPI))
+        continue;
+      assert(isa<VPInstruction>(&VPI) && "Can only handle VPInstructions");
----------------
alexey-bataev wrote:

Do we need this assertion? `cast<>` will assert itself

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


More information about the llvm-commits mailing list