llvm.org GIT mirror llvm / d2070b0
Fix a bug in the AVX 256-bit shuffle code in cases where the splat element is on the boundary of two 128-bit vectors. The attached testcase was stuck in an endless loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148027 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 8 years ago
2 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
44124412 // Extract the 128-bit part containing the splat element and update
44134413 // the splat element index when it refers to the higher register.
44144414 if (Size == 256) {
4415 unsigned Idx = (EltNo > NumElems/2) ? NumElems/2 : 0;
4415 unsigned Idx = (EltNo >= NumElems/2) ? NumElems/2 : 0;
44164416 V1 = Extract128BitVector(V1, DAG.getConstant(Idx, MVT::i32), DAG, dl);
44174417 if (Idx > 0)
44184418 EltNo -= NumElems/2;
0 ; RUN: llc < %s -march=x86 -mcpu=corei7-avx -mattr=+avx -mtriple=i686-pc-win32 | FileCheck %s
1
2 ; CHECK: endless_loop
3 define void @endless_loop() {
4 entry:
5 %0 = load <8 x i32> addrspace(1)* undef, align 32
6 %1 = shufflevector <8 x i32> %0, <8 x i32> undef, <16 x i32>
7 %2 = shufflevector <16 x i32> , <16 x i32> %1, <16 x i32>
8 store <16 x i32> %2, <16 x i32> addrspace(1)* undef, align 64
9 ret void
10 ; CHECK: ret
11 }