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

Issue 265703002: Add Om1 lowering with no optimizations (Closed)

Created:
6 years, 7 months ago by Jim Stichnoth
Modified:
6 years, 7 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

Add Om1 lowering with no optimizations. This adds infrastructure for low-level x86-32 instructions, and the target lowering patterns. Practically no optimizations are performed. Optimizations to be introduced later include liveness analysis, dead-code elimination, global linear-scan register allocation, linear-scan based stack slot coalescing, and compare/branch fusing. One optimization that is present is simple coalescing of stack slots for variables that are only live within a single basic block. There are also some fairly comprehensive cross tests. This testing infrastructure translates bitcode using both Subzero and llc, and a testing harness calls both versions with a variety of "interesting" inputs and compares the results. Specifically, Arithmetic, Icmp, Fcmp, and Cast instructions are tested this way, across all PNaCl primitive types. BUG= R=jvoung@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=5bc2b1d

Patch Set 1 #

Total comments: 108

Patch Set 2 : Address JF and Jan's comments #

Patch Set 3 : Add frem test; add LOWERING.rst file #

Total comments: 49

Patch Set 4 : Address Jan's second-round comments #

Total comments: 8

Patch Set 5 : Address Jan's third-round comments #

Total comments: 2

Patch Set 6 : Merge changed from Karl's committed CL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7717 lines, -266 lines) Patch
M .gitignore View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A LOWERING.rst View 1 2 3 1 chunk +310 lines, -0 lines 0 comments Download
M Makefile View 3 chunks +5 lines, -1 line 0 comments Download
M README.rst View 1 1 chunk +12 lines, -3 lines 0 comments Download
A crosstest/crosstest.py View 1 2 3 1 chunk +127 lines, -0 lines 0 comments Download
A crosstest/runtests.sh View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
A crosstest/simple_loop.c View 1 1 chunk +10 lines, -0 lines 0 comments Download
A crosstest/simple_loop_main.c View 1 1 chunk +29 lines, -0 lines 0 comments Download
A crosstest/test_arith.h View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
A crosstest/test_arith.cpp View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
A crosstest/test_arith.def View 1 2 3 1 chunk +45 lines, -0 lines 0 comments Download
A crosstest/test_arith_frem.ll View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
A crosstest/test_arith_main.cpp View 1 2 1 chunk +193 lines, -0 lines 0 comments Download
A crosstest/test_cast.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
A crosstest/test_cast.cpp View 1 1 chunk +61 lines, -0 lines 0 comments Download
A crosstest/test_cast_main.cpp View 1 1 chunk +225 lines, -0 lines 0 comments Download
A crosstest/test_cast_to_u1.ll View 1 1 chunk +92 lines, -0 lines 0 comments Download
A crosstest/test_fcmp.def View 1 1 chunk +27 lines, -0 lines 0 comments Download
A crosstest/test_fcmp.pnacl.ll View 1 chunk +324 lines, -0 lines 0 comments Download
A crosstest/test_fcmp_main.cpp View 1 1 chunk +98 lines, -0 lines 0 comments Download
A crosstest/test_icmp.h View 1 1 chunk +17 lines, -0 lines 0 comments Download
A crosstest/test_icmp.cpp View 1 1 chunk +21 lines, -0 lines 0 comments Download
A crosstest/test_icmp.def View 1 1 chunk +25 lines, -0 lines 0 comments Download
A crosstest/test_icmp_main.cpp View 1 1 chunk +118 lines, -0 lines 0 comments Download
A pydir/build-pnacl-ir.py View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download
M src/IceCfg.h View 3 chunks +15 lines, -2 lines 0 comments Download
M src/IceCfg.cpp View 1 2 3 2 chunks +97 lines, -1 line 0 comments Download
M src/IceCfgNode.h View 3 chunks +14 lines, -0 lines 0 comments Download
M src/IceCfgNode.cpp View 3 chunks +131 lines, -3 lines 0 comments Download
M src/IceDefs.h View 1 chunk +8 lines, -1 line 0 comments Download
M src/IceGlobalContext.h View 4 chunks +17 lines, -1 line 0 comments Download
M src/IceGlobalContext.cpp View 1 4 chunks +25 lines, -12 lines 0 comments Download
M src/IceInst.h View 1 8 chunks +113 lines, -1 line 0 comments Download
M src/IceInst.cpp View 1 10 chunks +126 lines, -6 lines 0 comments Download
M src/IceInst.def View 1 chunk +0 lines, -1 line 0 comments Download
A src/IceInstX8632.h View 1 1 chunk +720 lines, -0 lines 0 comments Download
A src/IceInstX8632.cpp View 1 1 chunk +868 lines, -0 lines 0 comments Download
A src/IceInstX8632.def View 1 chunk +71 lines, -0 lines 0 comments Download
M src/IceOperand.h View 1 2 3 7 chunks +106 lines, -2 lines 0 comments Download
M src/IceOperand.cpp View 4 chunks +59 lines, -4 lines 0 comments Download
A src/IceTargetLowering.h View 1 2 3 1 chunk +197 lines, -0 lines 0 comments Download
A src/IceTargetLowering.cpp View 1 1 chunk +147 lines, -0 lines 0 comments Download
A src/IceTargetLoweringX8632.h View 1 2 3 1 chunk +268 lines, -0 lines 0 comments Download
A src/IceTargetLoweringX8632.cpp View 1 2 3 4 5 1 chunk +1881 lines, -0 lines 0 comments Download
A src/IceTargetLoweringX8632.def View 1 chunk +52 lines, -0 lines 0 comments Download
M src/IceTypes.h View 1 chunk +14 lines, -0 lines 0 comments Download
M src/IceTypes.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M src/IceTypes.def View 1 chunk +2 lines, -1 line 0 comments Download
M src/llvm2ice.cpp View 1 2 3 4 5 7 chunks +59 lines, -7 lines 0 comments Download
M tests_lit/llvm2ice_tests/64bit.pnacl.ll View 1 2 3 4 5 61 chunks +364 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/alloc.ll View 1 2 3 4 5 3 chunks +28 lines, -11 lines 0 comments Download
M tests_lit/llvm2ice_tests/arith-opt.ll View 1 2 3 4 5 1 chunk +5 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/arithmetic-chain.ll View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/bitcast.ll View 1 2 3 4 5 2 chunks +8 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/bool-opt.ll View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/branch-simple.ll View 1 2 3 4 5 1 chunk +5 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/call.ll View 1 2 3 4 5 2 chunks +6 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/callindirect.pnacl.ll View 1 2 3 4 5 2 chunks +13 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/casts.ll View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/cmp-opt.ll View 1 2 3 4 5 3 chunks +19 lines, -4 lines 0 comments Download
M tests_lit/llvm2ice_tests/convert.ll View 1 2 3 4 5 9 chunks +142 lines, -67 lines 0 comments Download
M tests_lit/llvm2ice_tests/empty-func.ll View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/fp.pnacl.ll View 1 2 3 4 5 1 chunk +8 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/fpconst.pnacl.ll View 1 2 3 4 5 2 chunks +5 lines, -4 lines 0 comments Download
M tests_lit/llvm2ice_tests/global.ll View 1 2 3 4 5 1 chunk +5 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/icmp-simple.ll View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/load.ll View 1 2 3 4 5 5 chunks +9 lines, -3 lines 0 comments Download
A tests_lit/llvm2ice_tests/mangle.ll View 1 2 3 4 5 1 chunk +105 lines, -0 lines 0 comments Download
M tests_lit/llvm2ice_tests/return-int-arg.ll View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/select-opt.ll View 1 2 3 4 5 1 chunk +8 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/shift.ll View 1 2 3 4 5 3 chunks +12 lines, -6 lines 0 comments Download
D tests_lit/llvm2ice_tests/simple-arith.ll View 1 2 3 4 5 1 chunk +0 lines, -35 lines 0 comments Download
D tests_lit/llvm2ice_tests/simple-cond.ll View 1 2 3 4 5 1 chunk +0 lines, -32 lines 0 comments Download
M tests_lit/llvm2ice_tests/simple-loop.ll View 1 2 3 4 5 3 chunks +13 lines, -12 lines 0 comments Download
M tests_lit/llvm2ice_tests/store.ll View 1 2 3 4 5 5 chunks +8 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/struct-arith.pnacl.ll View 1 2 3 4 5 1 chunk +5 lines, -7 lines 0 comments Download
M tests_lit/llvm2ice_tests/switch-opt.ll View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M tests_lit/llvm2ice_tests/unreachable.ll View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Jim Stichnoth
This is the second mega-CL for Subzero. The rest should be much more manageable, at ...
6 years, 7 months ago (2014-04-30 22:28:18 UTC) #1
JF
Partial first pass. https://codereview.chromium.org/265703002/diff/1/Makefile File Makefile (right): https://codereview.chromium.org/265703002/diff/1/Makefile#newcode32 Makefile:32: CXXFLAGS := -Wall -Wextra -Werror -fno-rtti ...
6 years, 7 months ago (2014-05-01 00:16:54 UTC) #2
jvoung (off chromium)
Well I didn't get too far, but here are some comments https://codereview.chromium.org/265703002/diff/1/crosstest/test_arith.cpp File crosstest/test_arith.cpp (right): ...
6 years, 7 months ago (2014-05-03 00:13:27 UTC) #3
JF
https://codereview.chromium.org/265703002/diff/1/src/IceCfg.cpp File src/IceCfg.cpp (right): https://codereview.chromium.org/265703002/diff/1/src/IceCfg.cpp#newcode92 src/IceCfg.cpp:92: // placePhiLoads() must be called before placePhiStores(). Are they ...
6 years, 7 months ago (2014-05-04 23:54:58 UTC) #4
Jim Stichnoth
Latest patchset addresses all of JF's and Jan's comments so far. https://codereview.chromium.org/265703002/diff/1/Makefile File Makefile (right): ...
6 years, 7 months ago (2014-05-05 07:03:54 UTC) #5
jvoung (off chromium)
https://codereview.chromium.org/265703002/diff/1/src/IceInstX8632.cpp File src/IceInstX8632.cpp (right): https://codereview.chromium.org/265703002/diff/1/src/IceInstX8632.cpp#newcode42 src/IceInstX8632.cpp:42: const char *WidthString; // {byte,word,dword,qword} ptr On 2014/05/05 07:03:55, ...
6 years, 7 months ago (2014-05-15 23:47:33 UTC) #6
Jim Stichnoth
https://codereview.chromium.org/265703002/diff/1/src/IceTargetLowering.h File src/IceTargetLowering.h (right): https://codereview.chromium.org/265703002/diff/1/src/IceTargetLowering.h#newcode79 src/IceTargetLowering.h:79: class TargetLowering { On 2014/05/05 07:03:55, stichnot wrote: > ...
6 years, 7 months ago (2014-05-17 14:14:32 UTC) #7
jvoung (off chromium)
whew -- looked through the rest of the TargetLowerX8632 file https://codereview.chromium.org/265703002/diff/30001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/265703002/diff/30001/src/IceTargetLoweringX8632.cpp#newcode1055 ...
6 years, 7 months ago (2014-05-19 20:28:54 UTC) #8
Jim Stichnoth
https://codereview.chromium.org/265703002/diff/30001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/265703002/diff/30001/src/IceTargetLoweringX8632.cpp#newcode1055 src/IceTargetLoweringX8632.cpp:1055: Operand *Src0 = legalize(Inst->getSrc(0)); On 2014/05/19 20:28:54, jvoung wrote: ...
6 years, 7 months ago (2014-05-20 18:20:07 UTC) #9
jvoung (off chromium)
LGTM https://codereview.chromium.org/265703002/diff/60001/src/IceTargetLoweringX8632.cpp File src/IceTargetLoweringX8632.cpp (right): https://codereview.chromium.org/265703002/diff/60001/src/IceTargetLoweringX8632.cpp#newcode1538 src/IceTargetLoweringX8632.cpp:1538: // The table is indexed by InstIcmp::Condition. Make ...
6 years, 7 months ago (2014-05-22 18:02:37 UTC) #10
Jim Stichnoth
All comments are addressed. I have also merged in Karl's previous CL and fixed any ...
6 years, 7 months ago (2014-05-22 20:19:15 UTC) #11
Jim Stichnoth
6 years, 7 months ago (2014-05-22 20:38:52 UTC) #12
Message was sent while issue was closed.
Committed patchset #6 manually as r5bc2b1d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698