Closed
Description
Upstream, LLVM is transitioning to a new PassManager, and they plan to remove support for the old one. See #8390 for a nice writeup with more details.
So now is the time for us to find problems with it, and get bugs reported upstream before it's too late.
I already tried merging #8390 into the llvm12
branch and found 2 problems:
Problem 1. The following test fails:
test.zig
export fn main() i32 {
@setEvalBranchQuota(1001);
const y = rec(1001);
return y - 1;
}
fn rec(n: usize) callconv(.Inline) usize {
if (n <= 1) return n;
return rec(n - 1);
}
How to reproduce:
# build self hosted compiler
./zig build
./zig-cache/bin/zig build-exe test.zig
Expected: exit(0)
Actual: Segmentation fault in __zig_probe_stack
Problem 2. LLVM is 2x slower for debug builds. Noooooooooooooooo!
This issue is to file some friendly bug reports upstream, make sure they get fixed upstream, and then try re-enabling the new pass manager in Zig and see if we run into any more issues.