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

Side by Side Diff: src/arm64/lithium-arm64.cc

Issue 1150683004: ARM64: do not optimize away shift if its result is used as both left and right (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-491049.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/arm64/lithium-codegen-arm64.h" 9 #include "src/arm64/lithium-codegen-arm64.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2119 HValue** left) { 2119 HValue** left) {
2120 if (!val->representation().IsInteger32()) return NULL; 2120 if (!val->representation().IsInteger32()) return NULL;
2121 if (!(val->IsBitwise() || val->IsAdd() || val->IsSub())) return NULL; 2121 if (!(val->IsBitwise() || val->IsAdd() || val->IsSub())) return NULL;
2122 2122
2123 HBinaryOperation* hinstr = HBinaryOperation::cast(val); 2123 HBinaryOperation* hinstr = HBinaryOperation::cast(val);
2124 HValue* hleft = hinstr->left(); 2124 HValue* hleft = hinstr->left();
2125 HValue* hright = hinstr->right(); 2125 HValue* hright = hinstr->right();
2126 DCHECK(hleft->representation().Equals(hinstr->representation())); 2126 DCHECK(hleft->representation().Equals(hinstr->representation()));
2127 DCHECK(hright->representation().Equals(hinstr->representation())); 2127 DCHECK(hright->representation().Equals(hinstr->representation()));
2128 2128
2129 if (hleft == hright) {
2130 // Cannot replace two operands at once.
2131 return NULL;
2132 }
2133
2129 if ((hright->IsConstant() && 2134 if ((hright->IsConstant() &&
2130 LikelyFitsImmField(hinstr, HConstant::cast(hright)->Integer32Value())) || 2135 LikelyFitsImmField(hinstr, HConstant::cast(hright)->Integer32Value())) ||
2131 (hinstr->IsCommutative() && hleft->IsConstant() && 2136 (hinstr->IsCommutative() && hleft->IsConstant() &&
2132 LikelyFitsImmField(hinstr, HConstant::cast(hleft)->Integer32Value()))) { 2137 LikelyFitsImmField(hinstr, HConstant::cast(hleft)->Integer32Value()))) {
2133 // The constant operand will likely fit in the immediate field. We are 2138 // The constant operand will likely fit in the immediate field. We are
2134 // better off with 2139 // better off with
2135 // lsl x8, x9, #imm 2140 // lsl x8, x9, #imm
2136 // add x0, x8, #imm2 2141 // add x0, x8, #imm2
2137 // than with 2142 // than with
2138 // mov x16, #imm2 2143 // mov x16, #imm2
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 HAllocateBlockContext* instr) { 2763 HAllocateBlockContext* instr) {
2759 LOperand* context = UseFixed(instr->context(), cp); 2764 LOperand* context = UseFixed(instr->context(), cp);
2760 LOperand* function = UseRegisterAtStart(instr->function()); 2765 LOperand* function = UseRegisterAtStart(instr->function());
2761 LAllocateBlockContext* result = 2766 LAllocateBlockContext* result =
2762 new(zone()) LAllocateBlockContext(context, function); 2767 new(zone()) LAllocateBlockContext(context, function);
2763 return MarkAsCall(DefineFixed(result, cp), instr); 2768 return MarkAsCall(DefineFixed(result, cp), instr);
2764 } 2769 }
2765 2770
2766 2771
2767 } } // namespace v8::internal 2772 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-491049.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698