You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When casting from i8x3 -> i16x3 there's an ICE on rustc 1.17.0-nightly (24a70eb59 2017-02-09)
PromoteIntegerResult #0: t35: v4i16 = sign_extend_vector_inreg t34
Do not know how to promote this operator!
UNREACHABLE executed at /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:51!
It seems to trigger when the width is 3, the source is not a float, and in size is smaller than the out size. Clang handles this case fine in its __builtin_convertvector.
This appears to be an LLVM bug. The following reduced LLVM IR file triggers the crash on both Rust's LLVM fork, and LLVM 3.9. It appears to be fixed on LLVM 4.0
define i64 @main(i64, i8**) unnamed_addr {
start:
%veci8 = alloca <3 x i8>
%veci16 = alloca <3 x i16>
%2 = load <3 x i8>, <3 x i8>* %veci8
%3 = sext <3 x i8> %2 to <3 x i16>
store <3 x i16> %3, <3 x i16>* %veci16
ret i64 0
}
From what I've discovered so far, the bug is related to LLVM's x86 platform code performing this optimization on the LLVM selection DAG:
load, sign_extend -> load, concat_vectors, sign_extend_vector_inreg. The relevant code can be found at src/llvm/lib/Target/X86/X86ISelLowering.cpp in the function combineToExtendVectorInReg (starts at line 30090). Github unfortunately disallows linking lines in the file, as it's over 30K (!) lines.
I'm going to investigate this further, and see if I can determine what was changed in LLVM 4.0 to fix this.
I don't know exactly what the Rust team's procedure is for updating LLVM, but this issue should be resolved when the rust-llvm-2017-04-13 branch is in use.
Cannot reproduce today (we are on llvm 4.0 now), marking E-needstest. I believe this'll need a run-pass test since compile-fail with rustc_error I believe doesn't run LLVM (which is where the problem occurs, presumably).
Activity
Aaron1011 commentedon Apr 23, 2017
This appears to be an LLVM bug. The following reduced LLVM IR file triggers the crash on both Rust's LLVM fork, and LLVM 3.9. It appears to be fixed on LLVM 4.0
From what I've discovered so far, the bug is related to LLVM's x86 platform code performing this optimization on the LLVM selection DAG:
load, sign_extend -> load, concat_vectors, sign_extend_vector_inreg. The relevant code can be found atsrc/llvm/lib/Target/X86/X86ISelLowering.cppin the functioncombineToExtendVectorInReg(starts at line 30090). Github unfortunately disallows linking lines in the file, as it's over 30K (!) lines.I'm going to investigate this further, and see if I can determine what was changed in LLVM 4.0 to fix this.
Aaron1011 commentedon Apr 23, 2017
It turns out that this bug was already fixed in LLVM: See https://reviews.llvm.org/D25790 and https://reviews.llvm.org/D25268. The rust-llvm-2016-10-29 branch of Rust's LLVM fork doesn't include these fixes, however, the rust-llvm-2017-04-13.
I don't know exactly what the Rust team's procedure is for updating LLVM, but this issue should be resolved when the rust-llvm-2017-04-13 branch is in use.
Mark-Simulacrum commentedon Jun 22, 2017
Cannot reproduce today (we are on llvm 4.0 now), marking E-needstest. I believe this'll need a run-pass test since compile-fail with rustc_error I believe doesn't run LLVM (which is where the problem occurs, presumably).
Rollup merge of rust-lang#43465 - topecongiro:needs-test, r=Mark-Simu…