Debian Codegraph @

llvm/test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir

raw
1 # RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu -start-after \
2 # RUN: virtregrewriter -ppc-asm-full-reg-names -verify-machineinstrs %s \
3 # RUN: -o - | FileCheck %s
4 # RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu -start-after \
5 # RUN: virtregrewriter -ppc-asm-full-reg-names -verify-machineinstrs %s \
6 # RUN: -o - | FileCheck %s
7 # RUN: llc -mcpu=pwr10 -mtriple=powerpc64le-unknown-linux-gnu -start-after \
8 # RUN: virtregrewriter -ppc-asm-full-reg-names -verify-machineinstrs %s \
9 # RUN: -o - | FileCheck %s
10
11 --- |
12 ; ModuleID = 'a.ll'
13 source_filename = "a.c"
14 target datalayout = "e-m:e-i64:64-n32:64"
15 target triple = "powerpc64le-unknown-linux-gnu"
16
17 ; Function Attrs: nounwind
18 define void @test(i32 signext %a6, i32 signext %a7, i32 signext %a17) local_unnamed_addr #0 {
19 entry:
20 %cmp27 = icmp slt i32 %a6, %a7
21 %cmp29 = icmp sgt i32 %a6, %a17
22 %or.cond781 = or i1 %cmp27, %cmp29
23 tail call void asm sideeffect "# nothing", "~{cr0},~{cr1},~{cr2},~{cr3},~{cr4},~{cr5},~{cr6},~{cr7},~{memory}"() #1, !srcloc !1
24 br label %if.end326
25
26 if.end326: ; preds = %entry
27 br i1 %or.cond781, label %if.then330, label %if.end331
28
29 if.then330: ; preds = %if.end326
30 unreachable
31
32 if.end331: ; preds = %if.end326
33 ret void
34 }
35
36 ; Function Attrs: nounwind
37 declare void @llvm.stackprotector(ptr, ptr) #1
38
39 attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }
40 attributes #1 = { nounwind }
41
42 !llvm.ident = !{!0}
43
44 !0 = !{!"clang version 8.0.0 (trunk 349357)"}
45 !1 = !{i32 3373}
46
47 ...
48 ---
49 name: test
50 alignment: 16
51 exposesReturnsTwice: false
52 legalized: false
53 regBankSelected: false
54 selected: false
55 failedISel: false
56 tracksRegLiveness: true
57 hasWinCFI: false
58 registers: []
59 liveins:
60 - { reg: '$x3', virtual-reg: '' }
61 - { reg: '$x4', virtual-reg: '' }
62 - { reg: '$x5', virtual-reg: '' }
63 frameInfo:
64 isFrameAddressTaken: false
65 isReturnAddressTaken: false
66 hasStackMap: false
67 hasPatchPoint: false
68 stackSize: 0
69 offsetAdjustment: 0
70 maxAlignment: 4
71 adjustsStack: false
72 hasCalls: false
73 stackProtector: ''
74 maxCallFrameSize: 4294967295
75 cvBytesOfCalleeSavedRegisters: 0
76 hasOpaqueSPAdjustment: false
77 hasVAStart: false
78 hasMustTailInVarArgFunc: false
79 localFrameSize: 0
80 savePoint: []
81 restorePoint: []
82 fixedStack: []
83 stack:
84 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4,
85 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
86 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
87 - { id: 1, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4,
88 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
89 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
90 - { id: 2, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4,
91 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
92 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
93 constants: []
94 body: |
95 bb.0.entry:
96 liveins: $x3, $x4, $x5
97
98 renamable $cr0 = CMPW renamable $r3, renamable $r4, implicit $x4
99 renamable $cr1 = CMPW renamable $r3, renamable $r5, implicit $x5, implicit killed $x3
100 renamable $cr5lt = CRNOR renamable $cr0lt, renamable $cr1gt, implicit killed $cr0
101 renamable $cr5gt = COPY renamable $cr1gt, implicit $cr1
102 ; CHECK: crnor 4*cr5+lt, lt, 4*cr1+gt
103 ; CHECK: crmove 4*cr5+gt, 4*cr1+gt
104 SPILL_CRBIT killed renamable $cr5lt, 0, %stack.0 :: (store (s32) into %stack.0)
105 renamable $cr1 = CMPW renamable $r4, renamable $r5, implicit killed $x5, implicit killed $x4
106 SPILL_CRBIT killed renamable $cr5gt, 0, %stack.1 :: (store (s32) into %stack.1)
107 SPILL_CRBIT killed renamable $cr1gt, 0, %stack.2 :: (store (s32) into %stack.2)
108 INLINEASM &"# nothing", 25, 12, implicit-def dead early-clobber $cr0, 12, implicit-def dead early-clobber $cr1, 12, implicit-def dead early-clobber $cr2, 12, implicit-def dead early-clobber $cr3, 12, implicit-def dead early-clobber $cr4, 12, implicit-def dead early-clobber $cr5, 12, implicit-def dead early-clobber $cr6, 12, implicit-def dead early-clobber $cr7, !1
109 BLR8 implicit $lr8, implicit $rm
110
111 bb.1.if.end326:
112 successors: %bb.2(0x00000001), %bb.3(0x7fffffff)
113
114 renamable $cr5lt = RESTORE_CRBIT 0, %stack.0 :: (load (s32) from %stack.0)
115 renamable $cr5gt = RESTORE_CRBIT 0, %stack.1 :: (load (s32) from %stack.1)
116 renamable $cr5lt = CROR killed renamable $cr5lt, killed renamable $cr5gt
117 BCn killed renamable $cr5lt, %bb.3
118 B %bb.2
119
120 bb.2.if.then330:
121 successors:
122
123
124 bb.3.if.end331:
125 BLR8 implicit $lr8, implicit $rm
126
127 ...