Skip to content
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

-O0 is not a recommended option for clang #902

Closed
jirislaby opened this issue May 25, 2018 · 9 comments
Closed

-O0 is not a recommended option for clang #902

jirislaby opened this issue May 25, 2018 · 9 comments

Comments

@jirislaby
Copy link
Contributor

@jirislaby jirislaby commented May 25, 2018

According to https://bugs.llvm.org/show_bug.cgi?id=35950#c10, we should not be using -O0 on its own. So what do you suggest?

Stay with -O0 and extend it to -O0 -Xclang -disable-O0-optnone?

Or upgrade to -O1 and use -O1 -Xclang -disable-llvm-passes?

The latter currently causes test failures, as it seems. The former is being built right now at https://travis-ci.org/klee/klee/builds/383711164?utm_source=github_status&utm_medium=notification

@jirislaby jirislaby changed the title -O0 is not a recommended option -O0 is not a recommended option for clang May 25, 2018
@humeafo
Copy link

@humeafo humeafo commented May 26, 2018

Or is it possible to add an additional pass to remove the optnone attr on klee-side?

Loading

@jirislaby
Copy link
Contributor Author

@jirislaby jirislaby commented Jun 15, 2018

I wouldn't remove optnone unconditionally, it might cause problems for locations where added intentionally.

But it turned out that -O0 -Xclang -disable-O0-optnone works quite well.

Loading

@humeafo
Copy link

@humeafo humeafo commented Jun 20, 2018

It's a better option except some more work on tests, perhaps this should be mentioned in docs for beginners when 6.0 port is merged to trunk.

Loading

@kren1
Copy link
Contributor

@kren1 kren1 commented Jul 2, 2018

Just a note that these options don't work for LLVM 3.4

Loading

@jirislaby
Copy link
Contributor Author

@jirislaby jirislaby commented Jul 2, 2018

@kren1 correct, that's why I do: 34ba4a7#diff-d952c1df2f0c4ff2821b3dd8b67bb7d5

Loading

@ccadar
Copy link
Contributor

@ccadar ccadar commented Jul 2, 2018

BTW, I think we should change add instructions on the web for LLVM 3.6, and slowly "migrate" to it. Any volunteers for the instructions? ;)

Loading

@MartinNowack
Copy link
Contributor

@MartinNowack MartinNowack commented Jul 18, 2018

Looking at #937 and #920, I think we should make this the default option for the runtime library. Using -O0 and -g and as suggested by @jirislaby -Xclang -disable-O0-optnone for newer clang versions.

KLEE can be still invoked with the -optimize flag.

Loading

@kren1
Copy link
Contributor

@kren1 kren1 commented Mar 5, 2019

As a note this is a fun comparision between the options on our get_sign.c: https://godbolt.org/z/tdtmDy example. It seems the -O0 -Xclang -disable-O0-optnone, -O1 -Xclang -disable-llvm-passesare very similar except that the -O1 option has some lifetime information.

Loading

@ccadar
Copy link
Contributor

@ccadar ccadar commented May 30, 2019

I think we can close this one, as we update the tests and the documentation to use/recommend these options.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants