[CUDA][HIP][NFC] Do not add `-fgpu-rdc` flag twice
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 13 Jul 2022 19:56:15 +0000 (15:56 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 13 Jul 2022 19:57:53 +0000 (15:57 -0400)
Summary:
We currently add the `-fgpu-rdc` flag twice. Once unconditionally for
both the host and device phases of compilation, and a second time only
for the host. When we moved to an unconditional addition of this flag it
the old one was most likely not removed. This patch simply removes the
redundant flag and changes no functionality.

clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/cuda-external-tools.cu

index e187fce..0081426 100644 (file)
@@ -7011,8 +7011,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   if ((IsCuda || IsHIP) && CudaDeviceInput) {
       CmdArgs.push_back("-fcuda-include-gpubinary");
       CmdArgs.push_back(CudaDeviceInput->getFilename());
-      if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false))
-        CmdArgs.push_back("-fgpu-rdc");
   }
 
   if (IsCuda) {
index 198443e..1aa87cc 100644 (file)
 // ARCH64-SAME: "-triple" "x86_64-
 // ARCH32-SAME: "-triple" "i386-
 // CHECK-SAME: "-fcuda-include-gpubinary" "[[FATBINARY]]"
-// RDC-SAME: "-fgpu-rdc"
-// CHECK-NOT: "-fgpu-rdc"
 
 // CHK-PTXAS-VERBOSE: ptxas{{.*}}" "-v"