Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: src/IceTargetLoweringARM32.cpp

Issue 1424873003: Subzero. ARM32. Implements the Availability Optimization. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/callindirect.pnacl.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringARM32.cpp
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index 7e67b71d259fc54a965dfbca3efc23f54c5a9fa3..282fde154364fc3883ac1497e7bb4b01068db8c4 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -3477,6 +3477,21 @@ Operand *TargetARM32::legalize(Operand *From, LegalMask Allowed,
// legalize() allow a physical register. Legal_Flex converts registers to the
// right type OperandARM32FlexReg as needed.
assert(Allowed & Legal_Reg);
+
+ // Copied ipsis literis from TargetX86Base<Machine>.
+ if (RegNum == Variable::NoRegister) {
+ if (Variable *Subst = getContext().availabilityGet(From)) {
+ // At this point we know there is a potential substitution available.
+ if (Subst->mustHaveReg() && !Subst->hasReg()) {
+ // At this point we know the substitution will have a register.
+ if (From->getType() == Subst->getType()) {
+ // At this point we know the substitution's register is compatible.
+ return Subst;
+ }
+ }
+ }
+ }
+
// Go through the various types of operands: OperandARM32Mem,
// OperandARM32Flex, Constant, and Variable. Given the above assertion, if
// type of operand is not legal (e.g., OperandARM32Mem and !Legal_Mem), we
@@ -3734,6 +3749,7 @@ void TargetARM32::postLower() {
if (Ctx->getFlags().getOptLevel() == Opt_m1)
return;
markRedefinitions();
+ Context.availabilityUpdate();
}
void TargetARM32::makeRandomRegisterPermutation(
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/callindirect.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698