[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-26 Thread Fangrui Song via cfe-commits
MaskRay wrote: > This change seems to have caused a test in emscripten to starting failing > with `argument unused during compilation: '-O2'`: > [emscripten-core/emscripten#21841](https://github.com/emscripten-core/emscripten/pull/21841). > > Is that an intended side effect of this change? The

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-26 Thread Sam Clegg via cfe-commits
sbc100 wrote: This change seems to have caused a test in emscripten to starting failing with `argument unused during compilation: '-O2'`: https://github.com/emscripten-core/emscripten/pull/21841. Is that an intended side effect of this change? The fix on our end seems reasonable but posting

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-26 Thread Fangrui Song via cfe-commits
MaskRay wrote: > FYI I'm seeing about 0.6% compile-time regressions for `O0` test-suite builds > with this change > ([llvm-compile-time-tracker.com/compare.php?from=ef2ca97f48f1aee1483f0c29de5ba52979bec454&to=18376810f359dbd39d2a0aa0ddfc0f7f50eac199&stat=instructions:u](https://llvm-compile-tim

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Nikita Popov via cfe-commits
nikic wrote: FYI I'm seeing about 0.6% compile-time regressions for `O0` test-suite builds with this change (https://llvm-compile-time-tracker.com/compare.php?from=ef2ca97f48f1aee1483f0c29de5ba52979bec454&to=18376810f359dbd39d2a0aa0ddfc0f7f50eac199&stat=instructions:u). Though there is also a

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: `createAMDGPUELFStreamer` ignores `RelaxAll`, so this appears to be x86-only. There may be some clean-up opportunities. https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Fangrui Song via cfe-commits
MaskRay wrote: > .text > b dest// b.n 2-byte branch > b dest2 // b.w 4-byte branch > nop > dest: > nop > .space 2048 > dest2: > nop Thanks for checking. Confirmed no impact to ARM because `llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp:

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Peter Smith via cfe-commits
smithp35 wrote: No objections from me. I would prefer there not to be a difference for assembly at different optimisation levels. I can't find any evidence that this affects Arm (Thumb to be precise) assembly at all. For example: ``` .text b dest// b.n 2-byte branch

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-25 Thread Shengchen Kan via cfe-commits
https://github.com/KanRobert approved this pull request. LGTM. My understanding is that this flag is used for reducing compile time and debug only. https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-24 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-24 Thread Fangrui Song via cfe-commits
MaskRay wrote: There may be an example that the current -mrelax-all default penalizes Thumb/Thumb2 code size as well, but I haven't found an example. https://github.com/llvm/llvm-project/pull/90013 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Fangrui Song (MaskRay) Changes Some assembly mnemonics may assemble to instructions of different lengths. The longer form is to support instructions like a long branch. -mrelax-all enables `MCRelaxAll`, which expands instructions to the lon

[clang] [Driver] Don't default to -mrelax-all for non-RISCV -O0 (PR #90013)

2024-04-24 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/90013 Some assembly mnemonics may assemble to instructions of different lengths. The longer form is to support instructions like a long branch. -mrelax-all enables `MCRelaxAll`, which expands instructions to the long fo