diff options
author | Chris Ye <yechunliang@gmail.com> | 2020-01-16 11:40:44 +0000 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2020-01-16 11:58:09 +0000 |
commit | 75188b01e9af3a89639d84be912f84610d6885ba (patch) | |
tree | b8d60839ddcde7e38693e0e90f4af3726d4cdfd8 /llvm/lib/CodeGen/PHIElimination.cpp | |
parent | 8a3446746098ba29348bb8f85357dd0b466a6d6e (diff) | |
download | llvm-75188b01e9af3a89639d84be912f84610d6885ba.zip llvm-75188b01e9af3a89639d84be912f84610d6885ba.tar.gz llvm-75188b01e9af3a89639d84be912f84610d6885ba.tar.bz2 |
[PHIEliminate] Move dbg values after phi and label
If there are DBG_VALUEs between phi and label (after phi and before label),
DBG_VALUE will block PHI lowering after the LABEL. Moving all DBG_VALUEs
after Labels in the function ScheduleDAGSDNodes::EmitSchedule to avoid
impacting PHI lowering.
before:
PHI
DBG_VALUE
LABEL
after: (move DBG_VALUE after label)
PHI
LABEL
DBG_VALUE
then: (phi lowering after label)
LABEL
COPY
DBG_VALUE
Fixes the issue: https://bugs.llvm.org/show_bug.cgi?id=43859
Differential Revision: https://reviews.llvm.org/D70597
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PHIElimination.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 4dd4c4b..1ed479d 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -210,6 +210,11 @@ bool PHIElimination::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock::iterator LastPHIIt = std::prev(MBB.SkipPHIsAndLabels(MBB.begin())); + assert((LastPHIIt == skipDebugInstructionsBackward( + std::prev(MBB.SkipPHIsLabelsAndDebug(MBB.begin())), + MBB.begin())) && + "There must be no DBG_VALUEs between PHI and LABEL"); + while (MBB.front().isPHI()) LowerPHINode(MBB, LastPHIIt); |