[PATCH] D21156: [X86] Add costs for SSE zext/sext to v4i64 to TTI

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 15:40:27 PDT 2016


mkuper created this revision.
mkuper added reviewers: RKSimon, congh.
mkuper added a subscriber: llvm-commits.

The costs are somewhat hand-wavy, but should be much closer to the truth - what we get from the target-independent code right now is ridiculously high.

The underlying problem seems to be that the target-independent code in BasicTTIImpl assumes that if the dest type is illegal, the operation will get completely scalarized. This is, of course, nonsense. What it should probably do is take the legalization cost + 2 * the actual cost of the extend after the split (by querying the concrete TTI on the result vector).
This problem isn't unique to casts, there's similar logic for, at least, arithmetic instructions and selects. Changing that right now seems like it would rock the boat too much, I want to see if I run into more cases like this in practice first.

http://reviews.llvm.org/D21156

Files:
  lib/Target/X86/X86TargetTransformInfo.cpp
  test/Analysis/CostModel/X86/sse-itoi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21156.60110.patch
Type: text/x-patch
Size: 3940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160608/bb0eae80/attachment.bin>


More information about the llvm-commits mailing list