From 4ea02c59d8c9223cae9eab7ae0ab1d3e42702554 Mon Sep 17 00:00:00 2001 From: "james.brodman" Date: Tue, 21 May 2013 10:00:22 -0400 Subject: [PATCH] Disable break optimization and change return check to use full mask. --- ctx.cpp | 2 +- stmt.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ctx.cpp b/ctx.cpp index 872751eb..5b93c8bc 100644 --- a/ctx.cpp +++ b/ctx.cpp @@ -1266,7 +1266,7 @@ FunctionEmitContext::CurrentLanesReturned(Expr *expr, bool doCoherenceCheck) { LoadInst(returnedLanesPtr, "old_returned_lanes"); llvm::Value *newReturnedLanes = 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 // lanes have returned diff --git a/stmt.cpp b/stmt.cpp index a95f8fbf..eba506ab 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -447,6 +447,8 @@ IfStmt::EmitCode(FunctionEmitContext *ctx) const { ctx->SetCurrentBasicBlock(bexit); ctx->EndIf(); } + /* + // Disabled for performance reasons. Change to an optional compile-time opt switch. else if (lCanApplyBreakOptimization(trueStmts, falseStmts)) { // If we have a simple break statement inside the 'if' and are // under varying control flow, just update the execution mask @@ -456,6 +458,7 @@ IfStmt::EmitCode(FunctionEmitContext *ctx) const { // benefit in this case. ctx->SetInternalMaskAndNot(ctx->GetInternalMask(), testValue); } + */ else emitVaryingIf(ctx, testValue); }