This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Fix -save-temps
ClosedPublic

Authored by yaxunl on Oct 8 2019, 2:22 PM.

Details

Summary

Currently clang does not save some of the intermediate file generated during device compilation for HIP when -save-temps is specified.

This patch fixes that.

Diff Detail

Event Timeline

yaxunl created this revision.Oct 8 2019, 2:22 PM
tra accepted this revision.Oct 8 2019, 3:18 PM
tra added inline comments.
lib/Driver/Driver.cpp
4400 ↗(On Diff #223944)

... so we derive the file name from the main file name.

4405 ↗(On Diff #223944)

llvm::sys::path::replace_extension(Output, ""); ?

lib/Driver/ToolChains/HIP.cpp
253 ↗(On Diff #223944)

/*OutputIsAsm=*/true

lib/Driver/ToolChains/HIP.h
62 ↗(On Diff #223944)

OutputIsAsm? Otherwise it's not quite clear what IsAsm refers to.

This revision is now accepted and ready to land.Oct 8 2019, 3:18 PM
yaxunl marked 8 inline comments as done.Oct 9 2019, 10:56 AM
yaxunl added inline comments.
lib/Driver/Driver.cpp
4400 ↗(On Diff #223944)

for -fno-gpu-rdc, there is only one file. We derive the name from that file. In -fgpu-rdc case, the file name is determined by the output file name elsewhere.

4405 ↗(On Diff #223944)

will do when committing

lib/Driver/ToolChains/HIP.cpp
253 ↗(On Diff #223944)

will do

lib/Driver/ToolChains/HIP.h
62 ↗(On Diff #223944)

will do

ashi1 accepted this revision.Oct 9 2019, 10:59 AM

LGTM

This revision was automatically updated to reflect the committed changes.
yaxunl marked 4 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2019, 11:45 AM