native_client/pnacl-llvm.git
26 hours agoRe-allow an x86-32 fast-isel optimization for NaCl / use shorter insts. master
Jan Voung [Fri, 17 May 2013 20:35:07 +0000 (13:35 -0700)]
Re-allow an x86-32 fast-isel optimization for NaCl / use shorter insts.

There was an old fix for r+r based memory references on
x86-64 that checked for isTargetNaCl() instead of
isTargetNaCl64(). This disabled some r+r for 32-bit.
However, fast isel only sets up r+r with geps, and we don't
have geps in the stable ABI.  We could potentially add
some similar pattern matching in the future...

The problem we *do* see with the current bitcode, is that
this change also made it preferred to use an index register
instead of a base register. This made the memory references
on x86-32 look like:

  cmpl ..., (,%eax,1)

instead of

  cmpl ..., (%eax)

So we had longer instructions.
Total zipped nexe sizes: 5.73MB (old) vs 5.59 MB (new) (2.5%)
Total not zipped: 17.28MB vs 16.28 MB (6%)

runtime diffs (min of 5 runs)
* eon 4.94 (old) vs 4.72 (new) (~4%)
* mesa 21.64 vs 21.08
* mcf 5.76 vs 5.60
* vortex 4.21 vs 4.05
* perlbmk 27.62 vs 26.55
(the rest were under 2% better)

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3359
R=stichnot@chromium.org

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

28 hours agoCherry-pick r181922: Fix miscompile due to StackColoring incorrectly merging stack...
Mark Seaborn [Fri, 17 May 2013 18:24:54 +0000 (11:24 -0700)]
Cherry-pick r181922: Fix miscompile due to StackColoring incorrectly merging stack slots (PR15707)

IR optimisation passes can result in a basic block that contains:

  llvm.lifetime.start(%buf)
  ...
  llvm.lifetime.end(%buf)
  ...
  llvm.lifetime.start(%buf)

Before this change, calculateLiveIntervals() was ignoring the second
lifetime.start() and was regarding %buf as being dead from the
lifetime.end() through to the end of the basic block.  This can cause
StackColoring to incorrectly merge %buf with another stack slot.

Fix by removing the incorrect Starts[pos].isValid() and
Finishes[pos].isValid() checks.

Just doing:
      Starts[pos] = Indexes->getMBBStartIdx(MBB);
      Finishes[pos] = Indexes->getMBBEndIdx(MBB);
unconditionally would be enough to fix the bug, but it causes some
test failures due to stack slots not being merged when they were
before.  So, in order to keep the existing tests passing, treat LiveIn
and LiveOut separately rather than approximating the live ranges by
merging LiveIn and LiveOut.

This fixes PR15707.
Patch by Mark Seaborn.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3374

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

2 days agoTemporarily remove test that fails on Mac
Eli Bendersky [Thu, 16 May 2013 14:40:13 +0000 (07:40 -0700)]
Temporarily remove test that fails on Mac

BUG=None

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

3 days agoSeparate the PNaCl llc into a tool named pnacl-llc (how original!)
Eli Bendersky [Wed, 15 May 2013 18:13:43 +0000 (11:13 -0700)]
Separate the PNaCl llc into a tool named pnacl-llc (how original!)

BUG=None
R=jvoung@chromium.org

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

4 days agoUpdate tests to use FileCheck instead of grep (which is deprecated in the LLVM regres...
Eli Bendersky [Tue, 14 May 2013 22:07:54 +0000 (15:07 -0700)]
Update tests to use FileCheck instead of grep (which is deprecated in the LLVM regression suite)

BUG=None
R=mseaborn@chromium.org

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

4 days agoThe customary LLVM way of obtaining intrinsics is with
Eli Bendersky [Tue, 14 May 2013 22:06:43 +0000 (15:06 -0700)]
The customary LLVM way of obtaining intrinsics is with
    Intrinsic::getDeclaration and use the definition in
    include/llvm/Intrinsics.td

    This also makes the attribute on the intrinsic to be more
    consistent with the back-end (code-gen), which automatically assumes
    it's ReadNone (because this is what Intrinsics.td) defines.

    Using ReadNone rather than ReadOnly may be not strictly correct because
    the intrinsic depends on the value of the TP. However, this attribute is
    not really used anywhere in IR optimizations, and in the backend the
    intrinsic is ReadNone anyhow (the IR setting gets overridden).

    If we run into any problems with this in the future, we may consider
    handling the lowering of this intrinsic in
    TargetLowering::LowerINTRINSIC_W_CHAIN rather than in
    TargetLowering::LowerINTRINSIC_WO_CHAIN.

BUG=None
R=mseaborn@chromium.org

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

4 days agoFix some build warnings in Nacl-specific code
Eli Bendersky [Tue, 14 May 2013 19:23:44 +0000 (12:23 -0700)]
Fix some build warnings in Nacl-specific code

BUG=None
R=dschuff@chromium.org

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

4 days agoAdding a pass - RewritePNaClLibraryCalls, that replaces known library calls with...
Eli Bendersky [Tue, 14 May 2013 17:43:34 +0000 (10:43 -0700)]
Adding a pass - RewritePNaClLibraryCalls, that replaces known library calls with stable bitcode intrinsics.

Starting with setjmp and longjmp.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=jvoung@chromium.org, mseaborn@chromium.org

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

4 days agoUpdate PNaCl intrinsic whitelist test for moving {frame,return}address to blacklist.
Jan Voung [Tue, 14 May 2013 16:29:41 +0000 (09:29 -0700)]
Update PNaCl intrinsic whitelist test for moving {frame,return}address to blacklist.

Forgot to do this in last CL:
  https://codereview.chromium.org/14657017/

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
R=dschuff@chromium.org

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

4 days agoStart to disallow llvm.frameaddress and llvm.returnaddress in ABI checker.
Jan Voung [Tue, 14 May 2013 00:07:25 +0000 (17:07 -0700)]
Start to disallow llvm.frameaddress and llvm.returnaddress in ABI checker.

They do not seem to be widely used by user code.

* The boehm garbage collector library does reference
__builtin_return_address under an ifdef, but it
does not appear to be compiled in.

* Mesa-7.6 uses __builtin_frame_address
for u_debug_stack.c, but that also does not appear to be
part of the built libraries.

They expose stack/code addresses (at least the lower
32-bits of the address).

As part of https://codereview.chromium.org/14619022/,
we stopped considering the scons and gcc torture tests that
use these intrinsics as meeting the stable ABI.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
R=dschuff@chromium.org

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

7 days agoPNaCl ABI: Promote illegal integer types
Derek Schuff [Sat, 11 May 2013 00:11:46 +0000 (17:11 -0700)]
PNaCl ABI: Promote illegal integer types

This pass (mostly) legalizes integer types by promoting them.
It has some limitations (e.g. it can't change function types)
but it is more than sufficient for what clang and SROA generate.

A more significant limitation of promotion is that packed
bitfields of size > 64 bits are still not handled. There are
none in our tests (other than callingconv_case_by_case which
doesn't require a stable pexe) but we will want to either
handle them by correctly expanding them, or find a better way
to error out.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360
R=eliben@chromium.org, jvoung@chromium.org

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

7 days agoLLVM: Add ELF Note section to NaCl object files identifying them as such to gold
Derek Schuff [Fri, 10 May 2013 23:00:11 +0000 (16:00 -0700)]
LLVM: Add ELF Note section to NaCl object files identifying them as such to gold

This is needed to switch the native linker to one based on upstream binutils
2.23
R=mseaborn@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2971
also related to bug https://code.google.com/p/nativeclient/issues/detail?id=3424

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

9 days agoSupport @llvm.nacl.{set|long}jmp intrinsics by translating them to library calls
Eli Bendersky [Thu, 9 May 2013 22:16:09 +0000 (15:16 -0700)]
Support @llvm.nacl.{set|long}jmp intrinsics by translating them to library calls

This is similar to the way @llvm.{set|long}jmp are handled.

The previously defined nacl-specific intrinsics are no longer used
and are overridden.

For the library call, call setjmp/longjmp without a preceding
underscore as these symbols exist in our runtime support code
(pnacl/support/setjmp_XXX.S)

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=mseaborn@chromium.org

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

9 days agoMove llvm.eh.frame.cfa to the blacklist of intrinsics.
Jan Voung [Thu, 9 May 2013 20:35:25 +0000 (13:35 -0700)]
Move llvm.eh.frame.cfa to the blacklist of intrinsics.

Tests that use them now skip ABI verification.
Known tests that use this are the scons tests:
- the barebones_stack_alignment16 test and
- the EH ones under tests/toolchain/

Also list other eh_* in the blacklist more explicitly
(they were already caught by the default case).

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
TEST= scons, gcc torture, llvm
R=dschuff@chromium.org

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

9 days agoAdd a llvm lit test for NaCl ARM/X86 support for bswap i16, i32, i64.
Jan Voung [Thu, 9 May 2013 17:52:35 +0000 (10:52 -0700)]
Add a llvm lit test for NaCl ARM/X86 support for bswap i16, i32, i64.

Slowly trying to promote "dev" intrinsics that are being
tested to be accepted.  Luckily, bswap is supported
without compiler_rt for ARM and x86 at least.

Test at default level and -O0. Also tested by
gcc/testsuite/gcc.dg/builtin-bswap-[1,2,3,4,5].c,
and a couple of other gcc tests.

We may want to blacklist odd argument sizes
like i8, and i1, which the x86 backend won't handle.
The i16 case is also interesting, however, it's easy
to do if you have an i32 bswap.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3378
R=eliben@chromium.org

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

9 days agoPNaCl: Add NoAlias attributes in ExpandByVal and ExpandVarArgs passes
Mark Seaborn [Thu, 9 May 2013 15:17:04 +0000 (08:17 -0700)]
PNaCl: Add NoAlias attributes in ExpandByVal and ExpandVarArgs passes

This could help prevent these expansion passes from inhibiting
optimisations than run after the expansion.  e.g. It gives the
optimiser more freedom to move around reads from the varargs buffer
because they will not alias writes to other locations.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k

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

9 days agoAdd dependency on NaClTransforms to lib/Target/ARM.
Jan Voung [Wed, 8 May 2013 23:29:57 +0000 (16:29 -0700)]
Add dependency on NaClTransforms to lib/Target/ARM.

It depends on NaClTransforms for the denominator zero checks transform.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2833
(fix build)

R=dschuff@chromium.org

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

10 days agoPut llvm.powi in the dev list of intrinsics.
Jan Voung [Wed, 8 May 2013 16:40:40 +0000 (09:40 -0700)]
Put llvm.powi in the dev list of intrinsics.

This is used by the LLVM translator as part of:
lib/Analysis/ConstantFolding.cpp (it tries to do constant
folding for pow calls...)

Also, tweak comment about llvm.pow vs llvm.powi.  It
looks like powi is the imprecise one, not pow.

BUG=unblock DEPs roll, broken self-build.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=3378
R=eliben@chromium.org

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

10 days agoInsert denominator zero checks for NaCl
David Sehr [Wed, 8 May 2013 16:28:31 +0000 (09:28 -0700)]
Insert denominator zero checks for NaCl

This IR pass for ARM inserts a comparison and a branch to trap if the
denominator of a DIV or REM instruction is zero.  This makes ARM fault
identically to x86 in this case.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=2833
R=eliben@chromium.org

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

10 days agoStart a whitelist of intrinsics for the PNaCl ABI checker.
Jan Voung [Tue, 7 May 2013 23:01:21 +0000 (16:01 -0700)]
Start a whitelist of intrinsics for the PNaCl ABI checker.

This list is currently too small to support our tests
(scons, gcc, llvm). To prevent the tests from breaking,
there is a -pnaclabi-allow-intrinsics flag which defaults
to true.  To turn on the checking for real,
set -pnaclabi-allow-intrinsics=0.

We will avoid actually using the -pnaclabi-allow-intrinsics
flags in tests, and try to just stick with the
-pnacl-disable-abi-check flag. Remove this flag soon.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
R=eliben@chromium.org

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

12 days agoCopy llvm-bcanalyzer to build pnacl-bcanalyzer.
Karl Schimpf [Mon, 6 May 2013 22:12:28 +0000 (15:12 -0700)]
Copy llvm-bcanalyzer to build pnacl-bcanalyzer.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org

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

12 days agoAllow pnacl-freeze/thaw to redirect to stdin/stdout.
Karl Schimpf [Mon, 6 May 2013 20:03:45 +0000 (13:03 -0700)]
Allow pnacl-freeze/thaw to redirect to stdin/stdout.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org

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

12 days agoFix build warnings/UB in LTOCodeGenerator.cpp
Derek Schuff [Mon, 6 May 2013 19:34:34 +0000 (12:34 -0700)]
Fix build warnings/UB in LTOCodeGenerator.cpp

Change the gatherModuleForLinking interface to return void,
and add a default case in setMergedModuleOutputFormat to silence gcc warning.

BUG=cleanup
R=jvoung@chromium.org, mseaborn@chromium.org

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

2 weeks agoCopy BitCodes.h to NaCl/NaClBitCodes.h
Karl Schimpf [Thu, 2 May 2013 14:32:29 +0000 (07:32 -0700)]
Copy BitCodes.h to NaCl/NaClBitCodes.h

Create NaCl specific version of BitCodes.h so that we can custimize it
for the PNaCl wire format. Moves enums to namespace naclbitc. Renames
classes using NaCl prefix. Fixes references so that files compiles.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org

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

2 weeks agoFix ifdef for NaClLLVMBitCodes.h
Karl Schimpf [Wed, 1 May 2013 18:10:05 +0000 (11:10 -0700)]
Fix ifdef for NaClLLVMBitCodes.h

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org

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

2 weeks agoCopy LLVM bitcode reader to generate a PNaCl wire format reader.
Karl Schimpf [Wed, 1 May 2013 17:42:30 +0000 (10:42 -0700)]
Copy LLVM bitcode reader to generate a PNaCl wire format reader.

Copy classes for LLVM BitcodeReader into a NaCl subdirectory, to create a wire
format version. Renames classes/functions to include NaCl prefix, so that
they don't conflict with the LLVM Bitcode reader.

Also implements pnacl-thaw, showing that we can read the PNaCl wire format
files.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org

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

2 weeks agoRemove a hanging LOCALMOD that was for the CC rewrite pass.
Jan Voung [Tue, 30 Apr 2013 23:34:09 +0000 (16:34 -0700)]
Remove a hanging LOCALMOD that was for the CC rewrite pass.

The struct-type-based cc rewrite pass was removed.

BUG=none
R=eliben@chromium.org

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

2 weeks agoRemove unnecessary includes from pnacl-freeze.
Karl Schimpf [Tue, 30 Apr 2013 20:57:34 +0000 (13:57 -0700)]
Remove unnecessary includes from pnacl-freeze.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405

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

2 weeks agoUse unique'ed types for varargs expansion instead of non-unique named types.
Jan Voung [Mon, 29 Apr 2013 22:52:38 +0000 (15:52 -0700)]
Use unique'ed types for varargs expansion instead of non-unique named types.

Saves a tiny bit of space for var-args heavy bitcode
programs, since the anonymous types get unique'ed.  E.g.,
saves 20KB out of 1.6MB in spec gcc when comparing the
gzipped files, or about 100KB when not zipped.  This is only
a savings with the current wire format.  If we change the
alloca, etc. to only have sizes and not struct types
then we would also not have this duplication.

Just happened to notice while looking through code for
what struct types remain used in the bitcode.

random cleanup for:
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3338
R=mseaborn@chromium.org

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

2 weeks agoFix CMake build of bitcode wrapper header utility.
Derek Schuff [Mon, 29 Apr 2013 18:10:40 +0000 (11:10 -0700)]
Fix CMake build of bitcode wrapper header utility.
It wasn't even attempting to build before.

R=jvoung@chromium.org
BUG=cmake/ninja build

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

3 weeks agoFix CMake build of NaClBitWriter
Derek Schuff [Fri, 26 Apr 2013 23:36:00 +0000 (16:36 -0700)]
Fix CMake build of NaClBitWriter

TBR=kschimpf@google.com
BUG=none

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

3 weeks agoCheck for metadata in PNaCl ABI checker.
Jan Voung [Fri, 26 Apr 2013 21:12:49 +0000 (14:12 -0700)]
Check for metadata in PNaCl ABI checker.

Disallow all metadata by default.  There is a flag "-allow-debug-metadata",
which will be used in pnacl-ld driver, to not change the debugging workflow.
That flag will not be present in the pnacl-abicheck driver though.

We'll also run -strip-metadata within pnacl-ld, after optimizations are run,
so that at least that part is checked inside pnacl-ld.
CL for driver changes:
https://codereview.chromium.org/14358048/

BUG= http://code.google.com/p/nativeclient/issues/detail?id=3348
R=dschuff@chromium.org

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

3 weeks agoRemove a localmod that was a variation of a fix for debug metadata.
Jan Voung [Fri, 26 Apr 2013 20:16:19 +0000 (13:16 -0700)]
Remove a localmod that was a variation of a fix for debug metadata.

This was fixed upstream a different way:
"""
Bob Wilson 2013-03-18 23:15:31 CDT
Manman says this was fixed in r173946.
Comment 10 Bob Wilson 2013-03-18 23:32:21 CDT
That change was reverted and replaced by r174093.
"""

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2809
TEST=./scons bitcode=1 run_dwarf_local_var_objdump_test
R=eliben@chromium.org

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

3 weeks agoCopy Bitwriter to generate PNaClBitwriter.
Karl Schimpf [Fri, 26 Apr 2013 19:54:15 +0000 (12:54 -0700)]
Copy Bitwriter to generate PNaClBitwriter.

Copy classes for LLVM BitcodeWriter into a PNaCL subdirectory, to create a
PNaCL version. Renames classes/methods to include PNaCl prefix so that they
don't conflict with the LLVM BitcodeWriter.

Also removed experimental support for use-list order
preservation.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3405

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

3 weeks agoPNaCl: Add ExpandByVal pass for expanding out by-value struct args and results
Mark Seaborn [Wed, 24 Apr 2013 00:02:57 +0000 (17:02 -0700)]
PNaCl: Add ExpandByVal pass for expanding out by-value struct args and results

This pass expands out the "byval" and "sret" argument attributes.

This will affect the calling conventions for PPAPI under PNaCl (for
passing PP_Var etc. by value), so the PNaCl PPAPI shims will need to
be updated in order to enable this pass by default.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k

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

3 weeks agoPNaCl: Add FlattenGlobals pass for simplifying global variable initializers
Mark Seaborn [Tue, 23 Apr 2013 21:49:45 +0000 (14:49 -0700)]
PNaCl: Add FlattenGlobals pass for simplifying global variable initializers

This pass converts initializers for global variables into a flattened
normal form which removes nested struct types and simplifies
ConstantExprs.

In the future, we might change the bitcode format to use the flattened
bytes+relocs representation for global initializers.  In that case, we
will be able to reuse the FlattenedConstant class in the bitcode
reader/writer for converting to and from this form.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3113
TEST=test/Transforms/NaCl/flatten-globals.ll

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

3 weeks agoFix bot build of translator, renormalize CMakeLists/LLVMBuild.txt/Makefile
Derek Schuff [Mon, 22 Apr 2013 22:16:54 +0000 (15:16 -0700)]
Fix bot build of translator, renormalize CMakeLists/LLVMBuild.txt/Makefile
naming to better match upstream

R=jvoung@chromium.org
BUG=bot LLVM roll

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

4 weeks agoFix CMake build
Derek Schuff [Thu, 18 Apr 2013 16:51:42 +0000 (09:51 -0700)]
Fix CMake build
Clean up the LLVMBuild and CMakeLists.txt files

BUG=none
TEST=none

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

4 weeks agoAdd support for the div/rem instructions under x86 fast-isel.
Jim Stichnoth [Wed, 17 Apr 2013 03:45:19 +0000 (20:45 -0700)]
Add support for the div/rem instructions under x86 fast-isel.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3385

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

4 weeks agoPNaCl ABI checker: Disallow the "resume" instruction
Mark Seaborn [Mon, 15 Apr 2013 18:30:48 +0000 (11:30 -0700)]
PNaCl ABI checker: Disallow the "resume" instruction

This instruction is used for C++ exception handling.  It is only used
inside basic blocks reached from landingpads, so it is stripped out by
the "-lowerinvoke" pass.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3377
TEST=NaCl small_tests

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

5 weeks agoHave the StripMetadata pass also strip unsupported named metadata.
Jan Voung [Fri, 12 Apr 2013 20:14:15 +0000 (13:14 -0700)]
Have the StripMetadata pass also strip unsupported named metadata.

Previously it was just instruction attachments.
Depends on a driver change to actually work:
https://codereview.chromium.org/14072004/

BUG= http://code.google.com/p/nativeclient/issues/detail?id=3348

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

5 weeks agoPNaCl: extend GlobalCleanup to null-out extern_weak function references, and extend...
Derek Schuff [Fri, 12 Apr 2013 20:09:00 +0000 (13:09 -0700)]
PNaCl: extend GlobalCleanup to null-out extern_weak function references, and extend the ABI checker to verify.

Also promote weak symbols to internal ones, which was required because the scons barebones tests define weak versions of memcpy/memset

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3339
TEST= llvm-regression (globalcleanup.ll), scons barebones tests

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

5 weeks agoPNaCl ABI checker: Disallow ConstantExprs inside functions
Mark Seaborn [Fri, 12 Apr 2013 19:56:57 +0000 (12:56 -0700)]
PNaCl ABI checker: Disallow ConstantExprs inside functions

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3337
TEST=test/NaCl/PNaClABI/*.ll

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

5 weeks agoPNaCl ABI checker: Disallow va_arg, varargs functions and varargs calls
Mark Seaborn [Fri, 12 Apr 2013 19:53:42 +0000 (12:53 -0700)]
PNaCl ABI checker: Disallow va_arg, varargs functions and varargs calls

This doesn't disallow the va_start/va_end/va_copy intrinsics yet;
these will get disallowed later when we add whitelisting of intrinsics
to the PNaCl ABI checker.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
TEST=test/NaCl/PNaClABI/*.ll

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

5 weeks agoPNaCl ABI checker: Disallow invoke+landingpad instructions
Mark Seaborn [Fri, 12 Apr 2013 19:49:49 +0000 (12:49 -0700)]
PNaCl ABI checker: Disallow invoke+landingpad instructions

The first release of the stable PNaCl ABI won't support zero-cost C++
exception handling.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3377
TEST=toolchain trybots + gcc torture tests + Spec2k + LLVM regression tests

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

5 weeks ago[MIPS] Fix LLVM issues with recent LLVM trunk merge
Petar Jovanovic [Thu, 11 Apr 2013 01:23:13 +0000 (03:23 +0200)]
[MIPS] Fix LLVM issues with recent LLVM trunk merge

This change fixes some of the issues that came with recent merge with LLVM
trunk, and it removes some workarounds that are not needed anymore in the
code. In more details, it:

- removes hack to set ELF::EF_MIPS_PIC flag;
- checks whether __nacl_read_tp is defined in the module, as different
  relocation(s) is used to calculate the address;
- marks Mips::JALRPseudo as indirect call in NaCl rewrite pass;
- fixes incorrect merge in MipsAsmPrinter.cpp and MipsMCTargetDesc.cpp.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=2275
TEST= run smoke tests

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

5 weeks agoPNaCl ABI checker: Disallow the GetElementPtr instruction
Mark Seaborn [Wed, 10 Apr 2013 16:39:53 +0000 (09:39 -0700)]
PNaCl ABI checker: Disallow the GetElementPtr instruction

This instruction is removed by ExpandGetElementPtr.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=test/NaCl/PNaClABI/instructions.ll + PNaCl toolchain trybots

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

5 weeks agoPNaCl ABI checker: Disallow "section", "thread_local" and "gc" attributes
Mark Seaborn [Wed, 10 Apr 2013 16:37:34 +0000 (09:37 -0700)]
PNaCl ABI checker: Disallow "section", "thread_local" and "gc" attributes

 * Disallow "section" on functions and global variables.
 * Disallow "thread_local" on global variables.
 * Disallow "gc" on functions.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=2837
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3126
TEST=test/NaCl/PNaClABI/global-attributes.ll + PNaCl toolchain trybots

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

6 weeks agoPNaCl: Change ExpandVarArgs to work around invalid use of va_arg
Mark Seaborn [Thu, 4 Apr 2013 17:46:59 +0000 (10:46 -0700)]
PNaCl: Change ExpandVarArgs to work around invalid use of va_arg

I've encountered two uses of va_arg on an empty argument list: NaCl's
open() wrapper (now fixed), and 176.gcc in Spec2k.  Although this is
invalid use of va_arg (giving undefined behaviour), it's too awkward
to fix 176.gcc.

Work around this invalid usage by ensuring that the argument list
pointer points to a location on the stack rather than being
uninitialised.  va_arg will return undefined values as it does in the
usual native ABIs, rather than crashing.

We could add options for non-strict and strict modes (possibly with a
bounds check), but that's too much complication for now.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
TEST=test/Transforms/NaCl/*.ll + ran 176.gcc from Spec2k

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

6 weeks agoDisable shift-compare instcombine optimization for NaCl.
Derek Schuff [Tue, 2 Apr 2013 16:38:08 +0000 (09:38 -0700)]
Disable shift-compare instcombine optimization for NaCl.
This is one of at least 2 optimizations which introduce non-power-of-two
integer sizes, which we don't want to allow in the PNaCl stable wire format.
This transforms
(icmp pred iM (shl iM %value, N), ConstInt)
  -> (icmp pred i(M-N) (trunc %value iM to i(N-N)), (trunc (ConstInt >> N))
and reduces the size of the compare and its operands.

R=mseaborn@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360

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

6 weeks agoPNaCl: Tidy: Remove an unnecessary cast in the ABI checker
Mark Seaborn [Mon, 1 Apr 2013 17:36:42 +0000 (10:36 -0700)]
PNaCl: Tidy: Remove an unnecessary cast in the ABI checker

I noticed this while debugging a runtime cast assertion error.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=test/NaCl/PNaClABI/*.ll

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

6 weeks agoPNaCl ABI checker: Disable integer size check since it doesn't pass yet
Mark Seaborn [Mon, 1 Apr 2013 17:34:55 +0000 (10:34 -0700)]
PNaCl ABI checker: Disable integer size check since it doesn't pass yet

We would like to enable the ABI checker as soon as possible so that we
can iterate.  The check can be re-enabled when it passes.

FileCheck doesn't allow CHECKs to be commented out so we have to
disrupt them instead.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3360
TEST=run ABI checker on NaCl Scons-based tests

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

6 weeks agoPNaCl: Fix ABI checker to give a better error message on BlockAddresses
Mark Seaborn [Mon, 1 Apr 2013 17:01:37 +0000 (10:01 -0700)]
PNaCl: Fix ABI checker to give a better error message on BlockAddresses

Before, the checker failed with a cast error, when trying to cast the
BasicBlock in a BlockAddress to a Constant.

Fix it so that we at least know which global initializer is being rejected.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=test/NaCl/PNaClABI/types.ll

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

6 weeks agopnacl-abicheck: Fix exit status so that 256 errors aren't reported as success
Mark Seaborn [Mon, 1 Apr 2013 16:36:55 +0000 (09:36 -0700)]
pnacl-abicheck: Fix exit status so that 256 errors aren't reported as success

Avoid truncation problems.  On Unix, exit(256) is equivalent to exit(0).

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=none

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

6 weeks agoPNaCl: Allow the ABI checker to be used from "opt"
Mark Seaborn [Mon, 1 Apr 2013 16:33:02 +0000 (09:33 -0700)]
PNaCl: Allow the ABI checker to be used from "opt"

This allows the ABI checker passes to be used in the same way as
LLVM's "-verify" pass.  It allows the checker to be run between other
passes, and without launching pnacl-abicheck as a separate process (so
without the overhead of reading bitcode into memory again).

Make the ABI checker passes produce fatal errors by default, to match
"-verify".  This is overridden for pnacl-abicheck's use.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=tested with pnacl-ld.py changes to use the ABI checker passes

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

7 weeks agoPNaCl: Fix ExpandTls to handle a couple of corner cases involving PHI nodes
Mark Seaborn [Sat, 30 Mar 2013 00:42:10 +0000 (17:42 -0700)]
PNaCl: Fix ExpandTls to handle a couple of corner cases involving PHI nodes

ExpandTls's use of replaceUsesOfWith() didn't work for PHI nodes
containing the same Constant twice (which needs to work for same or
differing incoming BasicBlocks).  The same applies to
ExpandTlsConstantExpr.

I noticed this while implementing ExpandConstantExpr.

Fix this and factor out some common code that all three passes can
use.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2837
TEST=test/Transforms/NaCl/*.ll

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

7 weeks agoAdd a pass to strip bitcode metadata.
Jan Voung [Thu, 28 Mar 2013 23:56:41 +0000 (16:56 -0700)]
Add a pass to strip bitcode metadata.

This only works on instruction attachments for now.  Since it is a
ModulePass we can add something to strip NamedMetadata
based on a whitelist, if we want to retain some of that.

It does not touch debug metadata, and leaves -strip-debug to handle that.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3348

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

7 weeks agoTarget Cortex-A9 with NEON in PNaCl's LLC driver.
JF Bastien [Thu, 28 Mar 2013 21:59:14 +0000 (14:59 -0700)]
Target Cortex-A9 with NEON in PNaCl's LLC driver.

This is a follow-up to:
  https://codereview.chromium.org/12683004/
  https://codereview.chromium.org/12969002/

And will enable optiomizations for our minimum platform when translating
with default flags. At some point we'll probably want to specialize
further by detecting, e.g. A15 and turning on VFP4, IDIV, etc...

R= dschuff@chromium.org, jvoung@chromium.org

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

7 weeks agoMake pnacl-abicheck return nonzero status if errors are found.
Derek Schuff [Wed, 27 Mar 2013 23:59:55 +0000 (16:59 -0700)]
Make pnacl-abicheck return nonzero status if errors are found.
Also add -q flag for quiet operation; i.e. don't print the
errors, only use the exit status to indicate failure.

R=mseaborn@chromium.org,jvoung@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309

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

7 weeks agoPNaCl: Fix ExpandVarArgs to handle "byval" struct arguments properly
Mark Seaborn [Wed, 27 Mar 2013 20:28:15 +0000 (13:28 -0700)]
PNaCl: Fix ExpandVarArgs to handle "byval" struct arguments properly

 * Ensure that the "byval" attribute is preserved for the fixed
   arguments.  Before, it was stripped off from function calls but
   left in for function definitions, which broke passing struct
   arguments (which PNaCl Clang generates as "byval").

 * Ensure that function and return attributes are preserved too.

 * Handle "byval" variable arguments in calls too by dereferencing the
   pointer.  These are not yet usable with PNaCl Clang, which does not
   allow va_arg on structs (see
   https://code.google.com/p/nativeclient/issues/detail?id=2381), but
   we might as well make this pass ready to handle this.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
TEST=test/Transforms/NaCl/expand-varargs*.ll

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

7 weeks agoPNaCl: Add ExpandGetElementPtr pass for converting GetElementPtr to arithmetic
Mark Seaborn [Tue, 26 Mar 2013 20:49:56 +0000 (13:49 -0700)]
PNaCl: Add ExpandGetElementPtr pass for converting GetElementPtr to arithmetic

This is similar to the GEP handling in visitGetElementPtr() in
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp.

Once this pass is enabled, it will simplify the language to reduce the
set of constructs that a PNaCl translator needs to handle as part of a
stable wire format for PNaCl.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=test/Transforms/NaCl/expand-getelementptr.ll

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

7 weeks agoPNaCl ABI: add passes to cleanup/finalize some linkage types and resolve aliases.
Derek Schuff [Mon, 25 Mar 2013 23:51:51 +0000 (16:51 -0700)]
PNaCl ABI: add passes to cleanup/finalize some linkage types and resolve aliases.

R=mseaborn@chromium.org,eliben@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3339

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

7 weeks agoPNaCl: Fix ExpandTls to handle GlobalAliases of thread-local variables
Mark Seaborn [Mon, 25 Mar 2013 19:08:49 +0000 (12:08 -0700)]
PNaCl: Fix ExpandTls to handle GlobalAliases of thread-local variables

Expand out these aliases in the ExpandTlsConstantExpr pass.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3347
TEST=test/Transforms/NaCl/expand-tls-constexpr-alias.ll

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

7 weeks agoAdd -time-ir-parsing flag to llc.
Eli Bendersky [Mon, 25 Mar 2013 16:11:06 +0000 (09:11 -0700)]
Add -time-ir-parsing flag to llc.

This is in the process of being added upstream but the exact location
is still debated and will take some time to settle. In the mean-time
I'm adding it as a localmod so we can run our benchmarks effectively.
Later this should be switched to the upstream implementation (or move
to our own llc-replacement-driver).

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3349

8 weeks agoPNaCl: Add ExpandVarArgs pass for expanding out variable-args function calls
Mark Seaborn [Thu, 21 Mar 2013 21:18:49 +0000 (14:18 -0700)]
PNaCl: Add ExpandVarArgs pass for expanding out variable-args function calls

Once this pass is enabled, it will simplify the language to reduce the
set of constructs that a PNaCl translator needs to handle as part of a
stable wire format for PNaCl.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
TEST=test/Transforms/NaCl/expand-varargs.ll

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

8 weeks agoProperly conditionalize for NaCl an Mips AsmPrinter LOCALMOD that has to
Eli Bendersky [Wed, 20 Mar 2013 22:37:05 +0000 (15:37 -0700)]
Properly conditionalize for NaCl an Mips AsmPrinter LOCALMOD that has to
be kept to pass regression tests.

8 weeks agoMerge remote-tracking branch 'origin/master'
Eli Bendersky [Wed, 20 Mar 2013 22:05:17 +0000 (15:05 -0700)]
Merge remote-tracking branch 'origin/master'

Merge Nacl-LLVM work since the upstream merge branched

8 weeks agoApply after-merge fixes to return to working state.
Eli Bendersky [Mon, 11 Mar 2013 22:38:11 +0000 (15:38 -0700)]
Apply after-merge fixes to return to working state.

2 months agoDon't fold large offsets into FrameIndexBase displacements either
Derek Schuff [Mon, 18 Mar 2013 21:16:31 +0000 (14:16 -0700)]
Don't fold large offsets into FrameIndexBase displacements either

R=sehr@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3302

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

2 months agoSwitch ABI verifier passes to manual initialization.
Derek Schuff [Mon, 18 Mar 2013 18:15:22 +0000 (11:15 -0700)]
Switch ABI verifier passes to manual initialization.
This lines them up with the rest of the codebase and will make them work
with statically-linked opt.

R=mseaborn@chromium.org
BUG=none
TEST=existing tests keep working (we don't actually use static opt)

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

2 months agoPNaCl: Add ExpandConstantExpr pass for converting ConstantExprs to Instructions
Mark Seaborn [Fri, 15 Mar 2013 20:44:43 +0000 (13:44 -0700)]
PNaCl: Add ExpandConstantExpr pass for converting ConstantExprs to Instructions

Once this pass is enabled, it will simplify the language to reduce the
set of constructs that a PNaCl translator needs to handle as part of a
stable wire format for PNaCl.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3337
TEST=test/Transforms/NaCl/expand-constantexpr.ll

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

2 months agoFix CMakeFile as well.
Derek Schuff [Thu, 14 Mar 2013 20:57:00 +0000 (13:57 -0700)]
Fix CMakeFile as well.
Carryover from https://codereview.chromium.org/12690007

2 months agoFix LLVMBuild.txt for NaCl analysis passes
Derek Schuff [Thu, 14 Mar 2013 20:53:07 +0000 (13:53 -0700)]
Fix LLVMBuild.txt for NaCl analysis passes

R=jvoung@chromium.org
BUG= Sandboxed LLC doesn't build correctly anymore without it

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

2 months agoCleanup of ABI Checker
Derek Schuff [Thu, 14 Mar 2013 17:14:47 +0000 (10:14 -0700)]
Cleanup of ABI Checker
Fix spacing of error output, use OwningPtr everywhere at top level,
fix command line parsing

R=jvoung@chromium.org
BUG=

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

2 months agoABI verifier: Add standalone tool pnacl-abicheck
Derek Schuff [Wed, 13 Mar 2013 23:04:03 +0000 (16:04 -0700)]
ABI verifier: Add standalone tool pnacl-abicheck
This CL adds a standalone tool pnacl-abicheck for checking the ABI validity of a bitcode file.
It also adds a flag pnaclabi-verify to llc to enable the same checking in llc.
It also improves the mechanism for handling and reporting validation errors and uses it in both tools.

R=jvoung@chromium.org,mseaborn@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309

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

2 months agoMerge commit '279b9184c2ff4fea93b198a3519b8cb3a1d8d195'
Eli Bendersky [Mon, 11 Mar 2013 22:16:37 +0000 (15:16 -0700)]
Merge commit '279b9184c2ff4fea93b198a3519b8cb3a1d8d195'

Conflicts:
include/llvm/CodeGen/LexicalScopes.h
include/llvm/MC/MCAsmInfo.h
lib/Linker/LinkArchives.cpp
lib/Linker/LinkItems.cpp
lib/MC/MCAsmInfo.cpp
lib/MC/MCDwarf.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/Mips/MipsTargetObjectFile.cpp
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86TargetMachine.cpp
lib/Transforms/CMakeLists.txt
lib/Transforms/LLVMBuild.txt
lib/Transforms/Makefile
test/MC/ARM/arm_instructions.s
test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s

2 months agoAdd an RPC to LLC.nexe to init with appended flags (vs set all flags).
Jan Voung [Wed, 6 Mar 2013 19:30:09 +0000 (11:30 -0800)]
Add an RPC to LLC.nexe to init with appended flags (vs set all flags).

This will take the default flags and append any extra flags.
For now, this is only intended to support -O in the browser,
and perhaps -mcpu=.*, -mattr=.  We move the tuning parameters
like -mcpu out of the default, so that a user does not end up
setting the -mcpu more than once (which is disallowed).

What does go into the default is -mtriple, which we may want
to hard-code into the build somehow (but it's not yet clear
how to do that cleanly).  That way, a user does not need
to specify that portion.  We also hardcode the -sfi-* flags.

Sort of tested by: https://codereview.chromium.org/12459004/

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3325

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

2 months agoPrune unused PBQP register allocator and PBQP Heuristics from llvm-sb.
Jan Voung [Mon, 4 Mar 2013 18:50:27 +0000 (10:50 -0800)]
Prune unused PBQP register allocator and PBQP Heuristics from llvm-sb.

Saves about 58KB.  These LinkAll{CodeGen/AsmWriter}Components.h headers
are only #included by LLC/LLI.  We could create our own version of these
if we want to create our own version of LLC, but that could make it
harder to notice when the header changes.

BUG= http://code.google.com/p/nativeclient/issues/detail?id=1222

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

2 months agoOnly fold small constants into memory reference displacements.
Derek Schuff [Sat, 2 Mar 2013 00:18:35 +0000 (16:18 -0800)]
Only fold small constants into memory reference displacements.
This should more generally prevent negative values in index registers, but
still allow most uses of this address mode for structure references.

R=sehr@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3302

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

2 months agoAArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.
Tim Northover [Thu, 28 Feb 2013 13:52:07 +0000 (13:52 +0000)]
AArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176253 91177308-0d34-0410-b5e6-96231b3b80d8

2 months ago[msan] Implement sanitize_memory attribute.
Evgeniy Stepanov [Thu, 28 Feb 2013 11:25:14 +0000 (11:25 +0000)]
[msan] Implement sanitize_memory attribute.

Shadow checks are disabled and memory loads always produce fully initialized
values in functions that don't have a sanitize_memory attribute. Value and
argument shadow is propagated as usual.

This change also updates blacklist behaviour to match the above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176247 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoCorrections for XFAIL armv5 tests
Renato Golin [Thu, 28 Feb 2013 10:05:10 +0000 (10:05 +0000)]
Corrections for XFAIL armv5 tests

Most of the tests that behave differently on llvm-arm-linux buildbot
did so becase the triple wasn't set correctly to armv5, so we can
revert most of the special behaviour added previously. Some tests
still need the special treatment, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176243 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoRemove unused leftover declarations.
Evgeniy Stepanov [Thu, 28 Feb 2013 08:42:11 +0000 (08:42 +0000)]
Remove unused leftover declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176240 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoEnable syntax highlighting for reStructuredText files.
Bill Wendling [Thu, 28 Feb 2013 06:43:24 +0000 (06:43 +0000)]
Enable syntax highlighting for reStructuredText files.
Patch by Journeyer J. Joh!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176235 91177308-0d34-0410-b5e6-96231b3b80d8

2 months ago[Support][ErrorOr] Add support for implicit conversion from error code/condition...
Michael J. Spencer [Thu, 28 Feb 2013 01:44:26 +0000 (01:44 +0000)]
[Support][ErrorOr] Add support for implicit conversion from error code/condition enums.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176228 91177308-0d34-0410-b5e6-96231b3b80d8

2 months ago[PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite...
Argyrios Kyrtzidis [Thu, 28 Feb 2013 00:38:19 +0000 (00:38 +0000)]
[PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite loop by constantly trying
to create the parent path.

This can happen if the path is a relative filename and the current directory was removed.
Thanks to Daniel D. for the hint in fixing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176226 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoFix a problem in alias analysis. It is about the misinterpretation of "Object".
Shuxin Yang [Thu, 28 Feb 2013 00:24:45 +0000 (00:24 +0000)]
Fix a problem in alias analysis. It is about the misinterpretation of "Object".

This problem is exposed by r171325 which is already reverted. It is rather
hard to fabricate a testing case without it.

r171325 should *NOT* be resurrected as it has a potential problem although
this problem dosen't directly contribute to PR14988.

The bug is tracked by:
  - rdar://13063553, and
  - http://llvm.org/bugs/show_bug.cgi?id=14988

Thank Arnold for coming up a better solution to this problem. After
comparing this solution and my original proposal, I decided to ditch mine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176225 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoRemove unnecessary check against isGlobalVariable. We check it
Eric Christopher [Wed, 27 Feb 2013 23:49:50 +0000 (23:49 +0000)]
Remove unnecessary check against isGlobalVariable. We check it
a few lines above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176224 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoRework comment slightly and fix a few typos.
Eric Christopher [Wed, 27 Feb 2013 23:49:47 +0000 (23:49 +0000)]
Rework comment slightly and fix a few typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176223 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoRemove unnecessary cast to void.
Eric Christopher [Wed, 27 Feb 2013 23:49:45 +0000 (23:49 +0000)]
Remove unnecessary cast to void.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176222 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoDebug Info: for static member variables, always put AT_MIPS_linkage_name to the
Manman Ren [Wed, 27 Feb 2013 23:21:02 +0000 (23:21 +0000)]
Debug Info: for static member variables, always put AT_MIPS_linkage_name to the
definition DIE (TAG_variable), and put AT_MIPS_linkage_name to TAG_member when
DarwinGDBCompat is true.

Darwin GDB needs AT_MIPS_linkage_name at both places to work.

Follow-up patch to r176143.
rdar://problem/13291234

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176220 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoSilence the unused variable warning.
Nadav Rotem [Wed, 27 Feb 2013 22:52:54 +0000 (22:52 +0000)]
Silence the unused variable warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176218 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoThe FastISEL should be fast. But when we record statistics we use atomic operations...
Nadav Rotem [Wed, 27 Feb 2013 21:59:43 +0000 (21:59 +0000)]
The FastISEL should be fast. But when we record statistics we use atomic operations to increment the counters.
This patch disables the counters on non-debug builds. This reduces the runtime of SelectionDAGISel::SelectCodeCommon by ~5%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176214 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoCopy missing member in DataLayout copy ctor.
David Blaikie [Wed, 27 Feb 2013 21:44:59 +0000 (21:44 +0000)]
Copy missing member in DataLayout copy ctor.

Test case is missing due to it not being reachable through the current tools
but out of tree code such as the sample at
http://llvm.org/docs/tutorial/LangImpl4.html

Patch by Peng Cheng <gm4cheng@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176213 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoARM: FMA is legal only if VFP4 is available.
Jim Grosbach [Wed, 27 Feb 2013 21:31:12 +0000 (21:31 +0000)]
ARM: FMA is legal only if VFP4 is available.

rdar://13306723

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176212 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoRemove this instance of dl as it's defined in a previous scope.
Chad Rosier [Wed, 27 Feb 2013 20:34:14 +0000 (20:34 +0000)]
Remove this instance of dl as it's defined in a previous scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176208 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoReverted: r176136 - Have a way for a target to opt-out of target-independent fast...
Michael Ilseman [Wed, 27 Feb 2013 19:54:00 +0000 (19:54 +0000)]
Reverted: r176136 - Have a way for a target to opt-out of target-independent fast isel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176204 91177308-0d34-0410-b5e6-96231b3b80d8

2 months ago[docs] Discuss manpage output.
Sean Silva [Wed, 27 Feb 2013 18:48:42 +0000 (18:48 +0000)]
[docs] Discuss manpage output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176199 91177308-0d34-0410-b5e6-96231b3b80d8

2 months agoSwitching -1ULL to UINT64_MAX to fix MSVC warnings. Patch thanks to Peng Cheng!
Aaron Ballman [Wed, 27 Feb 2013 18:38:33 +0000 (18:38 +0000)]
Switching -1ULL to UINT64_MAX to fix MSVC warnings.  Patch thanks to Peng Cheng!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176197 91177308-0d34-0410-b5e6-96231b3b80d8

2 months ago[docs] Provide pointer for building Sphinx docs.
Sean Silva [Wed, 27 Feb 2013 18:33:21 +0000 (18:33 +0000)]
[docs] Provide pointer for building Sphinx docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176195 91177308-0d34-0410-b5e6-96231b3b80d8