This is an archive of the discontinued LLVM Phabricator instance.

Update phis in AMDGPUUnifyDivergentExitNodes
ClosedPublic

Authored by s-perron on Jun 21 2019, 11:04 AM.

Details

Reviewers
arsenm
Summary

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.

Diff Detail

Event Timeline

s-perron created this revision.Jun 21 2019, 11:04 AM
arsenm accepted this revision.Jun 21 2019, 11:07 AM

LGTM with nit

test/CodeGen/AMDGPU/update-phi.ll
2

Can you replace the checks with update_test_checks?

This revision is now accepted and ready to land.Jun 21 2019, 11:07 AM
s-perron updated this revision to Diff 206040.Jun 21 2019, 11:33 AM
arsenm accepted this revision.Jun 21 2019, 11:34 AM
s-perron marked 2 inline comments as done.Jun 21 2019, 11:34 AM
s-perron added inline comments.
test/CodeGen/AMDGPU/update-phi.ll
2

Done.

s-perron marked an inline comment as done.Jun 21 2019, 11:38 AM

I cannot commit this change. Hopefully somebody can take care of that for me. Thanks.

arsenm closed this revision.Jun 26 2019, 1:31 PM

Looks like this was r364342