If we just compile with -O0, clang will add optnone attributes
everywhere, so opt won't actually be able to perform any passes.
Instruct clang to not emit the optnone so opt can do its thing.
Details
Diff Detail
- Build Status
Buildable 27088 Build 27087: arc lint + arc unit
Event Timeline
llvm/docs/HowToSubmitABug.rst | ||
---|---|---|
87 | This is definitely over 80 columns, but I'm not sure if we're strict about that in the documentation, and what the best way to split it would be. Also, are there any preferences for -O0 -Xclang -disable-O0-optnone vs. -O1 -Xclang -disable-llvm-passes vs. -O1 -Xclang -disable-llvm-optzns? |
llvm/docs/HowToSubmitABug.rst | ||
---|---|---|
87 | I think -disable-passes is preferred over -disable-llvm-optzns. That spelling is weird. Using -O1 -Xclang -disable-llvm-passes is going to more accurately give the IR. There are other differences that clang makes in -O0 other than the obvious optnone. |
llvm/docs/HowToSubmitABug.rst | ||
---|---|---|
87 | Just for my knowledge, could you elaborate on some of the differences, if you happen to remember them off-hand? |
llvm/docs/HowToSubmitABug.rst | ||
---|---|---|
87 | I think TBAA metadata is skipped in -O0 as one example. You can grep for CodeGenOpts.OptimizationLevel in clang's lib/CodeGen/ directory for others. |
Ping.
I might just commit for post-commit review, since @craig.topper weighed in on my main question above.
This is definitely over 80 columns, but I'm not sure if we're strict about that in the documentation, and what the best way to split it would be.
Also, are there any preferences for -O0 -Xclang -disable-O0-optnone vs. -O1 -Xclang -disable-llvm-passes vs. -O1 -Xclang -disable-llvm-optzns?