[llvm] [LoopVectorize] Add an option to test potential issues with VPlan (PR #121154)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 08:59:00 PST 2025


================
@@ -3448,8 +3453,9 @@ bool LoopVectorizationCostModel::isPredicatedInst(Instruction *I) const {
   // If predication is not needed, avoid it.
   // TODO: We can use the loop-preheader as context point here and get
   // context sensitive reasoning for isSafeToSpeculativelyExecute.
+  Instruction *CtxI = CheckSpeculatabilityAtUse ? I->getNextNode() : nullptr;
----------------
fhahn wrote:

Thinking more about this, wouldn't we need to ask if it is safe to execute speculatively in the loop header? Or a predecessors of `I->getParent()` that executes unconditionally?

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


More information about the llvm-commits mailing list