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

Issue 205613002: Initial skeleton of Subzero. (Closed)

Created:
6 years, 9 months ago by Jim Stichnoth
Modified:
5 years, 2 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Visibility:
Public.

Description

Initial skeleton of Subzero. This includes just enough code to build the high-level ICE IR and dump it back out again. There is a script szdiff.py that does a fuzzy diff of the input and output for verification. See the comment in szdiff.py for a description of the fuzziness. Building llvm2ice requires LLVM headers, libs, and tools (e.g. FileCheck) to be present. These default to something like llvm_i686_linux_work/Release+Asserts/ based on the checked-out and built pnacl-llvm code; I'll try to figure out how to more automatically detect the build configuration. "make check" runs the lit tests. This CL has under 2000 lines of "interesting" Ice*.{h,cpp} code, plus 600 lines of llvm2ice.cpp driver code, and the rest is tests. Here is the high-level mapping of source files to functionality: IceDefs.h, IceTypes.h, IceTypes.cpp: Commonly used types and utilities. IceCfg.h, IceCfg.cpp: Operations at the function level. IceCfgNode.h, IceCfgNode.cpp: Operations on basic blocks (nodes). IceInst.h, IceInst.cpp: Operations on instructions. IceOperand.h, IceOperand.cpp: Operations on operands, such as stack locations, physical registers, and constants. BUG= none R=jfb@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=f7c9a14

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address Mark's layout/style comments #

Total comments: 34

Patch Set 3 : Address JF's initial comments. #

Patch Set 4 : Remove LICENSE, add LICENSE.TXT #

Total comments: 10

Patch Set 5 : Address Jan's initial comments and JF's second round. #

Total comments: 10

Patch Set 6 : Add support for Unreachable and BitCast instructions #

Patch Set 7 : Added bitcast.ll test #

Patch Set 8 : Use SubzeroPointerType instead of IceType_i32 for pointers #

Total comments: 6

Patch Set 9 : Address Jan's latest comments #

Total comments: 19

Patch Set 10 : Address JF comments round 2 #

Patch Set 11 : Introduce IceGlobalContext, and rearrange other things around that #

Total comments: 156

Patch Set 12 : Address JF comments round 3 #

Patch Set 13 : Fix omissions from previous patchset. #

Total comments: 48

Patch Set 14 : Changes for JF's followup #

Total comments: 23

Patch Set 15 : More cleanup after JF review #

Patch Set 16 : Use non-anonymous structs so that array_lengthof works #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6788 lines, -0 lines) Patch
A .gitignore View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
A LICENSE.TXT View 1 2 3 1 chunk +42 lines, -0 lines 0 comments Download
A Makefile View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +74 lines, -0 lines 0 comments Download
A README.rst View 1 2 3 4 5 6 7 8 1 chunk +71 lines, -0 lines 0 comments Download
A src/IceCfg.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +144 lines, -0 lines 0 comments Download
A src/IceCfg.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +93 lines, -0 lines 0 comments Download
A src/IceCfgNode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +62 lines, -0 lines 0 comments Download
A src/IceCfgNode.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +109 lines, -0 lines 0 comments Download
A src/IceDefs.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +122 lines, -0 lines 0 comments Download
A src/IceGlobalContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +85 lines, -0 lines 0 comments Download
A src/IceGlobalContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +169 lines, -0 lines 0 comments Download
A src/IceInst.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +527 lines, -0 lines 0 comments Download
A src/IceInst.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +436 lines, -0 lines 0 comments Download
A src/IceInst.def View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +89 lines, -0 lines 0 comments Download
A src/IceOperand.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +251 lines, -0 lines 0 comments Download
A src/IceOperand.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +91 lines, -0 lines 0 comments Download
A src/IceTypes.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +36 lines, -0 lines 0 comments Download
A src/IceTypes.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +74 lines, -0 lines 0 comments Download
A src/IceTypes.def View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +31 lines, -0 lines 0 comments Download
A src/llvm2ice.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +655 lines, -0 lines 0 comments Download
A szdiff.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +86 lines, -0 lines 0 comments Download
A tests_lit/.gitignore View 1 chunk +1 line, -0 lines 0 comments Download
A tests_lit/lit.cfg View 1 chunk +54 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/64bit.pnacl.ll View 1 chunk +799 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/alloc.ll View 1 chunk +35 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/arith-opt.ll View 1 chunk +110 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/arithmetic-chain.ll View 1 chunk +24 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/bitcast.ll View 1 2 3 4 5 6 1 chunk +30 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/bool-opt.ll View 1 chunk +16 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/branch-simple.ll View 1 chunk +21 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/call.ll View 1 chunk +66 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/callindirect.pnacl.ll View 1 chunk +27 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/casts.ll View 1 chunk +16 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/cmp-opt.ll View 1 chunk +41 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/convert.ll View 1 chunk +180 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/empty-func.ll View 1 chunk +14 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/fp.pnacl.ll View 1 chunk +1099 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/fpconst.pnacl.ll View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +535 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/global.ll View 1 chunk +23 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/icmp-simple.ll View 1 chunk +18 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/inttoptr.ll View 1 chunk +13 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/load.ll View 1 chunk +50 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/return-int-arg.ll View 1 chunk +20 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/select-opt.ll View 1 chunk +28 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/shift.ll View 1 chunk +33 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/simple-arith.ll View 1 chunk +34 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/simple-cond.ll View 1 chunk +30 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/simple-loop.ll View 1 chunk +52 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/store.ll View 1 chunk +50 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/struct-arith.pnacl.ll View 1 chunk +55 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/switch-opt.ll View 1 chunk +36 lines, -0 lines 0 comments Download
A tests_lit/llvm2ice_tests/unreachable.ll View 1 2 3 4 5 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
Jim Stichnoth
6 years, 9 months ago (2014-03-20 00:01:00 UTC) #1
Mark Seaborn
Some notes about layout and style... https://codereview.chromium.org/205613002/diff/1/IceCfg.h File IceCfg.h (right): https://codereview.chromium.org/205613002/diff/1/IceCfg.h#newcode2 IceCfg.h:2: /* Copyright 2014 ...
6 years, 9 months ago (2014-03-20 00:09:47 UTC) #2
Jim Stichnoth
Addressed Mark's initial comments. Unfortunately, moving the source files into the src/ subdirectory makes it ...
6 years, 9 months ago (2014-03-20 22:58:45 UTC) #3
JF
https://codereview.chromium.org/205613002/diff/40001/.gitignore File .gitignore (right): https://codereview.chromium.org/205613002/diff/40001/.gitignore#newcode3 .gitignore:3: #==============================================================================# I'm not sure you really need this. https://codereview.chromium.org/205613002/diff/40001/.gitignore#newcode30 ...
6 years, 9 months ago (2014-03-21 02:11:30 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/40001/.gitignore File .gitignore (right): https://codereview.chromium.org/205613002/diff/40001/.gitignore#newcode3 .gitignore:3: #==============================================================================# On 2014/03/21 02:11:30, JF wrote: > I'm not ...
6 years, 9 months ago (2014-03-21 21:33:08 UTC) #5
jvoung (off chromium)
quick scan comments https://codereview.chromium.org/205613002/diff/40001/src/IceOperand.h File src/IceOperand.h (right): https://codereview.chromium.org/205613002/diff/40001/src/IceOperand.h#newcode184 src/IceOperand.h:184: Vars = new IceVariable *[1]; what ...
6 years, 9 months ago (2014-03-22 00:29:38 UTC) #6
JF
https://codereview.chromium.org/205613002/diff/70001/README.rst File README.rst (right): https://codereview.chromium.org/205613002/diff/70001/README.rst#newcode40 README.rst:40: quality) is also available. Future targets include x8664, arm32, ...
6 years, 9 months ago (2014-03-23 00:03:14 UTC) #7
Jim Stichnoth
Comments still to be addressed: - Better "llvm2ice --target" arg string values (JF). https://codereview.chromium.org/205613002/diff/70001/README.rst#newcode40 - ...
6 years, 9 months ago (2014-03-24 13:18:52 UTC) #8
Karl
https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h#newcode38 src/IceInst.h:38: Switch, What about the "unreachable" instruction? https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h#newcode352 src/IceInst.h:352: class ...
6 years, 9 months ago (2014-03-24 15:39:06 UTC) #9
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h#newcode38 src/IceInst.h:38: Switch, On 2014/03/24 15:39:07, Karl wrote: > What about ...
6 years, 9 months ago (2014-03-24 15:56:13 UTC) #10
Karl
https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h#newcode38 src/IceInst.h:38: Switch, On 2014/03/24 15:56:13, stichnot wrote: > On 2014/03/24 ...
6 years, 9 months ago (2014-03-24 16:07:39 UTC) #11
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h File src/IceInst.h (right): https://codereview.chromium.org/205613002/diff/90001/src/IceInst.h#newcode38 src/IceInst.h:38: Switch, On 2014/03/24 16:07:40, Karl wrote: > On 2014/03/24 ...
6 years, 9 months ago (2014-03-25 20:01:06 UTC) #12
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp File src/llvm2ice.cpp (right): https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp#newcode154 src/llvm2ice.cpp:154: return IceType_i32; On 2014/03/24 13:18:53, stichnot wrote: > On ...
6 years, 8 months ago (2014-03-28 13:52:17 UTC) #13
jvoung (off chromium)
https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp File src/llvm2ice.cpp (right): https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp#newcode151 src/llvm2ice.cpp:151: return convertType(PTy->getElementType()); Should this also return i32? Otherwise wouldn't ...
6 years, 8 months ago (2014-03-28 16:17:06 UTC) #14
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp File src/llvm2ice.cpp (right): https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp#newcode154 src/llvm2ice.cpp:154: return IceType_i32; On 2014/03/28 16:17:07, jvoung (cr) wrote: > ...
6 years, 8 months ago (2014-03-28 16:45:07 UTC) #15
jvoung (off chromium)
https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp File src/llvm2ice.cpp (right): https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp#newcode151 src/llvm2ice.cpp:151: return convertType(PTy->getElementType()); On 2014/03/28 16:17:07, jvoung (cr) wrote: > ...
6 years, 8 months ago (2014-03-28 23:21:53 UTC) #16
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp File src/llvm2ice.cpp (right): https://codereview.chromium.org/205613002/diff/40001/src/llvm2ice.cpp#newcode151 src/llvm2ice.cpp:151: return convertType(PTy->getElementType()); On 2014/03/28 23:21:53, jvoung (cr) wrote: > ...
6 years, 8 months ago (2014-03-29 14:23:22 UTC) #17
JF
A few comments, more to come :) https://codereview.chromium.org/205613002/diff/190001/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/205613002/diff/190001/src/IceCfg.cpp#newcode61 src/IceCfg.cpp:61: NextInstNumber(1) { ...
6 years, 8 months ago (2014-04-04 04:05:25 UTC) #18
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/190001/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/205613002/diff/190001/src/IceCfg.cpp#newcode61 src/IceCfg.cpp:61: NextInstNumber(1) { On 2014/04/04 04:05:26, JF wrote: > Missing ...
6 years, 8 months ago (2014-04-06 02:16:08 UTC) #19
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/190001/src/IceCfg.h File src/IceCfg.h (right): https://codereview.chromium.org/205613002/diff/190001/src/IceCfg.h#newcode103 src/IceCfg.h:103: mutable IceOstream Str; On 2014/04/06 02:16:09, stichnot wrote: > ...
6 years, 8 months ago (2014-04-09 05:34:26 UTC) #20
JF
I went through all of the .h/.cpp files, but not through the tests yet. https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h ...
6 years, 8 months ago (2014-04-16 01:27:31 UTC) #21
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h File src/IceCfg.h (right): https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h#newcode54 src/IceCfg.h:54: IceCfgNode *makeNode(const IceString &Name = ""); On 2014/04/16 01:27:32, ...
6 years, 8 months ago (2014-04-21 20:26:39 UTC) #22
JF
https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h File src/IceCfg.h (right): https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h#newcode54 src/IceCfg.h:54: IceCfgNode *makeNode(const IceString &Name = ""); On 2014/04/21 20:26:40, ...
6 years, 8 months ago (2014-04-23 03:51:27 UTC) #23
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h File src/IceCfg.h (right): https://codereview.chromium.org/205613002/diff/230001/src/IceCfg.h#newcode54 src/IceCfg.h:54: IceCfgNode *makeNode(const IceString &Name = ""); On 2014/04/23 03:51:28, ...
6 years, 7 months ago (2014-04-26 15:02:10 UTC) #24
JF
lgtm after a few cosmetic additions below. https://codereview.chromium.org/205613002/diff/230001/src/IceDefs.h File src/IceDefs.h (right): https://codereview.chromium.org/205613002/diff/230001/src/IceDefs.h#newcode21 src/IceDefs.h:21: #include <stdio.h> ...
6 years, 7 months ago (2014-04-26 20:20:55 UTC) #25
Jim Stichnoth
All comments should be addressed, except for the issue of being unable to use llvm::array_lengthof() ...
6 years, 7 months ago (2014-04-27 15:04:57 UTC) #26
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/290001/src/IceInst.cpp File src/IceInst.cpp (right): https://codereview.chromium.org/205613002/diff/290001/src/IceInst.cpp#newcode35 src/IceInst.cpp:35: sizeof(InstArithmeticAttributes) / sizeof(*InstArithmeticAttributes); On 2014/04/27 15:04:57, stichnot wrote: > ...
6 years, 7 months ago (2014-04-27 15:25:22 UTC) #27
JF
> https://codereview.chromium.org/205613002/diff/290001/src/IceInst.cpp#newcode35 > src/IceInst.cpp:35: sizeof(InstArithmeticAttributes) / > sizeof(*InstArithmeticAttributes); > On 2014/04/27 15:04:57, stichnot wrote: >> ...
6 years, 7 months ago (2014-04-27 15:59:44 UTC) #28
Jim Stichnoth
The CQ bit was checked by stichnot@chromium.org
6 years, 7 months ago (2014-04-27 23:39:44 UTC) #29
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-27 23:40:05 UTC) #30
commit-bot: I haz the power
Commit queue rejected this change because it did not recognize the base URL. Please commit ...
6 years, 7 months ago (2014-04-27 23:40:06 UTC) #31
Jim Stichnoth
Committed patchset #16 manually as rf7c9a14 (presubmit successful).
6 years, 7 months ago (2014-04-29 17:52:46 UTC) #32
Jim Stichnoth
https://codereview.chromium.org/205613002/diff/230001/src/IceInst.cpp File src/IceInst.cpp (right): https://codereview.chromium.org/205613002/diff/230001/src/IceInst.cpp#newcode54 src/IceInst.cpp:54: case Fmul: On 2014/04/16 01:27:32, JF wrote: > Fadd ...
5 years, 2 months ago (2015-09-25 17:23:10 UTC) #33
JF
On 2015/09/25 17:23:10, stichnot wrote: > https://codereview.chromium.org/205613002/diff/230001/src/IceInst.cpp > File src/IceInst.cpp (right): > > https://codereview.chromium.org/205613002/diff/230001/src/IceInst.cpp#newcode54 > ...
5 years, 2 months ago (2015-09-25 17:48:51 UTC) #34
JF
On 2015/09/25 17:48:51, JF wrote: > On 2015/09/25 17:23:10, stichnot wrote: > > https://codereview.chromium.org/205613002/diff/230001/src/IceInst.cpp > ...
5 years, 2 months ago (2015-09-25 17:52:15 UTC) #35
JF
5 years, 2 months ago (2015-09-25 18:07:45 UTC) #36
Message was sent while issue was closed.
OK ignoring my morning confusion, it turns out you're right:

  http://grouper.ieee.org/groups/1788/email/msg03558.html
The clause of 754 at work is 6.2.3 NaN propagation:
"If two or more inputs are NaN, then the payload of the resulting NaN should be
identical to the payload of one of the input NaNs if representable in the
destination format. This standard does not specify which of the input NaNs will
provide the payload."


and:

  http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
"If both operands are NaNs, then the result will be one of those NaNs, but it
might not be the NaN that was generated first."


Sorry for the noise!

Powered by Google App Engine
This is Rietveld 408576698