[AArch64] NFC: Cleanup isAArch64FrameOffsetLegal
authorSander de Smalen <sander.desmalen@arm.com>
Wed, 27 Mar 2019 13:16:19 +0000 (13:16 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Wed, 27 Mar 2019 13:16:19 +0000 (13:16 +0000)
commit90d1b551e19ac5c913a3f8693d41149af0f84329
treed24e34dddb553d184f74041a9a3ebf3f8b57dbef
parentbcc4d5383545430ab9767983b6deb05bd2bfc4a5
[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
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.h