diff options
author | Fangrui Song <i@maskray.me> | 2024-04-25 09:27:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 09:27:55 -0700 |
commit | 18376810f359dbd39d2a0aa0ddfc0f7f50eac199 (patch) | |
tree | e2c4614aee4d26ac9fb6611b2da5ad75d90a4793 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | |
parent | ef2ca97f48f1aee1483f0c29de5ba52979bec454 (diff) | |
download | llvm-18376810f359dbd39d2a0aa0ddfc0f7f50eac199.zip llvm-18376810f359dbd39d2a0aa0ddfc0f7f50eac199.tar.gz llvm-18376810f359dbd39d2a0aa0ddfc0f7f50eac199.tar.bz2 |
[Driver] Don't default to -mrelax-all for non-RISCV -O0
Some assembly mnemonics may assemble to instructions of different
lengths. The longer form is to support instructions like a long branch.
On X86, -mrelax-all enables `MCRelaxAll`, which expands instructions to
the long form regardless of whether a short form suffices, while
-mno-relax-all only expands instructions when needed.
```
// x86 example
void foo(int a) {
// -mno-relax-all or gas: short jump (2 bytes)
// -mrelax-all: near jump (6 bytes)
if (a) bar();
}
```
The -mrelax-all default for non-RISCV -O0 appears to only affect x86 and
increases code size without any compile time difference for a stage-2
x86-64 build of lld.
```
-mrelax-all: file size: 60.9MiB VM size: 52.4MiB
-mno-relax-all: file size: 58.2MiB VM size: 49.7MiB
```
There is no compile time difference (other than noise) GNU assembler
doesn't expand instructions by default. Let's remove the -mrelax-all default.
Pull Request: https://github.com/llvm/llvm-project/pull/90013
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
0 files changed, 0 insertions, 0 deletions