[PATCH] D29105: Fix regalloc assignment of overlapping registers
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 17:30:01 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL293728: Fix regalloc assignment of overlapping registers (authored by rampitec).
Changed prior to commit:
https://reviews.llvm.org/D29105?vs=85956&id=86530#toc
Repository:
rL LLVM
https://reviews.llvm.org/D29105
Files:
llvm/trunk/lib/CodeGen/SplitKit.cpp
Index: llvm/trunk/lib/CodeGen/SplitKit.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SplitKit.cpp
+++ llvm/trunk/lib/CodeGen/SplitKit.cpp
@@ -522,6 +522,27 @@
Def = LIS.getSlotIndexes()
->insertMachineInstrInMaps(*CopyMI, Late)
.getRegSlot();
+ if (LI->hasSubRanges()) {
+ LaneBitmask LM = LaneBitmask::getNone();
+ for (LiveInterval::SubRange &S : LI->subranges())
+ LM |= S.LaneMask;
+
+ if (MRI.getMaxLaneMaskForVReg(LI->reg) != LM) {
+ // Find subreg for the lane mask.
+ unsigned SubIdx = 0;
+ for (unsigned I = 1, E = TRI.getNumSubRegIndices(); I < E; ++I) {
+ if (TRI.getSubRegIndexLaneMask(I) == LM) {
+ SubIdx = I;
+ break;
+ }
+ }
+ if (SubIdx == 0)
+ report_fatal_error("Cannot find subreg index to cover all alive lanes");
+ CopyMI->getOperand(0).setSubReg(SubIdx);
+ CopyMI->getOperand(1).setSubReg(SubIdx);
+ CopyMI->getOperand(0).setIsUndef(true);
+ }
+ }
++NumCopies;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29105.86530.patch
Type: text/x-patch
Size: 1122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170201/8c0919cc/attachment.bin>
More information about the llvm-commits
mailing list