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 3 4target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" 5 6; Make sure we don't break load/store ordering when turning an extractelement 7; into loads, off the stack or a previous store. 8; Be very explicit about the ordering/stack offsets. 9 10define void @test_extractelement_legalization_storereuse(<4 x i32> %a, i32* nocapture %x, i32* nocapture readonly %y, i32 %i) #0 { 11; CHECK-LABEL: test_extractelement_legalization_storereuse: 12; CHECK: ## %bb.0: ## %entry 13; CHECK-NEXT: pushl %ebx 14; CHECK-NEXT: pushl %edi 15; CHECK-NEXT: pushl %esi 16; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax 17; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx 18; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx 19; CHECK-NEXT: paddd (%edx), %xmm0 20; CHECK-NEXT: movdqa %xmm0, (%edx) 21; CHECK-NEXT: movl (%edx), %esi 22; CHECK-NEXT: movl 4(%edx), %edi 23; CHECK-NEXT: shll $4, %ecx 24; CHECK-NEXT: movl 8(%edx), %ebx 25; CHECK-NEXT: movl 12(%edx), %edx 26; CHECK-NEXT: movl %esi, 12(%eax,%ecx) 27; CHECK-NEXT: movl %edi, (%eax,%ecx) 28; CHECK-NEXT: movl %ebx, 8(%eax,%ecx) 29; CHECK-NEXT: movl %edx, 4(%eax,%ecx) 30; CHECK-NEXT: popl %esi 31; CHECK-NEXT: popl %edi 32; CHECK-NEXT: popl %ebx 33; CHECK-NEXT: retl 34entry: 35 %0 = bitcast i32* %y to <4 x i32>* 36 %1 = load <4 x i32>, <4 x i32>* %0, align 16 37 %am = add <4 x i32> %a, %1 38 store <4 x i32> %am, <4 x i32>* %0, align 16 39 %ip0 = shl nsw i32 %i, 2 40 %ip1 = or i32 %ip0, 1 41 %ip2 = or i32 %ip0, 2 42 %ip3 = or i32 %ip0, 3 43 %vecext = extractelement <4 x i32> %am, i32 %ip0 44 %arrayidx = getelementptr inbounds i32, i32* %x, i32 %ip3 45 store i32 %vecext, i32* %arrayidx, align 4 46 %vecext5 = extractelement <4 x i32> %am, i32 %ip1 47 %arrayidx8 = getelementptr inbounds i32, i32* %x, i32 %ip0 48 store i32 %vecext5, i32* %arrayidx8, align 4 49 %vecext11 = extractelement <4 x i32> %am, i32 %ip2 50 %arrayidx14 = getelementptr inbounds i32, i32* %x, i32 %ip2 51 store i32 %vecext11, i32* %arrayidx14, align 4 52 %vecext17 = extractelement <4 x i32> %am, i32 %ip3 53 %arrayidx20 = getelementptr inbounds i32, i32* %x, i32 %ip1 54 store i32 %vecext17, i32* %arrayidx20, align 4 55 ret void 56} 57 58attributes #0 = { nounwind } 59