comparison 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
comparison
equal deleted inserted replaced
120:1172e4bd9c6f 121:803732b1fca8
1 ; RUN: llc < %s -mtriple i386-apple-darwin -mcpu=yonah | FileCheck %s 1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=yonah | FileCheck %s
2 3
3 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" 4 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
4 5
5 ; Make sure we don't break load/store ordering when turning an extractelement 6 ; Make sure we don't break load/store ordering when turning an extractelement
6 ; into loads, off the stack or a previous store. 7 ; into loads, off the stack or a previous store.
7 ; Be very explicit about the ordering/stack offsets. 8 ; Be very explicit about the ordering/stack offsets.
8 9
10 define void @test_extractelement_legalization_storereuse(<4 x i32> %a, i32* nocapture %x, i32* nocapture readonly %y, i32 %i) #0 {
9 ; CHECK-LABEL: test_extractelement_legalization_storereuse: 11 ; CHECK-LABEL: test_extractelement_legalization_storereuse:
10 ; CHECK: # BB#0 12 ; CHECK: ## BB#0: ## %entry
11 ; CHECK-NEXT: pushl %ebx 13 ; CHECK-NEXT: pushl %ebx
12 ; CHECK-NEXT: pushl %edi 14 ; CHECK-NEXT: pushl %edi
13 ; CHECK-NEXT: pushl %esi 15 ; CHECK-NEXT: pushl %esi
14 ; CHECK-NEXT: movl 16(%esp), %eax 16 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
15 ; CHECK-NEXT: movl 24(%esp), %ecx 17 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
16 ; CHECK-NEXT: movl 20(%esp), %edx 18 ; CHECK-NEXT: paddd (%ecx), %xmm0
17 ; CHECK-NEXT: paddd (%edx), %xmm0 19 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
18 ; CHECK-NEXT: movdqa %xmm0, (%edx) 20 ; CHECK-NEXT: movdqa %xmm0, (%ecx)
19 ; CHECK-NEXT: shll $4, %ecx 21 ; CHECK-NEXT: movl (%ecx), %esi
20 ; CHECK-NEXT: movl (%ecx,%edx), %esi 22 ; CHECK-NEXT: movl 4(%ecx), %edi
21 ; CHECK-NEXT: movl 12(%ecx,%edx), %edi 23 ; CHECK-NEXT: shll $4, %edx
22 ; CHECK-NEXT: movl 8(%ecx,%edx), %ebx 24 ; CHECK-NEXT: movl 8(%ecx), %ebx
23 ; CHECK-NEXT: movl 4(%ecx,%edx), %edx 25 ; CHECK-NEXT: movl 12(%ecx), %ecx
24 ; CHECK-NEXT: movl %esi, 12(%eax,%ecx) 26 ; CHECK-NEXT: movl %esi, 12(%eax,%edx)
25 ; CHECK-NEXT: movl %edx, (%eax,%ecx) 27 ; CHECK-NEXT: movl %edi, (%eax,%edx)
26 ; CHECK-NEXT: movl %ebx, 8(%eax,%ecx) 28 ; CHECK-NEXT: movl %ebx, 8(%eax,%edx)
27 ; CHECK-NEXT: movl %edi, 4(%eax,%ecx) 29 ; CHECK-NEXT: movl %ecx, 4(%eax,%edx)
28 ; CHECK-NEXT: popl %esi 30 ; CHECK-NEXT: popl %esi
29 ; CHECK-NEXT: popl %edi 31 ; CHECK-NEXT: popl %edi
30 ; CHECK-NEXT: popl %ebx 32 ; CHECK-NEXT: popl %ebx
31 ; CHECK-NEXT: retl 33 ; CHECK-NEXT: retl
32 define void @test_extractelement_legalization_storereuse(<4 x i32> %a, i32* nocapture %x, i32* nocapture readonly %y, i32 %i) #0 { 34 ; CHECK-NEXT: ## -- End function
33 entry: 35 entry:
34 %0 = bitcast i32* %y to <4 x i32>* 36 %0 = bitcast i32* %y to <4 x i32>*
35 %1 = load <4 x i32>, <4 x i32>* %0, align 16 37 %1 = load <4 x i32>, <4 x i32>* %0, align 16
36 %am = add <4 x i32> %a, %1 38 %am = add <4 x i32> %a, %1
37 store <4 x i32> %am, <4 x i32>* %0, align 16 39 store <4 x i32> %am, <4 x i32>* %0, align 16