[PATCH] D125511: [InstCombine] Merging constant-indexed GEP of GEP in both directions

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 18:57:53 PDT 2022


huangjd created this revision.
huangjd added reviewers: davidxl, Carrot, nikic, spatel, reames.
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.

Previously GEP of GEP with constant indices are only merged to the front (Second GEP is merged to the first one whenever possible). This patch expanded the optimization to also try merging to the direction under some constraints on GEP usage, if the first attempt failed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125511

Files:
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/gep-merge-constant-indices.ll
  llvm/test/Transforms/InstCombine/opaque-ptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125511.429114.patch
Type: text/x-patch
Size: 12535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220513/1c91ad01/attachment.bin>


More information about the llvm-commits mailing list