if (!MO.isReg())
continue;
unsigned Reg = MO.getReg();
+ if (!Reg)
+ continue;
if (MO.isDef()) {
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
ModifiedRegs.set(*AI);
// (inclusive) and the second insn.
ModifiedRegs.reset();
UsedRegs.reset();
- --MBBI;
- for (unsigned Count = 0; MBBI != B && Count < Limit; --MBBI) {
+ unsigned Count = 0;
+ do {
+ --MBBI;
MachineInstr *MI = MBBI;
- // Skip DBG_VALUE instructions.
- if (MI->isDebugValue())
- continue;
- // Now that we know this is a real instruction, count it.
- ++Count;
+ // Don't count DBG_VALUE instructions towards the search limit.
+ if (!MI->isDebugValue())
+ ++Count;
// If we found a match, return it.
if (isMatchingUpdateInsn(I, MI, BaseReg, Offset))
// return early.
if (ModifiedRegs[BaseReg] || UsedRegs[BaseReg])
return E;
- }
+ } while (MBBI != B && Count < Limit);
return E;
}
; CHECK-LABEL: _test:
; CHECK: fmov.2d v0, #2.00000000
-; CHECK: str q0, [sp]
+; CHECK: str q0, [sp, #-16]!
; CHECK: mov x8, sp
; CHECK: ldr s0, [x8, w1, sxtw #2]
; CHECK: str s0, [x0]
; CHECK-LABEL: _test2
; CHECK: movi.16b v0, #0x3f
-; CHECK: str q0, [sp]
+; CHECK: str q0, [sp, #-16]!
; CHECK: mov x8, sp
; CHECK: ldr s0, [x8, w1, sxtw #2]
; CHECK: str s0, [x0]