Always check the execution mask after break/continue/return.

When "break", "continue", or "return" is used under varying control flow,
we now always check the execution mask to see if all of the program
instances are executing it.  (Previously, this was only done with "cbreak",
"ccontinue", and "creturn", which are now deprecated.)

An important effect of this change is that it fixes a family of cases
where we could end up running with an "all off" execution mask, which isn't
supposed to happen, as it leads to all sorts of invalid behavior.

This change does cause the volume rendering example to run 9% slower, but
doesn't affect the other examples.

Issue #257.
This commit is contained in:
Matt Pharr
2012-07-06 11:09:11 -07:00
parent 73afab464f
commit 2d8026625b
6 changed files with 38 additions and 81 deletions

View File

@@ -706,9 +706,6 @@ FunctionEmitContext::Break(bool doCoherenceCheck) {
// jump to the break location.
if (inSwitchStatement() == false && ifsInCFAllUniform(CFInfo::Loop)) {
BranchInst(breakTarget);
if (ifsInCFAllUniform(CFInfo::Loop) && doCoherenceCheck)
Warning(currentPos, "Coherent break statement not necessary in "
"fully uniform control flow.");
// Set bblock to NULL since the jump has terminated the basic block
bblock = NULL;
}
@@ -778,9 +775,6 @@ FunctionEmitContext::Continue(bool doCoherenceCheck) {
// which case we know that only a single program instance is
// executing.
AddInstrumentationPoint("continue: uniform CF, jumped");
if (doCoherenceCheck)
Warning(currentPos, "Coherent continue statement not necessary in "
"fully uniform control flow.");
BranchInst(continueTarget);
bblock = NULL;
}