[PATCH] D34608: [AArch64] Increase CSR cost when defering use of CSR is preferred
Quentin Colombet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 30 15:15:09 PDT 2017
qcolombet requested changes to this revision.
qcolombet added inline comments.
This revision now requires changes to proceed.
================
Comment at: include/llvm/Target/TargetLowering.h:3406
+ return true;
+ }
+
----------------
I don't think we should expose. Either regalloc can always do the right call or it cannot and we shouldn't ask the target to decide if it wants to be lucky here.
================
Comment at: include/llvm/Target/TargetLowering.h:3412
+ virtual unsigned getNumberOfTradableSplitsAgainstCSR() const {
+ return 0;
+ }
----------------
I don't think we can have a simple numbers as in static number of instructions. The cost of splitting depends where it happens and not taking that into account would for sure lead to cases where we get it wrong.
================
Comment at: include/llvm/Target/TargetLowering.h:3419
+ virtual unsigned getNumberOfTradableSpillsAgainstCSR() const {
+ return 0;
+ }
----------------
Ditto.
================
Comment at: lib/CodeGen/RegAllocGreedy.cpp:2398
+ return std::max(BestCost.getFrequency(),
+ EntryFreq * TLI->getNumberOfTradableSpillsAgainstCSR());
+ else if (getStage(VirtReg) < RS_Split)
----------------
That formula does not make sense to me.
We should compare the cost of spilling vs. the CSRCost.
EntryFreq * #tradableSpills is not the cost of spilling.
================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:10787
+
+// The number of splits in user blocks which can be traded against the spill of
+// the CSR in the entry block when detering the first use of CSR is prefered.
----------------
What do user blocks mean in this context?
https://reviews.llvm.org/D34608
More information about the llvm-commits
mailing list