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

Unified Diff: src/arm64/lithium-arm64.cc

Issue 357973002: ARM64: avoid duplicate load of double constants (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/lithium-arm64.cc
diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc
index a5d59be6f1ca576877feafb811d924eb8d0fb1ab..b56ae8fa28747c8d22945e0dfd911bf7520685eb 100644
--- a/src/arm64/lithium-arm64.cc
+++ b/src/arm64/lithium-arm64.cc
@@ -1274,15 +1274,13 @@ LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
ASSERT(r.IsDouble());
ASSERT(instr->left()->representation().IsDouble());
ASSERT(instr->right()->representation().IsDouble());
- // TODO(all): In fact the only case that we can handle more efficiently is
- // when one of the operand is the constant 0. Currently the MacroAssembler
- // will be able to cope with any constant by loading it into an internal
- // scratch register. This means that if the constant is used more that once,
- // it will be loaded multiple times. Unfortunatly crankshaft already
- // duplicates constant loads, but we should modify the code below once this
- // issue has been addressed in crankshaft.
- LOperand* left = UseRegisterOrConstantAtStart(instr->left());
- LOperand* right = UseRegisterOrConstantAtStart(instr->right());
+ if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
+ LOperand* left = UseConstant(instr->left());
+ LOperand* right = UseConstant(instr->right());
+ return new(zone()) LCompareNumericAndBranch(left, right);
+ }
+ LOperand* left = UseRegisterAtStart(instr->left());
+ LOperand* right = UseRegisterAtStart(instr->right());
return new(zone()) LCompareNumericAndBranch(left, right);
}
}
« no previous file with comments | « no previous file | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698