Uh oh!
There was an error while loading. Please reload this page.
LLVM upgrades - #7115
Conversation
alexcrichton
commented
Jun 14, 2013
As before, it fails with a mysterious failure when running passes. If I rebase brson/llvm/wip on top of chapuni/llvm/master (~a month of changes), there's a silent error 5 failure. Not really sure what's going on here. If we don't upgrade LLVM, we don't get some rusti JIT fixes. If we do upgrade LLVM, windows breaks entirely. I don't have access to any windows machines, so I can't track it down to see what's going on :( |
alexcrichton
commented
Jul 4, 2013
To keep this updated, I've rebased on top of llvm-3.3 and pointed it at my own fork (one extra patch of mine + rebased patches from brson's branch). A recent pass through try-win and there's still a segfault immediately in stage2. |
alexcrichton
commented
Jul 4, 2013
After doing some more debugging, the failure only happens when optimizations are enabled, and it's currently a segfault in Sure enough, I disabled @pcwalton, I think you implemented fast_ffi, so perhaps this is just a rebase gone awry with recent LLVM versions? Also @brson would you might have info as well? |
This is a reopening of #6713 This is still blocked on windows failures. I'll re-push try once the existing crisis has passed.
alexcrichton
commented
Jul 5, 2013
It appears my understanding of |
vadimcn
commented
Aug 1, 2013
@alexcrichton: I think I've tracked down this segfault. Here's the callstack I am getting: https://gist.github.com/vadimcn/9e9d5333a99f08cddfa5 Also, building with RUST_MIN_STACK=102400 works without any issues, which also hints towards stack being too small. |
alexcrichton
commented
Aug 1, 2013
It turns out that the problem was that the The reason that it wasn't being set is caused by #8199. The I've added a workaround in the meantime, but @thestinger mentioned that it would probably be a good idea to update to the latest llvm in the meantime, so I'm going to attempt to do that tonight. If that turns out to be more trouble than its worth, then at least the state right now should be a working state! |
alexcrichton
commented
Aug 3, 2013
As of right now, the unoptimized version of rustc is failing on an unoptimized test, and can be reproduced with this test case: fnmain(){test_nd_dr((8,3),2);}fntest_nd_dr((n, d):(i8,i8),r:i8){let separate_div_rem = (n / d, n % d);let combined_div_rem = n.div_rem(&d);let(_, b) = separate_div_rem;assert_eq!(b, r);}Still trying to figure out why this is failing. The odd part is that it doesn't fail if built with optimizations... |
luqmana
commented
Aug 3, 2013
After a bunch of investigation, it seems like LLVM is wrong. I first looked at the IR ( The relevant bit: idivb %sil ; n % dmovq-72(%rbp), %r8movb %ah, (%r8) ; store the remainderSo we manually replaced the offending machine code in the binary (after adding a few nops with idivb %sil ; n % dmovq-72(%rbp), %r8shrw$8, %ax ; move remainder to lower 8 bitsmovb %al, (%r8) ; store the remainderand that worked. So, there are at least 2 problems. One is that it generates invalid assembly and the other is that it generates valid machine code that's semantically incorrect. (i.e. replacing So basically, it seems like an LLVM codegen bug. |
zecozephyr
commented
Aug 3, 2013
See the second or so paragraph of: http://x86asm.net/articles/x86-64-tour-of-intel-manuals/#General-purpose-Registers That is probably how this came about. Attempting to use the REX prefix to address a register in [r8, r15] whilst simultaneously specifying |
luqmana
commented
Aug 3, 2013
From #llvm: |
alexcrichton
commented
Aug 3, 2013
Wow, you guys are awesome! From what I had been looking at that completely makes sense. I've lost the binary that was failing for me so I can't check that it was that exact instruction, but it was definitely Regardless, this may get a bit difficult now. It looks like the release-3.3 of llvm isn't going to work for us, and the current head also doesn't work for us. We'll need to find a good LLVM commit to rebase our own patches on top of... |
luqmana
commented
Aug 4, 2013
So after bisecting between alexcrichton/llvm@a121e24 and alexcrichton/llvm@b1adb4d the culprit seems to be llvm-mirror/llvm@5012548. Which makes sense, since that patch adds support for div/idiv to x86 FastISel but doesn't teach it to handle using |
luqmana
commented
Aug 4, 2013
So, it turns out we were hitting http://llvm.org/bugs/show_bug.cgi?id=16105 which has already been fixed upstream (llvm-mirror/llvm@cc64dc6). |
* LLVM now has a C interface to LLVMBuildAtomicRMW * The exception handling support for the JIT seems to have been dropped * Various interfaces have been added or headers have changed
At the same time create a more robust wrapper to try to prevent this type of issue from cropping up in the future.
Thanks @luqama!
alexcrichton
commented
Aug 4, 2013
To keep this updated, bors bounced LLVM head as of last night due to some assertion being tripped compiling libstd, so I'm now going to go back to trying to get it working with 3.3 |
This is a reopening of #6713 This is still blocked on windows failures. I'll re-push try once the existing crisis has passed.
7115: Migrate HasSource::source to return Option r=matklad a=nick96 I've made a start on fixing rust-lang#6913 based on the provided work plan, migrating `HasSource::source` to return an `Option`. The simple cases are migrated but there are a few that I'm unsure exactly how they should be handled: - Logging the processing of functions in `AnalysisStatsCmd::run`: In verbose mode it includes the path to the module containing the function and the syntax range. I've handled this with an if-let but would it be better to blow up here with `expect`? I'm not 100% on the code paths but if we're processing a function definition then the source should exist. I've handled `source()` in all code paths as `None` being a valid return value but are there some cases where we should just blow up? Also, all I've done is bubble up the returned `None`s, there may be some places where we can recover and still provide something. Co-authored-by: Nick Spain <nicholas.spain@stileeducation.com> Co-authored-by: Nick Spain <nicholas.spain96@gmail.com>
This is a reopening of #6713
This is still blocked on windows failures. I'll re-push try once the existing crisis has passed.