Fix bugs with handling of 'continue' statements in foreach_* loops.

This commit is contained in:
Matt Pharr
2012-09-05 10:16:58 -07:00
parent 63b8fac852
commit ddcd0a49ec
3 changed files with 27 additions and 6 deletions

View File

@@ -830,13 +830,9 @@ FunctionEmitContext::jumpIfAllLoopLanesAreDone(llvm::BasicBlock *target) {
llvm::Value *allDone = NULL;
if (breakLanesPtr == NULL) {
// In a foreach loop, break and return are illegal, and
// breakLanesPtr is NULL. In this case, the mask is guaranteed to
// be all on at the start of each iteration, so we only need to
// check if all lanes have continued..
llvm::Value *continued = LoadInst(continueLanesPtr,
"continue_lanes");
allDone = All(continued);
allDone = MasksAllEqual(continued, blockEntryMask);
}
else {
// Check to see if (returned lanes | continued lanes | break lanes) is