[llvm] [LV][AArch64] Prefer Fixed over Scalable if cost-model is equal (Neoverse V2) (PR #95819)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 05:24:08 PDT 2024


sjoerdmeijer wrote:





> Thanks all, sounds like we have a way forward. Ultimately I think we should transition the cost modelling to be tree based rather than instruction based because that's where much of the frailty comes from. That's very much long term work, so not specifically relevant to this immediate goal.

sgtm. 

> Whilst I look forward to the results I do want to emphasise the "is inc/dec VL" bad for Neoverse V2 point. That feels like something we should get to the bottom of asap and just add the necessary feature flag.

I will ping you an email with details about this because I can't discuss that here. I will do that early next week because I am off tomorrow + Friday. 

> I have a final `preferFixedIfEqualToScalable` query though. Whilst I'm not against its use in this new context I do wonder if instead you could just use `getVScaleForTuning()` which will be set to 1 for Neoverse V2. My assumption here is that you basically want to ask "if we're tuning based on the assumption the SVE registers are no bigger than the Neon ones".

Yes, you're right, that's one of the main questions here. I will add it as an early-exit or fold it into `TTI.preferFixedIfEqualToScalable()` so that it both checks if the target has `FeatureUseFixedOverScalableIfEqualCost` set and if vscale = 1. I agree ideally we would just have `getVScaleForTuning()` and perhaps don't need `FeatureUseFixedOverScalableIfEqualCost` and `TTI.preferFixedIfEqualToScalable()`, but I didn't want to do this for all targets with vscale = 1 at the same time.



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


More information about the llvm-commits mailing list