diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-05-20 18:00:46 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-05-20 18:00:46 +0000 |
commit | fe4c39be37e11c19c8a844be37d21025fe3fdb00 (patch) | |
tree | 45cb442e0f8ff80c9b4542ef1c0048e01fff4fae /include | |
parent | 0a2adaeedd5d87443cfae45ed9cf8d53c0d22381 (diff) |
[RegBankSelect] Take advantage of a potential best cost information in
computeMapping.
Computing the cost of a mapping takes some time.
Since in Fast mode, the cost is irrelevant, just spare some cycles by not
computing it.
In Greedy mode, we need to choose the best cost, that means that when
the local cost gets more expensive than the best cost, we can stop
computing the repairing and cost for the current mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/GlobalISel/RegBankSelect.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h index 5d300198e15..b210a8e9f6e 100644 --- a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h +++ b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h @@ -533,10 +533,15 @@ private: /// Compute the cost of mapping \p MI with \p InstrMapping and /// compute the repairing placement for such mapping in \p /// RepairPts. + /// \p BestCost is used to specify when the cost becomes too high + /// and thus it is not worth computing the RepairPts. Moreover if + /// \p BestCost == nullptr, the mapping cost is actually not + /// computed. MappingCost computeMapping(MachineInstr &MI, const RegisterBankInfo::InstructionMapping &InstrMapping, - SmallVectorImpl<RepairingPlacement> &RepairPts); + SmallVectorImpl<RepairingPlacement> &RepairPts, + const MappingCost *BestCost = nullptr); /// When \p RepairPt involves splitting to repair \p MO for the /// given \p ValMapping, try to change the way we repair such that |