annotate test/CodeGen/X86/extractelement-legalization-store-ordering.ll @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents afa8332a0e37
children 3a76565eade5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
2 ; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=yonah | FileCheck %s
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 ; Make sure we don't break load/store ordering when turning an extractelement
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ; into loads, off the stack or a previous store.
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ; Be very explicit about the ordering/stack offsets.
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
121
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
10 define void @test_extractelement_legalization_storereuse(<4 x i32> %a, i32* nocapture %x, i32* nocapture readonly %y, i32 %i) #0 {
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ; CHECK-LABEL: test_extractelement_legalization_storereuse:
121
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
12 ; CHECK: ## BB#0: ## %entry
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
13 ; CHECK-NEXT: pushl %ebx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
14 ; CHECK-NEXT: pushl %edi
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
15 ; CHECK-NEXT: pushl %esi
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
16 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
17 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
18 ; CHECK-NEXT: paddd (%ecx), %xmm0
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
19 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
20 ; CHECK-NEXT: movdqa %xmm0, (%ecx)
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
21 ; CHECK-NEXT: movl (%ecx), %esi
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
22 ; CHECK-NEXT: movl 4(%ecx), %edi
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
23 ; CHECK-NEXT: shll $4, %edx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
24 ; CHECK-NEXT: movl 8(%ecx), %ebx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
25 ; CHECK-NEXT: movl 12(%ecx), %ecx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
26 ; CHECK-NEXT: movl %esi, 12(%eax,%edx)
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
27 ; CHECK-NEXT: movl %edi, (%eax,%edx)
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
28 ; CHECK-NEXT: movl %ebx, 8(%eax,%edx)
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
29 ; CHECK-NEXT: movl %ecx, 4(%eax,%edx)
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
30 ; CHECK-NEXT: popl %esi
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
31 ; CHECK-NEXT: popl %edi
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
32 ; CHECK-NEXT: popl %ebx
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
33 ; CHECK-NEXT: retl
803732b1fca8 LLVM 5.0
kono
parents: 95
diff changeset
34 ; CHECK-NEXT: ## -- End function
95
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 entry:
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 %0 = bitcast i32* %y to <4 x i32>*
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 %1 = load <4 x i32>, <4 x i32>* %0, align 16
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 %am = add <4 x i32> %a, %1
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 store <4 x i32> %am, <4 x i32>* %0, align 16
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 %ip0 = shl nsw i32 %i, 2
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 %ip1 = or i32 %ip0, 1
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 %ip2 = or i32 %ip0, 2
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 %ip3 = or i32 %ip0, 3
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 %vecext = extractelement <4 x i32> %am, i32 %ip0
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 %arrayidx = getelementptr inbounds i32, i32* %x, i32 %ip3
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 store i32 %vecext, i32* %arrayidx, align 4
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 %vecext5 = extractelement <4 x i32> %am, i32 %ip1
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 %arrayidx8 = getelementptr inbounds i32, i32* %x, i32 %ip0
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 store i32 %vecext5, i32* %arrayidx8, align 4
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 %vecext11 = extractelement <4 x i32> %am, i32 %ip2
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 %arrayidx14 = getelementptr inbounds i32, i32* %x, i32 %ip2
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 store i32 %vecext11, i32* %arrayidx14, align 4
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 %vecext17 = extractelement <4 x i32> %am, i32 %ip3
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 %arrayidx20 = getelementptr inbounds i32, i32* %x, i32 %ip1
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 store i32 %vecext17, i32* %arrayidx20, align 4
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 ret void
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 }
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
afa8332a0e37 LLVM 3.8
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 attributes #0 = { nounwind }