[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)
committerTobias Hieta <tobias@hieta.se>
Mon, 24 Oct 2022 11:42:49 +0000 (13:42 +0200)
commitceee53ce564c3034ea9636b3c416182efadc5967
tree47b9374632ffc24158897d8125fe7616f6ff60c2
parent086365be7ce0aaeb159fa80d02c426989d5115f3
[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

(cherry picked from commit 6219ec07c6f8d1ead51beca7cf21fbf2323c51d7)
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/phi-speculate-different-load-types.ll [new file with mode: 0644]