File: extractelement-legalization-store-ordering.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (59 lines) | stat: -rw-r--r-- 2,350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=yonah | FileCheck %s

target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"

; Make sure we don't break load/store ordering when turning an extractelement
; into loads, off the stack or a previous store.
; Be very explicit about the ordering/stack offsets.

define void @test_extractelement_legalization_storereuse(<4 x i32> %a, i32* nocapture %x, i32* nocapture readonly %y, i32 %i) #0 {
; CHECK-LABEL: test_extractelement_legalization_storereuse:
; CHECK:       ## %bb.0: ## %entry
; CHECK-NEXT:    pushl %ebx
; CHECK-NEXT:    pushl %edi
; CHECK-NEXT:    pushl %esi
; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %ecx
; CHECK-NEXT:    paddd (%ecx), %xmm0
; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edx
; CHECK-NEXT:    movdqa %xmm0, (%ecx)
; CHECK-NEXT:    movl (%ecx), %esi
; CHECK-NEXT:    movl 4(%ecx), %edi
; CHECK-NEXT:    shll $4, %edx
; CHECK-NEXT:    movl 8(%ecx), %ebx
; CHECK-NEXT:    movl 12(%ecx), %ecx
; CHECK-NEXT:    movl %esi, 12(%eax,%edx)
; CHECK-NEXT:    movl %edi, (%eax,%edx)
; CHECK-NEXT:    movl %ebx, 8(%eax,%edx)
; CHECK-NEXT:    movl %ecx, 4(%eax,%edx)
; CHECK-NEXT:    popl %esi
; CHECK-NEXT:    popl %edi
; CHECK-NEXT:    popl %ebx
; CHECK-NEXT:    retl
; CHECK-NEXT:    ## -- End function
entry:
  %0 = bitcast i32* %y to <4 x i32>*
  %1 = load <4 x i32>, <4 x i32>* %0, align 16
  %am = add <4 x i32> %a, %1
  store <4 x i32> %am, <4 x i32>* %0, align 16
  %ip0 = shl nsw i32 %i, 2
  %ip1 = or i32 %ip0, 1
  %ip2 = or i32 %ip0, 2
  %ip3 = or i32 %ip0, 3
  %vecext = extractelement <4 x i32> %am, i32 %ip0
  %arrayidx = getelementptr inbounds i32, i32* %x, i32 %ip3
  store i32 %vecext, i32* %arrayidx, align 4
  %vecext5 = extractelement <4 x i32> %am, i32 %ip1
  %arrayidx8 = getelementptr inbounds i32, i32* %x, i32 %ip0
  store i32 %vecext5, i32* %arrayidx8, align 4
  %vecext11 = extractelement <4 x i32> %am, i32 %ip2
  %arrayidx14 = getelementptr inbounds i32, i32* %x, i32 %ip2
  store i32 %vecext11, i32* %arrayidx14, align 4
  %vecext17 = extractelement <4 x i32> %am, i32 %ip3
  %arrayidx20 = getelementptr inbounds i32, i32* %x, i32 %ip1
  store i32 %vecext17, i32* %arrayidx20, align 4
  ret void
}

attributes #0 = { nounwind }