[PowerPC] Fix getMemOperandWithOffsetWidth

Commit 3c0b3250 introduced memory cluster under pwr10 target, but a
check for operands was unexpectedly removed. This adds it back to avoid
regression.
This commit is contained in:
Qiu Chaofan committed 2020-09-08 15:35:25 +08:00
1 parent 8ee1419ab6
commit bb39eb9e7f
1 file changed
+1 -1
+1 -1
View File
@@ -4765,7 +4765,7 @@ MachineInstr *PPCInstrInfo::findLoopInstr(
bool PPCInstrInfo::getMemOperandWithOffsetWidth(
const MachineInstr &LdSt, const MachineOperand *&BaseReg, int64_t &Offset,
unsigned &Width, const TargetRegisterInfo *TRI) const {
if (!LdSt.mayLoadOrStore())
if (!LdSt.mayLoadOrStore() || LdSt.getNumExplicitOperands() != 3)
return false;
// Handle only loads/stores with base register followed by immediate offset.