[TTI CostModel] change default cost of FP ops to 1 (PR36280)
authorSanjay Patel <spatel@rotateright.com>
Mon, 19 Feb 2018 16:11:44 +0000 (16:11 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 19 Feb 2018 16:11:44 +0000 (16:11 +0000)
commit3e8a76abfda50c5416558875fe799ffa44c169af
tree11c4bc67924f5267423175aed5801228a2f84af9
parentc7e51805ff52e84594b0514d5bdf31579434b80c
[TTI CostModel] change default cost of FP ops to 1 (PR36280)

This change was mentioned at least as far back as:
https://bugs.llvm.org/show_bug.cgi?id=26837#c26
...and I found a real program that is harmed by this:
Himeno running on AMD Jaguar gets 6% slower with SLP vectorization:
https://bugs.llvm.org/show_bug.cgi?id=36280
...but the change here appears to solve that bug only accidentally.

The div/rem costs for x86 look very wrong in some cases, but that's already true,
so we can fix those in follow-up patches. There's also evidence that more cost model
changes are needed to solve SLP problems as shown in D42981, but that's an independent
problem (though the solution may be adjusted after this change is made).

Differential Revision: https://reviews.llvm.org/D43079

llvm-svn: 325515
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/test/Analysis/CostModel/X86/arith-fp.ll
llvm/test/Analysis/CostModel/X86/intrinsic-cost.ll
llvm/test/Analysis/CostModel/X86/reduction.ll
llvm/test/Transforms/LoopVectorize/X86/imprecise-through-phis.ll
llvm/test/Transforms/SLPVectorizer/AArch64/remarks.ll
llvm/test/Transforms/SLPVectorizer/X86/PR36280.ll
llvm/test/Transforms/SLPVectorizer/X86/cse.ll
llvm/test/Transforms/SLPVectorizer/X86/horizontal.ll
llvm/test/Transforms/SLPVectorizer/X86/reorder_phi.ll
llvm/test/Transforms/SLPVectorizer/X86/simplebb.ll