[llvm] [VPlan] Add legal checks in VPWidenMemoryRecipe::computeCost(). NFC (PR #110445)
    Florian Hahn via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Oct  3 10:54:36 PDT 2024
    
    
  
================
@@ -2237,6 +2237,11 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
     const Value *Ptr = getLoadStorePointerOperand(&Ingredient);
     assert(!Reverse &&
            "Inconsecutive memory access should not have the order.");
+    if ((isa<LoadInst>(Ingredient) &&
+         !Ctx.TTI.isLegalMaskedGather(Ty, Alignment)) ||
+        (isa<StoreInst>(Ingredient) &&
+         !Ctx.TTI.isLegalMaskedScatter(Ty, Alignment)))
+      return InstructionCost::getInvalid();
----------------
fhahn wrote:
shouldn't `getGatherScatterOpCost` return `Invalid` in those cases as we pass `IsMasked` ?
https://github.com/llvm/llvm-project/pull/110445
    
    
More information about the llvm-commits
mailing list