Skip to content

switch to new LLVM PassManager #8418

Closed
Closed
@andrewrk

Description

@andrewrk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.upstreamAn issue with a third party project that Zig uses.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions