diff options
author | Stephen Tozer <Stephen.Tozer@sony.com> | 2022-12-19 15:44:16 +0000 |
---|---|---|
committer | Stephen Tozer <Stephen.Tozer@Sony.com> | 2022-12-19 17:14:25 +0000 |
commit | 6d169089f64c2be5b5107a8efd0e7ac614b50f71 (patch) | |
tree | 240e717377251a79bcb746df87c37fe40b189b1d /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | |
parent | ecfed0ab3413b620a925daa85d23b7cbec5d8c3b (diff) | |
download | llvm-6d169089f64c2be5b5107a8efd0e7ac614b50f71.zip llvm-6d169089f64c2be5b5107a8efd0e7ac614b50f71.tar.gz llvm-6d169089f64c2be5b5107a8efd0e7ac614b50f71.tar.bz2 |
[DebugInfo] Add function to test debug values for equivalence
This patch adds a new function that can be used to check all the
properties, other than the machine values, of a pair of debug values for
equivalence. This is done by folding the "directness" into the
expression, converting the expression to variadic form if it is not
already in that form, and then comparing directly. In a few places which
check whether two debug values are identical to see if their ranges can
be merged, this function will correctly identify cases where two debug
values are expressed differently but have the same meaning, allowing
those ranges to be correctly merged.
Differential Revision: https://reviews.llvm.org/D136173
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index 19e523a..800edf8 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -2676,7 +2676,7 @@ bool InstrRefBasedLDV::pickVPHILoc( if (OutVal.isUnjoinedPHI() && OutVal.BlockNo != MBB.getNumber()) return false; - if (FirstValue.Properties != OutVal.Properties) + if (!FirstValue.Properties.isJoinable(OutVal.Properties)) return false; for (unsigned Idx = 0; Idx < FirstValue.getLocationOpCount(); ++Idx) { @@ -2864,7 +2864,7 @@ bool InstrRefBasedLDV::vlocJoin( // different DIExpressions, different indirectness, or are mixed constants / // non-constants. for (const auto &V : Values) { - if (V.second->Properties != FirstVal.Properties) + if (!V.second->Properties.isJoinable(FirstVal.Properties)) return false; if (V.second->Kind == DbgValue::NoVal) return false; |