Skip to content

Commit ccfb97b

Browse files
committed
Revert "clang/AMDGPU: Stop looking for oclc_daz_opt_* control libraries (#134805)"
This reverts commit 028429a and 1004fae. These really need to be part of the compiler distribution. Bots are relying on a nearly year old version to provide bitcode.
1 parent d1d5f00 commit ccfb97b

File tree

6 files changed

+70
-38
lines changed

6 files changed

+70
-38
lines changed

clang/lib/Driver/ToolChains/AMDGPU.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ void RocmInstallationDetector::scanLibDevicePath(llvm::StringRef Path) {
6565
FiniteOnly.Off = FilePath;
6666
} else if (BaseName == "oclc_finite_only_on") {
6767
FiniteOnly.On = FilePath;
68+
} else if (BaseName == "oclc_daz_opt_on") {
69+
DenormalsAreZero.On = FilePath;
70+
} else if (BaseName == "oclc_daz_opt_off") {
71+
DenormalsAreZero.Off = FilePath;
6872
} else if (BaseName == "oclc_correctly_rounded_sqrt_on") {
6973
CorrectlyRoundedSqrt.On = FilePath;
7074
} else if (BaseName == "oclc_correctly_rounded_sqrt_off") {
@@ -881,6 +885,10 @@ void ROCMToolChain::addClangTargetOptions(
881885
return;
882886

883887
bool Wave64 = isWave64(DriverArgs, Kind);
888+
// TODO: There are way too many flags that change this. Do we need to check
889+
// them all?
890+
bool DAZ = DriverArgs.hasArg(options::OPT_cl_denorms_are_zero) ||
891+
getDefaultDenormsAreZeroForTarget(Kind);
884892
bool FiniteOnly = DriverArgs.hasArg(options::OPT_cl_finite_math_only);
885893

886894
bool UnsafeMathOpt =
@@ -901,7 +909,7 @@ void ROCMToolChain::addClangTargetOptions(
901909

902910
// Add the generic set of libraries.
903911
BCLibs.append(RocmInstallation->getCommonBitcodeLibs(
904-
DriverArgs, LibDeviceFile, Wave64, FiniteOnly, UnsafeMathOpt,
912+
DriverArgs, LibDeviceFile, Wave64, DAZ, FiniteOnly, UnsafeMathOpt,
905913
FastRelaxedMath, CorrectSqrt, ABIVer, GPUSan, false));
906914

907915
for (auto [BCFile, Internalize] : BCLibs) {
@@ -940,8 +948,9 @@ bool RocmInstallationDetector::checkCommonBitcodeLibs(
940948
llvm::SmallVector<ToolChain::BitCodeLibraryInfo, 12>
941949
RocmInstallationDetector::getCommonBitcodeLibs(
942950
const llvm::opt::ArgList &DriverArgs, StringRef LibDeviceFile, bool Wave64,
943-
bool FiniteOnly, bool UnsafeMathOpt, bool FastRelaxedMath, bool CorrectSqrt,
944-
DeviceLibABIVersion ABIVer, bool GPUSan, bool isOpenMP) const {
951+
bool DAZ, bool FiniteOnly, bool UnsafeMathOpt, bool FastRelaxedMath,
952+
bool CorrectSqrt, DeviceLibABIVersion ABIVer, bool GPUSan,
953+
bool isOpenMP) const {
945954
llvm::SmallVector<ToolChain::BitCodeLibraryInfo, 12> BCLibs;
946955

947956
auto AddBCLib = [&](ToolChain::BitCodeLibraryInfo BCLib,
@@ -960,6 +969,7 @@ RocmInstallationDetector::getCommonBitcodeLibs(
960969
AddBCLib(getOCKLPath());
961970
else if (GPUSan && isOpenMP)
962971
AddBCLib(getOCKLPath(), false);
972+
AddBCLib(getDenormalsAreZeroPath(DAZ));
963973
AddBCLib(getUnsafeMathPath(UnsafeMathOpt || FastRelaxedMath));
964974
AddBCLib(getFiniteOnlyPath(FiniteOnly || FastRelaxedMath));
965975
AddBCLib(getCorrectlyRoundedSqrtPath(CorrectSqrt));
@@ -987,6 +997,11 @@ ROCMToolChain::getCommonDeviceLibNames(const llvm::opt::ArgList &DriverArgs,
987997
return {};
988998

989999
// If --hip-device-lib is not set, add the default bitcode libraries.
1000+
// TODO: There are way too many flags that change this. Do we need to check
1001+
// them all?
1002+
bool DAZ = DriverArgs.hasFlag(options::OPT_fgpu_flush_denormals_to_zero,
1003+
options::OPT_fno_gpu_flush_denormals_to_zero,
1004+
getDefaultDenormsAreZeroForTarget(Kind));
9901005
bool FiniteOnly = DriverArgs.hasFlag(
9911006
options::OPT_ffinite_math_only, options::OPT_fno_finite_math_only, false);
9921007
bool UnsafeMathOpt =
@@ -1006,7 +1021,7 @@ ROCMToolChain::getCommonDeviceLibNames(const llvm::opt::ArgList &DriverArgs,
10061021
getSanitizerArgs(DriverArgs).needsAsanRt();
10071022

10081023
return RocmInstallation->getCommonBitcodeLibs(
1009-
DriverArgs, LibDeviceFile, Wave64, FiniteOnly, UnsafeMathOpt,
1024+
DriverArgs, LibDeviceFile, Wave64, DAZ, FiniteOnly, UnsafeMathOpt,
10101025
FastRelaxedMath, CorrectSqrt, ABIVer, GPUSan, isOpenMP);
10111026
}
10121027

clang/lib/Driver/ToolChains/ROCm.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class RocmInstallationDetector {
137137
ConditionalLibrary WavefrontSize64;
138138
ConditionalLibrary FiniteOnly;
139139
ConditionalLibrary UnsafeMath;
140+
ConditionalLibrary DenormalsAreZero;
140141
ConditionalLibrary CorrectlyRoundedSqrt;
141142

142143
// Maps ABI version to library path. The version number is in the format of
@@ -151,7 +152,8 @@ class RocmInstallationDetector {
151152
bool allGenericLibsValid() const {
152153
return !OCML.empty() && !OCKL.empty() && !OpenCL.empty() &&
153154
WavefrontSize64.isValid() && FiniteOnly.isValid() &&
154-
UnsafeMath.isValid() && CorrectlyRoundedSqrt.isValid();
155+
UnsafeMath.isValid() && DenormalsAreZero.isValid() &&
156+
CorrectlyRoundedSqrt.isValid();
155157
}
156158

157159
void scanLibDevicePath(llvm::StringRef Path);
@@ -173,12 +175,11 @@ class RocmInstallationDetector {
173175

174176
/// Get file paths of default bitcode libraries common to AMDGPU based
175177
/// toolchains.
176-
llvm::SmallVector<ToolChain::BitCodeLibraryInfo, 12>
177-
getCommonBitcodeLibs(const llvm::opt::ArgList &DriverArgs,
178-
StringRef LibDeviceFile, bool Wave64, bool FiniteOnly,
179-
bool UnsafeMathOpt, bool FastRelaxedMath,
180-
bool CorrectSqrt, DeviceLibABIVersion ABIVer,
181-
bool GPUSan, bool isOpenMP) const;
178+
llvm::SmallVector<ToolChain::BitCodeLibraryInfo, 12> getCommonBitcodeLibs(
179+
const llvm::opt::ArgList &DriverArgs, StringRef LibDeviceFile,
180+
bool Wave64, bool DAZ, bool FiniteOnly, bool UnsafeMathOpt,
181+
bool FastRelaxedMath, bool CorrectSqrt, DeviceLibABIVersion ABIVer,
182+
bool GPUSan, bool isOpenMP) const;
182183
/// Check file paths of default bitcode libraries common to AMDGPU based
183184
/// toolchains. \returns false if there are invalid or missing files.
184185
bool checkCommonBitcodeLibs(StringRef GPUArch, StringRef LibDeviceFile,
@@ -244,6 +245,10 @@ class RocmInstallationDetector {
244245
return UnsafeMath.get(Enabled);
245246
}
246247

248+
StringRef getDenormalsAreZeroPath(bool Enabled) const {
249+
return DenormalsAreZero.get(Enabled);
250+
}
251+
247252
StringRef getCorrectlyRoundedSqrtPath(bool Enabled) const {
248253
return CorrectlyRoundedSqrt.get(Enabled);
249254
}

clang/test/Driver/amdgpu-openmp-toolchain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
// RUN: %clang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx803 \
5555
// RUN: --no-offloadlib --offloadlib --rocm-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode %s 2>&1 | \
5656
// RUN: FileCheck %s --check-prefix=CHECK-LIB-DEVICE
57-
// CHECK-LIB-DEVICE: "-cc1" {{.*}}ocml.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_803.bc"
57+
// CHECK-LIB-DEVICE: "-cc1" {{.*}}ocml.bc"{{.*}}oclc_daz_opt_on.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_803.bc"
5858

5959
// RUN: %clang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx803 -nogpulib \
6060
// RUN: --offloadlib --no-offloadlib --rocm-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode %s 2>&1 | \
6161
// RUN: FileCheck %s --check-prefix=CHECK-LIB-DEVICE-NOGPULIB
62-
// CHECK-LIB-DEVICE-NOGPULIB-NOT: "-cc1" {{.*}}ocml.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_803.bc"
62+
// CHECK-LIB-DEVICE-NOGPULIB-NOT: "-cc1" {{.*}}ocml.bc"{{.*}}oclc_daz_opt_on.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_803.bc"
6363

6464
// RUN: %clang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx90a:sramecc-:xnack+ \
6565
// RUN: -nogpulib %s 2>&1 | FileCheck %s --check-prefix=CHECK-TARGET-ID

clang/test/Driver/hip-device-libs.hip

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
// RUN: --cuda-gpu-arch=gfx803 \
77
// RUN: --rocm-path=%S/Inputs/rocm \
88
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
9-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
9+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
1010

1111

1212
// Test subtarget with flushing off by ddefault.
1313
// RUN: %clang -### --target=x86_64-linux-gnu \
1414
// RUN: --cuda-gpu-arch=gfx900 \
1515
// RUN: --rocm-path=%S/Inputs/rocm \
1616
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
17-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
17+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR
1818

1919

2020
// Test explicit flag, opposite of target default.
@@ -23,7 +23,7 @@
2323
// RUN: -fgpu-flush-denormals-to-zero \
2424
// RUN: --rocm-path=%S/Inputs/rocm \
2525
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
26-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
26+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
2727

2828

2929
// Test explicit flag, opposite of target default.
@@ -32,7 +32,7 @@
3232
// RUN: -fno-gpu-flush-denormals-to-zero \
3333
// RUN: --rocm-path=%S/Inputs/rocm \
3434
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
35-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
35+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR
3636

3737

3838
// Test explicit flag, same as target default.
@@ -41,7 +41,7 @@
4141
// RUN: -fno-gpu-flush-denormals-to-zero \
4242
// RUN: --rocm-path=%S/Inputs/rocm \
4343
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
44-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
44+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR
4545

4646

4747
// Test explicit flag, same as target default.
@@ -50,7 +50,7 @@
5050
// RUN: -fgpu-flush-denormals-to-zero \
5151
// RUN: --rocm-path=%S/Inputs/rocm \
5252
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
53-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
53+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
5454

5555

5656
// Test last flag wins, not flushing
@@ -59,53 +59,53 @@
5959
// RUN: -fgpu-flush-denormals-to-zero -fno-gpu-flush-denormals-to-zero \
6060
// RUN: --rocm-path=%S/Inputs/rocm \
6161
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
62-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
62+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR
6363

6464

6565
// RUN: %clang -### --target=x86_64-linux-gnu \
6666
// RUN: --cuda-gpu-arch=gfx900 \
6767
// RUN: -fgpu-flush-denormals-to-zero -fno-gpu-flush-denormals-to-zero \
6868
// RUN: --rocm-path=%S/Inputs/rocm \
6969
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
70-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
70+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,NOFLUSHD,ROCMDIR
7171

7272

7373
// RUN: %clang -### --target=x86_64-linux-gnu \
7474
// RUN: --cuda-gpu-arch=gfx900 \
7575
// RUN: -fno-gpu-flush-denormals-to-zero -fgpu-flush-denormals-to-zero \
7676
// RUN: --rocm-path=%S/Inputs/rocm \
7777
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
78-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
78+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
7979

8080

8181
// RUN: %clang -### --target=x86_64-linux-gnu \
8282
// RUN: --cuda-gpu-arch=gfx803 \
8383
// RUN: -fno-gpu-flush-denormals-to-zero -fgpu-flush-denormals-to-zero \
8484
// RUN: --rocm-path=%S/Inputs/rocm \
8585
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
86-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
86+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
8787

8888
// Test finding device lib in resource dir
8989
// RUN: %clang -### --target=x86_64-linux-gnu \
9090
// RUN: --offload-arch=gfx803 -nogpuinc \
9191
// RUN: -resource-dir=%S/Inputs/rocm_resource_dir \
9292
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
93-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,RESDIR
93+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,RESDIR
9494

9595
// Test --hip-device-lib-path flag
9696
// RUN: %clang -### --target=x86_64-linux-gnu \
9797
// RUN: --cuda-gpu-arch=gfx803 -nogpuinc \
9898
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \
9999
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
100-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
100+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
101101

102102
// Test --hip-device-lib-path wins over -resource-dir
103103
// RUN: %clang -### --target=x86_64-linux-gnu \
104104
// RUN: --cuda-gpu-arch=gfx803 -nogpuinc \
105105
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \
106106
// RUN: -resource-dir=%S/Inputs/rocm_resource_dir \
107107
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
108-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,ROCMDIR
108+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ALL,FLUSHD,ROCMDIR
109109

110110
// Test environment variable HIP_DEVICE_LIB_PATH
111111
// RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode \
@@ -213,26 +213,33 @@
213213

214214
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]ockl.bc"
215215

216+
// FLUSHD-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_daz_opt_on.bc"
217+
// NOFLUSHD-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_daz_opt_off.bc"
218+
216219
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_unsafe_math_off.bc"
217220
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_finite_only_off.bc"
218221
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_correctly_rounded_sqrt_on.bc"
219222
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_wavefrontsize64_on.bc"
220223
// ALL-SAME: "-mlink-builtin-bitcode" "[[DEVICELIB_DIR]]oclc_isa_version_{{[0-9]+}}.bc"
221224
// INST-SAME: "-mlink-builtin-bitcode" "{{.*}}instrument.bc"
222225

223-
// FAST: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"
226+
// FAST: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
227+
// FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"
224228
// FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_on.bc"
225229
// FAST-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
226230

227-
// FINITE: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
231+
// FINITE: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
232+
// FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
228233
// FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_on.bc"
229234
// FINITE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
230235

231-
// UNSAFE: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"
236+
// UNSAFE: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
237+
// UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_on.bc"
232238
// UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"
233239
// UNSAFE-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_on.bc"
234240

235-
// DIVSQRT: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
241+
// DIVSQRT: "-mlink-builtin-bitcode" "{{.*}}oclc_daz_opt_off.bc"
242+
// DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_unsafe_math_off.bc"
236243
// DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_finite_only_off.bc"
237244
// DIVSQRT-SAME: "-mlink-builtin-bitcode" "{{.*}}oclc_correctly_rounded_sqrt_off.bc"
238245

clang/test/Driver/rocm-device-libs.cl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: -x cl -mcpu=gfx900 \
77
// RUN: --rocm-path=%S/Inputs/rocm \
88
// RUN: %s \
9-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900,WAVE64 %s
9+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
1010

1111

1212

@@ -15,7 +15,7 @@
1515
// RUN: -x cl -mcpu=gfx803 \
1616
// RUN: --rocm-path=%S/Inputs/rocm \
1717
// RUN: %s \
18-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803,WAVE64 %s
18+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803-DEFAULT,GFX803,WAVE64 %s
1919

2020

2121

@@ -24,7 +24,7 @@
2424
// RUN: -x cl -mcpu=fiji \
2525
// RUN: --rocm-path=%S/Inputs/rocm \
2626
// RUN: %s \
27-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803,WAVE64 %s
27+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX803-DEFAULT,GFX803,WAVE64 %s
2828

2929

3030

@@ -33,15 +33,15 @@
3333
// RUN: -cl-denorms-are-zero \
3434
// RUN: --rocm-path=%S/Inputs/rocm \
3535
// RUN: %s \
36-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,GFX900,WAVE64 %s
36+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DAZ,GFX900,WAVE64 %s
3737

3838

3939
// RUN: %clang -### -target amdgcn-amd-amdhsa \
4040
// RUN: -x cl -mcpu=gfx803 \
4141
// RUN: -cl-denorms-are-zero \
4242
// RUN: --rocm-path=%S/Inputs/rocm \
4343
// RUN: %s \
44-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,GFX803,WAVE64 %s
44+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DAZ,GFX803,WAVE64 %s
4545

4646

4747

@@ -124,13 +124,13 @@
124124
// RUN: -x cl -mcpu=gfx900 \
125125
// RUN: --hip-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode \
126126
// RUN: %S/opencl.cl \
127-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900,WAVE64 %s
127+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
128128

129129
// Test environment variable HIP_DEVICE_LIB_PATH
130130
// RUN: env HIP_DEVICE_LIB_PATH=%S/Inputs/rocm/amdgcn/bitcode %clang -### -target amdgcn-amd-amdhsa \
131131
// RUN: -x cl -mcpu=gfx900 \
132132
// RUN: %S/opencl.cl \
133-
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900,WAVE64 %s
133+
// RUN: 2>&1 | FileCheck --check-prefixes=COMMON,COMMON-DEFAULT,GFX900-DEFAULT,GFX900,WAVE64 %s
134134

135135
// RUN: %clang -### -target amdgcn-amd-amdhsa \
136136
// RUN: -x cl -mcpu=gfx908:xnack+ -fsanitize=address \
@@ -150,6 +150,11 @@
150150
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ocml.bc"
151151
// COMMON-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/ockl.bc"
152152

153+
// GFX900-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_off.bc"
154+
// GFX803-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
155+
// GFX700-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
156+
// COMMON-DAZ-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_daz_opt_on.bc"
157+
153158

154159
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_unsafe_math_off.bc"
155160
// COMMON-DEFAULT-SAME: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_finite_only_off.bc"

flang/test/Driver/omp-driver-offload.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
! RUN: %flang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx900 \
185185
! RUN: --rocm-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode %s 2>&1 | \
186186
! RUN: FileCheck %s --check-prefix=ROCM-DEVICE-LIB
187-
! ROCM-DEVICE-LIB: "-fc1" {{.*}}ocml.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_900.bc"
187+
! ROCM-DEVICE-LIB: "-fc1" {{.*}}ocml.bc"{{.*}}oclc_daz_opt_off.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_900.bc"
188188

189189
! Test -fopenmp-force-usm option without offload
190190
! RUN: %flang -S -### %s -o %t 2>&1 \

0 commit comments

Comments
 (0)