OSDN Git Service

android-x86/external-swiftshader.git
10 years agoMake py import not assume dir is "pnacl-subzero". Avoid autovect in crosstest.
Jan Voung [Fri, 6 Jun 2014 15:47:54 +0000 (08:47 -0700)]
Make py import not assume dir is "pnacl-subzero". Avoid autovect in crosstest.

Derek's CL to check out subzero calls the source directory
"subzero", and the file header comments call the directory
"subzero". Just make the python sys.path munging for
importing pydir more generic.

Also change crosstest to not run the raw LLVM "opt" with
optimizations (only use it for ABI stabilization passes).
Instead run pnacl-clang with -O2. Otherwise, newer NACL_SDK
versions include a newer LLVM "opt" binary which
autovectorizes and may generate vector IR that is not
handled by Subzero yet.

E.g.,
LLVM ERROR: Invalid PNaCl instruction:   %1 = insertelement <4 x i32> undef, i32 %0, i32 0
w/ pepper_canary to version 37, revision 274873

BUG=none
TEST=make -f Makefile.standalone check
R=stichnot@chromium.org, wala@chromium.org

Review URL: https://codereview.chromium.org/317963002

10 years agoFix a C++ violation.
Jim Stichnoth [Thu, 5 Jun 2014 15:06:12 +0000 (08:06 -0700)]
Fix a C++ violation.

Ice::Inst::NumberSentinel is defined within the Inst class definition:

class Inst {
  ...
  static const InstNumberT NumberDeleted = -1;
  static const InstNumberT NumberSentinel = 0;
  ...
};

Under some compilers/options, this causes a link error when passing NumberSentinel as a const T& argument.

(Another option would be to move the actual definitions into IceInst.cpp.)

BUG= none
R=jfb@chromium.org

Review URL: https://codereview.chromium.org/311243006

10 years agoSubzero: Initial O2 lowering
Jim Stichnoth [Wed, 4 Jun 2014 18:57:08 +0000 (11:57 -0700)]
Subzero: Initial O2 lowering

Includes the following:
1. Liveness analysis.
2. Linear-scan register allocation.
3. Address mode optimization.
4. Compare-branch fusing.

All of these depend on liveness analysis.  There are three versions of liveness analysis (in order of increasing cost):
1. Lightweight.  This computes last-uses for variables local to a single basic block.
2. Full.  This computes last-uses for all variables based on global dataflow analysis.
3. Full live ranges.  This computes all last-uses, plus calculates the live range intervals in terms of instruction numbers.  (The live ranges are needed for register allocation.)

For testing the full live range computation, Cfg::validateLiveness() checks every Variable of every Inst and verifies that the current Inst is contained within the Variable's live range.

The cross tests are run with O2 in addition to Om1.

Some of the lit tests (for what good they do) are updated with O2 code sequences.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/300563003

10 years agoAdd wala@chromium.org to owners list
Matt Wala [Mon, 2 Jun 2014 22:46:46 +0000 (15:46 -0700)]
Add wala@chromium.org to owners list

BUG= none
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/305973005

10 years agoFix g++ -pedantic warnings.
Jim Stichnoth [Fri, 23 May 2014 20:39:02 +0000 (13:39 -0700)]
Fix g++ -pedantic warnings.

1. Comma-terminated enumerator lists.
2. Empty macro arguments.
3. Variable-length arrays.

The first issue is definitely hitting the Mac bots.  The other two issues will quite possibly following that.

BUG= none
R=jfb@chromium.org

Review URL: https://codereview.chromium.org/296823013

10 years agoFix x86 floating-point constant emission.
Jim Stichnoth [Fri, 23 May 2014 20:31:24 +0000 (13:31 -0700)]
Fix x86 floating-point constant emission.

Previously, the basis of constant pooling was implemented, but two things were lacking:

1. The constant pools were not being emitted in the asm file.

2. A direct FP value was emitted in an FP instruction, e.g. "addss xmm0, 1.0000e00".  Curiously, at least for some FP constants, llvm-mc was accepting this syntax.

BUG= none
R=jfb@chromium.org

Review URL: https://codereview.chromium.org/291213003

10 years agoAdd Makefiles to support building along with LLVM
Derek Schuff [Thu, 22 May 2014 23:39:25 +0000 (16:39 -0700)]
Add Makefiles to support building along with LLVM

This change now supports building subzero as part of the LLVM build (instead
of in a separate build step). It is modeled on clang's Makefiles.

The existing Makefile has been renamed and can still be used manually, e.g.
Make -f Makefile.standalone

It does not yet support running tests, just building.

R=stichnot@chromium.org, jvoung@chromium.org
BUG=

Review URL: https://codereview.chromium.org/293983007

10 years agoAdd Om1 lowering with no optimizations.
Jim Stichnoth [Thu, 22 May 2014 20:38:48 +0000 (13:38 -0700)]
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

10 years agoModify pnacl subzero to be able to read pnacl bitcode files.
Karl Schimpf [Mon, 19 May 2014 21:56:51 +0000 (14:56 -0700)]
Modify pnacl subzero to be able to read pnacl bitcode files.

BUG=None
R=jfb@chromium.org, stichnot@chromium.org

Review URL: https://codereview.chromium.org/277033003

10 years agoInitial skeleton of Subzero.
Jim Stichnoth [Tue, 29 Apr 2014 17:52:43 +0000 (10:52 -0700)]
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

Review URL: https://codereview.chromium.org/205613002

10 years agoSubzero: initial codereview and OWNERS files, copied from libcxxabi.
Jim Stichnoth [Wed, 19 Mar 2014 22:15:53 +0000 (15:15 -0700)]
Subzero: initial codereview and OWNERS files, copied from libcxxabi.

BUG= none
R=jfb@chromium.org

Review URL: https://codereview.chromium.org/205113003

10 years agoInitial empty repository
Vadim Shtayura [Wed, 19 Mar 2014 17:52:30 +0000 (10:52 -0700)]
Initial empty repository