[llvm] [VPlan] Manage instruction metadata in VPlan. (PR #135272)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 23 14:48:59 PDT 2025
================
@@ -2752,10 +2762,10 @@ void VPWidenLoadRecipe::execute(VPTransformState &State) {
NewLI = Builder.CreateAlignedLoad(DataTy, Addr, Alignment, "wide.load");
}
// Add metadata to the load, but setVectorValue to the reverse shuffle.
- State.addMetadata(NewLI, LI);
- if (Reverse)
- NewLI = Builder.CreateVectorReverse(NewLI, "reverse");
- State.set(this, NewLI);
+ State.addNewMetadata(NewLI, LI);
+ applyMetadata(*NewLI);
+ State.set(this,
+ Reverse ? Builder.CreateVectorReverse(NewLI, "reverse") : NewLI);
----------------
ayalz wrote:
Yes, keeping State.set() separate as the last operation after completing the creation of instructions would be more consistent, e.g., also with VPWidenLoadEVLRecipe::execute() below. BTW, better ask here `if (isReverse())` as asked there and above.
https://github.com/llvm/llvm-project/pull/135272
More information about the llvm-commits
mailing list