Reapply [MergeICmps] Don't require GEP
authorNikita Popov <npopov@redhat.com>
Fri, 25 Feb 2022 16:36:29 +0000 (17:36 +0100)
committerNikita Popov <npopov@redhat.com>
Fri, 4 Mar 2022 10:39:11 +0000 (11:39 +0100)
commitd3a52089eb3e9d8b41dd8ca08d3d532dee78c4e8
tree4a9ac90c6865b9f604b8711507cb70f14cd991be
parentf9331c9a2c8746bc1a63d45c59019545e376b3e0
Reapply [MergeICmps] Don't require GEP

Recommit without changes over 53abe3ff66a54117308352d379837c7d3229f8d6,
which addressed the cause of the reported crash.

-----

With opaque pointers, the zero-offset load will generally not use
a GEP. Allow a direct load without GEP, which is treated the same
way as a zero-offset GEP.
llvm/lib/Transforms/Scalar/MergeICmps.cpp
llvm/test/Transforms/MergeICmps/X86/no-gep-other-work.ll
llvm/test/Transforms/MergeICmps/X86/opaque-ptr.ll