[PATCH] D29631: SystemZTargetTransformInfo cost functions and some common code changes

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 03:00:06 PDT 2017


jonpa updated this revision to Diff 93835.
jonpa added a comment.

Patch improved:

- SystemZ memory accesses inteleaving enabled, and getInterleavedMemoryOpCost() implemented. Tested with: test/Transforms/LoopVectorize/SystemZ/mem-interleaving-costs.ll
- getMemoryOpCost() improved by passing the Instruction pointer, so that operations that fold a load can be considered. Tested with: test/Analysis/CostModel/SystemZ/memop-folding-int-arith.ll
- BasicTTIImpl.h getCastInstrCost() improved to check for legal extending loads, in which case the cost of the z/sext instruction becomes 0. Tested with: test/Analysis/CostModel/SystemZ/ext-load.ll

Sofar, the passing of the Instruction to the cost methods have been added for:
getCastInstrCost(): For z/sext: check if the operand is a load, and in case target supports a legal matching Z/SEXTLOAD, return 0.
getCmpSelInstrCost(): SystemZ needs to check the def of the vector select mask, in order to compute the extra cost in case the vector compare had a different operand type.
getMemoryOpCost(): SystemZ checks if a load has a single user which is an (arithmetic) instruction that will fold the load into one of its operands

getOperandsScalarizationOverhead(): the assert has been changed so that the passed VF can either be 1 or match the VecTy number of elements. This is needed so that things work from different call contexts.


https://reviews.llvm.org/D29631

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/CodeGen/BasicTTIImpl.h
  lib/Analysis/CostModel.cpp
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.h
  lib/Target/ARM/ARMTargetTransformInfo.cpp
  lib/Target/ARM/ARMTargetTransformInfo.h
  lib/Target/PowerPC/PPCTargetTransformInfo.cpp
  lib/Target/PowerPC/PPCTargetTransformInfo.h
  lib/Target/SystemZ/SystemZISelLowering.cpp
  lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  lib/Target/SystemZ/SystemZTargetTransformInfo.h
  lib/Target/X86/X86TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.h
  lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
  lib/Transforms/Vectorize/BBVectorize.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Analysis/CostModel/SystemZ/cmp-ext.ll
  test/Analysis/CostModel/SystemZ/cmpsel.ll
  test/Analysis/CostModel/SystemZ/ext-load.ll
  test/Analysis/CostModel/SystemZ/fp-arith.ll
  test/Analysis/CostModel/SystemZ/fp-cast.ll
  test/Analysis/CostModel/SystemZ/int-arith.ll
  test/Analysis/CostModel/SystemZ/int-cast.ll
  test/Analysis/CostModel/SystemZ/load_store.ll
  test/Analysis/CostModel/SystemZ/logical.ll
  test/Analysis/CostModel/SystemZ/memop-folding-int-arith.ll
  test/Analysis/CostModel/SystemZ/scalar-cmp-cmp-log-sel.ll
  test/Transforms/LoopVectorize/SystemZ/mem-interleaving-costs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29631.93835.patch
Type: text/x-patch
Size: 414111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170403/81511e3e/attachment-0001.bin>


More information about the llvm-commits mailing list