This is an archive of the discontinued LLVM Phabricator instance.

[mlir:LLVM] Rewrite the LLVMIR export to use the debug info attributes
ClosedPublic

Authored by rriddle on Oct 22 2022, 4:29 PM.

Details

Summary

This has been a long standing TODO, and actually enables users to generate
debug information for LLVM using the LLVM dialect; as opposed to our
dummy placeholder that generated just enough for line table information.

Diff Detail

Event Timeline

rriddle created this revision.Oct 22 2022, 4:29 PM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Oct 22 2022, 4:29 PM
rriddle updated this revision to Diff 470073.Oct 24 2022, 12:33 AM
rriddle edited the summary of this revision. (Show Details)
Herald added a project: Restricted Project. · View Herald TranscriptOct 24 2022, 12:33 AM
Mogball accepted this revision.Oct 24 2022, 12:58 PM
Mogball added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
241

Is this line <= 80 characters?

244

Why the roundtrip here?

mlir/include/mlir/IR/Location.h
45

dyn_cast<T>(loc)?

mlir/lib/Target/LLVMIR/DebugTranslation.cpp
81

very nice

mlir/test/Target/LLVMIR/openmp-nested.mlir
41

I don't have the context for this test, but why this change?

This revision is now accepted and ready to land.Oct 24 2022, 12:58 PM

This is super exciting River! Baby MLIR is growing up to be a real compiler! :)

rriddle marked 4 inline comments as done.Oct 24 2022, 5:08 PM
rriddle added inline comments.
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
244

The intrinsics want the values to be wrapped as metadata... (it's all quite weird)

mlir/test/Target/LLVMIR/openmp-nested.mlir
41

Essentially just that the generation changed depending on the presence of debug info (if info isn't generated, a different global var is created). We don't implicitly generate debug info anymore, so it uses the fallback path (but that's not important for this test).

This revision was landed with ongoing or failed builds.Oct 24 2022, 10:32 PM
This revision was automatically updated to reflect the committed changes.
rriddle marked 2 inline comments as done.