[PATCH] D76434: [SCEV] Query for immediate cost in Expander

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 09:45:58 PDT 2020


samparker created this revision.
samparker added reviewers: lebedev.ri, reames, echristo, mkazantsev, hfinkel, craig.topper, arsenm.
Herald added subscribers: danielkiss, zzheng, hiraditya, kristof.beyls, wdng, nemanjai.

Change isHighCostExpansion to query the backend for the use of an constant. This also sinks the idea of a free constant into the default TTI implementation as it is reasonable enough to assume that a constant is likely to be free, rather than the same cost as a 'basic' - which is the cost of most instructions. It seems that the biggest causes of change are due by loop unrolling, which has affected PPC, X86 and ARM.


https://reviews.llvm.org/D76434

Files:
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/lib/Analysis/ScalarEvolutionExpander.cpp
  llvm/test/CodeGen/ARM/indvar-cost.ll
  llvm/test/CodeGen/ARM/indvar-unroll-imm-cost.ll
  llvm/test/Transforms/IndVarSimplify/eliminate-trunc.ll
  llvm/test/Transforms/IndVarSimplify/iv-widen.ll
  llvm/test/Transforms/IndVarSimplify/loop-invariant-conditions.ll
  llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll
  llvm/test/Transforms/LoopUnroll/PowerPC/p8-unrolling-legalize-vectors.ll
  llvm/test/Transforms/LoopVectorize/X86/float-induction-x86.ll
  llvm/test/Transforms/SpeculateAroundPHIs/convergent.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76434.251403.patch
Type: text/x-patch
Size: 133213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200319/f65fa199/attachment.bin>


More information about the llvm-commits mailing list