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)
commitaf77ca7e6e738b7963a622e4c35807ecc52f854b
treea3bfa600028445f98c1ea7bf2b1013d595967431
parent2b5d7e93dd18c13d5358f602d361273ec0960b37
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

llvm-svn: 372405
llvm/include/llvm/Analysis/LoopInfoImpl.h
llvm/test/CodeGen/AMDGPU/loop_header_nopred.mir [new file with mode: 0644]