[LLVMCPU] Default the export source location line to 0 (#25239) LLVMCPUTarget fills an export's SourceLocation only when the debug level is at least 1 and the export's location contains a file location. Otherwise `line` stayed uninitialized and LibraryBuilder write random bytes from the stack into the source location table of the executable library. The issue makes .vmfb files non-reproducible: compiling the same input twice gives different bytes/checksums. It doesn't happen to all inputs, only to some, e.g. TOSA bytecode from the TFLite converter, where every op has `loc(unknown)`. Default `line` to 0, like the other integer fields of structs in the same module. Tested by compiling four TFLite models multiple times with the llvm-cpu backend and comparing binaries: before the change every new recompile was different from the first one, after the fix all were identical. Assisted-by: Claude Code --------- Signed-off-by: Zmicier Prybysh <zprybysh@baylibre.com>
diff --git a/compiler/plugins/target/LLVMCPU/LibraryBuilder.h b/compiler/plugins/target/LLVMCPU/LibraryBuilder.h index 53a93aa..15a1013 100644 --- a/compiler/plugins/target/LLVMCPU/LibraryBuilder.h +++ b/compiler/plugins/target/LLVMCPU/LibraryBuilder.h
@@ -104,7 +104,7 @@ struct SourceLocation { std::string stage; std::string path; - uint32_t line; + uint32_t line = 0; }; // iree_hal_executable_dispatch_parameter_v0_t