Skip to content

Commit 48c24cf

Browse files
committed
Review comments
1 parent 35f1e15 commit 48c24cf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,11 +1401,13 @@ bool RAGreedy::trySplitAroundHintReg(MCPhysReg Hint,
14011401
continue;
14021402

14031403
unsigned SubReg = Opnd.getSubReg();
1404-
if (!IsDef) {
1405-
// Check if VirtReg interferes with OtherReg after this COPY instruction.
1406-
if (VirtReg.liveAt(LIS->getInstructionIndex(Instr).getRegSlot()))
1407-
continue;
1408-
}
1404+
unsigned OtherSubReg = OtherOpnd.getSubReg();
1405+
if (SubReg && OtherSubReg && SubReg != OtherSubReg)
1406+
continue;
1407+
1408+
// Check if VirtReg interferes with OtherReg after this COPY instruction.
1409+
if (!IsDef && VirtReg.liveAt(LIS->getInstructionIndex(Instr).getRegSlot()))
1410+
continue;
14091411

14101412
MCRegister OtherPhysReg =
14111413
OtherReg.isPhysical() ? OtherReg.asMCReg() : VRM->getPhys(OtherReg);

0 commit comments

Comments
 (0)