[llvm] r272157 - [RegBankSelect] Explain what it would take to support non-copy
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 8 08:40:33 PDT 2016
Author: qcolombet
Date: Wed Jun 8 10:40:32 2016
New Revision: 272157
URL: http://llvm.org/viewvc/llvm-project?rev=272157&view=rev
Log:
[RegBankSelect] Explain what it would take to support non-copy
repairing.
Copies are easy because we repair only when there is a mismatch. For
non-copy repairing, i.e., cases that involves breaking down or gathering
up the value, one of the operand may not have a register bank yet. Thus,
derivate a cost from that, requires more work.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp?rev=272157&r1=272156&r2=272157&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp Wed Jun 8 10:40:32 2016
@@ -384,6 +384,15 @@ RegBankSelect::MappingCost RegBankSelect
// Thus, if we end up here this information should be here.
assert(MBFI && MBPI && "Cost computation requires MBFI and MBPI");
+ // FIXME: We will have to rework the repairing cost model.
+ // The repairing cost depends on the register bank that MO has.
+ // However, when we break down the value into different values,
+ // MO may not have a register bank while still needing repairing.
+ // For the fast mode, we don't compute the cost so that is fine,
+ // but still for the repairing code, we will have to make a choice.
+ // For the greedy mode, we should choose greedily what is the best
+ // choice based on the next use of MO.
+
// Sums up the repairing cost of MO at each insertion point.
uint64_t RepairCost = getRepairCost(MO, ValMapping);
// Bias used for splitting: 5%.
More information about the llvm-commits
mailing list