This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][AArch64] Make FP constraint checks consider possible use/def register banks
ClosedPublic

Authored by paquette on May 24 2019, 2:07 PM.

Details

Summary

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 save some emitted copies 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. RegbankSelect won't recognize that the inputs/outputs of the instructions must be on FPRs, and so it will put them on GPRs.

Diff Detail

Event Timeline

paquette created this revision.May 24 2019, 2:07 PM
aemerson accepted this revision.May 24 2019, 4:01 PM
This revision is now accepted and ready to land.May 24 2019, 4:01 PM
This revision was automatically updated to reflect the committed changes.