Skip to content

Commit 218da1b

Browse files
committed
more
1 parent 2029b03 commit 218da1b

File tree

1 file changed

+74
-8
lines changed

1 file changed

+74
-8
lines changed

llvm/test/DebugInfo/MIR/InstrRef/x86-cmov-converter.mir

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
12
# RUN: llc %s -o - --run-pass=x86-cmov-conversion -mtriple=x86_64-- | FileCheck %s
23
# REQUIRES: x86-registered-target
34
#
@@ -6,14 +7,6 @@
67
# locations. Check that this still works when unfolding memory operands, which
78
# involves more decomposition of instructions.
89
#
9-
# CHECK-LABEL: name: CmovInHotPath
10-
# CHECK-LABEL: bb.3.for.body:
11-
# CHECK: CMOV32rr {{.*}}, debug-instr-number 1
12-
#
13-
# CHECK-LABEL: name: test_cmov_memoperand_in_group_reuse_for_addr2
14-
# CHECK-LABEL: bb.2.entry:
15-
# CHECK-NEXT: PHI {{.*}} debug-instr-number 1,
16-
# CHECK-NEXT: PHI {{.*}} debug-instr-number 2,
1710
--- |
1811
; ModuleID = 'x86-cmov-converter.ll'
1912
source_filename = "x86-cmov-converter.ll"
@@ -110,6 +103,55 @@ liveins:
110103
- { reg: '$rcx', virtual-reg: '%8' }
111104
machineFunctionInfo: {}
112105
body: |
106+
; CHECK-LABEL: name: CmovInHotPath
107+
; CHECK: bb.0.entry:
108+
; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
109+
; CHECK-NEXT: liveins: $edi, $esi, $edx, $rcx
110+
; CHECK-NEXT: {{ $}}
111+
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64 = COPY $rcx
112+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr32 = COPY $edx
113+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr32 = COPY $esi
114+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr32 = COPY $edi
115+
; CHECK-NEXT: TEST32rr [[COPY3]], [[COPY3]], implicit-def $eflags, debug-location !12
116+
; CHECK-NEXT: JCC_1 %bb.2, 14, implicit $eflags
117+
; CHECK-NEXT: JMP_1 %bb.1
118+
; CHECK-NEXT: {{ $}}
119+
; CHECK-NEXT: bb.1.for.body.preheader:
120+
; CHECK-NEXT: successors: %bb.3(0x80000000)
121+
; CHECK-NEXT: {{ $}}
122+
; CHECK-NEXT: [[MOV32rr:%[0-9]+]]:gr32 = MOV32rr [[COPY3]], debug-location !13
123+
; CHECK-NEXT: [[SUBREG_TO_REG:%[0-9]+]]:gr64 = SUBREG_TO_REG 0, killed [[MOV32rr]], %subreg.sub_32bit, debug-location !13
124+
; CHECK-NEXT: JMP_1 %bb.3
125+
; CHECK-NEXT: {{ $}}
126+
; CHECK-NEXT: bb.2.for.cond.cleanup:
127+
; CHECK-NEXT: RET 0
128+
; CHECK-NEXT: {{ $}}
129+
; CHECK-NEXT: bb.3.for.body:
130+
; CHECK-NEXT: successors: %bb.4(0x40000000), %bb.5(0x40000000)
131+
; CHECK-NEXT: {{ $}}
132+
; CHECK-NEXT: [[PHI:%[0-9]+]]:gr64 = PHI [[COPY]], %bb.1, %4, %bb.5
133+
; CHECK-NEXT: [[PHI1:%[0-9]+]]:gr64 = PHI [[SUBREG_TO_REG]], %bb.1, %3, %bb.5
134+
; CHECK-NEXT: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm [[PHI]], 1, $noreg, 0, $noreg, debug-location !13 :: (load (s32) from %ir.lsr.iv1)
135+
; CHECK-NEXT: [[INC32r:%[0-9]+]]:gr32 = nsw INC32r [[MOV32rm]], implicit-def dead $eflags, debug-location !13
136+
; CHECK-NEXT: [[IMUL32rr:%[0-9]+]]:gr32 = nsw IMUL32rr [[MOV32rm]], [[COPY2]], implicit-def dead $eflags, debug-location !13
137+
; CHECK-NEXT: [[SUB32rr:%[0-9]+]]:gr32 = SUB32rr [[IMUL32rr]], [[COPY1]], implicit-def $eflags, debug-location !13
138+
; CHECK-NEXT: [[MOV32ri:%[0-9]+]]:gr32 = MOV32ri 10
139+
; CHECK-NEXT: JCC_1 %bb.5, 15, implicit $eflags, debug-location !13
140+
; CHECK-NEXT: {{ $}}
141+
; CHECK-NEXT: bb.4.for.body:
142+
; CHECK-NEXT: successors: %bb.5(0x80000000)
143+
; CHECK-NEXT: {{ $}}
144+
; CHECK-NEXT: bb.5.for.body:
145+
; CHECK-NEXT: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
146+
; CHECK-NEXT: {{ $}}
147+
; CHECK-NEXT: [[PHI2:%[0-9]+]]:gr32 = PHI [[INC32r]], %bb.4, [[MOV32ri]], %bb.3, debug-instr-number 1, debug-location !13
148+
; CHECK-NEXT: DBG_INSTR_REF !14, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(1, 0), debug-location !13
149+
; CHECK-NEXT: [[IMUL32rr1:%[0-9]+]]:gr32 = nsw IMUL32rr [[PHI2]], [[INC32r]], implicit-def dead $eflags, debug-location !13
150+
; CHECK-NEXT: MOV32mr [[PHI]], 1, $noreg, 0, $noreg, killed [[IMUL32rr1]], debug-location !13 :: (store (s32) into %ir.lsr.iv1)
151+
; CHECK-NEXT: [[ADD64ri8_:%[0-9]+]]:gr64 = ADD64ri8 [[PHI]], 4, implicit-def dead $eflags, debug-location !13
152+
; CHECK-NEXT: [[DEC64r:%[0-9]+]]:gr64 = DEC64r [[PHI1]], implicit-def $eflags, debug-location !13
153+
; CHECK-NEXT: JCC_1 %bb.2, 4, implicit $eflags, debug-location !13
154+
; CHECK-NEXT: JMP_1 %bb.3, debug-location !13
113155
bb.0.entry:
114156
successors: %bb.1(0x50000000), %bb.2(0x30000000)
115157
liveins: $edi, $esi, $edx, $rcx
@@ -177,6 +219,30 @@ body: |
177219
bb.0.entry:
178220
liveins: $edi, $esi, $rdx, $rcx
179221
222+
; CHECK-LABEL: name: test_cmov_memoperand_in_group_reuse_for_addr2
223+
; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
224+
; CHECK-NEXT: liveins: $edi, $esi, $rdx, $rcx
225+
; CHECK-NEXT: {{ $}}
226+
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64 = COPY $rcx
227+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr64 = COPY $rdx
228+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:gr32 = COPY $esi
229+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr32 = COPY $edi
230+
; CHECK-NEXT: [[SUB32rr:%[0-9]+]]:gr32 = SUB32rr [[COPY3]], [[COPY2]], implicit-def $eflags, debug-location !16
231+
; CHECK-NEXT: JCC_1 %bb.2, 7, implicit $eflags, debug-location !16
232+
; CHECK-NEXT: {{ $}}
233+
; CHECK-NEXT: .1.entry:
234+
; CHECK-NEXT: successors: %bb.2(0x80000000)
235+
; CHECK-NEXT: {{ $}}
236+
; CHECK-NEXT: [[MOV64rm:%[0-9]+]]:gr64 = MOV64rm [[COPY]], 1, $noreg, 0, $noreg :: (load (s64) from %ir.y)
237+
; CHECK-NEXT: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm [[MOV64rm]], 1, $noreg, 0, $noreg :: (load (s32) from %ir.p)
238+
; CHECK-NEXT: {{ $}}
239+
; CHECK-NEXT: .2.entry:
240+
; CHECK-NEXT: [[PHI:%[0-9]+]]:gr64 = PHI [[MOV64rm]], %bb.1, [[COPY1]], %bb.0, debug-instr-number 1, debug-location !16
241+
; CHECK-NEXT: [[PHI1:%[0-9]+]]:gr32 = PHI [[MOV32rm]], %bb.1, [[COPY3]], %bb.0, debug-instr-number 2, debug-location !16
242+
; CHECK-NEXT: DBG_INSTR_REF !17, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(1, 0), debug-location !16
243+
; CHECK-NEXT: DBG_INSTR_REF !18, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(2, 0), debug-location !16
244+
; CHECK-NEXT: $eax = COPY [[PHI1]], debug-location !16
245+
; CHECK-NEXT: RET 0, $eax, debug-location !16
180246
%3:gr64 = COPY $rcx
181247
%2:gr64 = COPY $rdx
182248
%1:gr32 = COPY $esi

0 commit comments

Comments
 (0)