Page MenuHomePhabricator

[llvm-dwp] Add a command line option to set the target triple
AcceptedPublic

Authored by pfaffe on Dec 23 2020, 12:45 AM.

Details

Reviewers
dblaikie
Summary

The llvm-dwp tool hard-codes the target triple to x86. Instead, add a command
line option for overriding the default triple to support alternative targets
such as WebAssembly as well.

Diff Detail

Event Timeline

pfaffe created this revision.Dec 23 2020, 12:45 AM
pfaffe requested review of this revision.Dec 23 2020, 12:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2020, 12:45 AM

Could the target triple be identified from one of the input files instead? (in any case, this'll need test coverage)

pfaffe updated this revision to Diff 316390.Wed, Jan 13, 7:22 AM

Read triple from first dwo file instead of from command line and add a test.

dblaikie accepted this revision.Wed, Jan 13, 1:02 PM

Code change looks good - test might be able to be tweaked a bit before committing.

llvm/test/tools/llvm-dwp/WebAssembly/simple.test
1 ↗(On Diff #316390)

Could the wasm.dwo file be written in assembly (that's more the style used these days, compared to when I wrote the original dwp tests) and assembled with llvm-mc? (this .test file could be the assembly .s file instead - self-describing/standalone in one file rather than an opaque binary beside this .test file that doesn't describe its inputs)

This revision is now accepted and ready to land.Wed, Jan 13, 1:02 PM
pfaffe updated this revision to Diff 316595.Thu, Jan 14, 2:08 AM

Replace binary test with an assembly test.

pfaffe updated this revision to Diff 318496.Fri, Jan 22, 5:33 AM

Rebase and improve testcase: The file can just be empty.

pfaffe updated this revision to Diff 318497.Fri, Jan 22, 5:34 AM

Restore changes lost in previous patchset.

dblaikie accepted this revision.Fri, Jan 22, 11:32 AM

Looks good