From 88cd5584e85cffd606cf7adf7f6ad7dcfa942a35 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Thu, 22 Mar 2012 13:27:26 -0700 Subject: [PATCH] Add Debug() statement to report on if stmt cost/safety test results. --- stmt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stmt.cpp b/stmt.cpp index d9018f02..9aad4291 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -541,6 +541,10 @@ IfStmt::emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *ltest) const { bool safeToRunWithAllLanesOff = (SafeToRunWithMaskAllOff(trueStmts) && SafeToRunWithMaskAllOff(falseStmts)); + Debug(pos, "If statement: true cost %d (safe %d), false cost %d (safe %d).", + ::EstimateCost(trueStmts), (int)SafeToRunWithMaskAllOff(trueStmts), + ::EstimateCost(falseStmts), (int)SafeToRunWithMaskAllOff(falseStmts)); + if (safeToRunWithAllLanesOff && (costIsAcceptable || g->opt.disableCoherentControlFlow)) { ctx->StartVaryingIf(oldMask);