[PATCH] D68665: [HIP] Fix -save-temps

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:57:00 PDT 2019


yaxunl marked 8 inline comments as done.
yaxunl added inline comments.


================
Comment at: lib/Driver/Driver.cpp:4400
+      // HIP image for device compilation with -fno-gpu-rdc is per compilation
+      // unit.
+      bool IsHIPNoRDC = JA.getOffloadingDeviceKind() == Action::OFK_HIP &&
----------------
tra wrote:
> ... so we derive the file name from the main file name.
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.


================
Comment at: lib/Driver/Driver.cpp:4405
+      if (IsHIPNoRDC)
+        Output = BaseName.substr(0, BaseName.rfind('.'));
       Output += OffloadingPrefix;
----------------
tra wrote:
> `llvm::sys::path::replace_extension(Output, "");` ?
will do when committing


================
Comment at: lib/Driver/ToolChains/HIP.cpp:253
+    constructLlcCommand(C, JA, Inputs, Args, SubArchName, Prefix, OptCommand,
+                        true);
   const char *LlcCommand =
----------------
tra wrote:
> `/*OutputIsAsm=*/true`
will do


================
Comment at: lib/Driver/ToolChains/HIP.h:62
+                                  const char *InputFileName,
+                                  bool IsAsm = false) const;
 
----------------
tra wrote:
> `OutputIsAsm`?  Otherwise it's not quite clear what `IsAsm` refers to.
will do


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68665/new/

https://reviews.llvm.org/D68665





More information about the cfe-commits mailing list