diff options
author | Mikael Holmen <mikael.holmen@ericsson.com> | 2018-06-21 10:03:34 +0000 |
---|---|---|
committer | Mikael Holmen <mikael.holmen@ericsson.com> | 2018-06-21 10:03:34 +0000 |
commit | 42f7bc96dd0b541ba57d3cf0ac10a2fc13de1524 (patch) | |
tree | b6a71a9b5f4ba5fcebeb0ea66f007dcbd441ce08 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | f38e631343c08bbd06ed3a0bef1ef661a343b344 (diff) | |
download | bcm5719-llvm-42f7bc96dd0b541ba57d3cf0ac10a2fc13de1524.tar.gz bcm5719-llvm-42f7bc96dd0b541ba57d3cf0ac10a2fc13de1524.zip |
[DebugInfo] Make sure all DBG_VALUEs' reguse operands have IsDebug property
Summary:
In some cases, these operands lacked the IsDebug property, which is meant to signal that
they should not affect codegen. This patch adds a check for this property in the
MachineVerifier and adds it where it was missing.
This includes refactorings to use MachineInstrBuilder construction functions instead of
manually setting up the intrinsic everywhere.
Patch by: JesperAntonsson
Reviewers: aprantl, rnk, echristo, javed.absar
Reviewed By: aprantl
Subscribers: qcolombet, sdardis, nemanjai, JDevlieghere, atanasyan, llvm-commits
Differential Revision: https://reviews.llvm.org/D48319
llvm-svn: 335214
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 99b223b1332..173c8bdfeab 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1371,20 +1371,11 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) { if (Op) { assert(DI->getVariable()->isValidLocationForIntrinsic(DbgLoc) && "Expected inlined-at fields to agree"); - if (Op->isReg()) { - Op->setIsDebug(true); - // A dbg.declare describes the address of a source variable, so lower it - // into an indirect DBG_VALUE. - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, - TII.get(TargetOpcode::DBG_VALUE), /*IsIndirect*/ true, - Op->getReg(), DI->getVariable(), DI->getExpression()); - } else - BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, - TII.get(TargetOpcode::DBG_VALUE)) - .add(*Op) - .addImm(0) - .addMetadata(DI->getVariable()) - .addMetadata(DI->getExpression()); + // A dbg.declare describes the address of a source variable, so lower it + // into an indirect DBG_VALUE. + BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, + TII.get(TargetOpcode::DBG_VALUE), /*IsIndirect*/ true, + *Op, DI->getVariable(), DI->getExpression()); } else { // We can't yet handle anything else here because it would require // generating code, thus altering codegen because of debug info. |