Disable break optimization and change return check to use full mask.
This commit is contained in:
2
ctx.cpp
2
ctx.cpp
@@ -1266,7 +1266,7 @@ FunctionEmitContext::CurrentLanesReturned(Expr *expr, bool doCoherenceCheck) {
|
|||||||
LoadInst(returnedLanesPtr, "old_returned_lanes");
|
LoadInst(returnedLanesPtr, "old_returned_lanes");
|
||||||
llvm::Value *newReturnedLanes =
|
llvm::Value *newReturnedLanes =
|
||||||
BinaryOperator(llvm::Instruction::Or, oldReturnedLanes,
|
BinaryOperator(llvm::Instruction::Or, oldReturnedLanes,
|
||||||
GetInternalMask(), "old_mask|returned_lanes");
|
GetFullMask(), "old_mask|returned_lanes");
|
||||||
|
|
||||||
// For 'coherent' return statements, emit code to check if all
|
// For 'coherent' return statements, emit code to check if all
|
||||||
// lanes have returned
|
// lanes have returned
|
||||||
|
|||||||
3
stmt.cpp
3
stmt.cpp
@@ -447,6 +447,8 @@ IfStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
ctx->SetCurrentBasicBlock(bexit);
|
ctx->SetCurrentBasicBlock(bexit);
|
||||||
ctx->EndIf();
|
ctx->EndIf();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
// Disabled for performance reasons. Change to an optional compile-time opt switch.
|
||||||
else if (lCanApplyBreakOptimization(trueStmts, falseStmts)) {
|
else if (lCanApplyBreakOptimization(trueStmts, falseStmts)) {
|
||||||
// If we have a simple break statement inside the 'if' and are
|
// If we have a simple break statement inside the 'if' and are
|
||||||
// under varying control flow, just update the execution mask
|
// under varying control flow, just update the execution mask
|
||||||
@@ -456,6 +458,7 @@ IfStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
// benefit in this case.
|
// benefit in this case.
|
||||||
ctx->SetInternalMaskAndNot(ctx->GetInternalMask(), testValue);
|
ctx->SetInternalMaskAndNot(ctx->GetInternalMask(), testValue);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
else
|
else
|
||||||
emitVaryingIf(ctx, testValue);
|
emitVaryingIf(ctx, testValue);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user