File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -861,9 +861,16 @@ void AMDGPUToolChain::addClangTargetOptions(
861861 // For SPIR-V we want to retain the pristine output of Clang CodeGen, since
862862 // optimizations might lose structure / information that is necessary for
863863 // generating optimal concrete AMDGPU code.
864+ // TODO: using the below option is a temporary placeholder until Clang
865+ // provides the required functionality, which essentially boils down to
866+ // -O0 being refactored / reworked to not imply optnone / remove TBAA.
867+ // Once that is added, we should pivot to that functionality, being
868+ // mindful to not corrupt the user provided and subsequently embedded
869+ // command-line (i.e. if the user asks for -O3 this is what the
870+ // finalisation should use).
864871 if (getTriple ().isSPIRV () &&
865- !DriverArgs.hasArg (options::OPT_disable_llvm_passes ))
866- CC1Args.push_back (" -disable-llvm-passes " );
872+ !DriverArgs.hasArg (options::OPT_disable_llvm_optzns ))
873+ CC1Args.push_back (" -disable-llvm-optzns " );
867874
868875 if (DeviceOffloadingKind == Action::OFK_None)
869876 addOpenCLBuiltinsLib (getDriver (), DriverArgs, CC1Args);
Original file line number Diff line number Diff line change 1414
1515// RUN: %clang -### --target=spirv64-amd-amdhsa %s -nogpulib -nogpuinc 2>&1 \
1616// RUN: | FileCheck %s --check-prefix=INVOCATION
17- // INVOCATION: "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}}"-disable-llvm-passes " {{.*}} "-o" "[[OUTPUT:.+]]" "-x" "c"
17+ // INVOCATION: "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}}"-disable-llvm-optzns " {{.*}} "-o" "[[OUTPUT:.+]]" "-x" "c"
1818// INVOCATION: "{{.*}}llvm-link" "-o" "a.out" "[[OUTPUT]]"
1919// INVOCATION: "{{.*}}llvm-spirv" "--spirv-max-version=1.6" "--spirv-ext=+all" "--spirv-allow-unknown-intrinsics" "--spirv-lower-const-expr" "--spirv-preserve-auxdata" "--spirv-debug-info-version=nonsemantic-shader-200" "a.out" "-o" "a.out"
You can’t perform that action at this time.
0 commit comments