diff options
author | Nikita Popov <npopov@redhat.com> | 2022-04-26 14:27:09 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-04-27 09:33:47 +0200 |
commit | c103f5e9da496866f2834a76709ae3a78054bb3f (patch) | |
tree | 05e69ecaa6fceb6c1897b35f687d821aeea1c58d /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 86c770346c26ce4c9abf5a5b7ab4b5bbfdcf9d78 (diff) | |
download | llvm-c103f5e9da496866f2834a76709ae3a78054bb3f.zip llvm-c103f5e9da496866f2834a76709ae3a78054bb3f.tar.gz llvm-c103f5e9da496866f2834a76709ae3a78054bb3f.tar.bz2 |
[InstCombine] Combine opaque pointer GEPs with mismatching element types
Currently, two GEPs will only be combined if the result element
type of one is the same as the source element type of the other.
However, this means we may miss folding opportunities where the
second GEP could be rewritten using a different element type. This
is especially relevant for opaque pointers, where constant GEPs
often use i8 element type.
Address this by converting GEP indices to offsets, adding them,
and then converting them back to indices. The first (inner) GEP
is allowed to have variable indices as well, in which case only
the constant suffix is converted into an offset.
This should address the regression reported in
https://reviews.llvm.org/D123300#3467615.
Differential Revision: https://reviews.llvm.org/D124459
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions