1

What's the "standard" optimization level used for clang? I believe that "O2" is a good choice for gcc - does that hold for clang also, or is there a generally better alternative?

2 Answers 2

3

-O2 and -Os are both good choices for general use with clang.

Sign up to request clarification or add additional context in comments.

1 Comment

0

-O3 will usually give you both the smallest and fastest code, but does tend to expose non obvious bugs in your code.

In general, you should make sure your code runs fine with all possible optimizations.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.