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

Unified Diff: src/compiler/instruction-selector-impl.h

Issue 2711633006: [wasm] Reuse constrained input for same vreg
Patch Set: alternative mulpair Created 3 years, 10 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 | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-impl.h
diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
index ecda4533517e8a21fbcf7a9741f8cf443ec498d0..5a2ebc597067193db126ebd8d1a8e5f637660975 100644
--- a/src/compiler/instruction-selector-impl.h
+++ b/src/compiler/instruction-selector-impl.h
@@ -50,8 +50,13 @@ class OperandGenerator {
}
InstructionOperand DefineAsFixed(Node* node, Register reg) {
- return Define(node, UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
- reg.code(), GetVReg(node)));
+ UnallocatedOperand op = DefineAsFixedForVreg(GetVReg(node), reg);
+ return Define(node, op);
+ }
+
+ UnallocatedOperand DefineAsFixedForVreg(int vreg, Register reg) {
+ return UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, reg.code(),
+ vreg);
}
template <typename FPRegType>
@@ -188,10 +193,15 @@ class OperandGenerator {
return UnallocatedOperand(UnallocatedOperand::SAME_AS_FIRST_INPUT, vreg);
}
- InstructionOperand DefineAsRegistertForVreg(int vreg) {
+ InstructionOperand DefineAsRegisterForVreg(int vreg) {
return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, vreg);
}
+ InstructionOperand UseFixedForVreg(int vreg, Register reg) {
+ return UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, reg.code(),
+ vreg);
+ }
+
InstructionOperand UseRegisterForVreg(int vreg) {
return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
UnallocatedOperand::USED_AT_START, vreg);
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698