Uh oh!
There was an error while loading. Please reload this page.
Update LLVM to pull in patch that removes extraneous null check. - #40914
Update LLVM to pull in patch that removes extraneous null check.#40914luqmana wants to merge 1 commit into
Conversation
rust-highfive
commented
Mar 29, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
True, left over from copy/paste of copyright preamble and compile-flags. Interestingly most (if not all?) the codegen tests seem to use no-prepopulate-passes.
There was a problem hiding this comment.
That's because in most cases we are interested in checking our codegen, not LLVM's optimizations.
alexcrichton
commented
Mar 30, 2017
Well it looks like the test works! (this is failing on the llvm 3.7 builder) I think this may just need a Other than that r=me |
arielb1
commented
Mar 30, 2017
We want to ignore the test on all non-local LLVMs - after all, no public LLVM released yet includes the optimization. |
luqmana
commented
Mar 30, 2017
@alexcrichton@arielb1 Hmm should we just use a version 4.1 and live with it not running for a while or do what a couple other tests seem to do and just specify 3.8? I'm not sure how many are actually in the llvm 3.8 branch. |
alexcrichton
commented
Mar 31, 2017
I don't particularly care how the test is written. If it gets past the bots and it runs on at least one bot that's all I really care about. |
arielb1
commented
Mar 31, 2017
Distributions use their own LLVM, which does not include our patch. |
alexcrichton
commented
Apr 1, 2017
I picked up this LLVM update in the beta backport (just did a reset to the current master) and it looks like this may fail during the bootstrap? https://travis-ci.org/rust-lang/rust/jobs/217577161 I'm not 100% sure it's caused by this, but it seems suspicious |
luqmana
commented
Apr 3, 2017
@alexcrichton hmm, i'll give a look into that. |
luqmana
commented
Apr 6, 2017
@alexcrichton I tried building beta and wasn't able to reproduce that failure? |
@luqmana: Did you build with LLVM assertions enabled? Edit: Also, the failure was while building |
luqmana
commented
Apr 7, 2017
@TimNN Aha! I didn't have assertions on. I must've disabled them at some point. Enabling those I was able to reproduce the error @alexcrichton had. I minimized the IR with bugpoint: ; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-7eb0c3b.bc"targettriple = "x86_64-unknown-linux-gnu"%foo = type { %bar*, %baz* }
%bar = type { %bil*, i8*, %baz* }
%bil = type { i32, [0 x i32], [1 x i32] }
%baz = type { i8*, i64 }
definefastccvoid@fail_sroa() {
entry-block:
%arg5 = alloca%foo, align8%0 = bitcast%foo*%arg5toi64*storei64undef, i64*%0, align8%1 = getelementptrinbounds%foo, %foo*%arg5, i640, i320%2 = load%bar*, %bar**%1, align8, !nonnull!0unreachable
}
!0 = !{}Running it with But, with LLVM from head the assertion is not triggered. |
TimNN
commented
Apr 7, 2017
@TimNN That'd be great, thanks! |
TimNN
commented
Apr 7, 2017
I tested this with LLVM 4.0:
|
shepmaster
commented
Apr 14, 2017
arielb1
commented
Apr 15, 2017
Someone has to figure out why this causes LLVM assertions and fix that. |
luqmana
commented
Apr 15, 2017
@shepmaster@arielb1 I'll hopefully get to it when I'm done in the next week or two. @TimNN Thanks for testing. Mind pushing a branch somewhere so I can reproduce? |
TimNN
commented
Apr 19, 2017
For the record, a short transcription for irc: |
bors
commented
Apr 25, 2017
☔ The latest upstream changes (presumably #40123) made this pull request unmergeable. Please resolve the merge conflicts. |
arielb1
commented
Apr 25, 2017
LLVM 4.0 has just landed. Can you make it work with that? |
@luqmana are you going to be doing this? Should I fix this PR myself? |
luqmana
commented
May 2, 2017
@arielb1 I was planning to get to it soon but you're also welcome to proceed. I did have a bit of time the other day and rebased on the llvm4.0 branch, but ended up finding that the extra null check reappeared. I didn't have time to investigate unfortunately. |
arielb1
commented
May 9, 2017
I'll take up this PR myself. |
Mark-Simulacrum
commented
May 14, 2017
@arielb1 Any update on taking this PR up yourself? |
arielb1
commented
May 16, 2017
status: waiting until I get on top of regressions etc. |
Mark-Simulacrum
commented
May 18, 2017
Note: When redoing the backport, if someone could check if #38349 is fixed as well that would be great. |
status: currently dealing with a few more important backlog items. I'll get to this. |
aidanhs
commented
Jun 1, 2017
Hi @arielb1, just want to make sure this hasn't dropped off the bottom of your backlog :) |
Actually I'm doing some LLVM stuff right now, so it might skip upwards. I'm just busy with some personal stuff. |
FWIW the upstream version of this patch seems to cause an assertion failure in LLVM for me when compiling libcore [1]. Someone else (@vadimcn?) has already reported this upstream earlier and minified it to SROA incorrectly putting PS: I'd report these findings on LLVM bug, but I don't have an account. Would be great if someone could pass it on. [1] To clarify, this is with an LLVM fork that tracks upstream much more closely than we do. Edit: Ha, I only just noticed that this assertion failure has been seen here too 😅 I somehow missed that and thought the problem was something different. |
arielb1
commented
Jun 13, 2017
Let's see how that goes. |
arielb1
commented
Jun 14, 2017
This patch does not actually help the original case - now it's EarlyCSE that is eating our metadata. It turns Into That's... odd. Why is it eating our assumptions? |
Minified: ; RUN: opt -S -early-cse < %s | FileCheck %sdeclarei1@food()
declarevoid@llvm.assume(i1)
; CHECK-LABEL: define void @hungry()definevoid@hungry() {
entry-block:
%0 = calli1@food()
%1 = xori1%0, true; CHECK: call void @llvm.assumecallvoid@llvm.assume(i1%1)
retvoid
}Passes on 3.9, fails on 4.0. |
arielb1
commented
Jun 16, 2017
The LLVM assertion in https://bugs.llvm.org/show_bug.cgi?id=32902 is fixed by my https://reviews.llvm.org/D34285, which is awaiting review by LLVM. |
arielb1
commented
Jun 20, 2017
status: still waiting for LLVM review by @chandlerc. |
arielb1
commented
Jun 27, 2017
@chandlerc had committed llvm-mirror/llvm@7df0651, so this is fixed on LLVM trunk! I'll backport this to our LLVM tomorrow. |
Mark-Simulacrum
commented
Jul 2, 2017
This is waiting on rust-lang/llvm#90. |
aidanhs
commented
Jul 5, 2017
rust-lang/llvm#90 has landed. |
arielb1
commented
Jul 11, 2017
superseded by #43026. |
Fixes#37945.