[PATCH] D74504: [AArch64][GlobalISel] Try to use existing reg classes in getRegClassesForCopy

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 13:37:56 PST 2020


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

When the source or destination of a copy already has a register class, we should use it when possible instead of computing it using `getMinClassForRegBank`.

We always set `GetAllRegSet` to true in `getMinClassForRegBank` when selecting copies. This is fine, but it has the side effect of adding extra copies in MIR tests, which can be annoying.


https://reviews.llvm.org/D74504

Files:
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/load-wro-addressing-modes.mir
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-and-tbz-tbnz.mir
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-ext-tbz-tbnz.mir
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-shift-tbz-tbnz.mir
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-trunc-tbz-tbnz.mir
  llvm/test/CodeGen/AArch64/GlobalISel/opt-fold-xor-tbz-tbnz.mir
  llvm/test/CodeGen/AArch64/GlobalISel/select-arith-extended-reg.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74504.244261.patch
Type: text/x-patch
Size: 11643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/b2d9e556/attachment.bin>


More information about the llvm-commits mailing list