[PATCH] D126030: [InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 16:10:19 PDT 2022


huangjd created this revision.
huangjd added reviewers: davidxl, Carrot, nikic, spatel, reames, aeubanks.
Herald added subscribers: arphaman, hiraditya.
Herald added a project: All.
huangjd requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Canonicalize GEP of GEP by swapping GEP with some suffix constant indices to the back (and GEP with all constant indices to the back of that), this allows more constant index GEP merging to happen. Exceptions are: If swapping violates use-def relations, or anti-optimizes LICM

Originally D125845 <https://reviews.llvm.org/D125845>, clean up revision mess


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126030

Files:
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/gep-canonicalize-constant-indices.ll
  llvm/test/Transforms/InstCombine/gep-merge-constant-indices.ll
  llvm/test/Transforms/InstCombine/shift.ll
  llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse-mask4.ll
  llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126030.430844.patch
Type: text/x-patch
Size: 15910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220519/1534b6be/attachment.bin>


More information about the llvm-commits mailing list