[llvm] [AArch64] Enable "sink-and-fold" in MachineSink by default (PR #67432)
Momchil Velikov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 10:57:21 PDT 2023
momchil-velikov wrote:
Small reproducer here:
```
int f(int);
void g(int x) {
int y = x + 1;
int t0 = y;
f(t0);
int t1 = y;
f(t1);
}
```
With these commands
```
#! /bin/bash
./bin/clang -target aarch64-linux -g -O2 -S ccc.c -emit-llvm
./bin/llc ccc.ll --aarch64-enable-sink-fold=true --stop-before=machine-sink -o ccc-before.mir
./bin/llc ccc.ll --aarch64-enable-sink-fold=true --stop-after=machine-sink -o ccc-after.mir
kdiff3 ccc-{before,after}.mir
```
it's quite evident how sink-and-fold causes quadratic explosion in the number the DBG_VALUE instructions.
https://github.com/llvm/llvm-project/pull/67432
More information about the llvm-commits
mailing list