diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-08-16 19:13:28 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-08-16 19:13:28 +0000 |
commit | 9af86a5e01c389572be7c5bcf43b8de78db94bc3 (patch) | |
tree | fa679441c2754b1a9580e0a26d6bbd96ec5371ae /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | db63088ea7cc8890972e875c87550609e6bfaf4a (diff) | |
download | bcm5719-llvm-9af86a5e01c389572be7c5bcf43b8de78db94bc3.tar.gz bcm5719-llvm-9af86a5e01c389572be7c5bcf43b8de78db94bc3.zip |
[MachineVerifier] Check if predecessor is jointly dominated by undefs
Each use of a value should be jointly dominated by the union of defs and
undefs. It can happen that it will only be jointly dominated by undefs,
and that is still legal. Make sure that the verifier is aware of that.
llvm-svn: 339924
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 318776136e2..1c192815ab9 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -23,6 +23,7 @@ // the verifier errors. //===----------------------------------------------------------------------===// +#include "LiveRangeCalc.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" @@ -2116,6 +2117,13 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, // Skip this block. ++MFI; } + + SmallVector<SlotIndex, 4> Undefs; + if (LaneMask.any()) { + LiveInterval &OwnerLI = LiveInts->getInterval(Reg); + OwnerLI.computeSubRangeUndefs(Undefs, LaneMask, *MRI, *Indexes); + } + while (true) { assert(LiveInts->isLiveInToMBB(LR, &*MFI)); // We don't know how to track physregs into a landing pad. @@ -2141,7 +2149,9 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, // instruction with subregister intervals // only one of the subregisters (not necessarily the current one) needs to // be defined. - if (!PVNI && (LaneMask.none() || !IsPHI) ) { + if (!PVNI && (LaneMask.none() || !IsPHI)) { + if (LiveRangeCalc::isJointlyDominated(*PI, Undefs, *Indexes)) + continue; report("Register not marked live out of predecessor", *PI); report_context(LR, Reg, LaneMask); report_context(*VNI); |