[AArch64] NFC: Cleanup isAArch64FrameOffsetLegal

Authored by sdesmalen on Mar 27 2019, 6:16 AM.


[AArch64] NFC: Cleanup isAArch64FrameOffsetLegal

Cleanup isAArch64FrameOffsetLegal by:

  • Merging the large switch statement to reuse AArch64InstrInfo::getMemOpInfo().
  • Using AArch64InstrInfo::getUnscaledLdSt() to determine whether an instruction has an unscaled variant.
  • Simplifying the logic that calculates the offset to fit the immediate.

Reviewers: paquette, evandro, eli.friedman, efriedma

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D59636

llvm-svn: 357064