diff options
author | Hans Wennborg <hans@chromium.org> | 2021-03-17 13:36:48 +0100 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2021-03-17 13:36:48 +0100 |
commit | 01ac6d1587e8613ba4278786e8341f8b492ac941 (patch) | |
tree | baf00c4693ff3fafe624fc178ca78286f8ae3811 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | c165a99a1b8861af87e0509a2e14debf2764804b (diff) | |
download | llvm-01ac6d1587e8613ba4278786e8341f8b492ac941.zip llvm-01ac6d1587e8613ba4278786e8341f8b492ac941.tar.gz llvm-01ac6d1587e8613ba4278786e8341f8b492ac941.tar.bz2 |
Revert "[DebugInfo] Handle multiple variable location operands in IR"
This caused non-deterministic compiler output; see comment on the
code review.
> This patch updates the various IR passes to correctly handle dbg.values with a
> DIArgList location. This patch does not actually allow DIArgLists to be produced
> by salvageDebugInfo, and it does not affect any pass after codegen-prepare.
> Other than that, it should cover every IR pass.
>
> Most of the changes simply extend code that operated on a single debug value to
> operate on the list of debug values in the style of any_of, all_of, for_each,
> etc. Instances of setOperand(0, ...) have been replaced with with
> replaceVariableLocationOp, which takes the value that is being replaced as an
> additional argument. In places where this value isn't readily available, we have
> to track the old value through to the point where it gets replaced.
>
> Differential Revision: https://reviews.llvm.org/D88232
This reverts commit df69c69427dea7f5b3b3a4d4564bc77b0926ec88.
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 55bc314..3d3f734 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -98,24 +98,6 @@ void DbgVariableIntrinsic::replaceVariableLocationOp(Value *OldValue, setArgOperand( 0, MetadataAsValue::get(getContext(), DIArgList::get(getContext(), MDs))); } -void DbgVariableIntrinsic::replaceVariableLocationOp(unsigned OpIdx, - Value *NewValue) { - assert(OpIdx < getNumVariableLocationOps() && "Invalid Operand Index"); - if (!hasArgList()) { - Value *NewOperand = isa<MetadataAsValue>(NewValue) - ? NewValue - : MetadataAsValue::get( - getContext(), ValueAsMetadata::get(NewValue)); - return setArgOperand(0, NewOperand); - } - SmallVector<ValueAsMetadata *, 4> MDs; - ValueAsMetadata *NewOperand = getAsMetadata(NewValue); - for (unsigned Idx = 0; Idx < getNumVariableLocationOps(); ++Idx) - MDs.push_back(Idx == OpIdx ? NewOperand - : getAsMetadata(getVariableLocationOp(Idx))); - setArgOperand( - 0, MetadataAsValue::get(getContext(), DIArgList::get(getContext(), MDs))); -} Optional<uint64_t> DbgVariableIntrinsic::getFragmentSizeInBits() const { if (auto Fragment = getExpression()->getFragmentInfo()) |