Loading clang/lib/Driver/ToolChains/CommonArgs.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -694,6 +694,16 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, CmdArgs.push_back(Args.MakeArgString(Twine(PluginOptPrefix) + ParallelismOpt + Parallelism)); // Pass down GlobalISel options. if (Arg *A = Args.getLastArg(options::OPT_fglobal_isel, options::OPT_fno_global_isel)) { // Parsing -fno-global-isel explicitly gives architectures that enable GISel // by default a chance to disable it. CmdArgs.push_back(Args.MakeArgString( Twine(PluginOptPrefix) + "-global-isel=" + (A->getOption().matches(options::OPT_fglobal_isel) ? "1" : "0"))); } // If an explicit debugger tuning argument appeared, pass it along. if (Arg *A = Args.getLastArg(options::OPT_gTune_Group, options::OPT_ggdbN_Group)) { Loading clang/test/Driver/lto.c +9 −0 Original line number Diff line number Diff line Loading @@ -105,3 +105,12 @@ // FLTO-THIN: -flto=thin // FLTO-THIN-NOT: "-flto" // FLTO-THIN-NOT: -flto=full // -flto passes along an explicit GlobalISel flag. // RUN: %clang --target=riscv64-linux-gnu -### %s -flto -fglobal-isel 2> %t // RUN: FileCheck --check-prefix=CHECK-GISEL < %t %s // RUN: %clang --target=aarch64-linux-gnu -### %s -flto -fno-global-isel 2> %t // RUN: FileCheck --check-prefix=CHECK-DISABLE-GISEL < %t %s // // CHECK-GISEL: "-plugin-opt=-global-isel=1" // CHECK-DISABLE-GISEL: "-plugin-opt=-global-isel=0" Loading
clang/lib/Driver/ToolChains/CommonArgs.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -694,6 +694,16 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, CmdArgs.push_back(Args.MakeArgString(Twine(PluginOptPrefix) + ParallelismOpt + Parallelism)); // Pass down GlobalISel options. if (Arg *A = Args.getLastArg(options::OPT_fglobal_isel, options::OPT_fno_global_isel)) { // Parsing -fno-global-isel explicitly gives architectures that enable GISel // by default a chance to disable it. CmdArgs.push_back(Args.MakeArgString( Twine(PluginOptPrefix) + "-global-isel=" + (A->getOption().matches(options::OPT_fglobal_isel) ? "1" : "0"))); } // If an explicit debugger tuning argument appeared, pass it along. if (Arg *A = Args.getLastArg(options::OPT_gTune_Group, options::OPT_ggdbN_Group)) { Loading
clang/test/Driver/lto.c +9 −0 Original line number Diff line number Diff line Loading @@ -105,3 +105,12 @@ // FLTO-THIN: -flto=thin // FLTO-THIN-NOT: "-flto" // FLTO-THIN-NOT: -flto=full // -flto passes along an explicit GlobalISel flag. // RUN: %clang --target=riscv64-linux-gnu -### %s -flto -fglobal-isel 2> %t // RUN: FileCheck --check-prefix=CHECK-GISEL < %t %s // RUN: %clang --target=aarch64-linux-gnu -### %s -flto -fno-global-isel 2> %t // RUN: FileCheck --check-prefix=CHECK-DISABLE-GISEL < %t %s // // CHECK-GISEL: "-plugin-opt=-global-isel=1" // CHECK-DISABLE-GISEL: "-plugin-opt=-global-isel=0"