[PATCH] D58461: [AArch64] Small fix for getIntImmCost

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 11:34:39 PST 2019


efriedma added a comment.

Needs a testcase.



================
Comment at: lib/Target/AArch64/AArch64TargetTransformInfo.cpp:49
+  if (AArch64_AM::isAnyMOVWMovAlias(Val, 64))
+    return 1;
+
----------------
What is this function actually supposed to compute?  If it's just the number of instructions an AArch64::MOVi64imm would expand to, I don't understand what a cost of "0" is supposed to mean.

We currently don't have any code to try to count the number of instructions AArch64ExpandPseudo::expandMOVImm will eventually emit.  The complete logic is complicated if you're trying to compute whether we'll generate 2, 3, or 4 instructions... and "countLeadingZeros" is a terrible approximation.  But I guess that isn't really important for most uses of getIntImmCost anyway.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58461





More information about the llvm-commits mailing list