File: remove-redundant-li-skip-imp-kill.mir

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 (114 lines) | stat: -rw-r--r-- 4,511 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown -run-pass \
# RUN:   ppc-pre-emit-peephole %s -o - | FileCheck %s
--- |
  ; ModuleID = 'a.ll'
  source_filename = "a.ll"
  target datalayout = "e-m:e-i64:64-n32:64"

  ; Function Attrs: nounwind
  define dso_local signext i32 @b(i32 signext %a, i32* nocapture %b) local_unnamed_addr #0 {
  entry:
    %call = tail call signext i32 @g(i32 signext %a)
    store i32 %call, i32* %b, align 4
    %call1 = tail call signext i32 @g(i32 signext %a)
    ret i32 %call1
  }

  ; Function Attrs: nounwind
  declare signext i32 @g(i32 signext) local_unnamed_addr #0

  ; Function Attrs: nounwind
  declare void @llvm.stackprotector(i8*, i8**) #0

  attributes #0 = { nounwind }

...
---
name:            b
alignment:       16
exposesReturnsTwice: false
legalized:       false
regBankSelected: false
selected:        false
failedISel:      false
tracksRegLiveness: true
hasWinCFI:       false
registers:       []
liveins:
  - { reg: '$x3', virtual-reg: '' }
  - { reg: '$x4', virtual-reg: '' }
frameInfo:
  isFrameAddressTaken: false
  isReturnAddressTaken: false
  hasStackMap:     false
  hasPatchPoint:   false
  stackSize:       64
  offsetAdjustment: 0
  maxAlignment:    1
  adjustsStack:    true
  hasCalls:        true
  stackProtector:  ''
  maxCallFrameSize: 32
  cvBytesOfCalleeSavedRegisters: 0
  hasOpaqueSPAdjustment: false
  hasVAStart:      false
  hasMustTailInVarArgFunc: false
  localFrameSize:  0
  savePoint:       ''
  restorePoint:    ''
fixedStack:
  - { id: 0, type: spill-slot, offset: -80, size: 8, alignment: 16, stack-id: default,
      callee-saved-register: '$x30', callee-saved-restored: true, debug-info-variable: '',
      debug-info-expression: '', debug-info-location: '' }
  - { id: 1, type: spill-slot, offset: -88, size: 8, alignment: 8, stack-id: default,
      callee-saved-register: '$x29', callee-saved-restored: true, debug-info-variable: '',
      debug-info-expression: '', debug-info-location: '' }
stack:           []
callSites:       []
constants:       []
machineFunctionInfo: {}
body:             |
  bb.0.entry:
    liveins: $x3, $x4, $x29, $x30

    ; CHECK-LABEL: name: b
    ; CHECK: liveins: $x3, $x4, $x29, $x30
    ; CHECK: $x0 = MFLR8 implicit $lr8
    ; CHECK: STD killed $x29, -24, $x1 :: (store (s64) into %fixed-stack.0)
    ; CHECK: STD killed $x30, -16, $x1 :: (store (s64) into %fixed-stack.1, align 16)
    ; CHECK: STD killed $x0, 16, $x1
    ; CHECK: $x1 = STDU $x1, -64, $x1
    ; CHECK: $x30 = OR8 killed $x4, $x4
    ; CHECK: dead $r4 = LI 10, implicit-def $x4
    ; CHECK: $x29 = OR8 $x3, $x3
    ; CHECK: BL8_NOP @g, csr_ppc64_r2_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit killed $x4, implicit $x2, implicit-def $r1, implicit-def $x3
    ; CHECK: STW8 killed renamable $x3, 0, killed renamable $x30 :: (store (s32) into %ir.b)
    ; CHECK: $x3 = OR8 killed $x29, $x29
    ; CHECK: BL8_NOP @g, csr_ppc64_r2_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def $x3
    ; CHECK: $x1 = ADDI8 $x1, 64
    ; CHECK: $x0 = LD 16, $x1
    ; CHECK: $x30 = LD -16, $x1 :: (load (s64) from %fixed-stack.1, align 16)
    ; CHECK: $x29 = LD -24, $x1 :: (load (s64) from %fixed-stack.0)
    ; CHECK: MTLR8 killed $x0, implicit-def $lr8
    ; CHECK: BLR8 implicit $lr8, implicit $rm, implicit killed $x3
    $x0 = MFLR8 implicit $lr8
    STD killed $x29, -24, $x1 :: (store (s64) into %fixed-stack.1)
    STD killed $x30, -16, $x1 :: (store (s64) into %fixed-stack.0, align 16)
    STD killed $x0, 16, $x1
    $x1 = STDU $x1, -64, $x1
    $x30 = OR8 killed $x4, $x4
    dead $r4 = LI 10, implicit-def $x4
    $x29 = OR8 $x3, $x3
    BL8_NOP @g, csr_ppc64_r2_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit killed $x4, implicit $x2, implicit-def $r1, implicit-def $x3
    STW8 killed renamable $x3, 0, killed renamable $x30 :: (store (s32) into %ir.b)
    $x3 = OR8 killed $x29, $x29
    BL8_NOP @g, csr_ppc64_r2_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def $x3
    $x1 = ADDI8 $x1, 64
    $x0 = LD 16, $x1
    $x30 = LD -16, $x1 :: (load (s64) from %fixed-stack.0, align 16)
    $x29 = LD -24, $x1 :: (load (s64) from %fixed-stack.1)
    MTLR8 killed $x0, implicit-def $lr8
    BLR8 implicit $lr8, implicit $rm, implicit killed $x3

...