This is an archive of the discontinued LLVM Phabricator instance.

Add support for multi-module bitcode files to llvm-dis
ClosedPublic

Authored by ormris on Nov 12 2019, 5:33 PM.

Details

Summary

This change would allow llvm-dis to disassemble multi-module bitcode
files, including the associated module summary. This will allow the
disassembler to work with all current bitcode formats transparently.

Event Timeline

ormris created this revision.Nov 12 2019, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2019, 5:33 PM
tejohnson accepted this revision.Nov 13 2019, 4:16 PM

LGTM - nice improvement!

This revision is now accepted and ready to land.Nov 13 2019, 4:16 PM
pcc added a comment.Nov 13 2019, 4:29 PM

The way I imagined this might work is that llvm-dis would write out the modules concatenated with some kind of delimiter between them. Then llvm-as would be taught to expect the same input and produce a multi-module file from it, which would allow an easy way to produce multi-module files. Does that sound like it might work better?

In D70153#1744929, @pcc wrote:

The way I imagined this might work is that llvm-dis would write out the modules concatenated with some kind of delimiter between them. Then llvm-as would be taught to expect the same input and produce a multi-module file from it, which would allow an easy way to produce multi-module files. Does that sound like it might work better?

I like the delimiter approach.

llvm/test/Assembler/multi-mod-disassemble.ll
6

diff -> cmp

In D70153#1744929, @pcc wrote:

The way I imagined this might work is that llvm-dis would write out the modules concatenated with some kind of delimiter between them. Then llvm-as would be taught to expect the same input and produce a multi-module file from it, which would allow an easy way to produce multi-module files. Does that sound like it might work better?

I think that is a good approach in the end, but since this is strictly better than the current situation, I wouldn't mind having this in as an interim fix.

Thanks for the review! I'll go ahead and commit this.

ormris marked an inline comment as done.Nov 14 2019, 10:26 AM
ormris added inline comments.
llvm/test/Assembler/multi-mod-disassemble.ll
6

Will fix before commit.

This revision was automatically updated to reflect the committed changes.