platform/upstream/llvm.git
9 years agoRemove log2 dependency when building against Android API-9 SDK
Vince Harron [Sun, 24 May 2015 13:24:31 +0000 (13:24 +0000)]
Remove log2 dependency when building against Android API-9 SDK

Android's API-9 SDK is missing log2 builtins. A previous commit added
support for building against this API revision but this requires log2l
to be present.  (And it doesn't seem to be defined, despite being in
the headers.)

Author: pasaulais (Pierre-Andre Saulais)

Differential Revision: http://reviews.llvm.org/D9884

llvm-svn: 238111

9 years agoMove parseSubArch to ARMTargetParser. NFC
Renato Golin [Sun, 24 May 2015 11:18:44 +0000 (11:18 +0000)]
Move parseSubArch to ARMTargetParser. NFC

Using getCanonicalArchName() is the right way to parse ARM arch names.

Mapping ARMTargetParser IDs to Triple Arch IDs is temporary, until they
are merged into a TargetDescription class.

This was the last LLVM FIXME to move things to ARMTargetParser. Now on
to Clang and beyond.

llvm-svn: 238110

9 years ago[msan] Mprotect all inaccessible memory regions.
Evgeniy Stepanov [Sun, 24 May 2015 02:47:59 +0000 (02:47 +0000)]
[msan] Mprotect all inaccessible memory regions.

Fix 2 bugs in memory mapping setup:
- the invalid region at offset 0 was not protected because mmap at
  address 0 fails with EPERM on most Linux systems. We did not
  notice this because the check condition was flipped: the code was
  checking that mprotect has failed. And the test that was supposed
  to catch this was weakened by the mitigations in the mmap
  interceptor.
- when running without origins, the origin shadow range was left
  unprotected.

The new test ensures that mmap w/o MAP_FIXED always returns valid
application addresses.

llvm-svn: 238109

9 years agoAdd target hook to allow merging stores of nonzero constants
Matt Arsenault [Sun, 24 May 2015 00:51:27 +0000 (00:51 +0000)]
Add target hook to allow merging stores of nonzero constants

On GPU targets, materializing constants is cheap and stores are
expensive, so only doing this for zero vectors was silly.

Most of the new testcases aren't optimally merged, and are for
later improvements.

llvm-svn: 238108

9 years ago[Support/ELF] Add missing DF_1_XXX bits.
Davide Italiano [Sat, 23 May 2015 23:08:28 +0000 (23:08 +0000)]
[Support/ELF] Add missing DF_1_XXX bits.

In preparation for adding support for decoding DF_FLAGS_1 to
llvm-readobj.

Differential Revision: http://reviews.llvm.org/D9955
Reviewed by: echristo

llvm-svn: 238107

9 years ago[Driver] Unbreak hexagon build bots
David Majnemer [Sat, 23 May 2015 19:23:55 +0000 (19:23 +0000)]
[Driver] Unbreak hexagon build bots

AddHexagonTargetArgs didn't respect the driver flags by unconditionally
pushing -fno-signed-char.  Instead, add Hexagon handling to
isSignedCharDefault.

llvm-svn: 238106

9 years ago[Driver] Handle -fno-signed-char and -fno-unsigned-char
David Majnemer [Sat, 23 May 2015 18:48:37 +0000 (18:48 +0000)]
[Driver] Handle -fno-signed-char and -fno-unsigned-char

GCC maps -fno-unsigned-char to -fsigned-char and -fno-signed-char to
-funsigned-char.

llvm-svn: 238105

9 years agoBump SmallString to the minimum required amount for raw_ostream to avoid allocation.
Benjamin Kramer [Sat, 23 May 2015 17:20:53 +0000 (17:20 +0000)]
Bump SmallString to the minimum required amount for raw_ostream to avoid allocation.

NFC.

llvm-svn: 238104

9 years ago[Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.
Benjamin Kramer [Sat, 23 May 2015 16:53:07 +0000 (16:53 +0000)]
[Mips] Prefer Twine::utohexstr over utohexstr, saves a string copy.

NFC.

llvm-svn: 238103

9 years ago[AArch64] Clean up the ELF streamer a bit.
Benjamin Kramer [Sat, 23 May 2015 16:39:10 +0000 (16:39 +0000)]
[AArch64] Clean up the ELF streamer a bit.

llvm-svn: 238102

9 years ago[AArch64] Move AArch64TargetStreamer out of MCStreamer.h
Benjamin Kramer [Sat, 23 May 2015 16:15:10 +0000 (16:15 +0000)]
[AArch64] Move AArch64TargetStreamer out of MCStreamer.h

It doesn't belong in the shared MC layer. NFC.

llvm-svn: 238101

9 years ago[llgo] cmd/llgoi: use line editor
Andrew Wilkins [Sat, 23 May 2015 15:16:09 +0000 (15:16 +0000)]
[llgo] cmd/llgoi: use line editor

Summary:
This diff adds line-editing to llgoi, by
vendoring and using github.com/peterh/liner.
I have only implemented the basics here;
follow-ups will come later to add persisted
history, and completion,

Reviewers: pcc

Reviewed By: pcc

Subscribers: axw, llvm-commits

Differential Revision: http://reviews.llvm.org/D9811

llvm-svn: 238100

9 years agoSilencing a spurious -Wreturn-type warning; NFC.
Aaron Ballman [Sat, 23 May 2015 14:46:49 +0000 (14:46 +0000)]
Silencing a spurious -Wreturn-type warning; NFC.

llvm-svn: 238099

9 years ago[clang-tidy] Fix for llvm.org/PR23572
Szabolcs Sipos [Sat, 23 May 2015 14:21:01 +0000 (14:21 +0000)]
[clang-tidy] Fix for llvm.org/PR23572

misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions.

llvm-svn: 238098

9 years ago[PowerPC] Fix fast-isel when compare is split from branch
Hal Finkel [Sat, 23 May 2015 12:18:10 +0000 (12:18 +0000)]
[PowerPC] Fix fast-isel when compare is split from branch

When the compare feeding a branch was in a different BB from the branch, we'd
try to "regenerate" the compare in the block with the branch, possibly trying
to make use of values not available there. Copy a page from AArch64's play book
here to fix the problem (at least in terms of correctness).

Fixes PR23640.

llvm-svn: 238097

9 years agoUpdate ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.
NAKAMURA Takumi [Sat, 23 May 2015 10:44:30 +0000 (10:44 +0000)]
Update ExecutionEngine/LLVMBuild.txt, to add LLVMCodeGen.

llvm-svn: 238096

9 years agoGive more meaningful names than I and J to some for loop variables after converting...
Craig Topper [Sat, 23 May 2015 08:45:10 +0000 (08:45 +0000)]
Give more meaningful names than I and J to some for loop variables after converting to range-based loops.

llvm-svn: 238095

9 years agoFix an unused variable warning in release builds.
Craig Topper [Sat, 23 May 2015 08:20:33 +0000 (08:20 +0000)]
Fix an unused variable warning in release builds.

llvm-svn: 238094

9 years agoUse range-based for loops. NFC.
Craig Topper [Sat, 23 May 2015 08:01:41 +0000 (08:01 +0000)]
Use range-based for loops. NFC.

llvm-svn: 238093

9 years agoRemove unnecessary indirection through SCEV
Tobias Grosser [Sat, 23 May 2015 05:58:30 +0000 (05:58 +0000)]
Remove unnecessary indirection through SCEV

llvm-svn: 238092

9 years agoUse unique_ptr to clarify ownershop of ScopArrayInfoMap
Tobias Grosser [Sat, 23 May 2015 05:58:27 +0000 (05:58 +0000)]
Use unique_ptr to clarify ownershop of ScopArrayInfoMap

llvm-svn: 238091

9 years agoUse unique_ptr to clarify ownership of ScopStmt
Tobias Grosser [Sat, 23 May 2015 05:14:09 +0000 (05:14 +0000)]
Use unique_ptr to clarify ownership of ScopStmt

llvm-svn: 238090

9 years agoDid some cleanup to stop us from leaking Pipe file descriptors.
Greg Clayton [Sat, 23 May 2015 03:54:53 +0000 (03:54 +0000)]
Did some cleanup to stop us from leaking Pipe file descriptors.

The main issue was the Communication::Disconnect() was calling its Connection::Disconnect() but this wouldn't release the pipes that the ConnectionFileDescriptor was using. We also have someone that is holding a strong reference to the Process so that when you re-run, target replaces its m_process_sp, but it doesn't get destructed because someone has a strong reference to it. I need to track that down. But, even if we have a strong reference to the a process that is outstanding, we need to call Process::Finalize() to have it release as much of its resources as possible to avoid memory bloat.

Removed the ProcessGDBRemote::SetExitStatus() override and replaced it with ProcessGDBRemote::DidExit().

Now we aren't leaking file descriptors and the stand alone test suite should run much better.

llvm-svn: 238089

9 years agoEnable scalar and PHI code generation for Polly
Tobias Grosser [Sat, 23 May 2015 03:34:41 +0000 (03:34 +0000)]
Enable scalar and PHI code generation for Polly

The feature itself has been committed by Johannes in r238070. As this is the
way forward, we now enable it to ensure we get test coverage.

Thank you Johannes for this nice work!

llvm-svn: 238088

9 years agoMake use of scalar/phi code generation explicit in the tests
Tobias Grosser [Sat, 23 May 2015 03:34:35 +0000 (03:34 +0000)]
Make use of scalar/phi code generation explicit in the tests

This ensures we pass all tests independently of how we set the options
-disable-polly-intra-scop-scalar-to-array and -polly-model-phi-nodes.

(At least if we enable both or disable both. Enabling them individually makes
 little sense, as they will hopefully disappear soon anyhow).

llvm-svn: 238087

9 years ago[lib/Fuzzer] doxygen-ify the comments for the user interface
Kostya Serebryany [Sat, 23 May 2015 02:12:05 +0000 (02:12 +0000)]
[lib/Fuzzer] doxygen-ify the comments for the user interface

llvm-svn: 238086

9 years ago[dfsan] ignore more __sanitizer callbacks
Kostya Serebryany [Sat, 23 May 2015 01:56:39 +0000 (01:56 +0000)]
[dfsan] ignore more __sanitizer callbacks

llvm-svn: 238085

9 years agoAsmPrinter: Remove the vtable-entry from DIEValue
Duncan P. N. Exon Smith [Sat, 23 May 2015 01:45:07 +0000 (01:45 +0000)]
AsmPrinter: Remove the vtable-entry from DIEValue

Remove all virtual functions from `DIEValue`, dropping the vtable
pointer from its layout.  Instead, create "impl" functions on the
subclasses, and use the `DIEValue::Type` to implement the dynamic
dispatch.

This is necessary -- obviously not sufficient -- for passing `DIEValue`s
around by value.  However, this change stands on its own: we make tons
of these.  I measured a drop in memory usage from 888 MB down to 860 MB,
or around 3.2%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238084

9 years ago[Sema] Don't use dyn_cast to detect an AtomicType
David Majnemer [Sat, 23 May 2015 01:32:17 +0000 (01:32 +0000)]
[Sema] Don't use dyn_cast to detect an AtomicType

An AtomicType might be hidden behind arbitrary levels of typedefs.
getAs<> will reliably walk through the sugar to get the underlying
AtomicType.

This fixes PR23638.

llvm-svn: 238083

9 years agoCodeGen: Remove redundant DIETypeSignature::dump(), NFC
Duncan P. N. Exon Smith [Sat, 23 May 2015 01:26:26 +0000 (01:26 +0000)]
CodeGen: Remove redundant DIETypeSignature::dump(), NFC

We already have this in `DIEValue`; no reason to shadow it.

llvm-svn: 238082

9 years ago[lib/Fuzzer] fully get rid of std::cerr in libFuzzer
Kostya Serebryany [Sat, 23 May 2015 01:22:35 +0000 (01:22 +0000)]
[lib/Fuzzer] fully get rid of std::cerr in libFuzzer

llvm-svn: 238081

9 years agoStop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.
Akira Hatanaka [Sat, 23 May 2015 01:14:08 +0000 (01:14 +0000)]
Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.

This is part of the work to remove TargetMachine::resetTargetOptions.

In this patch, instead of updating global variable NoFramePointerElim in
resetTargetOptions, its use in DisableFramePointerElim is replaced with a call
to TargetFrameLowering::noFramePointerElim. This function determines on a
per-function basis if frame pointer elimination should be disabled.

There is no change in functionality except that cl:opt option "disable-fp-elim"
can now override function attribute "no-frame-pointer-elim".

llvm-svn: 238080

9 years agoSimplify and rename function overrideFunctionAttributes. NFC.
Akira Hatanaka [Sat, 23 May 2015 01:12:26 +0000 (01:12 +0000)]
Simplify and rename function overrideFunctionAttributes. NFC.

This is in preparation to making changes needed to stop resetting
NoFramePointerElim in resetTargetOptions.

llvm-svn: 238079

9 years ago[lib/Fuzzer] start getting rid of std::cerr. Sadly, these parts of C++ library used...
Kostya Serebryany [Sat, 23 May 2015 01:07:46 +0000 (01:07 +0000)]
[lib/Fuzzer] start getting rid of std::cerr. Sadly, these parts of C++ library used in libFuzzer badly interract with the same code used in the target function and also with dfsan. It's easier to just not use std::cerr than to defeat these issues.

llvm-svn: 238078

9 years agoRemove unnecessary command line option "-disable-fp-elim".
Akira Hatanaka [Sat, 23 May 2015 00:31:56 +0000 (00:31 +0000)]
Remove unnecessary command line option "-disable-fp-elim".

This option currently has no effect as function attribute
"no-frame-pointer-elim=false" overrides it.

llvm-svn: 238077

9 years agoThis reverts commit r238064 and r238055.
Rafael Espindola [Sat, 23 May 2015 00:30:33 +0000 (00:30 +0000)]
This reverts commit r238064 and r238055.

They depend on a reverted llvm commit.

llvm-svn: 238076

9 years agoRevert "make reciprocal estimate code generation more flexible by adding command...
Rafael Espindola [Sat, 23 May 2015 00:22:44 +0000 (00:22 +0000)]
Revert "make reciprocal estimate code generation more flexible by adding command-line options"

This reverts commit r238051.

It broke some bots:

http://lab.llvm.org:8011/builders/llvm-ppc64-linux1/builds/18190

llvm-svn: 238075

9 years agoCorrect a mistaken comment from 238071 [NFC]
Philip Reames [Sat, 23 May 2015 00:05:43 +0000 (00:05 +0000)]
Correct a mistaken comment from 238071 [NFC]

llvm-svn: 238074

9 years agoProduce a single string table in a ELF .o
Rafael Espindola [Fri, 22 May 2015 23:58:30 +0000 (23:58 +0000)]
Produce a single string table in a ELF .o

Normally an ELF .o has two string tables, one for symbols, one for section
names.

With the scheme of naming sections like ".text.foo" where foo is a symbol,
there is a big potential saving in using a single one.

Building llvm+clang+lld with master and with this patch the results were:

master:                          193,267,008 bytes
patch:                           186,107,952 bytes
master non unique section names: 183,260,192 bytes
patch non unique section names:  183,118,632 bytes

So using non usique saves 10,006,816 bytes, and the patch saves 7,159,056 while
still using distinct names for the sections.

llvm-svn: 238073

9 years ago[lld] Manage atom ordinals in the File class rather than using a static counter.
Lang Hames [Fri, 22 May 2015 23:56:44 +0000 (23:56 +0000)]
[lld] Manage atom ordinals in the File class rather than using a static counter.

This is a cleaner fix for the race-condition bug that was originally papered
over by r237857.

llvm-svn: 238072

9 years agoExtend EarlyCSE to handle basic cases from JumpThreading and CVP
Philip Reames [Fri, 22 May 2015 23:53:24 +0000 (23:53 +0000)]
Extend EarlyCSE to handle basic cases from JumpThreading and CVP

This patch extends EarlyCSE to take advantage of the information that a controlling branch gives us about the value of a Value within this and dominated basic blocks. If the current block has a single predecessor with a controlling branch, we can infer what the branch condition must have been to execute this block. The actual change to support this is downright simple because EarlyCSE's existing scoped hash table logic deals with most of the complexity around merging.

The patch actually implements two optimizations.
1) The first is analogous to JumpThreading in that it enables EarlyCSE's CSE handling to fold branches which are exactly redundant due to a previous branch to branches on constants. (It doesn't actually replace the branch or change the CFG.) This is pretty clearly a win since it enables substantial CFG simplification before we start trying to inline.
2) The second is analogous to CVP in that it exploits the knowledge gained to replace dominated *uses* of the original value. EarlyCSE does not otherwise reason about specific uses, so this is the more arguable one. It does enable further simplication and constant folding within the rest of the visit by EarlyCSE.

In both cases, the added code only handles the easy dominance based case of each optimization. The general case is deferred to the existing passes.

Differential Revision: http://reviews.llvm.org/D9763

llvm-svn: 238071

9 years agoAdd scalar and phi code generation
Johannes Doerfert [Fri, 22 May 2015 23:43:58 +0000 (23:43 +0000)]
Add scalar and phi code generation

  To reduce compile time and to allow more and better quality SCoPs in
  the long run we introduced scalar dependences and PHI-modeling. This
  patch will now allow us to generate code if one or both of those
  options are set. While the principle of demoting scalars as well as
  PHIs to memory in order to communicate their value stays the same,
  this allows to delay the demotion till the very end (the actual code
  generation). Consequently:
    - We __almost__ do not modify the code if we do not generate code
      for an optimized SCoP in the end. Thus, the early exit as well as
      the unprofitable option will now actually preven us from
      introducing regressions in case we will probably not get better
      code.
    - Polly can be used as a "pure" analyzer tool as long as the code
      generator is set to none.
    - The original SCoP is almost not touched when the optimized version
      is placed next to it. Runtime regressions if the runtime checks
      chooses the original are not to be expected and later
      optimizations do not need to revert the demotion for that part.
    - We will generate direct accesses to the demoted values, thus there
      are no "trivial GEPs" that select the first element of a scalar we
      demoted and treated as an array.

Differential Revision: http://reviews.llvm.org/D7513

llvm-svn: 238070

9 years agoUse target's SIGSTOP and SIGINT when making decision about continue after async packet.
Oleksiy Vyalov [Fri, 22 May 2015 23:14:39 +0000 (23:14 +0000)]
Use target's SIGSTOP and SIGINT when making decision about continue after async packet.

http://reviews.llvm.org/D9857

llvm-svn: 238068

9 years ago[InstCombine] Don't eagerly propagate nsw for A*B+A*C => A*(B+C)
David Majnemer [Fri, 22 May 2015 23:02:11 +0000 (23:02 +0000)]
[InstCombine] Don't eagerly propagate nsw for A*B+A*C => A*(B+C)

InstCombine transforms A *nsw B +nsw A *nsw C to A *nsw (B + C).
This is incorrect -- e.g. if A = -1, B = 1, C = INT_SMAX. Then
nothing in the LHS overflows, but the multiplication in RHS overflows.

We need to first make sure that we won't multiple by INT_SMAX + 1.

Test case `add_of_mul` contributed by Sanjoy Das.

This fixes PR23635.

Differential Revision: http://reviews.llvm.org/D9629

llvm-svn: 238066

9 years agoFix this module to work with current packects and also to be able to figure out avera...
Greg Clayton [Fri, 22 May 2015 23:00:59 +0000 (23:00 +0000)]
Fix this module to work with current packects and also to be able to figure out average packets speed and standard deviation.

llvm-svn: 238065

9 years agoadd missing include for TargetRecip
Sanjay Patel [Fri, 22 May 2015 22:59:27 +0000 (22:59 +0000)]
add missing include for TargetRecip

llvm-svn: 238064

9 years ago[lib/Fuzzer] remove -use_coverage_pairs=1, an experimental feature that is unlikely...
Kostya Serebryany [Fri, 22 May 2015 22:47:03 +0000 (22:47 +0000)]
[lib/Fuzzer] remove -use_coverage_pairs=1, an experimental feature that is unlikely to ever scale

llvm-svn: 238063

9 years ago[lib/Fuzzer] mention the user-supplied mutators
Kostya Serebryany [Fri, 22 May 2015 22:43:05 +0000 (22:43 +0000)]
[lib/Fuzzer] mention the user-supplied mutators

llvm-svn: 238062

9 years agoFix doxygen comments
Jonathan Peyton [Fri, 22 May 2015 22:37:22 +0000 (22:37 +0000)]
Fix doxygen comments

These fixes make doxygen happy.

llvm-svn: 238061

9 years agoFix spelling errors
Jonathan Peyton [Fri, 22 May 2015 22:35:51 +0000 (22:35 +0000)]
Fix spelling errors

These spelling errors are in comments and some debug messages.

llvm-svn: 238060

9 years ago[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators
Kostya Serebryany [Fri, 22 May 2015 22:35:31 +0000 (22:35 +0000)]
[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators

llvm-svn: 238059

9 years agoCodeGen: Avoid a reserved name and fix the naming style of some arguments. NFC
Justin Bogner [Fri, 22 May 2015 22:16:55 +0000 (22:16 +0000)]
CodeGen: Avoid a reserved name and fix the naming style of some arguments. NFC

It's undefined to use reserved names like _Diags. Fix up the other
parameter names to consistently use a modern style while I'm here.

llvm-svn: 238058

9 years agobuiltins: mark functions as aapcs on Windows
Saleem Abdulrasool [Fri, 22 May 2015 21:47:24 +0000 (21:47 +0000)]
builtins: mark functions as aapcs on Windows

Windows does not use AAPCS, but rather AAPCS-VFP, and thus the functions which
are assumed to be AAPCS will cause invalid argument setup.  Ensure that the
functions are marked as AAPCS.

llvm-svn: 238056

9 years agoadd the -mrecip driver flag and process its options
Sanjay Patel [Fri, 22 May 2015 21:42:10 +0000 (21:42 +0000)]
add the -mrecip driver flag and process its options

This is the front-end counterpart to D8982 (LLVM r238051).

The -mrecip option interface is based on maintaining compatibility with gcc:
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289

...while adding more functionality (allowing users to specify the number of refinement steps for each
estimate type).

Differential Revision: http://reviews.llvm.org/D8989

llvm-svn: 238055

9 years ago[AArch64][CGP] Sink zext feeding stxr/stlxr into the same block.
Ahmed Bougacha [Fri, 22 May 2015 21:37:17 +0000 (21:37 +0000)]
[AArch64][CGP] Sink zext feeding stxr/stlxr into the same block.

The usual CodeGenPrepare trickery, on a target-specific intrinsic.
Without this, the expansion of atomics will usually have the zext
be hoisted out of the loop, defeating the various patterns we have
to catch this precise case.

Differential Revision: http://reviews.llvm.org/D9930

llvm-svn: 238054

9 years agoRelax these tests a bit.
Rafael Espindola [Fri, 22 May 2015 21:37:13 +0000 (21:37 +0000)]
Relax these tests a bit.

It is not relevant where in the string table the name is located.

llvm-svn: 238053

9 years ago[AArch64] Robustize atomic cmpxchg test a little more. NFC.
Ahmed Bougacha [Fri, 22 May 2015 21:35:14 +0000 (21:35 +0000)]
[AArch64] Robustize atomic cmpxchg test a little more. NFC.

We changed the test to test non-constant values in r238049.
We can also use CHECK-NEXT to be a little stricter.

llvm-svn: 238052

9 years agomake reciprocal estimate code generation more flexible by adding command-line options
Sanjay Patel [Fri, 22 May 2015 21:10:06 +0000 (21:10 +0000)]
make reciprocal estimate code generation more flexible by adding command-line options

This patch adds a class for processing many recip codegen possibilities.
The TargetRecip class is intended to handle both command-line options to llc as well
as options passed in from a front-end such as clang with the -mrecip option.

The x86 backend is updated to use the new functionality.
Only -mcpu=btver2 with -ffast-math should see a functional change from this patch.
All other CPUs continue to *not* use reciprocal estimates by default with -ffast-math.

Differential Revision: http://reviews.llvm.org/D8982

llvm-svn: 238051

9 years ago[Mips] Cleanup and reformat test cases, add more checkings
Simon Atanasyan [Fri, 22 May 2015 21:08:37 +0000 (21:08 +0000)]
[Mips] Cleanup and reformat test cases, add more checkings

No functional changes.

llvm-svn: 238050

9 years ago[AArch64] Robustize atomic cmpxchg test. NFC.
Ahmed Bougacha [Fri, 22 May 2015 21:08:15 +0000 (21:08 +0000)]
[AArch64] Robustize atomic cmpxchg test.  NFC.

Constants are easy to get right the wrong way.

llvm-svn: 238049

9 years agoMake unique section names the default again.
Rafael Espindola [Fri, 22 May 2015 20:44:03 +0000 (20:44 +0000)]
Make unique section names the default again.

Using non unique names found a bug in the ICF inplementation in gold:

https://sourceware.org/bugzilla/show_bug.cgi?id=18440

This reverts commit r234143.

llvm-svn: 238048

9 years agoReinforce ARMTargetParser::getCanonicalArchName validation
Renato Golin [Fri, 22 May 2015 20:43:30 +0000 (20:43 +0000)]
Reinforce ARMTargetParser::getCanonicalArchName validation

Before, getCanonicalArchName was relying on parseArch() to validate the arch
name, which was a problem when other methods, that also needed to call it,
were duplicating the steps.

But to dissociate getCanonicalArchName from parseArch, we needed to make
getCanonicalArchName more robust in detecting valid arch names. It's still
not perfect, but will do for the time being, until we merge Triple with
TargetParser into a TargetDescription mega class.

llvm-svn: 238047

9 years agoUse new MachineInstr mayLoadOrStore() API. NFC.
Chad Rosier [Fri, 22 May 2015 20:07:34 +0000 (20:07 +0000)]
Use new MachineInstr mayLoadOrStore() API. NFC.

llvm-svn: 238044

9 years agodotest.py - fixed a bug displaying usage
Vince Harron [Fri, 22 May 2015 19:49:23 +0000 (19:49 +0000)]
dotest.py - fixed a bug displaying usage

./dotest.py --help

llvm-svn: 238043

9 years agoImplement PlatformWindows::GetEnvironment.
Zachary Turner [Fri, 22 May 2015 19:34:17 +0000 (19:34 +0000)]
Implement PlatformWindows::GetEnvironment.

This fixes a couple of tests that rely on being able to get the
host's environment or spawn an inferior with specific arguments.

llvm-svn: 238042

9 years agoFix use-after-free in OptionValueString.
Zachary Turner [Fri, 22 May 2015 19:33:54 +0000 (19:33 +0000)]
Fix use-after-free in OptionValueString.

We were assigning a temporary std::string to a StringRef.  Somehow
this worked on every platform but Windows.

llvm-svn: 238041

9 years agoDisable TestConcurrentEvents.py on Windows.
Zachary Turner [Fri, 22 May 2015 19:33:32 +0000 (19:33 +0000)]
Disable TestConcurrentEvents.py on Windows.

This test takes over 5 minutes to run just by itself, and everything
fails anyway, so it doesn't make sense to keep it running for now.

llvm-svn: 238040

9 years ago[TestRaise] Skip the SIGRTMIN test on Android.
Siva Chandra [Fri, 22 May 2015 19:00:33 +0000 (19:00 +0000)]
[TestRaise] Skip the SIGRTMIN test on Android.

Summary:
Running "kill -l" on nexus player (i386) device results in this:

    1    HUP Hangup                        33     33 Signal 33
    2    INT Interrupt                     34     34 Signal 34
    3   QUIT Quit                          35     35 Signal 35
    4    ILL Illegal instruction           36     36 Signal 36
    5   TRAP Trap                          37     37 Signal 37
    6   ABRT Aborted                       38     38 Signal 38
    7    BUS Bus error                     39     39 Signal 39
    8    FPE Floating point exception      40     40 Signal 40
    9   KILL Killed                        41     41 Signal 41
   10   USR1 User signal 1                 42     42 Signal 42
   11   SEGV Segmentation fault            43     43 Signal 43
   12   USR2 User signal 2                 44     44 Signal 44
   13   PIPE Broken pipe                   45     45 Signal 45
   14   ALRM Alarm clock                   46     46 Signal 46
   15   TERM Terminated                    47     47 Signal 47
   16 STKFLT Stack fault                   48     48 Signal 48
   17   CHLD Child exited                  49     49 Signal 49
   18   CONT Continue                      50     50 Signal 50
   19   STOP Stopped (signal)              51     51 Signal 51
   20   TSTP Stopped                       52     52 Signal 52
   21   TTIN Stopped (tty input)           53     53 Signal 53
   22   TTOU Stopped (tty output)          54     54 Signal 54
   23    URG Urgent I/O condition          55     55 Signal 55
   24   XCPU CPU time limit exceeded       56     56 Signal 56
   25   XFSZ File size limit exceeded      57     57 Signal 57
   26 VTALRM Virtual timer expired         58     58 Signal 58
   27   PROF Profiling timer expired       59     59 Signal 59
   28  WINCH Window size changed           60     60 Signal 60
   29     IO I/O possible                  61     61 Signal 61
   30    PWR Power failure                 62     62 Signal 62
   31    SYS Bad system call               63     63 Signal 63
   32     32 Signal 32                     64     64 Signal 64

The signals from 33-64 are missing symbolic names.

Test Plan: dotest.py -p TestRaise on Android

Reviewers: labath

Subscribers: tberghammer, aemerson, lldb-commits

Differential Revision: http://reviews.llvm.org/D9944

llvm-svn: 238039

9 years ago[bpf] emit jmp fixups in little endian
Alexei Starovoitov [Fri, 22 May 2015 18:47:33 +0000 (18:47 +0000)]
[bpf] emit jmp fixups in little endian

The 'off' field of 'struct bpf_insn' is in cpu-endianness,
since the rest is emitted as little endian, make sure
that 'off' field is little endian as well.

llvm-svn: 238038

9 years agoUse profile and version parsers from ARMTargetParser
Renato Golin [Fri, 22 May 2015 18:18:25 +0000 (18:18 +0000)]
Use profile and version parsers from ARMTargetParser

Now that ARMTargetParser can parse profile and version numbers,
use them instead of the local implementation.

llvm-svn: 238037

9 years agoAdding profile and version parsers to ARMTargetParser
Renato Golin [Fri, 22 May 2015 18:17:55 +0000 (18:17 +0000)]
Adding profile and version parsers to ARMTargetParser

This allows us to match armv6m to default to thumb, but will also be used by
Clang's driver and remove the current incomplete copy in it.

llvm-svn: 238036

9 years agoReapply r238011 with a fix for the trap instruction.
Quentin Colombet [Fri, 22 May 2015 18:10:47 +0000 (18:10 +0000)]
Reapply r238011 with a fix for the trap instruction.
The problem was that I slipped a change required for shrink-wrapping, namely I
used getFirstTerminator instead of the getLastNonDebugInstr that was here before
the refactoring, whereas the surrounding code is not yet patched for that.

Original message:
[X86] Refactor the prologue emission to prepare for shrink-wrapping.

- Add a late pass to expand pseudo instructions (tail call and EH returns).
 Instead of doing it in the prologue emission.
- Factor some static methods in X86FrameLowering to ease code sharing.

NFC.

Related to <rdar://problem/20821487>

llvm-svn: 238035

9 years agoRemove redundant std::move on functions that return a unique_ptr.
Benjamin Kramer [Fri, 22 May 2015 17:52:04 +0000 (17:52 +0000)]
Remove redundant std::move on functions that return a unique_ptr.

llvm-svn: 238034

9 years ago[Unroll] Separate the logic for testing each iteration of the loop,
Chandler Carruth [Fri, 22 May 2015 17:41:35 +0000 (17:41 +0000)]
[Unroll] Separate the logic for testing each iteration of the loop,
accumulating estimated cost, and other loop-centric logic from the logic
used to analyze instructions in a particular iteration.

This makes the visitor very narrow in scope -- all it does is visit
instructions, update a map of simplified values, and return whether it
is able to optimize away a particular instruction.

The two cost metrics are now returned as an optional struct. When the
optional is left unengaged, there is no information about the unrolled
cost of the loop, when it is engaged the cost metrics are available to
run against the thresholds.

No functionality changed.

llvm-svn: 238033

9 years ago[PPC64] Add support for clrbhrb, mfbhrbe, rfebb.
Bill Schmidt [Fri, 22 May 2015 16:44:10 +0000 (16:44 +0000)]
[PPC64] Add support for clrbhrb, mfbhrbe, rfebb.

This patch adds support for the ISA 2.07 additions involving the
branch history rolling buffer and event-based branching.  These will
not be used by typical applications, so built-in support is not
required.  They will only be available via inline assembly.

Assembly/disassembly tests are included in the patch.

llvm-svn: 238032

9 years agoAdd clarifying note that sampling-based profiles cannot be used for code coverage.
Diego Novillo [Fri, 22 May 2015 16:05:07 +0000 (16:05 +0000)]
Add clarifying note that sampling-based profiles cannot be used for code coverage.

llvm-svn: 238031

9 years ago[ELF] Remove redundant unique_ptr moves found by -Wpessimizing-move.
Benjamin Kramer [Fri, 22 May 2015 16:01:21 +0000 (16:01 +0000)]
[ELF] Remove redundant unique_ptr moves found by -Wpessimizing-move.

llvm-svn: 238030

9 years ago[ELF] Fix shared CMake build.
Benjamin Kramer [Fri, 22 May 2015 16:01:12 +0000 (16:01 +0000)]
[ELF] Fix shared CMake build.

llvm-svn: 238029

9 years agoStop inventing symbol sizes.
Rafael Espindola [Fri, 22 May 2015 15:43:00 +0000 (15:43 +0000)]
Stop inventing symbol sizes.

MachO and COFF quite reasonably only define the size for common symbols.

We used to try to figure out the "size" by computing the gap from one symbol to
the next.

This would not be correct in general, since a part of a section can belong to no
visible symbol (padding, private globals).

It was also really expensive, since we would walk every symbol to find the size
of one.

If a caller really wants this, it can sort all the symbols once and get all the
gaps ("size") in O(n log n) instead of O(n^2).

On MachO this also has the advantage of centralizing all the checks for an
invalid n_sect.

llvm-svn: 238028

9 years agoremove names from comments, fix typos; NFC
Sanjay Patel [Fri, 22 May 2015 15:38:24 +0000 (15:38 +0000)]
remove names from comments, fix typos; NFC

llvm-svn: 238027

9 years agofix typo, 80-col; NFC
Sanjay Patel [Fri, 22 May 2015 15:32:33 +0000 (15:32 +0000)]
fix typo, 80-col; NFC

llvm-svn: 238026

9 years agofix typo in comment; NFC
Sanjay Patel [Fri, 22 May 2015 15:31:47 +0000 (15:31 +0000)]
fix typo in comment; NFC

llvm-svn: 238025

9 years agoDetect invalid section indexes when we first read them.
Rafael Espindola [Fri, 22 May 2015 14:59:27 +0000 (14:59 +0000)]
Detect invalid section indexes when we first read them.

We still detect the same errors, but now we do it earlier.

llvm-svn: 238024

9 years ago[ARM] Fix typo in subtarget feature list for 7em triple
John Brawn [Fri, 22 May 2015 14:16:22 +0000 (14:16 +0000)]
[ARM] Fix typo in subtarget feature list for 7em triple

The list of subtarget features for the 7em triple contains 't2xtpk',
which actually disables that subtarget feature. Correct that to
'+t2xtpk' and test that the instructions enabled by that feature do
actually work.

Differential Revision: http://reviews.llvm.org/D9936

llvm-svn: 238022

9 years agoUpdating the documentation to include an operator! for negative capability support.
Aaron Ballman [Fri, 22 May 2015 13:36:48 +0000 (13:36 +0000)]
Updating the documentation to include an operator! for negative capability support.

llvm-svn: 238020

9 years agoFix llvm-nm -S option.
Rafael Espindola [Fri, 22 May 2015 13:28:35 +0000 (13:28 +0000)]
Fix llvm-nm -S option.

It is explicitly documented to have no effect on object formats where symbols
don't have sizes.

llvm-svn: 238019

9 years agoMake this test stricter. NFC.
Rafael Espindola [Fri, 22 May 2015 13:17:31 +0000 (13:17 +0000)]
Make this test stricter. NFC.

llvm-svn: 238018

9 years ago[ARM] report_fatal_error for not implemented functionality
Denis Protivensky [Fri, 22 May 2015 12:39:05 +0000 (12:39 +0000)]
[ARM] report_fatal_error for not implemented functionality

llvm-svn: 238017

9 years agoAdding new AST matcher: isConstexpr
Szabolcs Sipos [Fri, 22 May 2015 11:35:50 +0000 (11:35 +0000)]
Adding new AST matcher: isConstexpr

It matches constexpr variable and function declarations.

llvm-svn: 238016

9 years ago[ARM] Ability to add GOT and PLTGOT entries for same symbol
Denis Protivensky [Fri, 22 May 2015 11:23:39 +0000 (11:23 +0000)]
[ARM] Ability to add GOT and PLTGOT entries for same symbol

These two serve different purpose:
PLTGOT entries are (usually) lazily resolved and serve as trampolines
to correctly call dynamically linked functions. They often have
R_*_JUMP_SLOT dynamic relocation type used.
Simple GOT entries hold other things, one of them may be
R_*_GLOB_DAT to correctly reference global and static data. This
is also used to hold dynamically linked function's address.

To properly handle cases when shared object's function is called
and at the same time its address is taken, we need to be able to have
both GOT and PLTGOT entries bearing different dynamic relocation types
for the same symbol.

llvm-svn: 238015

9 years ago[ARM] Implement R_ARM_GLOB_DAT for GOT entries
Denis Protivensky [Fri, 22 May 2015 11:00:31 +0000 (11:00 +0000)]
[ARM] Implement R_ARM_GLOB_DAT for GOT entries

This is used when referencing global or static data in shared
objects. This is also used when function's address is taken and
function call is made indirectly.

llvm-svn: 238014

9 years agoAdd a clang-tidy check for move constructors/assignment ops without noexcept.
Alexander Kornienko [Fri, 22 May 2015 10:31:17 +0000 (10:31 +0000)]
Add a clang-tidy check for move constructors/assignment ops without noexcept.

Summary:
Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors
and assignment operators not using noexcept.

http://llvm.org/PR23519

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D9933

llvm-svn: 238013

9 years agoReapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext...
NAKAMURA Takumi [Fri, 22 May 2015 10:11:07 +0000 (10:11 +0000)]
Reapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext.h, to apease g++-4.7.

llvm-svn: 238012

9 years agoRevert "[X86] Fix a variable name for r237977 so that it works with every compilers."
Tamas Berghammer [Fri, 22 May 2015 10:01:56 +0000 (10:01 +0000)]
Revert "[X86] Fix a variable name for r237977 so that it works with every compilers."
Revert "[X86] Refactor the prologue emission to prepare for shrink-wrapping."

This reverts commit 6b3b93fc8b68a2c806aa992ee4bd3d7f61898d4b.
This reverts commit ab0b15dff8539826283a59c2dd700a18a9680e0f.

llvm-svn: 238011

9 years ago[OPENMP] Prepare codegen for privates in tasks for non-capturing of privates in Captu...
Alexey Bataev [Fri, 22 May 2015 08:56:35 +0000 (08:56 +0000)]
[OPENMP] Prepare codegen for privates in tasks for non-capturing of privates in CapturedStmt.

Reworked codegen for privates in tasks:

call @kmpc_omp_task_alloc();
...
call @kmpc_omp_task(task_proxy);

void map_privates(.privates_rec. *privs, type1 ** priv1_ref, ..., typen **privn_ref) {
  *priv1_ref = &privs->private1;
  ...
  *privn_ref = &privs->privaten;
  ret void
}

i32 task_entry(i32 ThreadId, i32 PartId, void* privs, void (void*, ...) map_privates, shareds* captures) {
  type1 **priv1;
  ...
  typen **privn;
  call map_privates(privs, priv1, ..., privn);
  <Task body with priv1, .., privn instead of the captured variables>.
  ret i32
}

i32 task_proxy(i32 ThreadId, kmp_task_t_with_privates *tt) {
  call task_entry(ThreadId, tt->task_data.PartId, &tt->privates, map_privates, tt->task_data.shareds);
}

llvm-svn: 238010

9 years agoAdd real time signals support to LinuxSignals
Pavel Labath [Fri, 22 May 2015 08:46:18 +0000 (08:46 +0000)]
Add real time signals support to LinuxSignals

Summary: This enables correct handling of real time signals by lldb.

Test Plan: Added a test that verifies handling of SIGRTMIN

Reviewers: tberghammer, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9911

llvm-svn: 238009

9 years agoCompile time improvements to VirtRegRewriter.
Puyan Lotfi [Fri, 22 May 2015 08:11:26 +0000 (08:11 +0000)]
Compile time improvements to VirtRegRewriter.

This change to VirtRegRewriter::addMBBLiveIns adds live-in registers for each
MachineBasicBlock's LiveIns set without isLiveIn checks as they are being added
because doing so is expensive. After all live-in registers are added, the LiveIn
vectors are sorted and uniqued.

llvm-svn: 238008

9 years agoRevert r237954, "Resubmit r237708 (MIR Serialization: print and parse LLVM IR using...
NAKAMURA Takumi [Fri, 22 May 2015 07:17:07 +0000 (07:17 +0000)]
Revert r237954, "Resubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format)."

It brought cyclic dependencies between LLVMCodeGen and LLVMMIR.

llvm-svn: 238007

9 years agoModernize some doc comments. NFC
Justin Bogner [Fri, 22 May 2015 06:48:13 +0000 (06:48 +0000)]
Modernize some doc comments. NFC

llvm-svn: 238006

9 years agoMC: Shave a pointer off of MCSymbol::Name
Duncan P. N. Exon Smith [Fri, 22 May 2015 06:04:42 +0000 (06:04 +0000)]
MC: Shave a pointer off of MCSymbol::Name

Shave a pointer off of `MCSymbolName` by storing `StringMapEntry<bool>*`
instead of `StringRef`.  This brings `sizeof(MCSymbol)` down to 64 on
64-bit platforms, a nice round number.  My profile showed memory
dropping from 914 MB down to 908 MB, roughly 0.7%.  Other than memory
usage, no functionality change here.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238005