[PATCH] D82091: [ARM][CostModel] Select instruction costs.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 04:03:20 PDT 2020


dmgreen added a comment.

I think you could argue the cost of selects in many ways on ARM. A lot of them will be free (folded into another instruction), a lot will cost 1, some will cost 2 because of the IT or even higher on a T1 core. I think in the end, whatever looks best on benchmarks is probably the best way to go.



================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:588
+  if (CostKind != TTI::TCK_RecipThroughput || !ValTy->isVectorTy()) {
+    if (ST->isMClass()) {
+      // Simplify and assume that more (scalar) instructions reduces throughput,
----------------
I'm not a huge fan of isMClass. That covers quite a range, and the top end (and even mid-end) of that range will chew through IT bocks/selects like they are not even present.

Maybe use some variant of isThumb would be better? I wouldn't expect the code below to change much between a mclass and others, unless I'm missing something?


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

https://reviews.llvm.org/D82091





More information about the llvm-commits mailing list