Update break/continue test to use contribution of function mask.
This commit is contained in:
7
ctx.cpp
7
ctx.cpp
@@ -841,6 +841,9 @@ FunctionEmitContext::jumpIfAllLoopLanesAreDone(llvm::BasicBlock *target) {
|
|||||||
if (breakLanesPtr == NULL) {
|
if (breakLanesPtr == NULL) {
|
||||||
llvm::Value *continued = LoadInst(continueLanesPtr,
|
llvm::Value *continued = LoadInst(continueLanesPtr,
|
||||||
"continue_lanes");
|
"continue_lanes");
|
||||||
|
continued = BinaryOperator(llvm::Instruction::And,
|
||||||
|
continued, GetFunctionMask(),
|
||||||
|
"continued&func");
|
||||||
allDone = MasksAllEqual(continued, blockEntryMask);
|
allDone = MasksAllEqual(continued, blockEntryMask);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -860,6 +863,10 @@ FunctionEmitContext::jumpIfAllLoopLanesAreDone(llvm::BasicBlock *target) {
|
|||||||
finishedLanes = BinaryOperator(llvm::Instruction::Or, finishedLanes,
|
finishedLanes = BinaryOperator(llvm::Instruction::Or, finishedLanes,
|
||||||
continued, "returned|breaked|continued");
|
continued, "returned|breaked|continued");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finishedLanes = BinaryOperator(llvm::Instruction::And,
|
||||||
|
finishedLanes, GetFunctionMask(),
|
||||||
|
"finished&func");
|
||||||
|
|
||||||
// Do we match the mask at loop or switch statement entry?
|
// Do we match the mask at loop or switch statement entry?
|
||||||
allDone = MasksAllEqual(finishedLanes, blockEntryMask);
|
allDone = MasksAllEqual(finishedLanes, blockEntryMask);
|
||||||
|
|||||||
3
stmt.cpp
3
stmt.cpp
@@ -374,6 +374,7 @@ lEmitIfStatements(FunctionEmitContext *ctx, Stmt *stmts, const char *trueOrFalse
|
|||||||
|
|
||||||
/** Returns true if the "true" block for the if statement consists of a
|
/** Returns true if the "true" block for the if statement consists of a
|
||||||
single 'break' statement, and the "false" block is empty. */
|
single 'break' statement, and the "false" block is empty. */
|
||||||
|
/*
|
||||||
static bool
|
static bool
|
||||||
lCanApplyBreakOptimization(Stmt *trueStmts, Stmt *falseStmts) {
|
lCanApplyBreakOptimization(Stmt *trueStmts, Stmt *falseStmts) {
|
||||||
if (falseStmts != NULL) {
|
if (falseStmts != NULL) {
|
||||||
@@ -392,7 +393,7 @@ lCanApplyBreakOptimization(Stmt *trueStmts, Stmt *falseStmts) {
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
IfStmt::EmitCode(FunctionEmitContext *ctx) const {
|
IfStmt::EmitCode(FunctionEmitContext *ctx) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user