[PATCH] D15604: Changes in conversion cost model for X86 target

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 00:00:01 PST 2015


delena created this revision.
delena added reviewers: congh, hfinkel, andreadb, nadav.
delena added a subscriber: llvm-commits.
delena set the repository for this revision to rL LLVM.

The current cost calculation for the conversion instructions has many problems
- The provided numbers are inaccurate
- Huge numbers are given for vector split

I changed the approach for vector cost calculation:
- If the original types are simple - check them first
- if the original vector should be split - take the legal types and multiply by split factor
- split factor is the max factor between source and destination
- do not put v8i32 -> v4i64 cost. The calculated cost should be 2 * (v4i32 -> v4i64).

I also checked all SSE numbers and put the real number of instructions instead.
I understand, that instruction latency is different in SSE2 and AVX, but
the matter of this cost model to let the vectorizer to choose the right VF (compare VFx to VFy for the same target).

Repository:
  rL LLVM

http://reviews.llvm.org/D15604

Files:
  ../lib/Target/X86/X86TargetTransformInfo.cpp
  ../test/Analysis/CostModel/X86/cast.ll
  ../test/Analysis/CostModel/X86/sitofp.ll
  ../test/Analysis/CostModel/X86/uitofp.ll
  ../test/Transforms/LoopVectorize/X86/conversion-cost.ll
  ../test/Transforms/LoopVectorize/X86/uint64_to_fp64-cost-model.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15604.43102.patch
Type: text/x-patch
Size: 49277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151217/9c1095f0/attachment-0001.bin>


More information about the llvm-commits mailing list