Fixed assertion in SROA if block has ho successors
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 11 Jun 2020 17:45:42 +0000 (10:45 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 11 Jun 2020 22:15:19 +0000 (15:15 -0700)
commita98d618f6e5f6429378ac1474b6df7ce1878061d
treed5efeeca2839abe527e337604ba2bccda4b0d5d4
parentc52516819073ccc2853a347b28a4e88fa0af9cbb
Fixed assertion in SROA if block has ho successors

BasicBlock::isLegalToHoistInto() asserts if block does not
have successors. The case is degenarate but assertion still
needs to be avoided.

https://bugs.llvm.org/show_bug.cgi?id=46280

Differential Revision: https://reviews.llvm.org/D81674
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/phi-gep.ll