[llvm] [VPlan] Speed up VPSlotTracker by using ModuleSlotTracker (PR #139881)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 01:05:39 PDT 2025


================
@@ -1546,6 +1540,34 @@ void VPSlotTracker::assignNames(const VPBasicBlock *VPBB) {
       assignName(Def);
 }
 
+std::string VPSlotTracker::getName(const VPValue *V) {
+  auto *UV = V->getUnderlyingValue();
+  auto *VPI = dyn_cast_or_null<VPInstruction>(V->getDefiningRecipe());
----------------
fhahn wrote:

Looks like the result of the dyn_cast is unconditionally dereferenced. It is not immediately clear why all VPValues w/o underlying value should be VPInstructions. Is there some check before calling getName that handles all other cases? If so, this should be `cast`, sunk into the condition

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


More information about the llvm-commits mailing list