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

Comments

@jirislaby
Copy link
Contributor

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

This comment has been minimized.

Copy link

commented May 26, 2018

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

@jirislaby

This comment has been minimized.

Copy link
Contributor Author

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.

@humeafo

This comment has been minimized.

Copy link

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.

@kren1

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2018

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

@jirislaby

This comment has been minimized.

Copy link
Contributor Author

commented Jul 2, 2018

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

@ccadar

This comment has been minimized.

Copy link
Contributor

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? ;)

@MartinNowack

This comment has been minimized.

Copy link
Contributor

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.

@ccadar ccadar referenced this issue Mar 5, 2019
@kren1

This comment has been minimized.

Copy link
Contributor

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.

@ccadar

This comment has been minimized.

Copy link
Contributor

commented May 30, 2019

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

@ccadar ccadar closed this May 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.