File: aarch64-ldst-no-premature-sp-pop.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (85 lines) | stat: -rw-r--r-- 2,524 bytes parent folder | download | duplicates (3)
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 -start-before=aarch64-ldst-opt -o - %s | FileCheck %s
# CHECK-NOT: stp     xzr, xzr, [sp], #16
# CHECK:     add     sp, sp, #16
--- |
  target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
  target triple = "aarch64"

  define hidden i32 @foo(i32 %0) {
    %2 = alloca [4 x i32], align 4
    %3 = bitcast [4 x i32]* %2 to i8*
    call void @llvm.memset.p0i8.i64(i8* nonnull align 4 dereferenceable(16) %3, i8 0, i64 16, i1 false)
    %4 = sext i32 %0 to i64
    %5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %4
    %6 = load i32, i32* %5, align 4
    ret i32 %6
  }

  declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #2
  declare void @llvm.stackprotector(i8*, i8**) #3

  !llvm.module.flags = !{!0}
  !llvm.ident = !{!1}

  !0 = !{i32 1, !"wchar_size", i32 4}
  !1 = !{!"clang version 11.0.0 "}
  !2 = !{!3, !3, i64 0}
  !3 = !{!"int", !4, i64 0}
  !4 = !{!"omnipotent char", !5, i64 0}
  !5 = !{!"Simple C++ TBAA"}

...
---
name:            foo
alignment:       8
exposesReturnsTwice: false
legalized:       false
regBankSelected: false
selected:        false
failedISel:      false
tracksRegLiveness: true
hasWinCFI:       false
registers:       []
liveins:
  - { reg: '$w0', virtual-reg: '' }
frameInfo:
  isFrameAddressTaken: false
  isReturnAddressTaken: false
  hasStackMap:     false
  hasPatchPoint:   false
  stackSize:       16
  offsetAdjustment: 0
  maxAlignment:    8
  adjustsStack:    false
  hasCalls:        false
  stackProtector:  ''
  maxCallFrameSize: 0
  cvBytesOfCalleeSavedRegisters: 0
  hasOpaqueSPAdjustment: false
  hasVAStart:      false
  hasMustTailInVarArgFunc: false
  localFrameSize:  16
  savePoint:       ''
  restorePoint:    ''
fixedStack:      []
stack:
  - { id: 0, type: default, offset: -16, size: 16,
      alignment: 8, stack-id: default, callee-saved-register: '', callee-saved-restored: true, 
      local-offset: -16, debug-info-variable: '', debug-info-expression: '',
      debug-info-location: '' }
callSites:       []
constants:       []
machineFunctionInfo: {}
body:             |
  bb.0 (%ir-block.1):
    liveins: $w0

    $sp = frame-setup SUBXri $sp, 16, 0
    $x8 = ADDXri $sp, 0, 0
    STRXui $xzr, $sp, 1 :: (store (s64) into %ir.3 + 8)
    STRXui $xzr, $sp, 0 :: (store (s64) into %ir.3)
    renamable $w0 = LDRWroW killed renamable $x8, killed renamable $w0, 1, 1 :: (load (s32) from %ir.5, !tbaa !2)
    $sp = frame-destroy ADDXri $sp, 16, 0
    RET undef $lr, implicit $w0

...