]> granicus.if.org Git - llvm/commit
Update phis in AMDGPUUnifyDivergentExitNodes
authorDiego Novillo <dnovillo@google.com>
Tue, 25 Jun 2019 18:55:16 +0000 (18:55 +0000)
committerDiego Novillo <dnovillo@google.com>
Tue, 25 Jun 2019 18:55:16 +0000 (18:55 +0000)
commit16be858d042880c7686cc3938beb2e270dcf0e42
tree77997b526055455216ba626da8ef4a5cb00629cc
parent08e75cad94c312893c0bd36241942ccda429393e
Update phis in AMDGPUUnifyDivergentExitNodes

Original patch https://reviews.llvm.org/D63659 from
Steven Perron <stevenperron@google.com>

The pass AMDGPUUnifyDivergentExitNodes does not update the phi nodes in
the successors of blocks that is splits. This is fixed by calling
BasicBlock::splitBasicBlock to split the block instead of doing it
manually. This does extra work because a new conditional branch is
created in BB which is immediately replaced, but I think the simplicity
is worth it. It also helps make the code more future proof in case other
things need to be updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364342 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
test/CodeGen/AMDGPU/update-phi.ll [new file with mode: 0644]