Does the rustc filter the options following -Cllvm-args?

If I change the code in the llvm backend. I add a option to disable a certain llvm pass, and then rustc adapts to the llvm backend. Can I use these options directly in rustc through -C llvm-args?

This option is added after the llvm code is modified.

root@ clang -mllvm --help-hidden test.c | grep disable-globalopt
--disable-globalopt - Disable GlobalOpt

Can the rustc directly use this option? like this, Does rustc transparently transmit compilation options to the LLVM?
rustc simple.rs -Cllvm-args=--disable-globalopt

Valid arguments for clang are different from valid arguments for llc which are different from valid arguments for rust's -Cllvm-args. The whole thing is an underdocumented mess. I've also been bitten before. See -C llvm-args is parsed inconsistently within LLVM with the arguments llc accepts · Issue #26338 · rust-lang/rust · GitHub

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.