This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Avoid adding debuginfo for a function if it contains calls that has no debug info.
ClosedPublic

Authored by timshen on Sep 22 2020, 11:38 PM.

Details

Summary

Also add a verifier pass to ExecutionEngine.

It's hard to come up with a test case, since mlir-opt always add location info after parsing it (?)

Diff Detail

Event Timeline

timshen created this revision.Sep 22 2020, 11:38 PM
Herald added a project: Restricted Project. · View Herald Transcript
timshen requested review of this revision.Sep 22 2020, 11:38 PM
mehdi_amini added inline comments.Sep 23 2020, 9:51 AM
mlir/lib/ExecutionEngine/OptUtils.cpp
116 ↗(On Diff #293652)

This looks like an odd place to me: can we put this at the end of the translate when we emit LLVM IR?

timshen updated this revision to Diff 293852.Sep 23 2020, 1:39 PM

Updated the place to verify the LLVM IR.

timshen marked an inline comment as done.Sep 23 2020, 1:39 PM
timshen updated this revision to Diff 293855.Sep 23 2020, 1:54 PM

Adjust tests.

mehdi_amini added inline comments.Sep 23 2020, 2:37 PM
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
240 ↗(On Diff #293855)

Can't it be done in mlir::translateModuleToLLVMIR directly because of the FIXME above?

@mehdi_amini , can you take a look? River doesn't seem to be around atm.

@mehdi_amini , can you take a look? River doesn't seem to be around atm.

Did you miss my last question?
I'm fine with this right now, but I wanted to make sure I understand why we don't just verify inside translateModuleToLLVMIR directly, and if we could fix/change translateModuleToLLVMIR to have this?

timshen updated this revision to Diff 294137.Sep 24 2020, 12:38 PM

Move the verification to translateLLVMIR.

@mehdi_amini , can you take a look? River doesn't seem to be around atm.

Did you miss my last question?
I'm fine with this right now, but I wanted to make sure I understand why we don't just verify inside translateModuleToLLVMIR directly, and if we could fix/change translateModuleToLLVMIR to have this?

I took "end of the translate" by "after the translate" not "within it but in the end", and moved it to ExecutionEngine where translateModuleToLLVMIR() was called. Moved to translateModuleToLLVMIR.

It does make more sense to move it to translateModuleToLLVMIR().

mehdi_amini accepted this revision.Sep 27 2020, 11:47 AM

Awesome, thanks!

This revision is now accepted and ready to land.Sep 27 2020, 11:47 AM