Skip to content

Commit bae7012

Browse files
authored
[SYCL][Driver][FPGA] Remove support for FPGA related options (#16864)
Removes support for any FPGA related options and any options that use FPGA specific arguments. Upon usage of any of these options, a specific error will be emitted: > clang++ -fintelfpga file.cpp clang++: error: option '-fintelfpga' is not supported and has been removed from the compiler. Please see the compiler documentation for more details The following options are being handled: - -fintelfpga - -fsycl-targets=spir64_fpga[-unknown-unknown] - -fsycl-link=early/image - -Xsycl-target-backend=spir64_fpga "opt" - -reuse-exe=arg - -fsycl-help=fpga This mainly removes support of the options as specified, subsequent cleanup of driver behaviors will be done in a later change. Due to the broad impact of these changes, all associated LIT tests have been updated/removed. Associated issue: #16929
1 parent c812d8b commit bae7012

File tree

78 files changed

+126
-3371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+126
-3371
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ def err_drv_unsupported_option_argument : Error<
2222
"unsupported argument '%1' to option '%0'">;
2323
def err_drv_unsupported_option_argument_for_target : Error<
2424
"unsupported argument '%1' to option '%0' for target '%2'">;
25+
def err_drv_unsupported_opt_removed : Error<
26+
"option '%0' is not supported and has been removed from the compiler. Please "
27+
"see the compiler documentation for more details">;
2528
def err_drv_unknown_stdin_type : Error<
2629
"-E or -x required when input is from standard input">;
2730
def err_drv_unknown_stdin_type_clang_cl : Error<

clang/include/clang/Driver/Driver.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,11 @@ class Driver {
617617

618618
/// getSYCLDeviceTriple - Returns the SYCL device triple for the
619619
/// specified subarch
620-
llvm::Triple getSYCLDeviceTriple(StringRef TargetArch = "spir64") const;
620+
// TODO: Additional Arg input parameter is for diagnostic output information
621+
// regarding FPGA support removal. This should be cleaned up in a future
622+
// release.
623+
llvm::Triple getSYCLDeviceTriple(StringRef TargetArch = "spir64",
624+
const llvm::opt::Arg *Arg = nullptr) const;
621625

622626
/// PrintActions - Print the list of actions.
623627
void PrintActions(const Compilation &C) const;

clang/include/clang/Driver/Options.h

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum ClangFlags {
2727
Ignored = (1 << 9),
2828
TargetSpecific = (1 << 10),
2929
Deprecated = (1 << 11),
30+
UnsupportedRemoved = (1 << 12),
3031
};
3132

3233
// Flags specifically for clang option visibility. We alias DefaultVis to

clang/include/clang/Driver/Options.td

+11-9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ def NoArgumentUnused : OptionFlag;
5151
// lines that use it.
5252
def Unsupported : OptionFlag;
5353

54+
// UnsupportedRemoved - The option is unsupported and recently removed. Allows
55+
// for special diagnostic handling, and the driver will reject command
56+
// lines that use it.
57+
def UnsupportedRemoved : OptionFlag;
58+
5459
// Ignored - The option is unsupported, and the driver will silently ignore it.
5560
def Ignored : OptionFlag;
5661

@@ -6982,8 +6987,8 @@ defm : FlangIgnoredDiagOpt<"target-lifetime">;
69826987

69836988
// C++ SYCL options
69846989
let Group = sycl_Group in {
6985-
def reuse_exe_EQ : Joined<["-"], "reuse-exe=">, Visibility<[ClangOption, CLOption, DXCOption]>,
6986-
HelpText<"Speed up FPGA aoc compile if the device code in <exe> is unchanged.">,
6990+
def reuse_exe_EQ : Joined<["-"], "reuse-exe=">,
6991+
Visibility<[ClangOption, CLOption, DXCOption]>, Flags<[UnsupportedRemoved]>,
69876992
MetaVarName<"<exe>">;
69886993
def fsycl : Flag<["-"], "fsycl">,
69896994
HelpText<"Enable SYCL C++ extensions">;
@@ -7031,10 +7036,9 @@ def fsycl_default_sub_group_size
70317036
def fsycl_default_sub_group_size_EQ
70327037
: Joined<["-"], "fsycl-default-sub-group-size=">,
70337038
Alias<fsycl_default_sub_group_size>, Visibility<[ClangOption, CC1Option]>;
7034-
def fintelfpga : Flag<["-"], "fintelfpga">,
7039+
def fintelfpga : Flag<["-"], "fintelfpga">, Flags<[UnsupportedRemoved]>,
70357040
Visibility<[ClangOption, CLOption, CC1Option]>,
7036-
MarshallingInfoFlag<LangOpts<"IntelFPGA">>,
7037-
HelpText<"Perform ahead-of-time compilation for FPGA">;
7041+
MarshallingInfoFlag<LangOpts<"IntelFPGA">>;
70387042
def fsycl_embed_ir : Flag<["-"], "fsycl-embed-ir">,
70397043
HelpText<"Embed LLVM IR for runtime kernel fusion">;
70407044
defm sycl_esimd_force_stateless_mem : BoolFOption<"sycl-esimd-force-stateless-mem",
@@ -7131,11 +7135,9 @@ def fsycl_use_bitcode : Flag<["-"], "fsycl-use-bitcode">,
71317135
def fno_sycl_use_bitcode : Flag<["-"], "fno-sycl-use-bitcode">,
71327136
Alias<fsycl_device_obj_EQ>, AliasArgs<["spirv"]>, Flags<[Deprecated]>,
71337137
HelpText<"Use SPIR-V instead of LLVM bitcode in fat objects (deprecated)">;
7134-
def fsycl_link_EQ : Joined<["-"], "fsycl-link=">,
7135-
HelpText<"Generate partially linked device and host object to be used at "
7136-
"various stages of compilation">, Values<"image,early">;
7138+
def fsycl_link_EQ : Joined<["-"], "fsycl-link=">;
71377139
def fsycl_link : Flag<["-"], "fsycl-link">, Alias<fsycl_link_EQ>,
7138-
AliasArgs<["early"]>, HelpText<"Generate partially linked device object to "
7140+
AliasArgs<["default"]>, HelpText<"Generate partially linked device object to "
71397141
"be used with the host link">;
71407142
defm sycl_unnamed_lambda
71417143
: BoolFOption<

clang/lib/Driver/Driver.cpp

+44-8
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ InputArgList Driver::ParseArgStrings(ArrayRef<const char *> ArgStrings,
340340
DiagnosticsEngine::Warning;
341341
continue;
342342
}
343+
// Emit an unsupported and removed diagnostic for any options that were
344+
// previously supported and subsequently removed. This is considered a
345+
// special case scenario that is currently being used for FPGA related
346+
// options that did not go through the regular deprecation process.
347+
if (A->getOption().hasFlag(options::UnsupportedRemoved)) {
348+
Diag(diag::err_drv_unsupported_opt_removed) << A->getAsString(Args);
349+
ContainsError |= Diags.getDiagnosticLevel(
350+
diag::err_drv_unsupported_opt_removed,
351+
SourceLocation()) > DiagnosticsEngine::Warning;
352+
continue;
353+
}
343354

344355
// Deprecated options emit a diagnostic about deprecation, but are still
345356
// supported until removed. It's possible to have a deprecated option which
@@ -886,6 +897,10 @@ static bool isValidSYCLTriple(llvm::Triple T) {
886897
((T.getArch() == llvm::Triple::spir && A != "spir") ||
887898
(T.getArch() == llvm::Triple::spir64 && A != "spir64")))
888899
return false;
900+
901+
// spir64_fpga is not supported.
902+
if (T.isSPIR() && T.getSubArch() == llvm::Triple::SPIRSubArch_fpga)
903+
return false;
889904
return true;
890905
}
891906

@@ -896,10 +911,19 @@ static const char *getDefaultSYCLArch(Compilation &C) {
896911
return "spir64";
897912
}
898913

899-
llvm::Triple Driver::getSYCLDeviceTriple(StringRef TargetArch) const {
914+
llvm::Triple Driver::getSYCLDeviceTriple(StringRef TargetArch,
915+
const Arg *Arg) const {
900916
SmallVector<StringRef, 5> SYCLAlias = {
901917
"spir", "spir64", "spir64_fpga", "spir64_x86_64",
902918
"spir64_gen", "spirv32", "spirv64", "nvptx64"};
919+
// spir64_fpga is no longer supported.
920+
llvm::Triple TargetTriple(TargetArch);
921+
if (Arg && !Arg->isClaimed() && TargetTriple.isSPIR() &&
922+
TargetTriple.getSubArch() == llvm::Triple::SPIRSubArch_fpga) {
923+
Diag(diag::err_drv_unsupported_opt_removed)
924+
<< Arg->getSpelling().str() + TargetArch.str();
925+
Arg->claim();
926+
}
903927
if (llvm::is_contained(SYCLAlias, TargetArch)) {
904928
llvm::Triple TT;
905929
TT.setArchName(TargetArch);
@@ -1239,8 +1263,17 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12391263
<< ArgValue << A->getOption().getName();
12401264
};
12411265

1266+
// TODO: Transition to using -fsycl-link as a flag as opposed to an option
1267+
// that takes an argument. The use of 'default' is a temporary solution as we
1268+
// remove FPGA support.
12421269
Arg *SYCLLink = getArgRequiringSYCLRuntime(options::OPT_fsycl_link_EQ);
1243-
checkSingleArgValidity(SYCLLink, {"early", "image"});
1270+
checkSingleArgValidity(SYCLLink, {"early", "image", "default"});
1271+
1272+
// Use of -fsycl-link=early and -fsycl-link=image are not supported.
1273+
if (SYCLLink && (SYCLLink->getValue() == StringRef("early") ||
1274+
SYCLLink->getValue() == StringRef("image")))
1275+
Diag(diag::err_drv_unsupported_opt_removed)
1276+
<< SYCLLink->getAsString(C.getInputArgs());
12441277

12451278
Arg *DeviceCodeSplit =
12461279
C.getInputArgs().getLastArg(options::OPT_fsycl_device_code_split_EQ);
@@ -1268,7 +1301,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
12681301
getArgRequiringSYCLRuntime(options::OPT_fsycl_force_target_EQ);
12691302
if (SYCLForceTarget) {
12701303
StringRef Val(SYCLForceTarget->getValue());
1271-
llvm::Triple TT(getSYCLDeviceTriple(Val));
1304+
llvm::Triple TT(getSYCLDeviceTriple(Val, SYCLForceTarget));
12721305
if (!isValidSYCLTriple(TT))
12731306
Diag(clang::diag::err_drv_invalid_sycl_target) << Val;
12741307
}
@@ -2730,7 +2763,6 @@ void Driver::PrintHelp(bool ShowHidden) const {
27302763
VisibilityMask);
27312764
}
27322765

2733-
27342766
// Print the help from any of the given tools which are used for AOT
27352767
// compilation for SYCL
27362768
void Driver::PrintSYCLToolHelp(const Compilation &C) const {
@@ -2743,9 +2775,12 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
27432775
if (AV == "gen" || AV == "all")
27442776
HelpArgs.push_back(std::make_tuple(getSYCLDeviceTriple("spir64_gen"),
27452777
"ocloc", "--help", ""));
2746-
if (AV == "fpga" || AV == "all")
2778+
if (AV == "fpga") {
2779+
Diag(diag::err_drv_unsupported_opt_removed)
2780+
<< A->getSpelling().str() + AV.str();
27472781
HelpArgs.push_back(std::make_tuple(getSYCLDeviceTriple("spir64_fpga"),
27482782
"aoc", "-help", "-sycl"));
2783+
}
27492784
if (AV == "x86_64" || AV == "all")
27502785
HelpArgs.push_back(std::make_tuple(getSYCLDeviceTriple("spir64_x86_64"),
27512786
"opencl-aot", "--help", ""));
@@ -4003,9 +4038,9 @@ bool Driver::checkForSYCLDefaultDevice(Compilation &C,
40034038

40044039
// Do not do the check if the default device is passed in -fsycl-targets
40054040
// or if -fsycl-targets isn't passed (that implies default device)
4006-
if (const Arg *A = Args.getLastArg(options::OPT_fsycl_targets_EQ)) {
4041+
if (const Arg *A = Args.getLastArgNoClaim(options::OPT_fsycl_targets_EQ)) {
40074042
for (const char *Val : A->getValues()) {
4008-
llvm::Triple TT(C.getDriver().getSYCLDeviceTriple(Val));
4043+
llvm::Triple TT(C.getDriver().getSYCLDeviceTriple(Val, A));
40094044
if ((TT.isSPIROrSPIRV()) && TT.getSubArch() == llvm::Triple::NoSubArch)
40104045
// Default triple found
40114046
return false;
@@ -6652,7 +6687,8 @@ class OffloadingActionBuilder final {
66526687
continue;
66536688
}
66546689

6655-
llvm::Triple TT(C.getDriver().getSYCLDeviceTriple(Val));
6690+
llvm::Triple TT(
6691+
C.getDriver().getSYCLDeviceTriple(Val, SYCLTargetsValues));
66566692
std::string NormalizedName = TT.normalize();
66576693

66586694
// Make sure we don't have a duplicate triple.

clang/lib/Driver/ToolChain.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ llvm::opt::DerivedArgList *ToolChain::TranslateOffloadTargetArgs(
17201720
A->getOption().matches(options::OPT_Xsycl_frontend);
17211721
if (A->getOption().matches(options::OPT_Xsycl_frontend_EQ)) {
17221722
// Passing device args: -Xsycl-target-frontend=<triple> -opt=val.
1723-
if (getDriver().getSYCLDeviceTriple(A->getValue(0)) == Triple)
1723+
if (getDriver().getSYCLDeviceTriple(A->getValue(0), A) == Triple)
17241724
Index = Args.getBaseArgs().MakeIndex(A->getValue(1));
17251725
else
17261726
continue;

clang/lib/Driver/ToolChains/SYCL.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1870,23 +1870,23 @@ void SYCLToolChain::TranslateTargetOpt(const llvm::Triple &Triple,
18701870
bool OptNoTriple;
18711871
OptNoTriple = A->getOption().matches(Opt);
18721872
if (A->getOption().matches(Opt_EQ)) {
1873+
const llvm::Triple OptTargetTriple =
1874+
getDriver().getSYCLDeviceTriple(A->getValue(), A);
18731875
// Passing device args: -X<Opt>=<triple> -opt=val.
18741876
StringRef GenDevice = SYCL::gen::resolveGenDevice(A->getValue());
18751877
bool IsGenTriple = Triple.isSPIR() &&
18761878
Triple.getSubArch() == llvm::Triple::SPIRSubArch_gen;
18771879
if (IsGenTriple) {
18781880
if (Device != GenDevice && !Device.empty())
18791881
continue;
1880-
if (getDriver().getSYCLDeviceTriple(A->getValue()) != Triple &&
1881-
GenDevice.empty())
1882+
if (OptTargetTriple != Triple && GenDevice.empty())
18821883
// Triples do not match, but only skip when we know we are not
18831884
// comparing against intel_gpu_*
18841885
continue;
1885-
if (getDriver().getSYCLDeviceTriple(A->getValue()) == Triple &&
1886-
!Device.empty())
1886+
if (OptTargetTriple == Triple && !Device.empty())
18871887
// Triples match, but we are expecting a specific device to be set.
18881888
continue;
1889-
} else if (getDriver().getSYCLDeviceTriple(A->getValue()) != Triple)
1889+
} else if (OptTargetTriple != Triple)
18901890
continue;
18911891
} else if (!OptNoTriple)
18921892
// Don't worry about any of the other args, we only want to pass what is

clang/test/CodeGenSYCL/fpga-attr-do-while-loops.cpp

-26
This file was deleted.

clang/test/Driver/ftarget-export-symbols.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@
2222
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl \
2323
// RUN: -fsycl-targets=spir64_x86_64 -ftarget-export-symbols %s 2>&1 \
2424
// RUN: | FileCheck -check-prefix=UNUSED %s
25-
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl \
26-
// RUN: -fsycl-targets=spir64_fpga -ftarget-export-symbols %s 2>&1 \
27-
// RUN: | FileCheck -check-prefix=UNUSED %s
2825

2926
// UNUSED: argument unused during compilation: '-ftarget-export-symbols'

clang/test/Driver/suppress-LNK4078-sycl-link.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,4 @@
22
// RUN: | FileCheck %s
33
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl %s -### 2>&1 \
44
// RUN: | FileCheck %s
5-
// RUN: %clangxx -target x86_64-pc-windows-msvc -fsycl -fintelfpga -fsycl-link=early %s -### 2>&1 \
6-
// RUN: | FileCheck %s
7-
// RUN: %clangxx -target x86_64-pc-windows-msvc -fsycl -fintelfpga -fsycl-link=image %s -### 2>&1 \
8-
// RUN: | FileCheck %s
9-
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl -fintelfpga -fsycl-link=early %s -### 2>&1 \
10-
// RUN: | FileCheck %s
11-
// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl -fintelfpga -fsycl-link=image %s -### 2>&1 \
12-
// RUN: | FileCheck %s
135
// CHECK: /IGNORE:4078

clang/test/Driver/suppress_LNK4221_intelfpga_sycl-link.cpp

-6
This file was deleted.

clang/test/Driver/sycl-add-default-spec-consts-image-old-model.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
// Check that no warnings are issued in correct cases and "-generate-device-image-default-spec-consts" is passed to sycl-post-link
1313
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image -fsycl-targets=spir64_gen 2>&1 %s | FileCheck %s -check-prefix=CHECK-AOT
14-
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image -fsycl-targets=spir64_fpga 2>&1 %s | FileCheck %s -check-prefix=CHECK-AOT
1514
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image -fsycl-targets=spir64_x86_64 2>&1 %s | FileCheck %s -check-prefix=CHECK-AOT
1615
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image -fsycl-targets=intel_gpu_pvc 2>&1 %s | FileCheck %s -check-prefix=CHECK-AOT
1716
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-add-default-spec-consts-image -fsycl-targets=nvidia_gpu_sm_90 -nocudalib 2>&1 %s | FileCheck %s -check-prefix=CHECK-AOT

clang/test/Driver/sycl-device-optimizations-old-model.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
88
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-only %s 2>&1 \
99
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
10-
// RUN: %clang -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \
11-
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
12-
// RUN: %clang_cl -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \
13-
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
1410
// CHECK-DEFAULT-NOT: "-fno-sycl-early-optimizations"
1511
// CHECK-DEFAULT-NOT: "-disable-llvm-passes"
1612
// CHECK-DEFAULT: "-fsycl-is-device"
@@ -25,10 +21,6 @@
2521
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
2622
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-only -fno-sycl-early-optimizations %s 2>&1 \
2723
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
28-
// RUN: %clang -### -fintelfpga %s 2>&1 \
29-
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
30-
// RUN: %clang_cl -### -fintelfpga %s 2>&1 \
31-
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
3224
// CHECK-NO-SYCL-EARLY-OPTS: "-fno-sycl-early-optimizations"
3325

3426
/// Check that Dead Parameter Elimination Optimization is enabled

clang/test/Driver/sycl-device-optimizations.cpp

-42
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
88
// RUN: %clang_cl -### -fsycl --offload-new-driver -fsycl-device-only %s 2>&1 \
99
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
10-
// RUN: %clang -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \
11-
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
12-
// RUN: %clang_cl -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \
13-
// RUN: | FileCheck -check-prefix=CHECK-DEFAULT %s
1410
// CHECK-DEFAULT-NOT: "-fno-sycl-early-optimizations"
1511
// CHECK-DEFAULT-NOT: "-disable-llvm-passes"
1612
// CHECK-DEFAULT: "-fsycl-is-device"
@@ -25,10 +21,6 @@
2521
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
2622
// RUN: %clang_cl -### -fsycl --offload-new-driver -fsycl-device-only -fno-sycl-early-optimizations %s 2>&1 \
2723
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
28-
// RUN: %clang -### -fintelfpga %s 2>&1 \
29-
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
30-
// RUN: %clang_cl -### -fintelfpga %s 2>&1 \
31-
// RUN: | FileCheck -check-prefix=CHECK-NO-SYCL-EARLY-OPTS %s
3224
// CHECK-NO-SYCL-EARLY-OPTS: "-fno-sycl-early-optimizations"
3325

3426
/// Check that Dead Parameter Elimination Optimization is enabled
@@ -75,37 +67,3 @@
7567
// CHECK-G-O3: clang{{.*}} "-fsycl-is-device{{.*}}" "-O3"
7668
// CHECK-G-O3: sycl-post-link{{.*}} "-O3"
7769
// CHECK-G-O3-NOT: "-O0"
78-
79-
/// Check that -O2 is passed for FPGA
80-
// RUN: %clang -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \
81-
// RUN: | FileCheck -check-prefix=CHECK-FPGA %s
82-
// RUN: %clang_cl -### -fintelfpga -fsycl-early-optimizations %s 2>&1 \
83-
// RUN: | FileCheck -check-prefix=CHECK-FPGA %s
84-
// CHECK-FPGA: clang{{.*}} "-fsycl-is-device{{.*}}" "-O2"
85-
// CHECK-FPGA: sycl-post-link{{.*}} "-O2"
86-
// CHECK-FPGA-NOT: "-O0"
87-
88-
/// Check that -O2 preserves for FPGA when it's explicitly passed
89-
// RUN: %clang -### -O2 -fintelfpga -fsycl-early-optimizations %s 2>&1 \
90-
// RUN: | FileCheck -check-prefix=CHECK-FPGA-O2 %s
91-
// For clang_cl, -O2 maps to -O3
92-
// RUN: %clang_cl -### -O2 -fintelfpga -fsycl-early-optimizations %s 2>&1 \
93-
// RUN: | FileCheck -check-prefix=CHECK-FPGA-O3 %s
94-
// CHECK-FPGA-O2: clang{{.*}} "-fsycl-is-device{{.*}}" "-O2"
95-
// CHECK-FPGA-O2: sycl-post-link{{.*}} "-O2"
96-
// CHECK-FPGA-O2-NOT: "-O0"
97-
// CHECK-FPGA-O3: clang{{.*}} "-fsycl-is-device{{.*}}" "-O3"
98-
// CHECK-FPGA-O3: sycl-post-link{{.*}} "-O3"
99-
// CHECK-FPGA-O3-NOT: "-O0"
100-
101-
/// Check that -O0 is passed for FPGA when -g is explicitly passed
102-
// RUN: %clang -### -fintelfpga -g %s 2>&1 \
103-
// RUN: | FileCheck -check-prefix=CHECK-FPGA-O0 %s
104-
// RUN: %clang_cl -### -fintelfpga -g %s 2>&1 \
105-
// RUN: | FileCheck -check-prefix=CHECK-FPGA-O0 %s
106-
// CHECK-FPGA-O0: clang{{.*}} "-fsycl-is-device{{.*}}" "-O0"
107-
// CHECK-FPGA-O0: sycl-post-link{{.*}} "-O0"
108-
// CHECK-FPGA-O0-NOT: "-O2"
109-
110-
111-

0 commit comments

Comments
 (0)