OSDN Git Service
Jim Stichnoth [Sat, 9 Apr 2016 00:09:29 +0000 (17:09 -0700)]
Subzero: Improve the -timing output.
For "Flat times" output, adds a column with cumulative percentage. Also, since these percentages add up to less than 100% due to timer overhead, we go ahead and scale up all of the "Flat times" percentages proportionally, to make them add to 100%. This makes it easier to compare breakdowns across different pexes.
Also, simplify the output to be simple tabular without extra brackets and whatnot. E.g.:
Total across all functions - Cumulative times:
Seconds Pct EventCnt TimerPath
8.580407 82.6% 0 szmain
8.580054 82.6% 0 szmain.parseModule
8.405447 80.9% 46473 szmain.parseModule.parseFunctions
...
Total across all functions - Flat times:
Seconds Pct CumPct EventCnt TimerName
1.354678 16.0% 16.0% 100716 linearScan
1.131292 13.3% 29.3% 139419 liveness
0.728727 8.6% 37.9% 46473 genCode
...
BUG= none
R=jpp@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/
1870073005 .
Jim Stichnoth [Thu, 7 Apr 2016 14:17:35 +0000 (07:17 -0700)]
Subzero: Fix an incorrect StringPool assert.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1866993002 .
Jim Stichnoth [Wed, 6 Apr 2016 19:21:14 +0000 (12:21 -0700)]
Subzero: Remove a couple clumsy uses of snprintf.
We can use llvm::format() to achieve the same result in these cases.
BUG= none
R=jpp@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/
1866633003 .
Jim Stichnoth [Wed, 6 Apr 2016 19:20:18 +0000 (12:20 -0700)]
Subzero: Dump register numbers as signed quantities.
Undo an overly aggression application of unsigned to register numbers in
8aa396610b7baf728631a43ea16ad3d13e38397a (https://codereview.chromium.org/
1676123002).
Now, instead of -verbose=regalloc output like:
++++++ Unhandled:
R=jpp@chromium.org, kschimpf@google.com,
4294967295 V=%__4 Range=[2:7),
4294967295 V=%__5 Range=[7:8),
4294967295 V=%__6 Range=[9:11), -1 V=%__4 Range=[2:7), -1 V=%__5 Range=[7:8), -1 V=%__6 Range=[9:11)
we have the originally intended:
++++++ Unhandled:
BUG= none
Review URL: https://codereview.chromium.org/
1868543002 .
Jim Stichnoth [Wed, 6 Apr 2016 13:37:15 +0000 (06:37 -0700)]
Subzero: Fix -timing-focus .
The problem is that the default timer is renamed to be the current function name, instead of "Total across all functions", but this causes an assertion failure during the final merge of thread-local timers into the global timers, because the names don't match.
The solution is to temporarily rename the timer to be the function name, until the timer is dumped, and then restore it to its original value.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1867473002 .
Jim Stichnoth [Tue, 5 Apr 2016 22:31:43 +0000 (15:31 -0700)]
Subzero: Improve non-MINIMAL string performance.
In a DUMP-enabled build, such as the standard Release+Asserts build, translator performance has regressed as a result of
467ffe51bebcb3ae3e3ce745c38fc20e8837c31c (https://codereview.chromium.org/
1838753002).
This is because Variable and CfgNode names are being instantiated unconditionally, rather than on-demand.
This CL restores most of that performance by going back to being on-demand. Note that it should have no effect on MINIMAL build performance.
Also, it turns out that Variable::getName() does not really need the Cfg* parameter, so that is removed (and all its callers are fixed transitively).
In addition, Variable and CfgNode are made more uniform with respect to each other in terms of inline definitions of the ctor, getName(), and setName().
BUG= none
R=jpp@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/
1866463002 .
John Porto [Tue, 5 Apr 2016 13:30:21 +0000 (06:30 -0700)]
Subzero. Refactors Switch Lowering.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1860473002 .
John Porto [Tue, 5 Apr 2016 13:20:50 +0000 (06:20 -0700)]
Subzero. Fixes Browser build.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1856323004 .
Eric Holk [Tue, 5 Apr 2016 00:07:42 +0000 (17:07 -0700)]
Initial Subzero WASM prototype.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1837663002 .
David Sehr [Mon, 4 Apr 2016 17:11:08 +0000 (10:11 -0700)]
Replace constant conditional branches by unconditional branches
BUG=
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1847423003 .
Jim Stichnoth [Mon, 4 Apr 2016 04:58:03 +0000 (21:58 -0700)]
Subzero: Fix -timing-funcs and -timing-focus flags.
1. Generate dummy FunctionXXX function names when either of those flags is given.
2. Remove the browser code that automatically sets F/G prefixes instead of Function/Global, since that performance tweak is no longer relevant.
3. Fix a presumably long-standing bug where -timing-focus would accumulate timings into the TLS copy of the timers, but would then try to print timing info based on the currently-empty GlobalContext copy of the timers.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1855683002 .
Karl Schimpf [Sat, 2 Apr 2016 17:06:56 +0000 (10:06 -0700)]
Fix error reporting for parallel parsed function blocks.
Fixes error reporting in function blocks by adding a start address
with parallel parses, and then using the getErrorBitNo() method
of the bitstream cursor to correct error bit number, based on the
start address.
Dependent on CL https://codereview.chromium.org/
1851163002.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4363
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1848313003 .
Karl Schimpf [Sat, 2 Apr 2016 16:55:31 +0000 (09:55 -0700)]
Simplify references to command line flags.
This CL removes all indirect pointer chasing to get the values of
command line flags. Since we are only using 1 copy of ClFlags, this CL
introduces a static field Flags to hold the defined command line flags
(it was previously a static field of GlobalContext).
For those few contexts where one must change CL flags due to context
(such as testsing and running in the browser), use ClFlags::Flags.
In the remainder of the cases, the code uses getFlags() which returns
a constant reference to ClFlags::Flags, allowing access to the get
accessors.
BUG=None
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1848303003 .
Jim Stichnoth [Sat, 2 Apr 2016 01:26:16 +0000 (18:26 -0700)]
Subzero: Fix a cleanup error after the IceString removal CL.
This corrects a "cleanup" mistake in line 414/417 of https://codereview.chromium.org/
1838753002/diff/120001/src/IceTargetLoweringX8664.cpp .
This wasn't caught before because "make presubmit" doesn't run any sandboxed x86-64 tests. So we add that to the presubmit script.
In addition, the "make check-spec" is changed to run each spec component via the "--run" flag of szbuild_spec2k.py. Otherwise, the makefile was hard-coding running the native binary setup instead of the sandboxed or nonsfi setup.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1852713004 .
John Porto [Fri, 1 Apr 2016 18:14:30 +0000 (11:14 -0700)]
Subzero. Outputs liveness memory usage.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1850163003 .
John Porto [Fri, 1 Apr 2016 12:43:09 +0000 (05:43 -0700)]
Subzero. Liveness memory management.
Creates a local arena allocator for holding liveness data structures.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4366
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1838973005 .
Karl Schimpf [Thu, 31 Mar 2016 21:39:10 +0000 (14:39 -0700)]
Clean up Cl flag refrences in the bitcode parser.
The code previously had to navigate through 1 (or more) indirect
pointers to find the CL flags. Since CL flags are a static field in
the global context, simplify these references. Note: I have added
member functions to do this (where appropriate) so that fixing code
could be easy if we choose to move where the command line flags are
stored.
BUG=None
R=eholk@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1845913003 .
Karl Schimpf [Thu, 31 Mar 2016 20:22:11 +0000 (13:22 -0700)]
Force sequential parsing when threads=0.
When threads=0, it doesn't pay to run a parallel parse, since each
parallel parse slows down parsing by requiring a copy of bits in the
function block.
BUG=None
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1848873002 .
Jim Stichnoth [Thu, 31 Mar 2016 18:55:23 +0000 (11:55 -0700)]
Subzero: Ignore variables with no actual uses.
Liveness analysis uses a pair of bit vectors in each CFG node. The early bits correspond to "global" variables that are referenced in more than one block, and the latter bits correspond to "local" variables that are referenced in only that particular single block.
Due to an oversight, variables that have no uses are conservatively classified as global, and consume space in every liveness bit vector.
This CL improves memory usage by reducing liveness bit vector size:
1. Identify variables with no actual uses and exclude them from the bit vectors.
2. Don't do liveness analysis on rematerializable variables, because they have no need to be involved in register allocation or dead code elimination.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4366
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1844713004 .
Jim Stichnoth [Thu, 31 Mar 2016 18:05:39 +0000 (11:05 -0700)]
Subzero: Refine the memory usage report with -szstats .
The problem is that the memory usage that comes from the -track-memory option is not very well-defined (it's a hidden LLVM option after all). It gives an OK sense of memory growth over time, but sometimes we really want to know how much CFG-local arena memory was allocated for a particular function.
To help with this, we add another row to the stats output, giving the MB size of the CFG arena at the end of translating the method.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4366
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1848733002 .
Karl Schimpf [Thu, 31 Mar 2016 17:20:23 +0000 (10:20 -0700)]
Allow Subzero to parse function blocks in parallel.
This CL modifies the code so that we can do sequential and parallel
parsing of function blocks in bitcode files, based on a command line
argument.
The command line argument was added because during testing, I had one
compilation failure (transient), and do not know the cause. Hence, I
was reluctant to install this CL without a command-line flag.
To test the new parallel parser, the easiest solution is to edit
IceClFlags.def and set the default value of ParseParallel to true.
This code also fixes up unit parsing tests, as well as one parsing
test. The cause of these problems was the implicit assumption that
function blocks are parsed sequentially, which no longer applies when
function blocks are parsed in parallel. To fix this, the "threads=0"
command line argument was added. It also added the starting up of
worker threads, since parsing of function blocks will happen in the
translation thread if parallel parsing is turned on.
The OptQ queue was modified to contain OptWorkerItem instances with a
single virtual to get the parsed code. This allows the IceConverter to
continue to work, by simply passing the generated Cfg as a work item.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4363
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1834473002 .
Jim Stichnoth [Wed, 30 Mar 2016 22:30:30 +0000 (15:30 -0700)]
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
Review URL: https://codereview.chromium.org/
1839263003 .
Jim Stichnoth [Tue, 29 Mar 2016 22:01:06 +0000 (15:01 -0700)]
Subzero: Remove IceString.
The purpose is to get control over excess string creation and deletion, especially when the strings are long enough to involve malloc/free.
Strings that interface with the outside world, or used for dump/debug, are now explicitly std::string.
Variable names and node names are represented as string IDs and pooled locally in the CFG. (In a non-DUMP build, this pool should always be empty.)
Other strings that are used across functions are represented as string IDs and pooled globally in the GlobalContext.
The --dump-strings flag allows these strings to be dumped for sanity checking, even in a MINIMAL build. In a MINIMAL build, the set of strings includes external symbol names, intrinsic names, helper function names, and label names of pooled constants to facilitate deterministic ELF string table output. For now, it also includes jump table entry names until that gets sorted out.
Constants are fixed so that the name and pooled fields are properly immutable after the constant is fully initialized.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1838753002 .
Karl Schimpf [Fri, 25 Mar 2016 14:12:26 +0000 (07:12 -0700)]
Fix Subzero binary instruction to allow optional flags argument.
This CL fixes pnacl-sz to handle smoothnacl.pexe.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4364
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1831043002 .
John Porto [Thu, 24 Mar 2016 13:11:29 +0000 (06:11 -0700)]
Subzero. Fixes valgrind errors.
Valgrind used to report errors about uninitialized variable access in
Subzero, when it was built with -O2. The problem was traced to
size_t Alignment = Var->getAlignment;
Alignment = std::max(MinAlignment, Var->getAlignment())
Apparently, the compiler will not correctly zero-extend
Var->getAlignment(), and thus Alignment's upper 32-bits would be
garbage.
BUG=
R=kschimpf@google.com, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1825363003 .
Jim Stichnoth [Mon, 21 Mar 2016 21:53:03 +0000 (14:53 -0700)]
Subzero: Fix the broken "make presubmit-lite".
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1819153002 .
Jim Stichnoth [Mon, 21 Mar 2016 19:49:33 +0000 (12:49 -0700)]
Subzero: Add presubmit-lite target.
The big reduction is in greatly reducing the set of non-native cross tests. Also, not so many copies of spec2k are run, and only one "representative" sandboxed target is built.
BUG= none
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
1824723002 .
John Porto [Mon, 21 Mar 2016 18:18:02 +0000 (11:18 -0700)]
Subzero. Flags refactoring.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1803403002 .
David Sehr [Thu, 17 Mar 2016 20:51:42 +0000 (13:51 -0700)]
Add malloc/new profiling on linux
BUG=
R=jpp@chromium.org, kschimpf@google.com, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1781213002 .
Karl Schimpf [Thu, 17 Mar 2016 20:30:13 +0000 (13:30 -0700)]
Cache common constants before lowering.
This code moves some constants used by the target lowering, so that they
are defined (and cached) during static initialization of the target
lowering, rather than looking up everytime they are used.
This CL does this for the constant zero, and predefined helper functions.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1775253003 .
John Porto [Wed, 16 Mar 2016 11:20:49 +0000 (04:20 -0700)]
Suzero. Refactors dependencies in Makefile.standalone.
Uses the compiler's frontend -MD -MP options to auto-generate make
dependencies.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1801273003 .
Jim Stichnoth [Tue, 15 Mar 2016 18:09:32 +0000 (11:09 -0700)]
Subzero: Shorten global prefixes in non-DUMP build.
Reverts part of
843142fe (https://codereview.chromium.org/
1776343004).
Makes global prefixes short in all non-DUMP builds, not just the browser
build, so that the user doesn't need to remember to supply the override
options in a command-line MINIMAL build.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1805593002 .
John Porto [Tue, 15 Mar 2016 18:06:25 +0000 (11:06 -0700)]
Subzero. Uses unique_ptrs in the emit queue.
Because explicit memory ownership is awesome!
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1804133002 .
John Porto [Tue, 15 Mar 2016 16:28:04 +0000 (09:28 -0700)]
Subzero. Allocate global initializers from a dedicated arena.
This allows Subzero to release the global initializers once they've been
lowered.
This CL also modifies the global initializer types to ensure they are
trivially destructible -- therefore not requiring destructors to run.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1776473007 .
Jim Stichnoth [Mon, 14 Mar 2016 15:37:52 +0000 (08:37 -0700)]
Subzero: Control whether deleted instructions are retained.
Normally, deleted instructions are preserved in the Cfg, and printed as part of dump output. This helps debugging by partially explaining the provenance of new instructions that originated from the deleted instructions.
However, these instructions slow down iteration over the instruction list, and checking their deleted status may pollute the cache.
As such, in a non-DUMP enabled build, we repurpose the renumberInstructions() pass to also unlink deleted instructions as needed.
A flag is provided to override this behavior, in case we have to debug a situation where a bug only manifests in a DUMP build and not a non-DUMP build, or vice versa.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=eholk@chromium.org, jpp@chromium.org
Review URL: https://codereview.chromium.org/
1790063003 .
Jim Stichnoth [Sat, 12 Mar 2016 18:22:53 +0000 (10:22 -0800)]
Subzero: Allow Makefile.standalone to build for a single target.
This makes it easier to focus on reducing the translator size.
Enable with e.g.:
make -f Makefile.standalone MINIMAL=1 SZTARGET=X8664 bloat-sb
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4362
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1787143002 .
Jim Stichnoth [Sat, 12 Mar 2016 18:04:08 +0000 (10:04 -0800)]
Subzero: Fix the Makefile for the LLVM build.
https://codereview.chromium.org/
1784243006/ added the ALLOW_TIMERS define, and I forgot to add it to Makefile and CMakeLists.txt.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1788873004 .
Jim Stichnoth [Fri, 11 Mar 2016 23:33:00 +0000 (15:33 -0800)]
Subzero: Improve the use of timers.
Several things are done here:
1. Move timer support to be guarded by the ALLOW_TIMERS define, or the BuildDefs::timers() constexpr method.
2. Add a NODUMP build configuration to control whether dump support is built in. So "make -f Makefile.standalone NODUMP=1 NOASSERT=1" is pretty close to a MINIMAL build with timer support.
3. Add some missing timers: alloca analysis, RMW analysis, helper call pre-lowering, load optimization analysis. These omitted pass timings were being rolled up into the "O2" bucket.
4. Add timers around push and pop operations on the translate queue and the emit queue.
5. Refactor the clumsy code to push/pop function timers (as opposed to pass timers), so that it fits into the nice RAII TimerMarker class like the pass timers.
6. It turns out that even with MINIMAL or NODUMP builds, we still construct a longish std::string every time Cfg::dump() is called, even though the string isn't used in MINIMAL/NODUMP mode. The dump() arg might as well be a const char * arg instead.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1784243006 .
Jim Stichnoth [Fri, 11 Mar 2016 22:59:43 +0000 (14:59 -0800)]
Subzero: Improve the behavior of resizing vectors.
In some cases, Subzero needs to insert into a std::vector at a particular index, resizing the vector as necessary. It appears that our vector implementation sets the capacity to exactly the size when growing the vector, without leaving any extra capacity. This causes lots of mallocs and recopies each time the vector size is increased. (Adding elements via push_back() or emplace_back() doesn't seem to have that behavior.)
We help this by reserving some extra space before resizing - bump to the next power of 2 up to some point, then bump to the next multiple of a chunk size beyond that point.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1783113002 .
Jim Stichnoth [Fri, 11 Mar 2016 22:58:23 +0000 (14:58 -0800)]
Subzero: 'make presubmit' checks for certain prerequisites.
A fresh checkout of native_client lacks some components that Subzero's "make -f Makefile.standalone presubmit" needs.
Add explicit checks for these components, and when missing, print suggestions for how to create them.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4359
R=jpp@chromium.org, smklein@chromium.org
Review URL: https://codereview.chromium.org/
1782343003 .
Sean Klein [Fri, 11 Mar 2016 17:49:36 +0000 (09:49 -0800)]
PNaCl Dynamic Linking: Force __pnacl_pso_root to be an external declaration.
This CL updates "isPNaClABIExternalName" -- Subzero checked for the symbol
"__pnacl_pso_root" as a function, but it is a declaration, and should be
checked as one. Additionally, when the PNaClTranslator is verifying the linkage
of declarations, allow "__pnacl_pso_root" to be flipped to external as a special
case.
Previously, translating a pso with --use-sz caused the warning:
"cannot find entry symbol '__pnacl_pso_root'".
That warning is removed with this CL.
Fixes revert from https://codereview.chromium.org/
1745783002/
TEST=external_declaration.ll
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4351
R=kschimpf@google.com, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1774383002 .
John Porto [Thu, 10 Mar 2016 18:59:02 +0000 (10:59 -0800)]
Subzero. X8664. No moar ::new for AutoBundle.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4077
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1783893002 .
Patch from John Porto <jpp@chromium.org>.
Jim Stichnoth [Thu, 10 Mar 2016 16:19:34 +0000 (08:19 -0800)]
Re-fix build errors from upgrading to clang 3.9 .
This reverts commit
5526c1718b43d77d90850ec0409a21ecfc975b2c (https://codereview.chromium.org/
1778663003) and implements it per jpp's suggestion.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1780773003 .
Sean Klein [Wed, 9 Mar 2016 23:26:41 +0000 (15:26 -0800)]
Eliminate all uses of 'le32-nacl-objcopy'.
Additionally, refactor "GetObjdumpCmd" and "GetObjcopyCmd".
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4361
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1777103002 .
Jim Stichnoth [Wed, 9 Mar 2016 23:19:40 +0000 (15:19 -0800)]
Subzero: Tweaks to reduce malloc use.
1. Subzero constructs many strings based in part on function name. When function names are not present (as in properly finalized pexes), they are synthesized as something like "Function12345". We can shorten these strings to e.g. "F12345" by using --default-function-prefix=F . Similar for global variable names.
Using short strings makes it much less likely to have to use malloc. As such, we force that to be the default in the browser translator build. For perf-testing the command-line version, the user can just add the option manually for now.
Ultimately, we should avoid use of strings in this way.
2. The register allocator uses a few instances of llvm::SmallVector that are sized too small and therefore end up using malloc. This can be fixed in a clean way, and there is a TODO for it, but in the meantime we just bump the size.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1776343004 .
Sean Klein [Wed, 9 Mar 2016 18:29:54 +0000 (10:29 -0800)]
Allow subzero tests to pass without le32-nacl-objdump.
le32-nacl-objdump has been deprecated, and should no longer be used.
Instead, "arm-nacl-objdump" is being used. "le32-nacl-objdump" used to be
a hard link to "arm-nacl-objdump", but has since been deleted in NaCl's
"toolchain_build_pnacl.py" script.
R=phosek@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1776843002 .
Jim Stichnoth [Wed, 9 Mar 2016 06:46:19 +0000 (22:46 -0800)]
Subzero: Fix build errors from upgrading to clang 3.9 .
BUG= none
TBR=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1778663003 .
Jim Stichnoth [Wed, 9 Mar 2016 00:18:40 +0000 (16:18 -0800)]
Subzero: Control memory growth from local label fixups.
The ConstantRelocatable objects for pushing local labels are allocated from the Assembler arena, and are no longer pooled, which restricts the memory growth from sandboxing x86-64 calls.
Because the Assembler arena is destroyed while the fixups are still active, these fixups have to be fixed up by holding a pointer to the symbol rather than the constant.
On the 10MB test pexe, the overall growth by the end is ~20MB, instead of ~130MB as before.
This also partially fixes an existing bug with arm32/nonsfi/iasm, exposed by running cross tests and forcing iasm output.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1773503003 .
Karl Schimpf [Tue, 8 Mar 2016 20:27:12 +0000 (12:27 -0800)]
Fix timing of parseFunctions.
The previous implementation was charging about 24% more time that it
should to the function parser. The cause was that the time to "queue" the
parsed functions, and the time to emit the assembled code (again
including "queue" time) was not accounted for. About 15% was going to
queuing costs, and 7% to emitting the ELF file.
This CL adds timing of function translateFunctions, which captures most
of the queueing costs, and timing for each of the major ELF emission
functions (emitELF). This allows the corresponding costs to be better
bucketed, and not charged to the time it takes to parse functions in
bitcode files.
Bug=None
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1775603002 .
John Porto [Tue, 8 Mar 2016 19:00:53 +0000 (11:00 -0800)]
Subzero. ARM32. Fix bugs uncovered by scons tests.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=eholk@chromium.org, kschimpf@google.com, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1768823002 .
Jim Stichnoth [Mon, 7 Mar 2016 17:54:15 +0000 (09:54 -0800)]
Subzero: Fix "make presubmit" for spec -Om1.
For the Om1 spec tests, we were generating commands like this:
./pydir/szbuild_spec2k.py -v -Om1 --target=x8632 -O2 --filetype=obj 253.perlbmk
where -Om1 and -O2 both appear. Python's argparse allows an argument to be set multiple times, and the last one would win, i.e. -O2 is used instead of -Om1.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1766603002 .
Jim Stichnoth [Mon, 7 Mar 2016 17:26:22 +0000 (09:26 -0800)]
Subzero: Fix symbol name mangling. Make flags global.
This cleans up the whole --prefix handling mechanism, so that all mangling is done based on logic in the parser instead of scattered all over the code base. Another nice side effect is that it allows some getName() style functions to return a const string reference instead of a string copy.
Also, moves ClFlags into a static field of GlobalContext, i.e. makes it global, so that these constant flags can be accessed without having to plumb a GlobalContext object. Note that some of the ClFlags and ClFlagsExtra plumbing in the compile server classes could be simplified to directly use the corresponding static fields, but this is left mostly as is for now, for when we do a proper separation between core and supplemental flags.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1766233002 .
Jim Stichnoth [Mon, 7 Mar 2016 16:25:24 +0000 (08:25 -0800)]
Subzero: Count lookups of each constant value in the constant pool.
With "-verbose cpool", at the end it dumps counts of the number of times each pooled constant was looked up. The output is grouped by type and sorted by constant value, but it's easy to run it through "sort -nr" to see it ordered by popularity.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1768173002 .
John Porto [Wed, 2 Mar 2016 23:10:19 +0000 (15:10 -0800)]
Subzero. ARM32. Fixes bugs uncovered by the llvm test suite.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1755333002 .
John Porto [Tue, 1 Mar 2016 23:19:29 +0000 (15:19 -0800)]
Subzero. ARM32. Fixes bugs uncovered by the gcc torture tests.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1747243003 .
Jim Stichnoth [Tue, 1 Mar 2016 20:22:29 +0000 (12:22 -0800)]
Subzero: Print constant pool info with --szstats.
BUG= none
R=eholk@chromium.org, jpp@chromium.org
Review URL: https://codereview.chromium.org/
1747333002 .
John Porto [Tue, 1 Mar 2016 14:11:05 +0000 (06:11 -0800)]
Subzero. ARM32. Reverts cl
1687553002.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1745393002 .
Jim Stichnoth [Tue, 1 Mar 2016 00:58:15 +0000 (16:58 -0800)]
Subzero: Reduce copying of Liveness bitvectors.
There were a lot of unnecessary copying and resizing and sloppiness in the use of BitVector for liveness analysis. This tries to reduce the amount of copying and associated memory allocation.
Also, works around a ConstantRelocatable hashing problem that was causing a huge slowdown in MINIMAL mode for the vector_shuffle scons test.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1746613002 .
Sean Klein [Tue, 1 Mar 2016 00:44:07 +0000 (16:44 -0800)]
Fix clang warning "has virtual functions but non-virtual destructor".
BUG= None
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1741733003 .
Jim Stichnoth [Mon, 29 Feb 2016 17:54:55 +0000 (09:54 -0800)]
Subzero: Fix JumpTable lowering on x86-64.
The problem is that when switch lowering decides to use a JumpTable and the switch variable is i64 on x86-64, the lowering tries to movzx the i64 variable into an i32 variable, and the Movzx ctor asserts.
This happens when translating pnacl-llc.pexe, but luckily it is also triggered in the existing adv-switch.ll test.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1743133002 .
Jim Stichnoth [Mon, 29 Feb 2016 17:34:01 +0000 (09:34 -0800)]
Subzero: Add "-verbose init" to control global initializer dumping.
One is rarely interested in seeing dump output regarding global initializers, so we add an additional verbose flag, and don't include it in the "-verbose most" set.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1744913002 .
Jim Stichnoth [Mon, 29 Feb 2016 17:16:00 +0000 (09:16 -0800)]
Subzero: Build sandboxed translators for the browser.
Along with the nexe equivalents of pnacl-sz, also build the browser-integrated versions that can be dropped in as replacements. Note that these are not exact replacements, as they likely support all targets.
In "make presubmit", instead build sandboxed translators in DEBUG=1 mode, so they can build in parallel with the assembler unit tests.
Add a "make bloat-sb" target that does the "make bloat" equivalent for the sandboxed translators.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1746593002 .
Jim Stichnoth [Mon, 29 Feb 2016 17:14:11 +0000 (09:14 -0800)]
Revert "Force __pnacl_pso_root to be an external declaration."
This reverts commit
352db9354e9c30f99c6f87674f70a6f23a9ef7eb from https://codereview.chromium.org/
1740033002/ .
That commit broke "make -f Makefile.standalone check-lit check-xtest".
BUG= none
R=smklein@chromium.org
Review URL: https://codereview.chromium.org/
1745783002 .
Jim Stichnoth [Sat, 27 Feb 2016 17:05:50 +0000 (09:05 -0800)]
Subzero: Print memory usage info when dumping.
Adds "-verbose mem" to enable printing the amount of CfgLocalAllocator memory allocated, each time Cfg::dump() is called.
"-verbose mem,status" is a good way to get summary info.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1743043002 .
Sean Klein [Fri, 26 Feb 2016 22:34:38 +0000 (14:34 -0800)]
Force __pnacl_pso_root to be an external declaration.
This CL updates "isPNaClABIExternalName" -- Subzero checked for the symbol
"__pnacl_pso_root" as a function, but it is a declaration, and should be
checked as one. Additionally, when the PNaClTranslator is verifying the linkage
of declarations, allow "__pnacl_pso_root" to be flipped to external as a special
case.
TEST=pnacl-translate -pso --use-sz -arch x86-32-nonsfi test_pll.final.pso
BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4351
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1740033002 .
John Porto [Fri, 26 Feb 2016 21:10:55 +0000 (13:10 -0800)]
Subzero. Fix CfgLocalAllocator bug.
BUG=
Review URL: https://codereview.chromium.org/
1742833002 .
John Porto [Fri, 26 Feb 2016 15:19:59 +0000 (07:19 -0800)]
Subzero. Moar performance tweaks.
1) Clones llvm::BitVector, and makes it Allocator aware (using the
CfgLocalAllocator<>)
2) Uses mallopt to set the malloc granularity. The default granularity
is too small, which forces too many mmap calls.
BUG=
R=sehr@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1738683003 .
Jim Stichnoth [Thu, 25 Feb 2016 08:13:46 +0000 (00:13 -0800)]
Subzero: Fix ODR errors in the g++ build.
See failed build at https://build.chromium.org/p/tryserver.nacl/builders/nacl-toolchain-win7-pnacl-x86_64/builds/3441 .
BUG= none
TBR=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1732233002 .
Jim Stichnoth [Thu, 25 Feb 2016 05:32:53 +0000 (21:32 -0800)]
Subzero: Provide "make sb" target for sandboxed pnacl-sz.
Instead of "./pnacl-sz <args>", one can run:
../../../run.py ./pnacl-sz.x8632.nexe <args>
or
../../../run.py ./pnacl-sz.x8664.nexe <args>
Hopefully the translator performance characteristics are close to that of the browser hookup.
Adds sb builds to two of the presubmit configurations.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1738633002 .
John Porto [Wed, 24 Feb 2016 23:58:55 +0000 (15:58 -0800)]
Subzero. Performance tweaks.
Introduces Ice::SmallBitVector.
Modifies ConstantRelocatables so that known offsets (i.e.,
not offsets to the code stream) do no require GlobalContext
allocations.
Modifies Cfg-local containers to use the CfgLocalAllocator.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1738443002 .
Jim Stichnoth [Wed, 24 Feb 2016 15:05:12 +0000 (07:05 -0800)]
Subzero: Add missing bits to MIPS implementation.
TBR=jpp@chromium.org
BUG= none
Review URL: https://codereview.chromium.org/
1730263002 .
Reed Kotler [Wed, 24 Feb 2016 02:59:43 +0000 (18:59 -0800)]
Subzero: Basic unconditional branch for Mips.
This is part of ARM patch:
https://codereview.chromium.org/
1151663004/
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1724643002 .
Patch from Reed Kotler <rkotlerimgtec@gmail.com>.
Reed Kotler [Sat, 20 Feb 2016 06:03:29 +0000 (22:03 -0800)]
Subzero: implement 64 bit multiply in mips32
Implement 64 bit multiply in mips32 and, in addition, add the lo/hi registers which are also used for other 64 bit math such as div, rem.
BUG=
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1716483003 .
Patch from Reed Kotler <rkotlerimgtec@gmail.com>.
John Porto [Thu, 18 Feb 2016 16:02:10 +0000 (08:02 -0800)]
Subzero. ARM32. Enable hwdiv-arm crosstests.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=eholk@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1708753002 .
Eric Holk [Wed, 17 Feb 2016 23:47:22 +0000 (15:47 -0800)]
Subzero. ARM32. Enable more crosstests.
This removes most of the #ifndef ARM32 directives so we get more
thorough testing. It still uses fewer iterations due to running on
Qemu, but I did manually check to be sure that the tests pass without
any special casing at all.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=jpp@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/
1708903002 .
Eric Holk [Wed, 17 Feb 2016 21:03:29 +0000 (13:03 -0800)]
ARM32 vector lowering: fabs, scalarize remaining arithmetic operations.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1685253003 .
Eric Holk [Wed, 17 Feb 2016 19:09:48 +0000 (11:09 -0800)]
ARM32 Vector lowering - scalarize select
With this change, we pass the select crosstest.
Since this would have introduced a three-argument version of
scalarizeInstruction, I decided to generalize it using templates.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1683243003 .
John Porto [Wed, 17 Feb 2016 18:16:12 +0000 (10:16 -0800)]
Subzero. Removes X8664_STACK_HACK from the crosstests.
X8664_STACK_HACK was an intrusive way to get the crosstests to run
while x32 support was not implemented in llvm. The hack is longer
needed.
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
1706883003 .
Karl Schimpf [Wed, 17 Feb 2016 17:51:23 +0000 (09:51 -0800)]
Add fabs(<4 x float>) to the integrated ARM assembler.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=eholk@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1697263007 .
Reed Kotler [Wed, 17 Feb 2016 13:37:01 +0000 (05:37 -0800)]
This would eliminate a lot of repetitive coding in subzero.
It's troublesome that we have to type (this) in several places
but I don't see a away around it yet and it does not add to the line
of code count at all to have to do this; it's just not aesthetic to me.
If this idea is okay, I can make all the similar changes
in the Mips Subzero port.
BUG=
Review URL: https://codereview.chromium.org/
1661233002 .
Patch from Reed Kotler <rkotlerimgtec@gmail.com>.
John Porto [Wed, 17 Feb 2016 13:00:59 +0000 (05:00 -0800)]
Subzero. ARM32. Refactors atomic intrinsics lowering.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1409863006 .
Jim Stichnoth [Tue, 16 Feb 2016 13:47:32 +0000 (05:47 -0800)]
Subzero: Set the correct target arch in the browser hookup.
The original implementation hard-coded the target to x86-32.
The new implementation mirrors pnacl-llc by probing the architecture it is running on.
Continues the plumbing work in https://codereview.chromium.org/
1698523003/ , toward the goal of enabling sandboxed translator tests for x86-64, particularly on the spec bots.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4077
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1696123003 .
Reed Kotler [Tue, 16 Feb 2016 04:01:24 +0000 (20:01 -0800)]
Subzero: Avoid explicit references to RegNumT sentinel value.
There are many occurrences of if (RegNum == RegNumT::NoRegister).
This patch eliminates NoRegister and provides a simpler mechanism for declaring and testing RegNumT values to see if they are undefined.
BUG= none
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1691193002 .
Patch from Reed Kotler <rkotlerimgtec@gmail.com>.
Karl Schimpf [Thu, 11 Feb 2016 23:20:49 +0000 (15:20 -0800)]
Add move vector to the integrated ARM assembler.
Implements a vector move as a vector orr on the corresponding Q
registers.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
1694533002 .
John Porto [Wed, 10 Feb 2016 23:57:16 +0000 (15:57 -0800)]
Subzero. ARM32. Nonsfi.
Adds nonsfi support to the ARM32 backend.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1665263003 .
Karl Schimpf [Wed, 10 Feb 2016 21:38:10 +0000 (13:38 -0800)]
Fix missing register class.
Adds class name for the "QtoS" register class.
BUG=None
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
1687163002 .
Karl Schimpf [Wed, 10 Feb 2016 21:30:48 +0000 (13:30 -0800)]
Add insert/extract element to the integrated ARM assembler.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1679023008 .
Eric Holk [Wed, 10 Feb 2016 21:07:06 +0000 (13:07 -0800)]
ARM32 vector ops - scalarize icmp, fcmp and cast.
This is part of a sequence of patches to quickly fill out vector
support by scalarizing the remaining operations. Later we can work to
generate better code.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1683153003 .
Jim Stichnoth [Wed, 10 Feb 2016 19:20:30 +0000 (11:20 -0800)]
Subzero: Use a proper RegNumT type instead of int32_t/SizeT.
Originally, register numbers were represented explicitly as int32_t, particularly so that -1 (or negative values in general) could be used as a NoRegister sentinel value. This created two problems:
1. It would be better to use a unique name for the type, to distinguish from other explicit int32_t uses such as stack offsets.
2. Apart from NoRegister, register number values ultimately come from unsigned sources like enum values and bitvector positions. This results in a number of clumsy casts to remove compiler warnings.
This creates a simple RegNumT class to manage this. It also deletes ordered comparison operators to help catch errors where particular register number orderings are assumed (as opposed to orderings of the encoded register values).
In addition, it creates a RegNumBitVector wrapper class that makes it much cleaner to do range-based for loops over bit vectors that represent RegNumT sets.
BUG= none
R=eholk@chromium.org, jpp@chromium.org
Review URL: https://codereview.chromium.org/
1676123002 .
Karl Schimpf [Wed, 10 Feb 2016 18:30:46 +0000 (10:30 -0800)]
Fix bug in arith.ll (ARM) tests.
CL https://codereview.chromium.org/
1687553002 introduced a bug when
running:
make -f Makefile.standalone check-lit FORCEASM=1
The cause of the problem is the way options "--asemble --disassemble"
work in run-pnacl-sz.py. When compiling using "--filetype=asm", the
assembler writes:
.word 0xe7fedef0
The output after assembly/disassembly is the same as above.
On the other hand, when compiling using "--filetype=iasm", the assembler
writes:
.byte 0xe7
.byte 0xfe
.byte 0xde
.byte 0xf0
While the same sequence of bytes is assembled, the dissassembly for the
latter generates assembly instruction:
udf #60896 ; 0xede0
The fix is to not check the generated disassembled instructions. Rather,
have it check if the same word is associated with the assembly
instruction.
Longer term, we should fix the several different ways --filetype=asm
introduces this instruction to match the "udf ..." output.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1682253003 .
Eric Holk [Wed, 10 Feb 2016 01:47:58 +0000 (17:47 -0800)]
ARM32 vector division lowering.
Enables vector division by scalarization.
Also, removed an assert as suggested by Karl in a previous CL:
https://codereview.chromium.org/
1646033002/diff/1/src/IceInstARM32.cpp#newcode717
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1681003002 .
Jim Stichnoth [Wed, 10 Feb 2016 01:25:02 +0000 (17:25 -0800)]
Subzero: Fix trailing whitespace errors.
To view the non-whitespace changes in this CL:
git cl patch -b testbranch
1678133003
git diff -w --ignore-blank-lines -b master
Such changes are only in gen_arm32_reg_tables.py and IceInst.cpp.
There are lots of tab characters in .ll files that shouldn't be there, but fixing them would require some thought about how to do consistent formatting, so that's left for later.
BUG= none
R=eholk@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/
1678133003 .
Karl Schimpf [Tue, 9 Feb 2016 21:20:38 +0000 (13:20 -0800)]
Change ARM calls into indirect calls.
This is done by putting far pointers (for calls) into a
register and then do an indirect call.
This was done to guarantee that we aren't putting a size limit on ARM32 executables.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1687553002 .
Karl Schimpf [Tue, 9 Feb 2016 21:09:23 +0000 (13:09 -0800)]
Add NOP to ARM IR lowering.
This change allows pnacl-sz to randomly insert NOPs into the generated
code, as is already done with X86.
BUG=None
R=eholk@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1670413002 .
Karl Schimpf [Tue, 9 Feb 2016 20:23:55 +0000 (12:23 -0800)]
Fix ARM assembler to pop registers in reverse order of pushes.
BUG=None
R=jpp@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1669973002 .
Eric Holk [Mon, 8 Feb 2016 23:22:18 +0000 (15:22 -0800)]
Subzero: ARM32: lowering of vector insert and extract.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/
1655313002 .
Jim Stichnoth [Sun, 7 Feb 2016 17:50:27 +0000 (09:50 -0800)]
Subzero: Clean up some uses of *_cast<>.
Some casts to size_t for use as array indexes are simply unnecessary.
Some explicit declaration types are changed to "auto" to avoid redundancy with the static_cast type.
A few llvm::dyn_cast<> operations are changed to llvm::cast<>, and vice versa.
A few explicit declaration types are changed to "auto" when used with llvm::cast<> and llvm::dynamic_cast<>. Some of these were missed during an earlier cleansing because of multi-line issues.
There are still a few opportunities related to Variable register numbers, but they are ignored for now because they are being addressed in another CL.
BUG= none
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/
1674033002 .
Jim Stichnoth [Fri, 5 Feb 2016 23:43:24 +0000 (15:43 -0800)]
Subzero: Fix a mul lowering error.
The low-level mul instruction may produce results in a register pair where one register is the explicit dest of the instruction, and the other register is defined through a FakeDef. If the FakeDef portion is ultimately unused, the FakeDef gets dead-code eliminated, and the register allocator doesn't know that the mul instruction affects the other register.
On x86, this can silently produce incorrect code. On ARM, the emitter complains that the explicitly represented second dest variable does not have a register.
The fix is to add a FakeUse of the FakeDef'd register. Unfortunately, this prevents the low-level mul instruction from ever being dead-code eliminated, but that's probably OK because it should have been eliminated at the high level.
BUG= none
R=eholk@chromium.org
Review URL: https://codereview.chromium.org/
1678523002 .
Jim Stichnoth [Fri, 5 Feb 2016 18:26:09 +0000 (10:26 -0800)]
Subzero: Improve an error message.
Add the variable name and function name to the fatal error message.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1677593003 .
Jim Stichnoth [Fri, 5 Feb 2016 17:50:02 +0000 (09:50 -0800)]
Subzero: Cleanup Inst==>Instr.
In the beginning, Ice::Inst was called IceInst, and patterns like "IceInst *Inst = ..." made perfect sense.
After the Ice:: name change, "Inst *Inst = ..." continued to compile, mostly.
However, shadowing a type name is clumsy and newer code tends to use "Inst *Instr", so we might as well switch all the instances over.
Some are still called "I" and those are left alone.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/
1665423002 .