[MLIR][Wasm] Remove statistics as they depend on global ctors (#153795)

Use a debug log instead for now.
This commit is contained in:
Mehdi Amini 2025-08-15 14:29:20 +02:00 committed by GitHub
parent 4f65345ab5
commit 7640645f79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 29 deletions

View File

@ -30,12 +30,6 @@
#define DEBUG_TYPE "wasm-translate"
// Statistics.
STATISTIC(numFunctionSectionItems, "Parsed functions");
STATISTIC(numGlobalSectionItems, "Parsed globals");
STATISTIC(numMemorySectionItems, "Parsed memories");
STATISTIC(numTableSectionItems, "Parsed tables");
static_assert(CHAR_BIT == 8,
"This code expects std::byte to be exactly 8 bits");
@ -1047,10 +1041,12 @@ public:
return;
// Copy over sizes of containers into statistics.
numFunctionSectionItems = symbols.funcSymbols.size();
numGlobalSectionItems = symbols.globalSymbols.size();
numMemorySectionItems = symbols.memSymbols.size();
numTableSectionItems = symbols.tableSymbols.size();
LDBG() << "WASM Imports:"
<< "\n"
<< " - Num functions: " << symbols.funcSymbols.size() << "\n"
<< " - Num globals: " << symbols.globalSymbols.size() << "\n"
<< " - Num memories: " << symbols.memSymbols.size() << "\n"
<< " - Num tables: " << symbols.tableSymbols.size();
}
ModuleOp getModule() {

View File

@ -1,19 +0,0 @@
// RUN: yaml2obj %S/inputs/stats.yaml.wasm -o - | mlir-translate --import-wasm -stats 2>&1 | FileCheck %s
// Check that we get the correct stats for a module that has a single
// function, table, memory, and global.
// REQUIRES: asserts
/* Source code used to create this test:
(module
(type (;0;) (func (param i32) (result i32)))
(func (;0;) (type 0) (param i32) (result i32)
local.get 0)
(table (;0;) 2 funcref)
(memory (;0;) 0 65536)
(global (;0;) i32 (i32.const 10)))
*/
// CHECK: 1 wasm-translate - Parsed functions
// CHECK-NEXT: 0 wasm-translate - Parsed globals
// CHECK-NEXT: 1 wasm-translate - Parsed memories
// CHECK-NEXT: 1 wasm-translate - Parsed tables