-
Notifications
You must be signed in to change notification settings - Fork 776
[clang][SYCL] Transfer opt level to clang target options #18470
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
[clang][SYCL] Transfer opt level to clang target options #18470
Conversation
a9796d4
to
63f3e57
Compare
63f3e57
to
81813a1
Compare
81813a1
to
082f04b
Compare
082f04b
to
09fa1a9
Compare
} | ||
} | ||
CC1Args.push_back(DriverArgs.MakeArgString(llvm::Twine("-O") + OOpt)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to make this a common function as it is also used for setting the opt level for the assembler?
.Default("2"); | ||
} | ||
} | ||
CC1Args.push_back(DriverArgs.MakeArgString(llvm::Twine("-O") + OOpt)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test to cover the passing of the optimization setting and the default expectation.
@mdtoguchi I actually solved this problem wrong, the solution was not in this PR, but the underneath problem was that adding any potential early return could skip the opt level transfer. I added a PR to solve that upstream here. I think we shouldn't add that here as |
Currently, without transferring the opt level to clang target options if we called:
it will not transfer this
-O3
to the CC1 args underneath that compiles the nvptx kernels:This PR would make it more consistent by explicitly transfer driver opt level called to CC1 args:
The PR also make
-O3
the default opt level. I tried to mimic the default opt level passed here.