]> granicus.if.org Git - llvm/commit
Remove assert from MachineLoop::getLoopPredecessor()
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 20 Sep 2019 15:26:10 +0000 (15:26 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 20 Sep 2019 15:26:10 +0000 (15:26 +0000)
commit2e8ee4b459a0f5931e6e5632a449be0ef971e070
tree7e01ffd7afccce2e696580c066f94102fd4e27d0
parent392a95b5fe8ef03fe3d294f949c8d6335ed24a6a
Remove assert from MachineLoop::getLoopPredecessor()

According to the documentation method returns predecessor
if the given loop's header has exactly one unique predecessor
outside the loop. Otherwise return null.

In reality it asserts if there is no predecessor outside of
the loop.

The testcase has the loop where predecessors outside of the
loop were not identified as analyzeBranch() was unable to
process the mask branch and returned true. That is also not
correct to assert for the truly dead loops.

Differential Revision: https://reviews.llvm.org/D67634

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372405 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopInfoImpl.h
test/CodeGen/AMDGPU/loop_header_nopred.mir [new file with mode: 0644]