[PATCH] D145370: [AArch64] Fix N2 SchedModel for arithmetic and logic ops with cheap LSL

Ricardo Jesus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 03:08:47 PST 2023


rjj added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64SchedPredNeoverse.td:17
+// Check for LSL shift <= 4
+def NeoverseCheapLSL : MCSchedPredicate<
+                         CheckAll<
----------------
dmgreen wrote:
> This is a quite common pattern and I think already exists somewhere. Can you move it somewhere shared?
I believe you are referring to the Exynos and Ampere versions? Though similar in spirit, they actually implement a slightly different logic (I'm not sure if intentionally or not). In particular, the Exynos considers a "cheap shift" any shift = 0, or LSL <= 3. The Ampere considers cheap shifts to be any shift = 0, or LSL <= 4. As far as I could test, this is not accurate for the N2. For example, on N2 an LSR = 0 is still an "expensive shift". Since I was not sure if these slight differences were intentional, I decided to create a separate predicate for the Neoverses.

Having said that, I agree it would be good to move it to a shared location! Do you have any suggestions as to where that could be?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145370/new/

https://reviews.llvm.org/D145370



More information about the llvm-commits mailing list