llvm.org GIT mirror llvm / 829b8ef
Merge 81343 from mainline. When widening a vector load, use the correct chain. This fixes PR4891. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81411 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 11 years ago
3 changed file(s) with 67 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
16641664
16651665 // Modified the chain - switch anything that used the old chain to use
16661666 // the new one.
1667 ReplaceValueWith(SDValue(N, 1), Chain);
1667 ReplaceValueWith(SDValue(N, 1), NewChain);
16681668
16691669 return Result;
16701670 }
0 ; RUN: llc < %s -o - -march=x86-64 | FileCheck %s
1 ; PR4891
2
3 ; Both loads should happen before either store.
4
5 ; CHECK: movl (%rdi), %eax
6 ; CHECK: movl (%rsi), %ecx
7 ; CHECK: movl %ecx, (%rdi)
8 ; CHECK: movl %eax, (%rsi)
9
10 define void @short2_int_swap(<2 x i16>* nocapture %b, i32* nocapture %c) nounwind {
11 entry:
12 %0 = load <2 x i16>* %b, align 2 ; <<2 x i16>> [#uses=1]
13 %1 = load i32* %c, align 4 ; [#uses=1]
14 %tmp1 = bitcast i32 %1 to <2 x i16> ; <<2 x i16>> [#uses=1]
15 store <2 x i16> %tmp1, <2 x i16>* %b, align 2
16 %tmp5 = bitcast <2 x i16> %0 to <1 x i32> ; <<1 x i32>> [#uses=1]
17 %tmp3 = extractelement <1 x i32> %tmp5, i32 0 ; [#uses=1]
18 store i32 %tmp3, i32* %c, align 4
19 ret void
20 }
0 ; RUN: llc %s -o - -march=x86-64 -mtriple=x86_64-unknown-linux-gnu -disable-mmx | FileCheck %s
1 ; PR4891
2
3 ; This load should be before the call, not after.
4
5 ; CHECK: movq compl+128(%rip), %xmm0
6 ; CHECK: movaps %xmm0, (%rsp)
7 ; CHECK: call killcommon
8
9 @compl = linkonce global [20 x i64] zeroinitializer, align 64 ; <[20 x i64]*> [#uses=1]
10
11 declare void @killcommon(i32* noalias)
12
13 define void @reset(<2 x float>* noalias %garbage1) {
14 "file complex.c, line 27, bb1":
15 %changed = alloca i32, align 4 ; [#uses=3]
16 br label %"file complex.c, line 27, bb13"
17
18 "file complex.c, line 27, bb13": ; preds = %"file complex.c, line 27, bb1"
19 store i32 0, i32* %changed, align 4
20 %r2 = getelementptr float* bitcast ([20 x i64]* @compl to float*), i64 32 ; [#uses=1]
21 %r3 = bitcast float* %r2 to <2 x float>* ; <<2 x float>*> [#uses=1]
22 %r4 = load <2 x float>* %r3, align 4 ; <<2 x float>> [#uses=1]
23 call void @killcommon(i32* %changed)
24 br label %"file complex.c, line 34, bb4"
25
26 "file complex.c, line 34, bb4": ; preds = %"file complex.c, line 27, bb13"
27 %r5 = load i32* %changed, align 4 ; [#uses=1]
28 %r6 = icmp eq i32 %r5, 0 ; [#uses=1]
29 %r7 = zext i1 %r6 to i32 ; [#uses=1]
30 %r8 = icmp ne i32 %r7, 0 ; [#uses=1]
31 br i1 %r8, label %"file complex.c, line 34, bb7", label %"file complex.c, line 27, bb5"
32
33 "file complex.c, line 27, bb5": ; preds = %"file complex.c, line 34, bb4"
34 br label %"file complex.c, line 35, bb6"
35
36 "file complex.c, line 35, bb6": ; preds = %"file complex.c, line 27, bb5"
37 %r11 = ptrtoint <2 x float>* %garbage1 to i64 ; [#uses=1]
38 %r12 = inttoptr i64 %r11 to <2 x float>* ; <<2 x float>*> [#uses=1]
39 store <2 x float> %r4, <2 x float>* %r12, align 4
40 br label %"file complex.c, line 34, bb7"
41
42 "file complex.c, line 34, bb7": ; preds = %"file complex.c, line 35, bb6", %"file complex.c, line 34, bb4"
43 ret void
44 }