summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-05-20 00:42:57 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-05-20 00:42:57 +0000
commitf1b77e3c658409af637022a64aa7f844718dfd78 (patch)
tree0707f01c63c3149bf2837fdd836d666c9784b712 /include
parente5257f1c4bf4ead85fc4fadefe83586bc2faff99 (diff)
[RegBankSelect] Refactor assignmentMatch to avoid testing the current
register bank twice. Prior to this change, we were checking if the assignment for the current machine operand was matching, then we would check if the mismatch requires to insert repair code. We actually already have this information from the first check, so just pass it along. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/GlobalISel/RegBankSelect.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
index 80ecd2f2f44..95e1560839f 100644
--- a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
+++ b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
@@ -164,8 +164,12 @@ private:
void init(MachineFunction &MF);
/// Check if \p Reg is already assigned what is described by \p ValMapping.
+ /// \p OnlyAssign == true means that \p Reg just needs to be assigned a
+ /// register bank. I.e., no repairing is necessary to have the
+ /// assignment match.
bool assignmentMatch(unsigned Reg,
- const RegisterBankInfo::ValueMapping &ValMapping) const;
+ const RegisterBankInfo::ValueMapping &ValMapping,
+ bool &OnlyAssign) const;
/// Insert repairing code for \p Reg as specified by \p ValMapping.
/// The repairing code is inserted before \p DefUseMI if \p IsDef is false