diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp b/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp index 7d825a8bf853..1242ce20b732 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/LiveIntervals.cpp @@ -1049,12 +1049,17 @@ public: // we may end up with a main range not covering all subranges. // This is extremely rare case, so let's check and reconstruct the // main range. - for (LiveInterval::SubRange &S : LI.subranges()) { - if (LI.covers(S)) - continue; - LI.clear(); - LIS.constructMainRangeFromSubranges(LI); - break; + if (LI.hasSubRanges()) { + unsigned SubReg = MO.getSubReg(); + LaneBitmask LaneMask = SubReg ? TRI.getSubRegIndexLaneMask(SubReg) + : MRI.getMaxLaneMaskForVReg(Reg); + for (LiveInterval::SubRange &S : LI.subranges()) { + if ((S.LaneMask & LaneMask).none() || LI.covers(S)) + continue; + LI.clear(); + LIS.constructMainRangeFromSubranges(LI); + break; + } } continue; |