]> granicus.if.org Git - llvm/commit
[GlobalISel][AArch64] Make FP constraint checks consider possible use/def banks
authorJessica Paquette <jpaquette@apple.com>
Fri, 24 May 2019 23:08:45 +0000 (23:08 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 24 May 2019 23:08:45 +0000 (23:08 +0000)
commit6167af33c4e32bdda77d7a9e0e001df8fa7d0222
tree00363233d60221081291955b15f2c405a8997aec
parent450e8301473761901768a028272a0099de1181a9
[GlobalISel][AArch64] Make FP constraint checks consider possible use/def banks

In a few places in getInstrMapping, we check if use/def instructions for the
instruction we're mapping have floating point constraints.

We can improve this check and reduce the number of copies in GISel-compiled code
if we make a couple observations:

- For a def instruction, it only matters if the def instruction must always
  output a value stored on a FPR

- For a use instruction, it only matters if the use instruction must always
  only take in values stored in FPRs

This adds two new functions:

- onlyUsesFP
- onlyDefinesFP

Then we can use those when we're checking the uses/defs instead.

Without this patch, the load, unmerge, store, and select in the added test
would have unnecessary copies.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361679 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64RegisterBankInfo.cpp
lib/Target/AArch64/AArch64RegisterBankInfo.h
test/CodeGen/AArch64/GlobalISel/regbank-fp-use-def.mir [new file with mode: 0644]