[PATCH] D11741: [TTI] Make the cost APIs in TargetTransformInfo consistently use 'int' rather than 'unsigned' for their costs.

Chandler Carruth chandlerc at gmail.com
Mon Aug 3 16:55:43 PDT 2015


chandlerc created this revision.
chandlerc added a reviewer: echristo.
chandlerc added a subscriber: llvm-commits.
Herald added a subscriber: jholewinski.

For something like costs in particular there is a natural "negative"
value, that of savings or saved cost. As a consequence, there is a lot
of code that subtracts or creates negative values based on cost, all of
which is prone to awkwardness or bugs when dealing with an unsigned
type. Similarly, we *never* want these values to wrap, as that would
cause Very Bad code generation (likely percieved as an infinite loop as
we try to emit over 2^32 instructions or some such insanity).

All around 'int' seems a much better fit for these basic metrics.

No functional change intended.

http://reviews.llvm.org/D11741

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Target/TargetLowering.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/CodeGen/TargetLoweringBase.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.h
  lib/Target/ARM/ARMTargetTransformInfo.cpp
  lib/Target/ARM/ARMTargetTransformInfo.h
  lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
  lib/Target/NVPTX/NVPTXTargetTransformInfo.h
  lib/Target/PowerPC/PPCTargetTransformInfo.cpp
  lib/Target/PowerPC/PPCTargetTransformInfo.h
  lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  lib/Target/SystemZ/SystemZTargetTransformInfo.h
  lib/Target/X86/X86TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11741.31286.patch
Type: text/x-patch
Size: 73514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150803/3cf14304/attachment.bin>


More information about the llvm-commits mailing list