diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetInstrInfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp index f5f53b50ab8..88fbfcb7784 100644 --- a/llvm/lib/CodeGen/TargetInstrInfo.cpp +++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp @@ -1124,13 +1124,14 @@ Optional<ParamLoadedValue> TargetInstrInfo::describeLoadedValue(const MachineInstr &MI) const { const MachineFunction *MF = MI.getMF(); DIExpression *Expr = DIExpression::get(MF->getFunction().getContext(), {}); + const MachineOperand *SrcRegOp, *DestRegOp; int64_t Offset; - if (auto DestSrc = isCopyInstr(MI)) { - return ParamLoadedValue(DestSrc->Source, Expr); - } else if (auto DestSrc = isAddImmediate(MI, Offset)) { + if (isCopyInstr(MI, SrcRegOp, DestRegOp)) { + return ParamLoadedValue(*SrcRegOp, Expr); + } else if (isAddImmediate(MI, DestRegOp, SrcRegOp, Offset)) { Expr = DIExpression::prepend(Expr, DIExpression::ApplyOffset, Offset); - return ParamLoadedValue(DestSrc->Source, Expr); + return ParamLoadedValue(*SrcRegOp, Expr); } return None; |

