OSDN Git Service

Add Om1 lowering with no optimizations.
authorJim Stichnoth <stichnot@chromium.org>
Thu, 22 May 2014 20:38:48 +0000 (13:38 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Thu, 22 May 2014 20:38:48 +0000 (13:38 -0700)
commit5bc2b1d163123ef17e0a14f50aae3bc8e4cd243e
treed4aa59f11a6b6b9ba9c60e3ea54b7c9fe8ae8cee
parenta667fb8599e071351bb9449687a259d710c9e849
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

Review URL: https://codereview.chromium.org/265703002
78 files changed:
.gitignore
LOWERING.rst [new file with mode: 0644]
Makefile
README.rst
crosstest/crosstest.py [new file with mode: 0755]
crosstest/runtests.sh [new file with mode: 0755]
crosstest/simple_loop.c [new file with mode: 0644]
crosstest/simple_loop_main.c [new file with mode: 0644]
crosstest/test_arith.cpp [new file with mode: 0644]
crosstest/test_arith.def [new file with mode: 0644]
crosstest/test_arith.h [new file with mode: 0644]
crosstest/test_arith_frem.ll [new file with mode: 0644]
crosstest/test_arith_main.cpp [new file with mode: 0644]
crosstest/test_cast.cpp [new file with mode: 0644]
crosstest/test_cast.h [new file with mode: 0644]
crosstest/test_cast_main.cpp [new file with mode: 0644]
crosstest/test_cast_to_u1.ll [new file with mode: 0644]
crosstest/test_fcmp.def [new file with mode: 0644]
crosstest/test_fcmp.pnacl.ll [new file with mode: 0644]
crosstest/test_fcmp_main.cpp [new file with mode: 0644]
crosstest/test_icmp.cpp [new file with mode: 0644]
crosstest/test_icmp.def [new file with mode: 0644]
crosstest/test_icmp.h [new file with mode: 0644]
crosstest/test_icmp_main.cpp [new file with mode: 0644]
pydir/build-pnacl-ir.py [new file with mode: 0755]
src/IceCfg.cpp
src/IceCfg.h
src/IceCfgNode.cpp
src/IceCfgNode.h
src/IceDefs.h
src/IceGlobalContext.cpp
src/IceGlobalContext.h
src/IceInst.cpp
src/IceInst.def
src/IceInst.h
src/IceInstX8632.cpp [new file with mode: 0644]
src/IceInstX8632.def [new file with mode: 0644]
src/IceInstX8632.h [new file with mode: 0644]
src/IceOperand.cpp
src/IceOperand.h
src/IceTargetLowering.cpp [new file with mode: 0644]
src/IceTargetLowering.h [new file with mode: 0644]
src/IceTargetLoweringX8632.cpp [new file with mode: 0644]
src/IceTargetLoweringX8632.def [new file with mode: 0644]
src/IceTargetLoweringX8632.h [new file with mode: 0644]
src/IceTypes.cpp
src/IceTypes.def
src/IceTypes.h
src/llvm2ice.cpp
tests_lit/llvm2ice_tests/64bit.pnacl.ll
tests_lit/llvm2ice_tests/alloc.ll
tests_lit/llvm2ice_tests/arith-opt.ll
tests_lit/llvm2ice_tests/arithmetic-chain.ll
tests_lit/llvm2ice_tests/bitcast.ll
tests_lit/llvm2ice_tests/bool-opt.ll
tests_lit/llvm2ice_tests/branch-simple.ll
tests_lit/llvm2ice_tests/call.ll
tests_lit/llvm2ice_tests/callindirect.pnacl.ll
tests_lit/llvm2ice_tests/casts.ll
tests_lit/llvm2ice_tests/cmp-opt.ll
tests_lit/llvm2ice_tests/convert.ll
tests_lit/llvm2ice_tests/empty-func.ll
tests_lit/llvm2ice_tests/fp.pnacl.ll
tests_lit/llvm2ice_tests/fpconst.pnacl.ll
tests_lit/llvm2ice_tests/global.ll
tests_lit/llvm2ice_tests/icmp-simple.ll
tests_lit/llvm2ice_tests/load.ll
tests_lit/llvm2ice_tests/mangle.ll [new file with mode: 0644]
tests_lit/llvm2ice_tests/return-int-arg.ll
tests_lit/llvm2ice_tests/select-opt.ll
tests_lit/llvm2ice_tests/shift.ll
tests_lit/llvm2ice_tests/simple-arith.ll [deleted file]
tests_lit/llvm2ice_tests/simple-cond.ll [deleted file]
tests_lit/llvm2ice_tests/simple-loop.ll
tests_lit/llvm2ice_tests/store.ll
tests_lit/llvm2ice_tests/struct-arith.pnacl.ll
tests_lit/llvm2ice_tests/switch-opt.ll
tests_lit/llvm2ice_tests/unreachable.ll