File: unalignedload.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (85 lines) | stat: -rw-r--r-- 3,464 bytes parent folder | download | duplicates (7)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
; RUN: llc  < %s -march=mipsel -mcpu=mips32   -relocation-model=pic | FileCheck %s -check-prefixes=ALL,MIPS32-EL
; RUN: llc  < %s -march=mips   -mcpu=mips32   -relocation-model=pic | FileCheck %s -check-prefixes=ALL,MIPS32-EB
; RUN: llc  < %s -march=mipsel -mcpu=mips32r2 -relocation-model=pic | FileCheck %s -check-prefixes=ALL,MIPS32-EL
; RUN: llc  < %s -march=mips   -mcpu=mips32r2 -relocation-model=pic | FileCheck %s -check-prefixes=ALL,MIPS32-EB
; RUN: llc  < %s -march=mipsel -mcpu=mips32r6 -relocation-model=pic | FileCheck %s -check-prefixes=ALL,MIPS32R6-EL
; RUN: llc  < %s -march=mips   -mcpu=mips32r6 -relocation-model=pic | FileCheck %s -check-prefixes=ALL,MIPS32R6-EB
%struct.S2 = type { %struct.S1, %struct.S1 }
%struct.S1 = type { i8, i8 }
%struct.S4 = type { [7 x i8] }

@s2 = common global %struct.S2 zeroinitializer, align 1
@s4 = common global %struct.S4 zeroinitializer, align 1

define void @bar1() nounwind {
entry:
; ALL-LABEL: bar1:

; ALL-DAG:       lw $[[R0:[0-9]+]], %got(s2)(

; MIPS32-EL-DAG: lbu $[[PART1:[0-9]+]], 2($[[R0]])
; MIPS32-EL-DAG: lbu $[[PART2:[0-9]+]], 3($[[R0]])
; MIPS32-EL-DAG: sll $[[T0:[0-9]+]], $[[PART2]], 8
; MIPS32-EL-DAG: or  $4, $[[T0]], $[[PART1]]

; MIPS32-EB-DAG: lbu $[[PART1:[0-9]+]], 2($[[R0]])
; MIPS32-EB-DAG: lbu $[[PART2:[0-9]+]], 3($[[R0]])
; MIPS32-EB-DAG: sll $[[T0:[0-9]+]], $[[PART1]], 8
; MIPS32-EB-DAG: or  $[[T1:[0-9]+]], $[[T0]], $[[PART2]]
; MIPS32-EB-DAG: sll $4, $[[T1]], 16

; MIPS32R6-DAG:  lhu $[[PART1:[0-9]+]], 2($[[R0]])

  tail call void @foo2(%struct.S1* byval(%struct.S1) getelementptr inbounds (%struct.S2, %struct.S2* @s2, i32 0, i32 1)) nounwind
  ret void
}

define void @bar2() nounwind {
entry:
; ALL-LABEL: bar2:

; ALL-DAG:       lw $[[R2:[0-9]+]], %got(s4)(

; MIPS32-EL-DAG: lwl $[[R1:4]], 3($[[R2]])
; MIPS32-EL-DAG: lwr $[[R1]], 0($[[R2]])
; MIPS32-EL-DAG: lbu $[[T0:[0-9]+]], 4($[[R2]])
; MIPS32-EL-DAG: lbu $[[T1:[0-9]+]], 5($[[R2]])
; MIPS32-EL-DAG: lbu $[[T2:[0-9]+]], 6($[[R2]])
; MIPS32-EL-DAG: sll $[[T3:[0-9]+]], $[[T1]], 8
; MIPS32-EL-DAG: or  $[[T4:[0-9]+]], $[[T3]], $[[T0]]
; MIPS32-EL-DAG: sll $[[T5:[0-9]+]], $[[T2]], 16
; MIPS32-EL-DAG: or  $5, $[[T4]], $[[T5]]

; MIPS32-EB-DAG: lwl $[[R1:4]], 0($[[R2]])
; MIPS32-EB-DAG: lwr $[[R1]], 3($[[R2]])
; MIPS32-EB-DAG: lbu $[[T0:[0-9]+]], 4($[[R2]])
; MIPS32-EB-DAG: lbu $[[T1:[0-9]+]], 5($[[R2]])
; MIPS32-EB-DAG: lbu $[[T2:[0-9]+]], 6($[[R2]])
; MIPS32-EB-DAG: sll $[[T3:[0-9]+]], $[[T0]], 8
; MIPS32-EB-DAG: or  $[[T4:[0-9]+]], $[[T3]], $[[T1]]
; MIPS32-EB-DAG: sll $[[T5:[0-9]+]], $[[T4]], 16
; MIPS32-EB-DAG: sll $[[T6:[0-9]+]], $[[T2]], 8
; MIPS32-EB-DAG: or  $5, $[[T5]], $[[T6]]

; FIXME: We should be able to do better than this using lhu
; MIPS32R6-EL-DAG: lw $4, 0($[[R2]])
; MIPS32R6-EL-DAG: lhu $[[T0:[0-9]+]], 4($[[R2]])
; MIPS32R6-EL-DAG: lbu $[[T1:[0-9]+]], 6($[[R2]])
; MIPS32R6-EL-DAG: sll $[[T2:[0-9]+]], $[[T1]], 16
; MIPS32R6-EL-DAG: or  $5, $[[T0]], $[[T2]]

; FIXME: We should be able to do better than this using lhu
; MIPS32R6-EB-DAG: lw $4, 0($[[R2]])
; MIPS32R6-EB-DAG: lhu $[[T0:[0-9]+]], 4($[[R2]])
; MIPS32R6-EB-DAG: lbu $[[T1:[0-9]+]], 6($[[R2]])
; MIPS32R6-EB-DAG: sll $[[T2:[0-9]+]], $[[T0]], 16
; MIPS32R6-EB-DAG: sll $[[T3:[0-9]+]], $[[T1]], 8
; MIPS32R6-EB-DAG: or  $5, $[[T2]], $[[T3]]

  tail call void @foo4(%struct.S4* byval(%struct.S4) @s4) nounwind
  ret void
}

declare void @foo2(%struct.S1* byval(%struct.S1))

declare void @foo4(%struct.S4* byval(%struct.S4))