File: fastalloca.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 (32 lines) | stat: -rw-r--r-- 1,215 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
; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel-abort=3 -mcpu=mips32r2 \
; RUN:     < %s -verify-machineinstrs | FileCheck %s

%struct.x = type { i32 }

@i = common global i32 0, align 4

define i32 @foobar(i32 signext %x) {
entry:
; CHECK-LABEL: foobar:
  %retval = alloca i32, align 4
  %x.addr = alloca i32, align 4
  %a = alloca %struct.x, align 4
  %c = alloca %struct.x*, align 4
  store i32 %x, i32* %x.addr, align 4
  %x1 = getelementptr inbounds %struct.x, %struct.x* %a, i32 0, i32 0
  %0 = load i32, i32* %x.addr, align 4
  store i32 %0, i32* %x1, align 4
  store %struct.x* %a, %struct.x** %c, align 4
  %1 = load %struct.x*, %struct.x** %c, align 4
  %x2 = getelementptr inbounds %struct.x, %struct.x* %1, i32 0, i32 0
  %2 = load i32, i32* %x2, align 4
  store i32 %2, i32* @i, align 4
  %3 = load i32, i32* %retval
; CHECK:        addiu   $[[A_ADDR:[0-9]+]], $sp, 8
; CHECK-DAG:    lw      $[[I_ADDR:[0-9]+]], %got(i)($[[REG_GP:[0-9]+]])
; CHECK-DAG:    sw      $[[A_ADDR]], [[A_ADDR_FI:[0-9]+]]($sp)
; CHECK-DAG:    lw      $[[A_ADDR2:[0-9]+]], [[A_ADDR_FI]]($sp)
; CHECK-DAG:    lw      $[[A_X:[0-9]+]], 0($[[A_ADDR2]])
; CHECK-DAG:    sw      $[[A_X]], 0($[[I_ADDR]])
  ret i32 %3
}