-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass clang options to be applied to generated object file? #2950
Comments
Seems only a single option is allowed/supported.
|
I have seen the system being fragile with multiple options in a string, not entirely sure why. Do you want me to add this feature? |
That would be nice. Thanks. |
The reason is that strings have to be passed separately in the argv[][] for the command. There is another small issue for the example here: -O0 is created by default. If -O2 is passed the mllvm, I got error for "multiple -O#". |
Thanks @chentong319 |
@jinchenglee Which step do you intend to use these options, opt or llc? The current implementation has another issue is that the |
I'm just exploring and besides I'm pretty greenhorn about LLVM toolsets. It seems to me it would be better to separate them as the tools (llc and opt) are different from beginning? |
@jinchenglee There are three options in onnx-mlir to pass options to opt and/or llc
I merged a new PR to handle the issue with mllvm. I added example of how to use Xopt and Xllc. Hope this PR2955 solved your issue. |
@jinchenglee can we close this issue? |
Sorry, I don't yet have time to try these yet. But for what this ticket is asking for, it's safe to close. If any issues, I or anyone can reopen it. Thanks. |
For example, I can compile my binary using
clang -target riscv64-unknown-elf -fno-builtin-printf -fno-lto -O2 -c example.c -o example.o
, how may I pass down the additional options through onnx-mlir? This might be a dumb question as I'm new to LLVM toolsets.I tried
$ onnx-mlir -mtriple=riscv64-unknown-elf -mllvm="-fno-builtin-printf -fno-lto -O2" --EmitObj ./nn.onnx
:The text was updated successfully, but these errors were encountered: