This is an archive of the discontinued LLVM Phabricator instance.

[mlir] ExecutionEngine needs special handling for COFF binaries
ClosedPublic

Authored by kernhanda on Feb 21 2021, 1:21 AM.

Diff Detail

Event Timeline

kernhanda created this revision.Feb 21 2021, 1:21 AM
kernhanda requested review of this revision.Feb 21 2021, 1:21 AM
mehdi_amini added inline comments.Feb 21 2021, 8:47 PM
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
262

Please document all this.

I'm also curious why this isn't handled by Orc directly?

Adding comments

kernhanda marked an inline comment as done.Feb 21 2021, 11:44 PM
kernhanda added inline comments.
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
262

Added comments. Can't tell you why it isn't handled by Orc directly, but LLJIT seems to be doing the same thing (noted in the documentation comment).

kernhanda marked an inline comment as done.Feb 21 2021, 11:44 PM

@lhames any opinion on whether Orc should handle this for the user? Seems like platform specific logic that every client would have to reimplement?

mehdi_amini accepted this revision.Feb 23 2021, 4:09 PM

I think Lang is on vacation right now, can you file a bug to Lang to look into this and add a TODO referencing the bug here?

This revision is now accepted and ready to land.Feb 23 2021, 4:09 PM

I think Lang is on vacation right now, can you file a bug to Lang to look into this and add a TODO referencing the bug here?

Ish. Every second day is a vacation day for the next two weeks -- I head back to the US then, so enjoying Australia while I can. In the mean time replies will be delayed sightly.

@lhames any opinion on whether Orc should handle this for the user? Seems like platform specific logic that every client would have to reimplement?

In an ideal world we shouldn't need them, but our COFF support isn't up to scratch yet. Turning these flags on by default for COFF is probably the right choice. In the long term a COFF JITLink implementation (and proper COMDAT support) is the right answer.

Thanks @lhames and @mehdi_amini ! I'll be landing this patch now

Turning these flags on by default for COFF is probably the right choice.

I thinks this still deserves a bug?

Turning these flags on by default for COFF is probably the right choice.

I thinks this still deserves a bug?

Created https://bugs.llvm.org/show_bug.cgi?id=49348. Let me know if there's anything else I can do.