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

Issue 2891113002: Use same range info when emitting code and computing if instruction can deopt. (Closed)

Created:
3 years, 7 months ago by Vyacheslav Egorov (Google)
Modified:
3 years, 7 months ago
Reviewers:
rmacnak
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Use same range info when emitting code and computing if instruction can deopt. For BinarySmiOpInstr and ShiftMintOpInstr we use range information to both decide if instruction can deopt and decide which checks should be emitted when emitting native code for this instruction. However because range information is attached to the definition and not uses it often gets out of sync as we mutate the graph. For example we might first make a decision that an instruction can't deoptimize based on more precise range information but then use less precise information in the backend for deciding which parts of the instruction to emit (because redifinition or a phi-instruction was removed from the graph). This mismatch can lead to a crash if less precise information tells backend that one of the inputs need to be checked - because there is no deoptimization label to jump to. This CL is addressing this problem by ensuring that range information is cached at the use and both ComputeCanDeoptimize() and backend use the same range information. Additionally this CL kills overly generic MergedMath instruction and replaces it with TruncDivModInstr. BUG=https://github.com/dart-lang/sdk/issues/29620 R=rmacnak@google.com Committed: https://github.com/dart-lang/sdk/commit/0eb44ec68f87af9a5da233406d8ebcfd42c5d1a5

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address Ryan's comments, add regression test #

Patch Set 3 : Add a comment to the test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+545 lines, -610 lines) Patch
A runtime/tests/vm/dart/regress29620_test.dart View 1 2 1 chunk +61 lines, -0 lines 0 comments Download
M runtime/vm/constant_propagator.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph.cc View 1 chunk +7 lines, -9 lines 0 comments Download
M runtime/vm/flow_graph_range_analysis.h View 2 chunks +13 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_range_analysis.cc View 1 3 chunks +32 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/il_printer.cc View 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 7 chunks +38 lines, -68 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 3 chunks +18 lines, -33 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 8 chunks +64 lines, -87 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 8 chunks +59 lines, -80 lines 0 comments Download
M runtime/vm/intermediate_language_dbc.cc View 2 chunks +1 line, -10 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 10 chunks +79 lines, -103 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 9 chunks +68 lines, -91 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 9 chunks +102 lines, -123 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
Vyacheslav Egorov (Google)
Hi Ryan! Could you take a look? Cheers PS. Alternative (simpler) fix would be to ...
3 years, 7 months ago (2017-05-18 16:59:13 UTC) #1
Vyacheslav Egorov (Google)
Hi Ryan! Could you take a look? Cheers PS. Alternative (simpler) fix would be to ...
3 years, 7 months ago (2017-05-18 16:59:31 UTC) #3
rmacnak
https://codereview.chromium.org/2891113002/diff/1/runtime/vm/flow_graph.cc File runtime/vm/flow_graph.cc (right): https://codereview.chromium.org/2891113002/diff/1/runtime/vm/flow_graph.cc#newcode2296 runtime/vm/flow_graph.cc:2296: other_binop->ReplaceUsesWith(div_mod); Aren't these uses already replaced from the ExtactOutput ...
3 years, 7 months ago (2017-05-18 20:02:45 UTC) #4
rmacnak
On 2017/05/18 16:59:31, Vyacheslav Egorov (Google) wrote: > Hi Ryan! Could you take a look? ...
3 years, 7 months ago (2017-05-18 20:04:48 UTC) #5
Vyacheslav Egorov (Google)
Please take another look. https://codereview.chromium.org/2891113002/diff/1/runtime/vm/flow_graph.cc File runtime/vm/flow_graph.cc (right): https://codereview.chromium.org/2891113002/diff/1/runtime/vm/flow_graph.cc#newcode2296 runtime/vm/flow_graph.cc:2296: other_binop->ReplaceUsesWith(div_mod); On 2017/05/18 20:02:45, rmacnak ...
3 years, 7 months ago (2017-05-19 08:07:08 UTC) #6
rmacnak
LGTM
3 years, 7 months ago (2017-05-19 16:18:17 UTC) #7
Vyacheslav Egorov (Google)
3 years, 7 months ago (2017-05-21 17:01:55 UTC) #9
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
0eb44ec68f87af9a5da233406d8ebcfd42c5d1a5 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698