[PATCH] D52417: [TargetTransformInfo] Pass a new argument 'Scalarized' to getMemoryOpCost.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 07:21:43 PDT 2018


jonpa created this revision.
jonpa added reviewers: hfinkel, uweigand.
Herald added subscribers: jsji, kbarton, nemanjai.
Herald added a reviewer: javed.absar.

I discovered while using https://reviews.llvm.org/D52351 (which fixes so that operands scalarization overhead cost is not added if target keeps addresses in GPRs), that some vector loads now got a zero cost. This was because the scalar load can be folded into e.g. an add as one of the operands. The problem is that the folding of the load can only occur in the scalar version, not if the load is vectorized.

This patch informs the target if this scalar load is to be inserted into a vector element by a new 'Scalarized' argument. This way, the SystemZ backend can differentiate between the two contexts for the cost of the scalar load.


https://reviews.llvm.org/D52417

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/CodeGen/BasicTTIImpl.h
  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/Hexagon/HexagonTargetTransformInfo.cpp
  lib/Target/Hexagon/HexagonTargetTransformInfo.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
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/SystemZ/load-scalarization-cost-1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52417.166660.patch
Type: text/x-patch
Size: 15276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180924/39683f86/attachment.bin>


More information about the llvm-commits mailing list