[SROA] Don't speculate phis with different load user types
authorArthur Eubanks <aeubanks@google.com>
Tue, 18 Oct 2022 00:03:35 +0000 (17:03 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 18 Oct 2022 15:44:13 +0000 (08:44 -0700)
commit6219ec07c6f8d1ead51beca7cf21fbf2323c51d7
tree530d3be3c52a373da42206f87cccd8e9a2b94761
parentce3c3cb2912425bb4367bfbe9a4c68a6d6f0a04a
[SROA] Don't speculate phis with different load user types

Fixes an SROA crash.

Fallout from opaque pointers since with typed pointers we'd bail out at the bitcast.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D136119
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/phi-speculate-different-load-types.ll [new file with mode: 0644]