[llvm] r284086 - [AArch64][RegisterBankInfo] Provide more realistic copy costs.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 17:11:55 PDT 2016
Author: qcolombet
Date: Wed Oct 12 19:11:55 2016
New Revision: 284086
URL: http://llvm.org/viewvc/llvm-project?rev=284086&view=rev
Log:
[AArch64][RegisterBankInfo] Provide more realistic copy costs.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp?rev=284086&r1=284085&r2=284086&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp Wed Oct 12 19:11:55 2016
@@ -181,7 +181,16 @@ unsigned AArch64RegisterBankInfo::copyCo
// 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);
}
More information about the llvm-commits
mailing list