================
@@ -2129,6 +2129,16 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args,
           << A->getSpelling() << Val;
     }
   }
+
+  // Forward the -mglobal-merge option for explicit control over the pass.
+  if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge,
+                               options::OPT_mno_global_merge)) {
+    CmdArgs.push_back("-mllvm");
----------------
jonathonpenix wrote:
I see, thanks!

Just to double check if I did the right thing: I removed the `=true` from the 
`-mglobal-merge` case but otherwise I left the if/else alone (ex: I'm still 
passing `-mllvm -riscv-enable-global-merge=false`) so that we can distinguish 
between the 'unset' (no `-m[no-]global-merge`) and `-mno-global-merge` cases.

I don't think it makes much of a functional difference at the moment since we 
only check for `EnableGlobalMerge == cl::BOU_TRUE`, but this seemed in line 
with the decision in https://reviews.llvm.org/D130481 to keep it as 
boolOrDefault. Please let me know if you had something else in mind!

https://github.com/llvm/llvm-project/pull/79372
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to