[PATCH] D79162: [Analysis] TTI: Add CastContextHint for getCastInstrCost

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 03:43:21 PDT 2020


Pierre-vh updated this revision to Diff 263134.
Pierre-vh added a comment.
Herald added subscribers: dantrushin, kerbowa, nhaehnle, jvesely, arsenm.

- Moved `CastContextHint` to `TargetTransformInfo`
- Moved the logic that calculates the `CastContextHint` from an `Instruction*` from `getCastInstrCost` (in TargetTransformInfo.cpp) to a static function in `TargetTransformInfo` named `getCastContextHint`).
- `CastContextHint` is no longer an optional parameter. Callers have to choose between using a `None` for the context, using a custom context or calling `TTI::getCastContextHint`
- Removed my change in BasicTTIImpl.h - (Should I restore it? It seemed to have no effects on tests)

This should much better than the previous version, and more in-line with other similar enums used by `getArithmeticInstrCost` for instance.

Note that this patch doesn't support `Interleave` and `Reversed` in `getCastContextHint` - I personally don't know how to do that, so feedback is welcome.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79162/new/

https://reviews.llvm.org/D79162

Files:
  llvm/include/llvm/Analysis/TargetTransformInfo.h
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/CodeGen/BasicTTIImpl.h
  llvm/lib/Analysis/ScalarEvolutionExpander.cpp
  llvm/lib/Analysis/TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/lib/Target/ARM/ARMTargetTransformInfo.h
  llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp
  llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h
  llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
  llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/lib/Target/X86/X86TargetTransformInfo.h
  llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79162.263134.patch
Type: text/x-patch
Size: 32215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200511/5c48c33a/attachment.bin>


More information about the llvm-commits mailing list