[llvm] [LV] Convert scatter w/uniform addr and mask being header mask to scalar store. (PR #172799)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 00:24:56 PDT 2026


https://github.com/ElvisWang123 commented:

I am currently undecided between these two options.

1. Create new scalar recipes (scalar-store, extract-lane, ...) and use `computeCost()` to calculate costs. 
- Requirement: `VPInstruction::computeCost()` must support costs w/o an underlying instruction. (Can partially enable `LastActiveLane` and `ExtractLane` first). 
- Pros: Can reflect recipe codegen/cost changes. 
- Cons: The drawback is that some of the recipes will be created only for cost calculation and will be removed if not profitable.

Or

2. Current approach (using TTI (legacy) to calculate costs in the transformation).
- Cons: The primary concern with the current approach is the risk of cost-model divergence. This can lead to mismatches if `VPInstruction` is updated to generate different instructions or if its `computeCost` implementation changes without corresponding updates to the transformation's cost logic in the future.

@fhahn @artagnon @lukel97  What do you think?

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


More information about the llvm-commits mailing list