Refactor emitFrameOffset to accept a StackOffset struct as its offset argument.
This method currently only supports byte offsets (MVT::i8) but will be extended
in a later patch to support scalable offsets (MVT::nxv1i8) as well.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
2968 ↗ | (On Diff #197753) | Are you intentionally performing the "DestReg == SrcReg && Offset == 0" both here and in emitFrameOffset? |
3008 ↗ | (On Diff #197753) | "if (ShiftSize)" is always true? |
3014 ↗ | (On Diff #197753) | The usage of "Sign" here is confusing; we always want a positive immediate for the SEH directives. |
3022 ↗ | (On Diff #197753) | We should assert here that the remaining offset is zero, to make the expected control flow clear. |
3026 ↗ | (On Diff #197753) | We should assert here that SrcReg is SP. |
3045 ↗ | (On Diff #197753) | What is Offset.isZero() supposed to be checking here? |
lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
2968 ↗ | (On Diff #197753) | No I wasn't, thanks for pointing out! |
3008 ↗ | (On Diff #197753) | In this patch it is always true. However, in the subsequent patch D61437: [AArch64] Static (de)allocation of SVE stack objects. I add a new opcode for SVE where ShiftSize is 0 (on line 2983). |
3014 ↗ | (On Diff #197753) | I'll remove it, and add an assert to check that Sign is always positive. |
3045 ↗ | (On Diff #197753) | For the case where the StackOffset can contain both (fixed-size) bytes, and scalable bytes (i.e. MVT::nxv1i8 for SVE where we know there are 'n x bytes', with 'n' being a runtime constant), we want to use ADDXri to emit a frame-offset if:
Or:
The functionality is added in D61437: [AArch64] Static (de)allocation of SVE stack objects. (lines 3067-3082). |
LGTM
lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
3045 ↗ | (On Diff #197753) | Oh, you don't want to emit the mov if the offset isn't empty because it would be redundant. That makes sense. |
My previous patch didn't have any context, so added it now (git format-patch -U999999)