summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-08-27 02:38:27 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-08-27 02:38:27 +0000
commit529dc06de0d6482c8bf8a4b66e21019f2ce04723 (patch)
tree1fd4bfe840db458b171ff4c050d5530c6d8e5027 /include
parent16b39f4d7f947aa7d5abbe9bad54e1f719e1571d (diff)
[RegBankSelect] Do not abort when the target wants to fall back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/GlobalISel/RegBankSelect.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
index 9faed91fd4d..ffd37875157 100644
--- a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
+++ b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
@@ -74,6 +74,7 @@ class BlockFrequency;
class MachineBranchProbabilityInfo;
class MachineBlockFrequencyInfo;
class MachineRegisterInfo;
+class TargetPassConfig;
class TargetRegisterInfo;
/// This pass implements the reg bank selector pass used in the GlobalISel
@@ -476,8 +477,12 @@ private:
/// Optimization mode of the pass.
Mode OptMode;
+ /// Current target configuration. Controls how the pass handles errors.
+ const TargetPassConfig *TPC;
+
/// Assign the register bank of each operand of \p MI.
- void assignInstr(MachineInstr &MI);
+ /// \return True on success, false otherwise.
+ bool assignInstr(MachineInstr &MI);
/// Initialize the field members using \p MF.
void init(MachineFunction &MF);
@@ -520,7 +525,9 @@ private:
///
/// \note The caller is supposed to do the rewriting of op if need be.
/// I.e., Reg = op ... => <NewRegs> = NewOp ...
- void repairReg(MachineOperand &MO,
+ ///
+ /// \return True if the repairing worked, false otherwise.
+ bool repairReg(MachineOperand &MO,
const RegisterBankInfo::ValueMapping &ValMapping,
RegBankSelect::RepairingPlacement &RepairPt,
const iterator_range<SmallVectorImpl<unsigned>::const_iterator>
@@ -570,7 +577,8 @@ private:
/// Apply \p Mapping to \p MI. \p RepairPts represents the different
/// mapping action that need to happen for the mapping to be
/// applied.
- void applyMapping(MachineInstr &MI,
+ /// \return True if the mapping was applied sucessfully, false otherwise.
+ bool applyMapping(MachineInstr &MI,
const RegisterBankInfo::InstructionMapping &InstrMapping,
SmallVectorImpl<RepairingPlacement> &RepairPts);