When a module contains more than one function, we should update debugify metadata by increasing the number of variables in the function rather than overwritting it. Differential Revision: https://reviews.llvm.org/D136949
166 lines
4.2 KiB
YAML
166 lines
4.2 KiB
YAML
# RUN: llc -run-pass=mir-debugify,mir-check-debugify -o - %s 2>&1 | FileCheck %s
|
|
|
|
# CHECK: Machine IR debug info check: PASS
|
|
# CHECK-NOT: Assertion `Var <= NumVars && "Unexpected name for DILocalVariable"'
|
|
|
|
--- |
|
|
define i32 @foo(i32 %a0, i32 %a1, i32 %a2, i32 %a3) {
|
|
%t0 = add i32 %a0, %a1
|
|
%t1 = add i32 %t0, %a2
|
|
%t2 = add i32 %t1, %a3
|
|
ret i32 %t2
|
|
}
|
|
|
|
define i32 @bar(i32 %a0, i32 %a1, i32 %a2, i32 %a3) {
|
|
%t0 = add i32 %a0, %a1
|
|
%t1 = add i32 %a2, %t0
|
|
%t2 = add i32 %t1, %a3
|
|
ret i32 %t2
|
|
}
|
|
|
|
...
|
|
---
|
|
name: foo
|
|
alignment: 16
|
|
exposesReturnsTwice: false
|
|
legalized: false
|
|
regBankSelected: false
|
|
selected: false
|
|
failedISel: false
|
|
tracksRegLiveness: true
|
|
hasWinCFI: false
|
|
callsEHReturn: false
|
|
callsUnwindInit: false
|
|
hasEHCatchret: false
|
|
hasEHScopes: false
|
|
hasEHFunclets: false
|
|
failsVerification: false
|
|
tracksDebugUserValues: false
|
|
registers:
|
|
- { id: 0, class: _, preferred-register: '' }
|
|
- { id: 1, class: _, preferred-register: '' }
|
|
- { id: 2, class: _, preferred-register: '' }
|
|
- { id: 3, class: _, preferred-register: '' }
|
|
- { id: 4, class: _, preferred-register: '' }
|
|
- { id: 5, class: _, preferred-register: '' }
|
|
- { id: 6, class: _, preferred-register: '' }
|
|
liveins:
|
|
- { reg: '$edi', virtual-reg: '' }
|
|
- { reg: '$esi', virtual-reg: '' }
|
|
- { reg: '$edx', virtual-reg: '' }
|
|
- { reg: '$ecx', virtual-reg: '' }
|
|
frameInfo:
|
|
isFrameAddressTaken: false
|
|
isReturnAddressTaken: false
|
|
hasStackMap: false
|
|
hasPatchPoint: false
|
|
stackSize: 0
|
|
offsetAdjustment: 0
|
|
maxAlignment: 1
|
|
adjustsStack: false
|
|
hasCalls: false
|
|
stackProtector: ''
|
|
functionContext: ''
|
|
maxCallFrameSize: 4294967295
|
|
cvBytesOfCalleeSavedRegisters: 0
|
|
hasOpaqueSPAdjustment: false
|
|
hasVAStart: false
|
|
hasMustTailInVarArgFunc: false
|
|
hasTailCall: false
|
|
localFrameSize: 0
|
|
savePoint: ''
|
|
restorePoint: ''
|
|
fixedStack: []
|
|
stack: []
|
|
callSites: []
|
|
debugValueSubstitutions: []
|
|
constants: []
|
|
machineFunctionInfo: {}
|
|
body: |
|
|
bb.1 (%ir-block.0):
|
|
liveins: $ecx, $edi, $edx, $esi
|
|
|
|
%0:_(s32) = COPY $edi
|
|
%1:_(s32) = COPY $esi
|
|
%2:_(s32) = COPY $edx
|
|
%3:_(s32) = COPY $ecx
|
|
%4:_(s32) = G_ADD %0, %1
|
|
%5:_(s32) = G_ADD %4, %2
|
|
%6:_(s32) = G_ADD %5, %3
|
|
$eax = COPY %6(s32)
|
|
RET 0, implicit $eax
|
|
|
|
...
|
|
---
|
|
name: bar
|
|
alignment: 16
|
|
exposesReturnsTwice: false
|
|
legalized: false
|
|
regBankSelected: false
|
|
selected: false
|
|
failedISel: false
|
|
tracksRegLiveness: true
|
|
hasWinCFI: false
|
|
callsEHReturn: false
|
|
callsUnwindInit: false
|
|
hasEHCatchret: false
|
|
hasEHScopes: false
|
|
hasEHFunclets: false
|
|
failsVerification: false
|
|
tracksDebugUserValues: false
|
|
registers:
|
|
- { id: 0, class: _, preferred-register: '' }
|
|
- { id: 1, class: _, preferred-register: '' }
|
|
- { id: 2, class: _, preferred-register: '' }
|
|
- { id: 3, class: _, preferred-register: '' }
|
|
- { id: 4, class: _, preferred-register: '' }
|
|
- { id: 5, class: _, preferred-register: '' }
|
|
- { id: 6, class: _, preferred-register: '' }
|
|
liveins:
|
|
- { reg: '$edi', virtual-reg: '' }
|
|
- { reg: '$esi', virtual-reg: '' }
|
|
- { reg: '$edx', virtual-reg: '' }
|
|
- { reg: '$ecx', virtual-reg: '' }
|
|
frameInfo:
|
|
isFrameAddressTaken: false
|
|
isReturnAddressTaken: false
|
|
hasStackMap: false
|
|
hasPatchPoint: false
|
|
stackSize: 0
|
|
offsetAdjustment: 0
|
|
maxAlignment: 1
|
|
adjustsStack: false
|
|
hasCalls: false
|
|
stackProtector: ''
|
|
functionContext: ''
|
|
maxCallFrameSize: 4294967295
|
|
cvBytesOfCalleeSavedRegisters: 0
|
|
hasOpaqueSPAdjustment: false
|
|
hasVAStart: false
|
|
hasMustTailInVarArgFunc: false
|
|
hasTailCall: false
|
|
localFrameSize: 0
|
|
savePoint: ''
|
|
restorePoint: ''
|
|
fixedStack: []
|
|
stack: []
|
|
callSites: []
|
|
debugValueSubstitutions: []
|
|
constants: []
|
|
machineFunctionInfo: {}
|
|
body: |
|
|
bb.1 (%ir-block.0):
|
|
liveins: $ecx, $edi, $edx, $esi
|
|
|
|
%0:_(s32) = COPY $edi
|
|
%1:_(s32) = COPY $esi
|
|
%2:_(s32) = COPY $edx
|
|
%3:_(s32) = COPY $ecx
|
|
%4:_(s32) = G_ADD %0, %1
|
|
%5:_(s32) = G_ADD %2, %4
|
|
%6:_(s32) = G_ADD %5, %3
|
|
$eax = COPY %6(s32)
|
|
RET 0, implicit $eax
|
|
|
|
...
|