[PATCH] D32536: Extend memcpy expansion in Transform/Utils to handle wider operand types.

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 07:01:07 PDT 2017


sfertile created this revision.
Herald added subscribers: nhaehnle, wdng.

Generalizes the current transformation of memcpy calls into a loop expansion to use wider operand types, and specializes between compile-time constant sizes and unknown size expansions.

A TTI call back is used to allow the target to provide the operand type for the main loop expansion based on copy size and alignment of source and destination arguments.  The residual block of memory after the main loop is then copied byte-wise in a loop for unknown sizes, and a TTI callback allows the target to provide the exact memory ops to use for the residual when the size is known at compile time.

The new implementations are turned off by default and can be enabled with  '-use-wide-memcpy-loop-lowering=true'.
The default values for the TTI callbacks use int8 operand types and matches the existing behaviour if they aren't overridden by the target.


Repository:
  rL LLVM

https://reviews.llvm.org/D32536

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/Transforms/Utils/LowerMemIntrinsics.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
  lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp
  lib/Transforms/Utils/LowerMemIntrinsics.cpp
  test/CodeGen/AMDGPU/lower-mem-intrinsics.ll
  test/CodeGen/NVPTX/lower-aggr-copies.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32536.96726.patch
Type: text/x-patch
Size: 34057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170426/38919f95/attachment.bin>


More information about the llvm-commits mailing list