[llvm] [LV][VPlan] Introduce VPScalarStore recipe to handle scalar stores in exit block. (PR #93148)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 05:24:49 PDT 2024


================
@@ -1927,6 +1921,24 @@ void VPScalarCastRecipe ::print(raw_ostream &O, const Twine &Indent,
 }
 #endif
 
+void VPScalarStoreRecipe::execute(VPTransformState &State) {
+  IRBuilderBase &Builder = State.Builder;
+  Value *StoredVal = State.get(getStoredVal(), 0, /*IsScalar*/ true);
----------------
fhahn wrote:

if it is sunk outside, shouldn't it store the last lane of the last unrolled iteration? as is, it would generate incorrect code when interleaving with other users?

Or alternatively enforce that the operand are also defined outside any vector region?

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


More information about the llvm-commits mailing list