[PATCH] D21251: [TTI] The cost model should not assume illegal vector casts get completely scalarized

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 15:29:37 PDT 2016


mkuper updated this revision to Diff 61313.
mkuper added a comment.
Herald added a subscriber: arsenm.

Updated to not affect AMDGPU, by specializing the "split cost".

Unfortunately, we can't just plug in getVectorSplitCost() (either this or a more sophisticated version) into getTypeLegalizationCost().

This is because most of the users of getTypeLegalizationCost() apparently don't use the returned value as a "cost". Rather, they seem assume it's just the number of post-legalization pieces, and multiply per-piece costs by that. So that needs a completely separate clean-up first. 
AMDGPU itself is also guilty of this - it multiplies by getTypeLegalizationCost().first, so if getTypeLegalizationCost(LegalType) were to return 0 - which it ought to, if we really consider it the "cost" of legalization - things would get seriously out of whack. But this happens across all targets.


http://reviews.llvm.org/D21251

Files:
  include/llvm/CodeGen/BasicTTIImpl.h
  lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
  test/Analysis/CostModel/ARM/cast.ll
  test/Analysis/CostModel/PowerPC/ext.ll
  test/Analysis/CostModel/X86/sitofp.ll
  test/Analysis/CostModel/X86/uitofp.ll
  test/Transforms/LoopVectorize/X86/gather_scatter.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21251.61313.patch
Type: text/x-patch
Size: 51371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160620/5315022d/attachment.bin>


More information about the llvm-commits mailing list