Add Debug() statement to report on if stmt cost/safety test results.
This commit is contained in:
4
stmt.cpp
4
stmt.cpp
@@ -541,6 +541,10 @@ IfStmt::emitVaryingIf(FunctionEmitContext *ctx, llvm::Value *ltest) const {
|
|||||||
bool safeToRunWithAllLanesOff = (SafeToRunWithMaskAllOff(trueStmts) &&
|
bool safeToRunWithAllLanesOff = (SafeToRunWithMaskAllOff(trueStmts) &&
|
||||||
SafeToRunWithMaskAllOff(falseStmts));
|
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 &&
|
if (safeToRunWithAllLanesOff &&
|
||||||
(costIsAcceptable || g->opt.disableCoherentControlFlow)) {
|
(costIsAcceptable || g->opt.disableCoherentControlFlow)) {
|
||||||
ctx->StartVaryingIf(oldMask);
|
ctx->StartVaryingIf(oldMask);
|
||||||
|
|||||||
Reference in New Issue
Block a user