summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-05-20 16:36:12 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-05-20 16:36:12 +0000
commit4c3d76947c9f9634a48baf1988ba2d06343ed7bb (patch)
treeaabb34bf51f68be61eec23b8653f7fb2cc02dc3e /include
parent2bd5cc36e7bfd75d8c8674e12d770a98e6da1887 (diff)
[RegBankSelect] Add a method to avoid splitting while repairing.
The previous choice of the insertion points for repairing was straightfoward but may introduce some basic block or edge splitting. In some situation this is something we can avoid. For instance, when repairing a phi argument, instead of placing the repairing on the related incoming edge, we may move it to the previous block, before the terminators. This is only possible when the argument is not defined by one of the terminator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270232 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/GlobalISel/RegBankSelect.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
index 028fe95d80c..d329d529246 100644
--- a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
+++ b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
@@ -515,6 +515,18 @@ private:
const RegisterBankInfo::InstructionMapping &InstrMapping,
SmallVectorImpl<RepairingPlacement> &RepairPts);
+ /// When \p RepairPt involves splitting to repair \p MO for the
+ /// given \p ValMapping, try to change the way we repair such that
+ /// the splitting is not required anymore.
+ ///
+ /// \pre \p RepairPt.hasSplit()
+ /// \pre \p MO == MO.getParent()->getOperand(\p RepairPt.getOpIdx())
+ /// \pre \p ValMapping is the mapping of \p MO for MO.getParent()
+ /// that implied \p RepairPt.
+ void tryAvoidingSplit(RegBankSelect::RepairingPlacement &RepairPt,
+ const MachineOperand &MO,
+ const RegisterBankInfo::ValueMapping &ValMapping) const;
+
/// Apply \p Mapping to \p MI. \p RepairPts represents the different
/// mapping action that need to happen for the mapping to be
/// applied.