diff options
author | Serguei Katkov <serguei.katkov@azul.com> | 2021-04-13 17:31:23 +0700 |
---|---|---|
committer | Serguei Katkov <serguei.katkov@azul.com> | 2021-04-19 12:31:18 +0700 |
commit | 61d22f2e4e916cdb01fd57d9145a25a5f30cc780 (patch) | |
tree | 07f5913c80773e43ccb2bf291432e2ec79bd4473 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 35e95c68176d599780c3907afe6c0c4c5162672f (diff) | |
download | llvm-61d22f2e4e916cdb01fd57d9145a25a5f30cc780.zip llvm-61d22f2e4e916cdb01fd57d9145a25a5f30cc780.tar.gz llvm-61d22f2e4e916cdb01fd57d9145a25a5f30cc780.tar.bz2 |
[Greedy RA] Add a check to MachineVerifier
If Virtual Register is alive in landing pad its def must be
before the call causing the exception or it should be statepoint instruction itself and
in this case def actually means the relocation of gc pointer and is alive in
landing pad.
The test shows the triggering this check for an option under development
use-registers-for-gc-values-in-landing-pad which is off by default until
it is functionally correct.
Reviewers: reames, void, jyknight, nickdesaulniers, efriedma, arsenm, rnk
Reviewed By: rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100525
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 503cd52..15fbda4 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -2972,6 +2972,15 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, // Check that VNI is live-out of all predecessors. for (const MachineBasicBlock *Pred : MFI->predecessors()) { SlotIndex PEnd = LiveInts->getMBBEndIdx(Pred); + // Predecessor of landing pad live-out on last call. + if (MFI->isEHPad()) { + for (auto I = Pred->rbegin(), E = Pred->rend(); I != E; ++I) { + if (I->isCall()) { + PEnd = Indexes->getInstructionIndex(*I).getBoundaryIndex(); + break; + } + } + } const VNInfo *PVNI = LR.getVNInfoBefore(PEnd); // All predecessors must have a live-out value. However for a phi |