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

Issue 1839263003: Subzero: Fix a bug in advanced phi lowering. (Closed)

Created:
4 years, 8 months ago by Jim Stichnoth
Modified:
4 years, 8 months ago
Reviewers:
Eric Holk, Karl, sehr, John
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Subzero: Fix a bug in advanced phi lowering. The motivating example (simplified) is this: %__698:eax = phi i32 [ %__646:ebx, %__188 ] // LIVEEND={%__646:ebx} %__617:bh = phi i8 [ %__618:ah, %__188 ] // LIVEEND={%__618:ah} %__615:bl = phi i8 [ %__616:al, %__188 ] // LIVEEND={%__616:al} By default, it first lowers the __698 assignment. However, that assignment has two "predecessors" because there are two other instructions whose dest variable aliases the __698 assignment's source operand. This triggers an assertion failure where we assume there is only one predecessor. The fix is two-pronged. First, we go ahead and generate as many temp assignments as needed to break the cycle, simply by changing an "if" to a "while". Second, when we need to break a cycle, we give preference to an instruction with only one predecessor so that only one temp assignment needs to be added. (It might be possible to prove that the second approach, i.e. preferring single-predecessor assignments, makes the first approach unnecessary, i.e. changing "if" to "while".) This change has no effect on the x86 output for spec2k. BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4365 R=jpp@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=bbd449d2042278c004d9bad80c529f88092b4550

Patch Set 1 #

Patch Set 2 : Improve comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -10 lines) Patch
M src/IceCfgNode.cpp View 1 4 chunks +20 lines, -10 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
Jim Stichnoth
4 years, 8 months ago (2016-03-30 15:57:09 UTC) #3
John
is it possible to add a test for this?
4 years, 8 months ago (2016-03-30 15:59:47 UTC) #4
John
lgtm
4 years, 8 months ago (2016-03-30 15:59:54 UTC) #5
Jim Stichnoth
On 2016/03/30 15:59:47, John wrote: > is it possible to add a test for this? ...
4 years, 8 months ago (2016-03-30 22:30:12 UTC) #6
Jim Stichnoth
4 years, 8 months ago (2016-03-30 22:30:35 UTC) #8
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
bbd449d2042278c004d9bad80c529f88092b4550 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698