Skip to content

Commit ed1ae34

Browse files
committed
[PowerPC][NFC] clean up if-else block in PPCRegisterInfo.cpp
1 parent eee9582 commit ed1ae34

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,37 +1635,44 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
16351635
}
16361636

16371637
// Special case for pseudo-ops SPILL_CR and RESTORE_CR, etc.
1638-
if (OpC == PPC::SPILL_CR) {
1638+
switch (OpC) {
1639+
case PPC::SPILL_CR:
16391640
lowerCRSpilling(II, FrameIndex);
16401641
return true;
1641-
} else if (OpC == PPC::RESTORE_CR) {
1642+
case PPC::RESTORE_CR:
16421643
lowerCRRestore(II, FrameIndex);
16431644
return true;
1644-
} else if (OpC == PPC::SPILL_CRBIT) {
1645+
case PPC::SPILL_CRBIT:
16451646
lowerCRBitSpilling(II, FrameIndex);
16461647
return true;
1647-
} else if (OpC == PPC::RESTORE_CRBIT) {
1648+
case PPC::RESTORE_CRBIT:
16481649
lowerCRBitRestore(II, FrameIndex);
16491650
return true;
1650-
} else if (OpC == PPC::SPILL_ACC || OpC == PPC::SPILL_UACC) {
1651+
case PPC::SPILL_ACC:
1652+
case PPC::SPILL_UACC:
16511653
lowerACCSpilling(II, FrameIndex);
16521654
return true;
1653-
} else if (OpC == PPC::RESTORE_ACC || OpC == PPC::RESTORE_UACC) {
1655+
case PPC::RESTORE_ACC:
1656+
case PPC::RESTORE_UACC:
16541657
lowerACCRestore(II, FrameIndex);
16551658
return true;
1656-
} else if (OpC == PPC::STXVP && DisableAutoPairedVecSt) {
1657-
lowerOctWordSpilling(II, FrameIndex);
1658-
return true;
1659-
} else if (OpC == PPC::SPILL_WACC) {
1659+
case PPC::STXVP: {
1660+
if (DisableAutoPairedVecSt) {
1661+
lowerOctWordSpilling(II, FrameIndex);
1662+
return true;
1663+
}
1664+
break;
1665+
}
1666+
case PPC::SPILL_WACC:
16601667
lowerWACCSpilling(II, FrameIndex);
16611668
return true;
1662-
} else if (OpC == PPC::RESTORE_WACC) {
1669+
case PPC::RESTORE_WACC:
16631670
lowerWACCRestore(II, FrameIndex);
16641671
return true;
1665-
} else if (OpC == PPC::SPILL_QUADWORD) {
1672+
case PPC::SPILL_QUADWORD:
16661673
lowerQuadwordSpilling(II, FrameIndex);
16671674
return true;
1668-
} else if (OpC == PPC::RESTORE_QUADWORD) {
1675+
case PPC::RESTORE_QUADWORD:
16691676
lowerQuadwordRestore(II, FrameIndex);
16701677
return true;
16711678
}

0 commit comments

Comments
 (0)