[PATCH] D72426: [GlobalISel][AArch64] Import + select LDR*roW and STR*roW patterns

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 16:24:08 PST 2020


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: Petar.Avramovic, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.

This adds support for selecting a large chunk of the load/store *roW patterns.

This is pretty much a straight port of `AArch64DAGToDAGISel::SelectAddrModeWRO` into GISel. The code is very similar to the XRO code. The main difference is that in the *roW patterns, we want to try and fold in an extend, and *possibly* a shift along with it. A good portion of this patch is refactoring the existing XRO code.

- Add `AArch64InstructionSelector::selectAddrModeWRO`
- Factor out the code from `AArch64InstructionSelector::selectAddrModeShiftedExtendXReg` which is used by both `AArch64InstructionSelector::selectAddrModeXRO` and `AArch64InstructionSelector::selectAddrModeWRO` into `AArch64InstructionSelector::selectExtendedSHL`. This is similar to the function of the same name in AArch64DAGToDAGISel.
- Add support for extends to the factored out code in `selectExtendedSHL`.
- Teach `getExtendTypeForInst` how to handle AND masks that are intended to be used in loads/stores (necessary for this addressing mode.)
- Make `getExtendTypeForInst` not static because moving it made an annoying diff and I wanted to have the WRO/XRO functions close to each other while I was writing the code.

Also add two tests. It seems like we just import more load patterns than store patterns, so I didn't put too much in the store test for now.

Also we're missing a couple of the load patterns right now, so I didn't include them in the test.


https://reviews.llvm.org/D72426

Files:
  llvm/lib/Target/AArch64/AArch64InstrFormats.td
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/load-wro-addressing-modes.mir
  llvm/test/CodeGen/AArch64/GlobalISel/store-wro-addressing-modes.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72426.236931.patch
Type: text/x-patch
Size: 26746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200109/6e21c240/attachment.bin>


More information about the llvm-commits mailing list