[PATCH] D110259: [SVE][Analysis] Tune the cost model according to the tune-cpu attribute

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 09:09:49 PDT 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64Subtarget.cpp:371-373
+  if (TuneCPU == "generic") return 4;
+  else if (TuneCPU == "neoverse-v1") return 2;
+  else if (TuneCPU == "neoverse-n2") return 1;
----------------
david-arm wrote:
> dmgreen wrote:
> > These per-cpu values should probably be subtarget features or defined in AArch64Subtarget::initializeProperties like the other alignments and whatnot.
> Hi @dmgreen, I think that's perfectly sensible when you only have a target-cpu feature. I originally tried doing it that way, but realised if target-cpu=generic and tune-cpu=neoverse-n1 then the subtarget won't have max vscale set, since we chose a generic subtarget.
Tune-cpu has never worked in the AArch64 backend, as far as I understand. Like I said in the other patch the subtarget features do not distinguish between performance features and architecture features.

Having one feature work off tune-cpu whereas everything else in the backend works on target-cpu sounds wrong to me, without fixing it properly and making -mtune work as you would expect across the board.  Which would be great but until then I would base everything off the cpu for consistency.

If you do want to make tune-cpu work, look at how the X86 backend does it. This shouldn't have to look into the Functions target-cpu and tune-cpu attributes, it should be initialized with the correct CPU and TuneCPU's passed in to the subtarget.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110259



More information about the llvm-commits mailing list