diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2018-02-17 16:42:54 +0000 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2018-02-17 16:42:54 +0000 |
commit | 47952b0c0348ff76e023c74e6d7848b37a43c152 (patch) | |
tree | dbb9f84323f461de737677d0da8ddecfb40ec14f /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | f569578373bc89dc8e6716e4510433c88c5c0554 (diff) | |
download | bcm5719-llvm-47952b0c0348ff76e023c74e6d7848b37a43c152.tar.gz bcm5719-llvm-47952b0c0348ff76e023c74e6d7848b37a43c152.zip |
[DebugInfo][FastISel] Fix dropping dbg.value()
Summary:
https://llvm.org/PR36263 shows that when compiling at -O0 a dbg.value()
instruction (that remains from an original dbg.declare()) is dropped
by FastISel. Since FastISel selects instructions by iterating a basic
block backwards, it drops the dbg.value if one of its operands is not
yet instantiated by a previously selected instruction.
Instead of calling 'lookUpRegForValue()' we can call 'getRegForValue()'
instead that will insert a placeholder for the operand to be filled in
when continuing the instruction selection.
Reviewers: aprantl, dblaikie, probinson
Reviewed By: aprantl
Subscribers: llvm-commits, dstenb, JDevlieghere
Differential Revision: https://reviews.llvm.org/D43386
llvm-svn: 325438
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index bc961386e6d..686fe88a2be 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1235,7 +1235,7 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) { .addImm(0U) .addMetadata(DI->getVariable()) .addMetadata(DI->getExpression()); - } else if (unsigned Reg = lookUpRegForValue(V)) { + } else if (unsigned Reg = getRegForValue(V)) { // FIXME: This does not handle register-indirect values at offset 0. bool IsIndirect = false; BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II, IsIndirect, Reg, |