From: TimePath Date: Sat, 12 May 2018 04:48:19 +0000 (+1000) Subject: Report stats on erased functions X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2FTimePath%2Fmaster;p=xonotic%2Fgmqcc.git Report stats on erased functions --- diff --git a/ir.cpp b/ir.cpp index 5e6cfaa..18323f8 100644 --- a/ir.cpp +++ b/ir.cpp @@ -3323,6 +3323,7 @@ bool ir_builder::generateGlobal(ir_value *global, bool islocal) * the function. */ if (global->m_flags & IR_FLAG_ERASABLE && global->m_reads.empty() && global->m_vtype == TYPE_FUNCTION) { + ++opts_optimizationcount[OPTIM_ERASE]; return true; } diff --git a/opts.def b/opts.def index 5addc3c..8b7c2d5 100644 --- a/opts.def +++ b/opts.def @@ -97,6 +97,7 @@ GMQCC_DEFINE_FLAG(VECTOR_COMPONENTS, 1) GMQCC_DEFINE_FLAG(CONST_FOLD_DCE, 2) GMQCC_DEFINE_FLAG(CONST_FOLD, 0) /* cannot be turned off */ + GMQCC_DEFINE_FLAG(ERASE, 0) /* cannot be turned off */ #endif #ifdef GMQCC_TYPE_OPTIONS