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

Peter Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 06:24:55 PDT 2024


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
        b dest2  // b.w 4-byte branch
        nop
dest:
        nop
        .space 2048
dest2:
        nop
```
Regardless of what -mrelax-all is (or the llvm-mc equivalent) the first `b dest` is always the smaller branch.

https://github.com/llvm/llvm-project/pull/90013


More information about the cfe-commits mailing list