mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-24 20:30:06 +00:00
Update LiveDebugValues to generate DIExpressions for spill offsets
instead of using the deprecated offset field of DBG_VALUE. This has no observable effect on the generated DWARF, but the assembler comments will look different. rdar://problem/33580047 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5f53af3617
commit
cc3f143b8d
@ -29,6 +29,7 @@
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/CodeGen/MachineMemOperand.h"
|
||||
#include "llvm/CodeGen/MachineModuleInfo.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/IR/DebugInfo.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
@ -446,11 +447,15 @@ void LiveDebugValues::transferSpillInst(MachineInstr &MI,
|
||||
// iterator in our caller.
|
||||
unsigned SpillBase;
|
||||
int SpillOffset = extractSpillBaseRegAndOffset(MI, SpillBase);
|
||||
const Module *M = MF->getMMI().getModule();
|
||||
const MachineInstr *DMI = &VarLocIDs[ID].MI;
|
||||
auto *SpillExpr = DIExpression::prepend(
|
||||
DMI->getDebugExpression(), DIExpression::NoDeref, SpillOffset);
|
||||
// Add the expression to the metadata graph so isn't lost in MIR dumps.
|
||||
M->getNamedMetadata("llvm.dbg.mir")->addOperand(SpillExpr);
|
||||
MachineInstr *SpDMI =
|
||||
BuildMI(*MF, DMI->getDebugLoc(), DMI->getDesc(), true, SpillBase,
|
||||
DMI->getDebugVariable(), DMI->getDebugExpression());
|
||||
SpDMI->getOperand(1).setImm(SpillOffset);
|
||||
DMI->getDebugVariable(), SpillExpr);
|
||||
DEBUG(dbgs() << "Creating DBG_VALUE inst for spill: ";
|
||||
SpDMI->print(dbgs(), false, TII));
|
||||
|
||||
|
@ -47,31 +47,34 @@
|
||||
# llc -stop-after=funclet-layout < spill1.ll > spill1.mir
|
||||
#
|
||||
# Make sure that we generated DBG_VALUE instructions for the spills
|
||||
# GENERATE: ![[MINUS48:.*]] = !DIExpression(DW_OP_constu, 48, DW_OP_minus)
|
||||
# GENERATE: ![[MINUS52:.*]] = !DIExpression(DW_OP_constu, 52, DW_OP_minus)
|
||||
# GENERATE: ![[MINUS56:.*]] = !DIExpression(DW_OP_constu, 56, DW_OP_minus)
|
||||
# GENERATE: bb.1.if.end:
|
||||
# GENERATE: MOV32mr %rbp, 1, _, -48, _, killed %edx :: (store 4 into %stack.5)
|
||||
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, -48, !26, !38
|
||||
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, !29, ![[MINUS48]]
|
||||
# GENERATE: MOV32mr %rbp, 1, _, -52, _, killed %r8d :: (store 4 into %stack.4)
|
||||
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, -52, !32, !38
|
||||
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
|
||||
# GENERATE: MOV32mr %rbp, 1, _, -56, _, killed %esi :: (store 4 into %stack.3)
|
||||
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, -56, !34, !38
|
||||
# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
|
||||
#
|
||||
# Check that the spill locations that are valid at the end of bb.1.if.end are
|
||||
# propagated to subsequent BBs.
|
||||
#
|
||||
# GENERATE: bb.2.if.then4:
|
||||
# GENERATE-NOT: bb.3:
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, -56, !34, !38
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, -52, !32, !38
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
|
||||
#
|
||||
# GENERATE: bb.3:
|
||||
# GENERATE-NOT: bb.4.if.end13:
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, -56, !34, !38
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, -52, !32, !38
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
|
||||
#
|
||||
# GENERATE: bb.4.if.end13:
|
||||
# GENERATE-NOT: bb.5.cleanup:
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, -56, !34, !38
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, -52, !32, !38
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
|
||||
# GENERATE-DAG: DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
|
||||
#
|
||||
# Check that the spill location rbp-48 (the variable int0) is not propagated
|
||||
# because int0 is redefined within the same basic block.
|
||||
|
Loading…
Reference in New Issue
Block a user