[PATCH] D124527: [GVN] Encode GEPs in offset representation

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 06:56:18 PDT 2022


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: JDevlieghere, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When using opaque pointers, convert GEPs into offset representation of the form `P + V1 * Scale1 + V2 * Scale2 + ... + ConstantOffset`. This allows us to recognize equivalent address calculations even if the GEPs don't use the same source element type.

This fixes an opaque pointer codegen regression seen in rustc.


https://reviews.llvm.org/D124527

Files:
  llvm/include/llvm/Transforms/Scalar/GVN.h
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/test/Transforms/GVN/opaque-ptr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124527.425507.patch
Type: text/x-patch
Size: 7086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220427/43773f9b/attachment.bin>


More information about the llvm-commits mailing list