-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Add support for -foffload-fp32-prec-div/sqrt options. #15836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
f8caf83
00ffb5a
795dd38
78a9005
50e71c0
54f2409
bdf78d7
8cd6d8b
755d630
27011c8
ff2b3d9
07752e2
aa909d2
fcc4786
24711fd
56314b7
e643027
b25e5ac
ce00296
bc01759
c5fffc5
f2fb8b2
83c9b31
0efc825
e1de775
34f07cc
e18930f
410856d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -372,6 +372,8 @@ BENIGN_ENUM_LANGOPT(FPEvalMethod, FPEvalMethodKind, 2, FEM_UnsetOnCommandLine, " | |||||||||
| ENUM_LANGOPT(Float16ExcessPrecision, ExcessPrecisionKind, 2, FPP_Standard, "Intermediate truncation behavior for Float16 arithmetic") | ||||||||||
| ENUM_LANGOPT(BFloat16ExcessPrecision, ExcessPrecisionKind, 2, FPP_Standard, "Intermediate truncation behavior for BFloat16 arithmetic") | ||||||||||
| BENIGN_ENUM_LANGOPT(FPAccuracy, FPAccuracyKind, 3, FPA_Default, "Accuracy for floating point operations and library functions") | ||||||||||
| LANGOPT(OffloadFp32PrecDiv, 1, 1, "Return correctly rounded results of fdiv") | ||||||||||
| LANGOPT(OffloadFp32PrecSqrt, 1, 1, "Return correctly rounded results of sqrt") | ||||||||||
|
||||||||||
| LANGOPT(OffloadFp32PrecDiv, 1, 1, "Return correctly rounded results of fdiv") | |
| LANGOPT(OffloadFp32PrecSqrt, 1, 1, "Return correctly rounded results of sqrt") | |
| LANGOPT(OffloadFP32PrecDiv, 1, 1, "Return correctly rounded results of fdiv") | |
| LANGOPT(OffloadFP32PrecSqrt, 1, 1, "Return correctly rounded results of sqrt") |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1157,6 +1157,22 @@ defm cx_fortran_rules: BoolOptionWithoutMarshalling<"f", "cx-fortran-rules", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "Range reduction is disabled " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "for complex arithmetic operations">>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defm offload_fp32_prec_div: BoolOption<"f", "offload-fp32-prec-div", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LangOpts<"OffloadFp32PrecDiv">, DefaultTrue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PosFlag<SetTrue, [], [ClangOption, CC1Option], "fdiv operations in offload device " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "code are required to return correctly rounded results.">, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "fdiv operations in offload device " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "code are not required to return correctly rounded results.">>, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Group<f_Group>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defm offload_fp32_prec_sqrt: BoolOption<"f", "offload-fp32-prec-sqrt", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LangOpts<"OffloadFp32PrecSqrt">, DefaultTrue, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PosFlag<SetTrue, [], [ClangOption, CC1Option], "sqrt operations in offload device " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "code are required to return correctly rounded results.">, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "sqrt operations in offload device " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "code are not required to return correctly rounded results.">>, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Group<f_Group>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defm offload_fp32_prec_div: BoolOption<"f", "offload-fp32-prec-div", | |
| LangOpts<"OffloadFp32PrecDiv">, DefaultTrue, | |
| PosFlag<SetTrue, [], [ClangOption, CC1Option], "fdiv operations in offload device " | |
| "code are required to return correctly rounded results.">, | |
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "fdiv operations in offload device " | |
| "code are not required to return correctly rounded results.">>, | |
| Group<f_Group>; | |
| defm offload_fp32_prec_sqrt: BoolOption<"f", "offload-fp32-prec-sqrt", | |
| LangOpts<"OffloadFp32PrecSqrt">, DefaultTrue, | |
| PosFlag<SetTrue, [], [ClangOption, CC1Option], "sqrt operations in offload device " | |
| "code are required to return correctly rounded results.">, | |
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "sqrt operations in offload device " | |
| "code are not required to return correctly rounded results.">>, | |
| Group<f_Group>; | |
| defm offload_fp32_prec_div: BoolOption<"f", "offload-fp32-prec-div", | |
| LangOpts<"OffloadFp32PrecDiv">, DefaultTrue, | |
| PosFlag<SetTrue, [], [ClangOption, CC1Option], "fdiv operations in offload device " | |
| "code are required to return correctly rounded results.">, | |
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "fdiv operations in offload device " | |
| "code are not required to return correctly rounded results.">>, | |
| Group<f_Group>; | |
| defm offload_fp32_prec_sqrt: BoolOption<"f", "offload-fp32-prec-sqrt", | |
| LangOpts<"OffloadFp32PrecSqrt">, DefaultTrue, | |
| PosFlag<SetTrue, [], [ClangOption, CC1Option], "sqrt operations in offload device " | |
| "code are required to return correctly rounded results.">, | |
| NegFlag<SetFalse, [], [ClangOption, CC1Option], "sqrt operations in offload device " | |
| "code are not required to return correctly rounded results.">>, | |
| Group<f_Group>; |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24099,6 +24099,7 @@ llvm::CallInst *CodeGenFunction::MaybeEmitFPBuiltinofFD( | |||||||||
| .Case("sincos", llvm::Intrinsic::fpbuiltin_sincos) | ||||||||||
| .Case("exp10", llvm::Intrinsic::fpbuiltin_exp10) | ||||||||||
| .Case("rsqrt", llvm::Intrinsic::fpbuiltin_rsqrt) | ||||||||||
| .Case("sqrt", llvm::Intrinsic::fpbuiltin_sqrt) | ||||||||||
| .Default(0); | ||||||||||
| } else { | ||||||||||
| // The function has a clang builtin. Create an attribute for it | ||||||||||
|
|
@@ -24200,7 +24201,8 @@ llvm::CallInst *CodeGenFunction::MaybeEmitFPBuiltinofFD( | |||||||||
| // a TU fp-accuracy requested. | ||||||||||
| const LangOptions &LangOpts = getLangOpts(); | ||||||||||
| if (hasFuncNameRequestedFPAccuracy(Name, LangOpts) || | ||||||||||
| !LangOpts.FPAccuracyVal.empty()) { | ||||||||||
| !LangOpts.FPAccuracyVal.empty() || !LangOpts.OffloadFp32PrecDiv || | ||||||||||
| !LangOpts.OffloadFp32PrecSqrt) { | ||||||||||
|
||||||||||
| !LangOpts.FPAccuracyVal.empty() || !LangOpts.OffloadFp32PrecDiv || | |
| !LangOpts.OffloadFp32PrecSqrt) { | |
| !LangOpts.FPAccuracyVal.empty() || !LangOpts.OffloadFP32PrecDiv || | |
| !LangOpts.OffloadFP32PrecSqrt) { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1889,15 +1889,23 @@ void CodeGenModule::getDefaultFunctionFPAccuracyAttributes( | |
| Int32Ty, convertFPAccuracyToAspect(FuncMapIt->second))); | ||
| } | ||
| } | ||
| if (FuncAttrs.attrs().size() == 0) | ||
| if (FuncAttrs.attrs().size() == 0) { | ||
| StringRef FPAccuracyVal; | ||
| if (!getLangOpts().FPAccuracyVal.empty()) { | ||
| StringRef FPAccuracyVal = llvm::fp::getAccuracyForFPBuiltin( | ||
| FPAccuracyVal = llvm::fp::getAccuracyForFPBuiltin( | ||
| ID, FuncType, convertFPAccuracy(getLangOpts().FPAccuracyVal)); | ||
| assert(!FPAccuracyVal.empty() && "A valid accuracy value is expected"); | ||
| FuncAttrs.addAttribute("fpbuiltin-max-error", FPAccuracyVal); | ||
| MD = llvm::ConstantAsMetadata::get(llvm::ConstantInt::get( | ||
| Int32Ty, convertFPAccuracyToAspect(getLangOpts().FPAccuracyVal))); | ||
| } | ||
| if (Name == "sqrt" && !getLangOpts().OffloadFp32PrecSqrt) | ||
| FPAccuracyVal = "3.0"; | ||
| if (Name == "fdiv" && !getLangOpts().OffloadFp32PrecDiv) | ||
| FPAccuracyVal = "2.5"; | ||
| if (!FPAccuracyVal.empty()) | ||
| FuncAttrs.addAttribute("fpbuiltin-max-error", FPAccuracyVal); | ||
|
||
| } | ||
| } | ||
|
|
||
| /// Add denormal-fp-math and denormal-fp-math-f32 as appropriate for the | ||
|
|
@@ -5790,10 +5798,16 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, | |
| // Emit the actual call/invoke instruction. | ||
| llvm::CallBase *CI; | ||
| if (!InvokeDest) { | ||
| if (!getLangOpts().FPAccuracyFuncMap.empty() || | ||
| !getLangOpts().FPAccuracyVal.empty()) { | ||
| const auto *FD = dyn_cast_if_present<FunctionDecl>(TargetDecl); | ||
| if (FD && FD->getNameInfo().getName().isIdentifier()) { | ||
| const auto *FD = dyn_cast_if_present<FunctionDecl>(TargetDecl); | ||
| if (FD && FD->getNameInfo().getName().isIdentifier()) { | ||
| StringRef FuncName = FD->getName(); | ||
| const bool IsFloat32Type = FD->getReturnType()->isFloat32Type(); | ||
| if (!getLangOpts().FPAccuracyFuncMap.empty() || | ||
| !getLangOpts().FPAccuracyVal.empty() || | ||
| (FuncName == "sqrt" && !getLangOpts().OffloadFp32PrecSqrt && | ||
| IsFloat32Type) || | ||
| (FuncName == "fdiv" && !getLangOpts().OffloadFp32PrecDiv && | ||
| IsFloat32Type)) { | ||
| CI = MaybeEmitFPBuiltinofFD(IRFuncTy, IRCallArgs, CalleePtr, | ||
| FD->getName(), FD->getBuiltinID()); | ||
| if (CI) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1721,6 +1721,40 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args, | |||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| static void EmitAccuracyDiag(const Driver &D, const JobAction &JA, | ||||||||||||||||
| StringRef AccuracValStr, StringRef TargetPrecStr) { | ||||||||||||||||
| if (JA.isDeviceOffloading(Action::OFK_SYCL)) { | ||||||||||||||||
| D.Diag(clang::diag::warn_acuracy_conflicts_with_explicit_target_prec_option) | ||||||||||||||||
| << AccuracValStr << TargetPrecStr; | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| void Clang::AddSPIRTargetArgs(const ArgList &Args, ArgStringList &CmdArgs, | ||||||||||||||||
| const JobAction &JA, const Driver &D) const { | ||||||||||||||||
| if (JA.isDeviceOffloading(Action::OFK_SYCL)) { | ||||||||||||||||
| if (Arg *A = Args.getLastArg(options::OPT_ffp_model_EQ)) { | ||||||||||||||||
| if (!strcmp(A->getValue(), "fast")) { | ||||||||||||||||
| CmdArgs.push_back("-fno-offload-fp32-prec-div"); | ||||||||||||||||
| CmdArgs.push_back("-fno-offload-fp32-prec-sqrt"); | ||||||||||||||||
| } | ||||||||||||||||
mdtoguchi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||
| } | ||||||||||||||||
| if (Arg *A = Args.getLastArg(options::OPT_ffp_accuracy_EQ)) { | ||||||||||||||||
| if (Args.getLastArg(options::OPT_fno_offload_fp32_prec_div)) | ||||||||||||||||
| EmitAccuracyDiag(D, JA, A->getValue(), "-fno-offload-fp32-prec-div"); | ||||||||||||||||
| if (Args.getLastArg(options::OPT_fno_offload_fp32_prec_sqrt)) | ||||||||||||||||
| EmitAccuracyDiag(D, JA, A->getValue(), "-fno-offload-fp32-prec-sqrt"); | ||||||||||||||||
| } | ||||||||||||||||
| if (Args.getLastArg(options::OPT_fno_offload_fp32_prec_div)) | ||||||||||||||||
| CmdArgs.push_back("-fno-offload-fp32-prec-div"); | ||||||||||||||||
| else | ||||||||||||||||
| CmdArgs.push_back("-foffload-fp32-prec-div"); | ||||||||||||||||
|
||||||||||||||||
| if (Args.getLastArg(options::OPT_fno_offload_fp32_prec_div)) | |
| CmdArgs.push_back("-fno-offload-fp32-prec-div"); | |
| else | |
| CmdArgs.push_back("-foffload-fp32-prec-div"); | |
| if (!Args.hasFlag(option::OPT_foffload_fp32_prec_div, | |
| option::OPT_fno_offload_fp32_prec_div, true)) | |
| CmdArgs.push_back("-fno-offload-fp32-prec-div"); |
Since -foffload-fp32-prec-div is default
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar comment to above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inadvertent line removal?
mdtoguchi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,14 +47,18 @@ class LLVM_LIBRARY_VISIBILITY Clang : public Tool { | |
|
|
||
| void RenderTargetOptions(const llvm::Triple &EffectiveTriple, | ||
| const llvm::opt::ArgList &Args, bool KernelOrKext, | ||
| llvm::opt::ArgStringList &CmdArgs) const; | ||
| llvm::opt::ArgStringList &CmdArgs, | ||
| const JobAction &JA) const; | ||
|
|
||
| void AddAArch64TargetArgs(const llvm::opt::ArgList &Args, | ||
| llvm::opt::ArgStringList &CmdArgs) const; | ||
| void AddARMTargetArgs(const llvm::Triple &Triple, | ||
| const llvm::opt::ArgList &Args, | ||
| llvm::opt::ArgStringList &CmdArgs, | ||
| bool KernelOrKext) const; | ||
| void AddSPIRTargetArgs(const llvm::opt::ArgList &Args, | ||
| llvm::opt::ArgStringList &CmdArgs, const JobAction &JA, | ||
| const Driver &D) const; | ||
|
||
| void AddARM64TargetArgs(const llvm::opt::ArgList &Args, | ||
| llvm::opt::ArgStringList &CmdArgs) const; | ||
| void AddLoongArchTargetArgs(const llvm::opt::ArgList &Args, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| // DEFINE: %{common_opts} = -internal-isystem %S/Inputs -fsycl-is-device \ | ||
| // DEFINE: -emit-llvm -triple spir64-unknown-unknown | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} %s -o - \ | ||
| // RUN: | FileCheck --check-prefix PREC-SQRT %s | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} -foffload-fp32-prec-sqrt %s -o - \ | ||
| // RUN: | FileCheck --check-prefix PREC-SQRT %s | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} -fno-offload-fp32-prec-sqrt %s -o - \ | ||
| // RUN: | FileCheck --check-prefix ROUNDED-SQRT %s | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} -foffload-fp32-prec-div %s -o - \ | ||
| // RUN: | FileCheck --check-prefix PREC-DIV %s | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} -fno-offload-fp32-prec-div %s -o - \ | ||
| // RUN: | FileCheck --check-prefix ROUNDED-DIV %s | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} -ffast-math -fno-offload-fp32-prec-div \ | ||
| // RUN: -fno-offload-fp32-prec-sqrt %s -o - \ | ||
| // RUN: | FileCheck --check-prefix ROUNDED-SQRT-FAST %s | ||
|
|
||
| // RUN: %clang_cc1 %{common_opts} -ffast-math -fno-offload-fp32-prec-div \ | ||
| // RUN: -fno-offload-fp32-prec-sqrt %s -o - \ | ||
| // RUN: | FileCheck --check-prefix ROUNDED-DIV-FAST %s | ||
|
|
||
| #include "sycl.hpp" | ||
|
|
||
| extern "C" SYCL_EXTERNAL float sqrt(float); | ||
| extern "C" SYCL_EXTERNAL float fdiv(float, float); | ||
|
|
||
| using namespace sycl; | ||
|
|
||
| int main() { | ||
| const unsigned array_size = 4; | ||
| range<1> numOfItems{array_size}; | ||
| float Value1 = .5f; | ||
| float Value2 = .9f; | ||
| queue deviceQueue; | ||
|
|
||
| deviceQueue.submit([&](handler& cgh) { | ||
| cgh.parallel_for<class KernelSqrt>(numOfItems, | ||
| [=](id<1> wiID) { | ||
| // PREC-SQRT: call spir_func float @sqrt(float noundef {{.*}}) | ||
| // ROUNDED-SQRT: call float @llvm.fpbuiltin.sqrt.f32(float {{.*}}) #[[ATTR_SQRT:[0-9]+]] | ||
| // ROUNDED-DIV: call spir_func float @sqrt(float noundef {{.*}}) | ||
| (void)sqrt(Value1); | ||
| }); | ||
| }); | ||
|
|
||
| deviceQueue.submit([&](handler& cgh) { | ||
| cgh.parallel_for<class KernelFdiv>(numOfItems, | ||
| [=](id<1> wiID) { | ||
| // PREC-SQRT: call spir_func float @fdiv(float noundef {{.*}}, float noundef {{.*}}) | ||
| // ROUNDED-SQRT: call spir_func float @fdiv(float noundef {{.*}}, float noundef {{.*}}) | ||
|
|
||
| // ROUNDED-SQRT-FAST: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.sqrt.f32(float {{.*}}) #[[ATTR_SQRT:[0-9]+]] | ||
|
|
||
| // PREC-DIV: call spir_func float @fdiv(float noundef {{.*}}, float noundef {{.*}}) | ||
| // ROUNDED-DIV: call float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]] | ||
| // ROUNDED-DIV-FAST: call reassoc nnan ninf nsz arcp afn float @llvm.fpbuiltin.fdiv.f32(float {{.*}}, float {{.*}}) #[[ATTR_DIV:[0-9]+]] | ||
| (void)fdiv(Value1, Value1); | ||
| }); | ||
| }); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| // ROUNDED-SQRT: attributes #[[ATTR_SQRT]] = {{.*}}"fpbuiltin-max-error"="3.0" | ||
| // ROUNDED-SQRT-FAST: attributes #[[ATTR_SQRT]] = {{.*}}"fpbuiltin-max-error"="3.0" | ||
| // ROUNDED-DIV: attributes #[[ATTR_DIV]] = {{.*}}"fpbuiltin-max-error"="2.5" | ||
| // ROUNDED-DIV-FAST: attributes #[[ATTR_DIV]] = {{.*}}"fpbuiltin-max-error"="2.5" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // RUN: %clang -c -fsycl -### %s 2>&1 | FileCheck %s | ||
|
|
||
| // RUN: %clang -c -fsycl -foffload-fp32-prec-div -### %s 2>&1 | FileCheck %s | ||
|
|
||
| // RUN: %clang -c -fsycl -foffload-fp32-prec-sqrt -### %s 2>&1 | FileCheck %s | ||
|
|
||
| // RUN: %clang -c -fsycl -foffload-fp32-prec-div -foffload-fp32-prec-sqrt -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s | ||
|
|
||
| // RUN: %clang -c -fsycl -foffload-fp32-prec-sqrt -foffload-fp32-prec-div -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s | ||
|
|
||
| // RUN: %clang -c -fsycl -fno-offload-fp32-prec-div -### %s 2>&1 \ | ||
| // RUN: | FileCheck --check-prefix=NO_PREC_DIV %s | ||
|
|
||
| // RUN: %clang -c -fsycl -fno-offload-fp32-prec-sqrt -### %s 2>&1 \ | ||
| // RUN: | FileCheck --check-prefix=NO_PREC_SQRT %s | ||
|
|
||
| // RUN: %clang -c -fsycl -fno-offload-fp32-prec-div -fno-offload-fp32-prec-sqrt -### %s 2>&1\ | ||
| // RUN: | FileCheck --check-prefix=NO_PREC_DIV_SQRT %s | ||
|
|
||
| // RUN: %clang -c -fsycl -fno-offload-fp32-prec-sqrt -fno-offload-fp32-prec-div -### %s 2>&1\ | ||
| // RUN: | FileCheck --check-prefix=NO_PREC_DIV_SQRT %s | ||
|
|
||
| // RUN: %clang -c -fsycl -ffp-accuracy=high -fno-math-errno \ | ||
| // RUN: -fno-offload-fp32-prec-div -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=WARN-HIGH-DIV | ||
|
|
||
| // RUN: %clang -c -fsycl -fno-offload-fp32-prec-div -ffp-accuracy=high \ | ||
| // RUN: -fno-math-errno -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=WARN-HIGH-DIV | ||
|
|
||
| // RUN: %clang -c -fsycl -fno-offload-fp32-prec-sqrt -ffp-accuracy=high \ | ||
| // RUN: -fno-math-errno -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=WARN-HIGH-SQRT | ||
|
|
||
| // RUN: %clang -c -fsycl -ffp-accuracy=high -fno-math-errno \ | ||
| // RUN: -fno-offload-fp32-prec-sqrt -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=WARN-HIGH-SQRT | ||
|
|
||
| // RUN: %clang -c -fsycl -ffp-accuracy=low -fno-math-errno -fno-offload-fp32-prec-div \ | ||
| // RUN: -### %s 2>&1 | FileCheck %s --check-prefix=WARN-LOW-DIV | ||
|
|
||
| // RUN: %clang -c -fsycl -ffp-accuracy=low -fno-math-errno \ | ||
| // RUN: -fno-offload-fp32-prec-sqrt -### %s 2>&1 \ | ||
| // RUN: | FileCheck %s --check-prefix=WARN-LOW-SQRT | ||
|
|
||
| // CHECK: "-triple" "spir64{{.*}}" "-fsycl-is-device"{{.*}} "-foffload-fp32-prec-div" "-foffload-fp32-prec-sqrt" | ||
| // CHECK-NOT: "-triple{{.*}}" "-fsycl-is-host"{{.*}} "-foffload-fp32-prec-div" "-foffload-fp32-prec-sqrt" | ||
| // NO_PREC_DIV: "-triple" "spir64{{.*}}"{{.*}} "-fsycl-is-device"{{.*}} "-fno-offload-fp32-prec-div" "-foffload-fp32-prec-sqrt" | ||
| // NO_PREC_SQRT: "-triple" "spir64{{.*}}" "-fsycl-is-device"{{.*}} "-foffload-fp32-prec-div" "-fno-offload-fp32-prec-sqrt" | ||
| // NO_PREC_DIV_SQRT: "-triple" "spir64{{.*}}" "-fsycl-is-device"{{.*}} "-fno-offload-fp32-prec-div" "-fno-offload-fp32-prec-sqrt" | ||
| // RUN: %clang -c -fsycl -ffp-model=fast -### %s 2>&1 | FileCheck --check-prefix=FAST %s | ||
|
|
||
| // WARN-HIGH-DIV: floating point accuracy control 'high' conflicts with explicit target precision option '-fno-offload-fp32-prec-div' | ||
| // WARN-HIGH-SQRT: floating point accuracy control 'high' conflicts with explicit target precision option '-fno-offload-fp32-prec-sqrt' | ||
| // WARN-LOW-DIV: floating point accuracy control 'low' conflicts with explicit target precision option '-fno-offload-fp32-prec-div' | ||
| // WARN-LOW-SQRT: floating point accuracy control 'low' conflicts with explicit target precision option '-fno-offload-fp32-prec-sqrt' | ||
| // FAST: "-triple" "spir64{{.*}}"{{.*}} "-fsycl-is-device"{{.*}} "-fno-offload-fp32-prec-div" "-fno-offload-fp32-prec-sqrt" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.