This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add MemOperand to the instruction created by storeRegToStackSlot/loadRegFromStackSlot
ClosedPublic

Authored by craig.topper on Nov 18 2020, 11:32 AM.

Details

Summary

It looks like most targets do this, but not all.

Diff Detail

Event Timeline

craig.topper created this revision.Nov 18 2020, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 18 2020, 11:32 AM
craig.topper requested review of this revision.Nov 18 2020, 11:32 AM
This revision is now accepted and ready to land.Nov 18 2020, 2:06 PM

Is the code change due to the fact that the optimizer later finally knows that 12(sp) and 8(sp) don't overlap?

Is the code change due to the fact that the optimizer later finally knows that 12(sp) and 8(sp) don't overlap?

MachineSinking is moving the fld down. It previously couldn't do it because isSafeToMove returned false because hasOrderedMemoryRef() conservatively returned true due to the missing mem operand.

// a load across an atomic load with Ordering > Monotonic.
if (mayStore() || isCall() || isPHI() ||
    (mayLoad() && hasOrderedMemoryRef())) {
  SawStore = true;
  return false;
}

Is the code change due to the fact that the optimizer later finally knows that 12(sp) and 8(sp) don't overlap?

MachineSinking is moving the fld down. It previously couldn't do it because isSafeToMove returned false because hasOrderedMemoryRef() conservatively returned true due to the missing mem operand.

// a load across an atomic load with Ordering > Monotonic.
if (mayStore() || isCall() || isPHI() ||
    (mayLoad() && hasOrderedMemoryRef())) {
  SawStore = true;
  return false;
}

Ok, cool, as I thought. Nice patch!