Closed Bug 1448978 Opened 2 years ago Closed 2 years ago

Split out Windows MOZ_OPTIMIZE_FLAGS based on compiler

Categories

(Firefox Build System :: General, enhancement)

3 Branch
enhancement
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: dmajor, Assigned: froydnj)

References

Details

Attachments

(1 file)

In my local clang-cl builds I just stomp over MOZ_OPTIMIZE_FLAGS. It would be cleaner if old-configure.in would say something like:

if <clang-cl>
  MOZ_OPTIMIZE_FLAGS="-O2"
else
  MOZ_OPTIMIZE_FLAGS="-O1 -Oi"
endif
Do we really want -O2 for clang-cl?  Why not -Os or -Oz, for consistency with what clang/gcc do?
Flags: needinfo?(dmajor)
Unless someone can show me better numbers, -O2 seems to be our only hope of even coming close to MSVC speed: bug 1443590 comment 8
Flags: needinfo?(dmajor)
We want to use clang-cl to ship Firefox, and the only way we can come
close to MSVC numbers is to use -O2 here, for better or worse.

dmajor, I see in bug 1443590 comment 8 that "binary sizes are much larger than
MSVC's"; is that with using -O2 or some other settings?  We'll probably need to
push harder on that before we get to something shippable...
Attachment #8962483 - Flags: review?(core-build-config-reviews)
Attachment #8962483 - Flags: feedback?(dmajor)
Assignee: nobody → nfroyd
Comment on attachment 8962483 [details] [diff] [review]
use more aggressive optimization flags for clang-cl

Yes, this increases code size in order to get us better speed. And ThinLTO makes it a lot worse still. And yes, it will be a major factor to consider before shipping this.
Attachment #8962483 - Flags: feedback?(dmajor) → feedback+
Attachment #8962483 - Flags: review?(core-build-config-reviews) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3619a41def16
use more aggressive optimization flags for clang-cl; r=chmanchester
Depends on: 1449108
https://hg.mozilla.org/mozilla-central/rev/3619a41def16
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
FWIW I have a patch sitting here to move MOZ_OPTIMIZE_FLAGS into moz.configure, but I got hung up on the fact that js/src uses different defaults.
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.