[PATCH] D73663: [AArch64][GlobalISel] During ISel try to convert G_PTR_ADD to G_ADD

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 13:59:12 PST 2020


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

This lowering tries to look for G_PTR_ADD instructions and then converts them to a standard G_ADD with a COPY on the source, and G_INTTOPTR on the result. This is ok for address space 0 on AArch64 as p0 can be treated as s64.

The motivation behind this is to expose the add semantics to the imported tablegen patterns. We shouldn't need to check for uses being loads/stores, because the selector works bottom up, uses before defs. By the time we end up trying to select a G_PTR_ADD, we should have already attempted to fold this into addressing modes and were therefore unsuccessful.

This gives some performance and code size improvements across the board.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73663

Files:
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/load-addressing-modes.mir
  llvm/test/CodeGen/AArch64/GlobalISel/select.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73663.241282.patch
Type: text/x-patch
Size: 13343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200129/14ae9b63/attachment.bin>


More information about the llvm-commits mailing list