D.Diag(diag::err_drv_bitcode_unsupported_on_toolchain);
}
+ // If GlobalISel is enabled, pass it through to LLVM.
+ if (Arg *A = Args.getLastArg(options::OPT_fglobal_isel,
+ options::OPT_fno_global_isel)) {
+ if (A->getOption().matches(options::OPT_fglobal_isel)) {
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-global-isel");
+ // Disable abort and fall back to SDAG silently.
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-global-isel-abort=0");
+ }
+ }
+
Args.AddLastArg(CmdArgs, options::OPT_prebind);
Args.AddLastArg(CmdArgs, options::OPT_noprebind);
Args.AddLastArg(CmdArgs, options::OPT_nofixprebinding);
// THIN_LTO_OBJECT_PATH: {{ld(.exe)?"}}
// THIN_LTO_OBJECT_PATH-SAME: "-object_path_lto"
// THIN_LTO_OBJECT_PATH-SAME: {{thinlto\-[a-zA-Z0-9_]+}}
+
+
+// Check that we pass through -fglobal-isel flags to libLTO.
+// RUN: %clang -target arm64-apple-darwin %s -flto -fglobal-isel -### 2>&1 | \
+// RUN: FileCheck --check-prefix=GISEL %s
+// GISEL: {{ld(.exe)?"}}
+// GISEL: "-mllvm" "-global-isel"
+// GISEL: "-mllvm" "-global-isel-abort=0"