[AArch64][RegisterBankInfo] Provide more realistic copy costs.

llvm-svn: 284086
This commit is contained in:
Quentin Colombet 2016-10-13 00:11:55 +00:00
parent 3245ee7e57
commit 27b40356f7
1 changed files with 10 additions and 1 deletions

View File

@ -181,7 +181,16 @@ unsigned AArch64RegisterBankInfo::copyCost(const RegisterBank &A,
// Will introduce other hooks for different size:
// * extract cost.
// * build_sequence cost.
// TODO: Add more accurate cost for FPR to/from GPR.
// Copy from (resp. to) GPR to (resp. from) FPR involves FMOV.
// FIXME: This should be deduced from the scheduling model.
if (&A == &AArch64::GPRRegBank && &B == &AArch64::FPRRegBank)
// FMOVXDr or FMOVWSr.
return 5;
if (&A == &AArch64::FPRRegBank && &B == &AArch64::GPRRegBank)
// FMOVDXr or FMOVSWr.
return 4;
return RegisterBankInfo::copyCost(A, B, Size);
}