This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix verifier errors in SILowerControlFlow
ClosedPublic

Authored by arsenm on Jun 9 2016, 3:53 PM.

Details

Reviewers
tstellarAMD
Summary

The main sin this was committing was using terminator
instructions in the middle of the block, and then
not updating the block successors / predecessors.
Split the blocks up to avoid this and introduce new
pseudo instructions for branches taken with exec masking.

Also use a pseudo instead of emitting s_endpgm and erasing
it in the special case of a non-void return.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 60266.Jun 9 2016, 3:53 PM
arsenm retitled this revision from to AMDGPU: Fix verifier errors in SILowerControlFlow.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
arsenm updated this revision to Diff 60269.Jun 9 2016, 3:57 PM

Also enable after SIDebuggerInsertNops since all the errors were from lower CF

LGTM.

lib/Target/AMDGPU/SILowerControlFlow.cpp
465–470

I believe this can be simplified by incrementing MBBI before doing the insert.

tstellarAMD accepted this revision.Jun 14 2016, 6:07 PM
tstellarAMD edited edge metadata.
This revision is now accepted and ready to land.Jun 14 2016, 6:07 PM
arsenm updated this revision to Diff 61463.Jun 21 2016, 5:06 PM
arsenm edited edge metadata.
arsenm marked an inline comment as done.

Fix more iterator related failures

arsenm closed this revision.Jun 22 2016, 1:22 PM

r273467