https://bugs.llvm.org/show_bug.cgi?id=43909

            Bug ID: 43909
           Summary: Nondeterminstic optimization on macOS, unknown where
                    though
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

The tor project has a bug open -
https://trac.torproject.org/projects/tor/ticket/32053 - that their builds on
macOS are not reproducible. The source of this nondeterminism in the build is
the Rust source code in Firefox. After digging in that thread (there's a lot of
discussion, but feel free to skip over it) we've concluded that the LLVM
optimization passes for a bitcode file are the source of the nondeterminism.

The files hosted at https://people.torproject.org/~gk/misc/32053/ are produced
by rustc itself, and style.no-opt.bc has been seen to optimize to style1.bc and
style2.bc. Locally I've checked the latest commit of LLVM and this command
produces different hashes:

    opt -O3 style.no-opt.bc -o foo.bc

Using LLVM trunk I'm seeing two sha1 hashes show up:

* 045fb2b4a581418e0287e208e1d4633804b7e2db
* 6887c6a5d427aa792b51188c2e27521392a1d048

One is more likely than the other, but this appears to be at least one source
of nondeterminism in the build of Tor.

Unfortunately the `style.no-opt.bc` file is 90MB large (!) which means that I'm
still in the process of reducing this to something more digestable. Running
`opt -O3` once on the file takes a few minutes, though, so my attempts at using
`bugpoint` are likely going to take quite awhile. In the meantime though I
wanted to open up this bug to see if others know better how to debug this
and/or minimize it. 

If more information is needed about the non-determinism, please just let me
know as well!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to