This commit ensures that debug intrinsics of killed variables do not
cause a crash of the importer. Killed locations are usually undef
constants, but in infrequent cases can also be metadata nodes, which
caused problems.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Target/LLVMIR/ModuleImport.cpp | ||
---|---|---|
1783–1784 | I think it'd be more robust to not even attempt convertMetadataValue in this case. Checking dbgInstr->isKillLocation() && !isa<ValueAsMetadata>() should catch this case, right? |
mlir/lib/Target/LLVMIR/ModuleImport.cpp | ||
---|---|---|
1783–1784 | Good idea. I moved the checkout into a static function, as it requires a bit more to match. |
I think it'd be more robust to not even attempt convertMetadataValue in this case. Checking dbgInstr->isKillLocation() && !isa<ValueAsMetadata>() should catch this case, right?