[PATCH] Reassociate GEP operands for loop invariant code motion

Mark Heffernan meheff at google.com
Mon Apr 20 18:26:25 PDT 2015


Hi jingyue, hfinkel,

Rename SeparateConstOffsetFromGEP pass to ReassociateGEPs and
expand to include reassociation of loop invariant terms in the
indices of GEPs.  This reassociation enables splitting GEPs into
two separate GEPS: one loop invariant and the other loop variant
GEPs.  The existing reassociation pass is unable to perform this
transformation because that pass does not reassociate values
across GEP operands.

The renamed pass now performs three related GEP transformations:

1) Reassociate and gather constant offsets in GEP sequential index operands.
2) Reassociate loop invariant terms in GEP sequential index operands.
3) (Optional) Lower GEPs into simpler GEPs or their arithmetic equivalents.

This patch adds (2) and includes significant refactoring to share
code between the constant offset reassociation and the loop
invariant reassociation.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9136

Files:
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  lib/Target/AArch64/AArch64TargetMachine.cpp
  lib/Target/NVPTX/NVPTXTargetMachine.cpp
  lib/Target/PowerPC/PPCTargetMachine.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/ReassociateGEPs.cpp
  lib/Transforms/Scalar/Scalar.cpp
  lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
  lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
  test/CodeGen/AArch64/aarch64-gep-opt.ll
  test/CodeGen/PowerPC/ppc64-gep-opt.ll
  test/Transforms/ReassociateGEPs/NVPTX/split-gep-and-gvn.ll
  test/Transforms/ReassociateGEPs/NVPTX/split-gep.ll
  test/Transforms/ReassociateGEPs/NVPTX/split-licm-gep.ll
  test/Transforms/SeparateConstOffsetFromGEP/NVPTX/lit.local.cfg
  test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll
  test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9136.24071.patch
Type: text/x-patch
Size: 149926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150421/3774d567/attachment.bin>


More information about the llvm-commits mailing list