[PATCH] D43079: [TTI CostModel] change default cost of FP ops to 1 (PR36280)

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 12:02:00 PST 2018


hfinkel added inline comments.


================
Comment at: include/llvm/CodeGen/BasicTTIImpl.h:494
+    // assumption when they can provide more accurate information.
+    unsigned OpCost = 1;
 
----------------
spatel wrote:
> ABataev wrote:
> > Maybe it is better to add a virtual method that will return the default cost of the integer and floating point operations for the target? The default implementation should keep 1 and 2, but for X86 it should return 1 in both cases.
> I don't know of any target where anything but '1' is the right default answer, so I'd rather not perpetuate this. I think it's better to correct the problems revealed by this change.
I agree, but recall that these are measuring reciprocal throughputs, and it's not unreasonable to assume that floating-point ops will have lower throughputs than integer operations in some general sense. Nevertheless, '2' seems somewhat arbitrary in this regard.


https://reviews.llvm.org/D43079





More information about the llvm-commits mailing list