platform/upstream/llvm.git
9 years agoPrune CRLF.
NAKAMURA Takumi [Mon, 14 Sep 2015 11:13:39 +0000 (11:13 +0000)]
Prune CRLF.

llvm-svn: 247541

9 years agoPropagate exit conditions as described in the PET paper
Johannes Doerfert [Mon, 14 Sep 2015 11:12:52 +0000 (11:12 +0000)]
Propagate exit conditions as described in the PET paper

  At some point we build loop trip counts using this method. It was replaced by
  a simpler trick that works only for affine (e.g., not modulo) constraints and
  relies on the removal of unbounded parts. In order to allow modulo constrains
  again we go back to the former, more accurate method.

llvm-svn: 247540

9 years agoSwitch default disposition of realtime signals
Pavel Labath [Mon, 14 Sep 2015 09:05:43 +0000 (09:05 +0000)]
Switch default disposition of realtime signals

Summary:
Realtime signals generally do not represent an error condition in an application but are more
like a regular means of IPC. As such, we shouldn't interrupt an application whenever it recieves
one. If any application will use these signals, it will probably use them a lot, rendering it's
debugging tiresome if we stopped at every signal. Furthermore, these signals are likely to be used
in a low level library, and the programmer may not even be aware of their presence.

For these reasons, I am switching the default disposition of realtime signals on all supported
platforms (i.e. Linux and Freebsd) to no-stop, no-notify. Any user still wishing to receive these
signals can always change the default to suit his needs.

Reviewers: ovyalov, emaste

Subscribers: lldb-commits, emaste

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

llvm-svn: 247537

9 years agoTest commit.
Marek Kurdej [Mon, 14 Sep 2015 08:05:12 +0000 (08:05 +0000)]
Test commit.

llvm-svn: 247536

9 years ago[Sema] Reject value-initialization of function types
David Majnemer [Mon, 14 Sep 2015 07:05:00 +0000 (07:05 +0000)]
[Sema] Reject value-initialization of function types

T in the expression T() must be a non-array complete object type or
the void type.  Function types are neither.

This fixes PR24798.

llvm-svn: 247535

9 years agoGlobalsAAResult: Try to fix crash.
NAKAMURA Takumi [Mon, 14 Sep 2015 06:16:44 +0000 (06:16 +0000)]
GlobalsAAResult: Try to fix crash.

DeletionCallbackHandle holds GAR in its creation. It assumes;

  - It is registered as CallbackVH. It should not be moved in its life.
  - Its parent, GAR, may be moved.

To move list<DeletionCallbackHandle> GlobalsAAResult::Handles,
GAR must be updated with the destination in GlobalsAAResult(&&).

llvm-svn: 247534

9 years ago[Static Analyzer] Remove a redundant file.
Gabor Horvath [Sun, 13 Sep 2015 23:03:11 +0000 (23:03 +0000)]
[Static Analyzer] Remove a redundant file.

llvm-svn: 247533

9 years ago[Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagatio...
Gabor Horvath [Sun, 13 Sep 2015 23:02:24 +0000 (23:02 +0000)]
[Static Analyzer] Merge the Objective-C Generics Checker into Dynamic Type Propagation checker.

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

llvm-svn: 247532

9 years agoCOFF: Corrected error message if a section failed to load.
Rui Ueyama [Sun, 13 Sep 2015 20:22:22 +0000 (20:22 +0000)]
COFF: Corrected error message if a section failed to load.

There is no sense to use Name in these lines as it is not initialized yet.

Patch from Igor Kudrin!

llvm-svn: 247531

9 years ago[docs] NFC: Fix line formatting in INSTALL.txt
Vedant Kumar [Sun, 13 Sep 2015 20:17:18 +0000 (20:17 +0000)]
[docs] NFC: Fix line formatting in INSTALL.txt

Patch by beltex!

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

llvm-svn: 247530

9 years ago[TableGen] Use range-based for loops and make a helper function static. NFC
Craig Topper [Sun, 13 Sep 2015 18:01:25 +0000 (18:01 +0000)]
[TableGen] Use range-based for loops and make a helper function static. NFC

llvm-svn: 247529

9 years ago[TableGen] Simplify some code by using StringRef::find instead of std::find. NFC
Craig Topper [Sun, 13 Sep 2015 18:01:20 +0000 (18:01 +0000)]
[TableGen] Simplify some code by using StringRef::find instead of std::find. NFC

llvm-svn: 247528

9 years ago[TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types...
Craig Topper [Sun, 13 Sep 2015 18:01:09 +0000 (18:01 +0000)]
[TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. NFC

llvm-svn: 247527

9 years ago[X86][MMX] Added shuffle decodes for MMX/3DNow! shuffles.
Simon Pilgrim [Sun, 13 Sep 2015 11:28:45 +0000 (11:28 +0000)]
[X86][MMX] Added shuffle decodes for MMX/3DNow! shuffles.

Added shuffle decodes for MMX PUNPCK + PSHUFW shuffles.
Added shuffle decodes for 3DNow! PSWAPD shuffles.

llvm-svn: 247526

9 years ago[FunctionAttrs] Move the malloc-like test to a static helper function
Chandler Carruth [Sun, 13 Sep 2015 08:23:27 +0000 (08:23 +0000)]
[FunctionAttrs] Move the malloc-like test to a static helper function
that could be used from a new pass manager. This one makes particular
sense as a static helper as it doesn't even need TLI.

llvm-svn: 247525

9 years ago[FunctionAttrs] Factor the logic to test for a known non-null return out
Chandler Carruth [Sun, 13 Sep 2015 08:17:14 +0000 (08:17 +0000)]
[FunctionAttrs] Factor the logic to test for a known non-null return out
of a method and into a re-usable static helper. We can potentially use
this function from the implementation of a new pass manager oriented
version of the pass. Also add some better documentation of exactly what
the semantic model of this routine is (it isn't trivial) and use a more
modern naming convention for it.

llvm-svn: 247524

9 years agoAVX-512: Fixed a bug in OR/XOR operations for 512-bit FP values on KNL.
Elena Demikhovsky [Sun, 13 Sep 2015 08:15:15 +0000 (08:15 +0000)]
AVX-512: Fixed a bug in OR/XOR operations for 512-bit FP values on KNL.
KNL does not have VXORPS, VORPS for 512-bit values.
I use integer VPXOR, VPOR that actually do the same.

X86ISD::FXOR/FOR are generated as a result of FSUB combining.

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

llvm-svn: 247523

9 years ago[FunctionAttrs] Make the per-function attribute inference a boring
Chandler Carruth [Sun, 13 Sep 2015 08:03:23 +0000 (08:03 +0000)]
[FunctionAttrs] Make the per-function attribute inference a boring
static function rather than a method. It just needed access to
TargetLibraryInfo, and this way it can be easily reused between the
current FunctionAttrs implementation and any port for the new pass
manager.

llvm-svn: 247522

9 years ago[FunctionAttrs] Collect utility functions as static helpers rather than
Chandler Carruth [Sun, 13 Sep 2015 07:50:43 +0000 (07:50 +0000)]
[FunctionAttrs] Collect utility functions as static helpers rather than
methods. They don't need anything from the class anyways.

Also, collect the declarations into the private section of the pass.

llvm-svn: 247521

9 years agoClean up doxygen comments in FunctionAttrs, promoting some non-doxygen
Chandler Carruth [Sun, 13 Sep 2015 06:57:25 +0000 (06:57 +0000)]
Clean up doxygen comments in FunctionAttrs, promoting some non-doxygen
comments, deleting duplicate comments, moving comments to consistently
live on the definition since these are all really internal routines,
etc. NFC.

llvm-svn: 247520

9 years agoDo some spring cleaning on FunctionAttrs.cpp with clang-format prior to
Chandler Carruth [Sun, 13 Sep 2015 06:47:20 +0000 (06:47 +0000)]
Do some spring cleaning on FunctionAttrs.cpp with clang-format prior to
other refactorings and cleanups here.

llvm-svn: 247519

9 years ago[llvm-mc] More meaningful error if input file doesn't exist.
Davide Italiano [Sun, 13 Sep 2015 04:09:40 +0000 (04:09 +0000)]
[llvm-mc] More meaningful error if input file doesn't exist.

Before we just printed on stderr the program name. Now at least we
print the name of the file that doesn't exist. There's probably room
for improvement of error handling in llvm-mc (and the tools in general),
but still this is a step forward.

llvm-svn: 247518

9 years ago[x86] enable machine combiner reassociations for 128-bit vector logical integer insts...
Sanjay Patel [Sat, 12 Sep 2015 19:47:50 +0000 (19:47 +0000)]
[x86] enable machine combiner reassociations for 128-bit vector logical integer insts (2nd try)

The changes in:
test/CodeGen/X86/machine-cp.ll
are just due to scheduling differences after some logic instructions were reassociated.

llvm-svn: 247516

9 years ago[CodeGen] Fix AtomicExpand invalidation issue caused by r247429.
Ahmed Bougacha [Sat, 12 Sep 2015 18:51:23 +0000 (18:51 +0000)]
[CodeGen] Fix AtomicExpand invalidation issue caused by r247429.

llvm-svn: 247514

9 years ago[X86] Renamed lowerVectorShuffleAsUnpack NFCI.
Simon Pilgrim [Sat, 12 Sep 2015 18:26:47 +0000 (18:26 +0000)]
[X86] Renamed lowerVectorShuffleAsUnpack NFCI.

Renamed to lowerVectorShuffleAsPermuteAndUnpack to make it clear that it lowers to more than just a UNPCK instruction.

llvm-svn: 247513

9 years agoDon't use bashism/kshism of test ==. From Kamil Rytarowski.
Joerg Sonnenberger [Sat, 12 Sep 2015 16:30:32 +0000 (16:30 +0000)]
Don't use bashism/kshism of test ==. From Kamil Rytarowski.

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

llvm-svn: 247512

9 years ago[X86] Moved lowerVectorShuffleWithUNPCK earlier to make reuse easier. NFCI.
Simon Pilgrim [Sat, 12 Sep 2015 16:03:06 +0000 (16:03 +0000)]
[X86] Moved lowerVectorShuffleWithUNPCK earlier to make reuse easier. NFCI.

llvm-svn: 247511

9 years agoUse -f instead of -d flag for testing existing of clang executable (http://reviews...
Ted Kremenek [Sat, 12 Sep 2015 16:01:34 +0000 (16:01 +0000)]
Use -f instead of -d flag for testing existing of clang executable (reviews.llvm.org/D12827).

llvm-svn: 247510

9 years ago[X86] Added i1 vector sextload tests
Simon Pilgrim [Sat, 12 Sep 2015 15:36:41 +0000 (15:36 +0000)]
[X86] Added i1 vector sextload tests

llvm-svn: 247509

9 years ago[X86][FMA] Refreshed fma tests
Simon Pilgrim [Sat, 12 Sep 2015 15:33:05 +0000 (15:33 +0000)]
[X86][FMA] Refreshed fma tests

llvm-svn: 247508

9 years agorevert r247506; need to verify changes in existing tests
Sanjay Patel [Sat, 12 Sep 2015 15:27:31 +0000 (15:27 +0000)]
revert r247506; need to verify changes in existing tests

llvm-svn: 247507

9 years ago[x86] enable machine combiner reassociations for 128-bit vector logical integer insts
Sanjay Patel [Sat, 12 Sep 2015 14:58:04 +0000 (14:58 +0000)]
[x86] enable machine combiner reassociations for 128-bit vector logical integer insts

llvm-svn: 247506

9 years agoFixed unused variable warning.
Simon Pilgrim [Sat, 12 Sep 2015 14:00:17 +0000 (14:00 +0000)]
Fixed unused variable warning.

llvm-svn: 247505

9 years ago[InstCombine] CVTPH2PS Vector Demanded Elements + Constant Folding
Simon Pilgrim [Sat, 12 Sep 2015 13:39:53 +0000 (13:39 +0000)]
[InstCombine] CVTPH2PS Vector Demanded Elements + Constant Folding

Improved InstCombine support for CVTPH2PS (F16C half 2 float conversion):

<4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16>) - only uses the bottom 4 i16 elements for the conversion.

Added constant folding support.

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

llvm-svn: 247504

9 years agoTest commit.
Kelvin Li [Sat, 12 Sep 2015 13:35:31 +0000 (13:35 +0000)]
Test commit.

llvm-svn: 247503

9 years ago[X86][SSE] Use general sext IR for (v)pmovsx stack folding tests
Simon Pilgrim [Sat, 12 Sep 2015 11:45:24 +0000 (11:45 +0000)]
[X86][SSE] Use general sext IR for (v)pmovsx stack folding tests

llvm-svn: 247502

9 years ago[PM] Port SROA to the new pass manager.
Chandler Carruth [Sat, 12 Sep 2015 09:09:14 +0000 (09:09 +0000)]
[PM] Port SROA to the new pass manager.

In some ways this is a very boring port to the new pass manager as there
are no interesting analyses or dependencies or other oddities.

However, this does introduce the first good example of a transformation
pass with non-trivial state porting to the new pass manager. I've tried
to carve out patterns here to replicate elsewhere, and would appreciate
comments on whether folks like these patterns:

- A common need in the new pass manager is to effectively lift the pass
  class and some of its state into a public header file. Prior to this,
  LLVM used anonymous namespaces to provide "module private" types and
  utilities, but that doesn't scale to cases where a public header file
  is needed and the new pass manager will exacerbate that. The pattern
  I've adopted here is to use the namespace-cased-name of the core pass
  (what would be a module if we had them) as a module-private namespace.
  Then utility and other code can be declared and defined in this
  namespace. At some point in the future, we could even have
  (conditionally compiled) code that used modules features when
  available to do the same basic thing.

- I've split the actual pass run method in two in order to expose
  a private method usable by the old pass manager to wrap the new class
  with a minimum of duplicated code. I actually looked at a bunch of
  ways to automate or generate these, but they are all quite terrible
  IMO. The fundamental need is to extract the set of analyses which need
  to cross this interface boundary, and that will end up being too
  unpredictable to effectively encapsulate IMO. This is also
  a relatively small amount of boiler plate that will live a relatively
  short time, so I'm not too worried about the fact that it is boiler
  plate.

The rest of the patch is totally boring but results in a massive diff
(sorry). It just moves code around and removes or adds qualifiers to
reflect the new name and nesting structure.

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

llvm-svn: 247501

9 years ago[CodeGen] Remove wrapper-free always_inline functions from COMDATs
David Majnemer [Sat, 12 Sep 2015 06:37:42 +0000 (06:37 +0000)]
[CodeGen] Remove wrapper-free always_inline functions from COMDATs

always_inline functions without a wrapper don't need to be in a COMDAT.

llvm-svn: 247500

9 years agoubsan: Also disable vptr validation on powerpc64le.
Peter Collingbourne [Sat, 12 Sep 2015 05:24:44 +0000 (05:24 +0000)]
ubsan: Also disable vptr validation on powerpc64le.

llvm-svn: 247499

9 years agoClean up trailing whitespace in the builtin headers
Sean Silva [Sat, 12 Sep 2015 02:55:19 +0000 (02:55 +0000)]
Clean up trailing whitespace in the builtin headers

llvm-svn: 247498

9 years agoClean up: Refactoring the hardcoded value of 6 for FindAvailableLoadedValue()'s param...
Larisse Voufo [Sat, 12 Sep 2015 01:41:55 +0000 (01:41 +0000)]
Clean up: Refactoring the hardcoded value of 6 for FindAvailableLoadedValue()'s parameter MaxInstsToScan.

llvm-svn: 247497

9 years agoclang/test/Driver/stackrealign.c REQUIRES clang-driver.
NAKAMURA Takumi [Sat, 12 Sep 2015 01:29:35 +0000 (01:29 +0000)]
clang/test/Driver/stackrealign.c REQUIRES clang-driver.

GCC driver, for example cygwin, both "-mstackrealign" "-mno-stackrealign" are passed.

llvm-svn: 247496

9 years agoFix typos.
Bruce Mitchener [Sat, 12 Sep 2015 01:17:08 +0000 (01:17 +0000)]
Fix typos.

Summary: This fixes a variety of typos in docs, code and headers.

Subscribers: jholewinski, sanjoy, arsenm, llvm-commits

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

llvm-svn: 247495

9 years agoAlways_inline codegen rewrite.
Evgeniy Stepanov [Sat, 12 Sep 2015 01:07:37 +0000 (01:07 +0000)]
Always_inline codegen rewrite.

Current implementation may end up emitting an undefined reference for
an "inline __attribute__((always_inline))" function by generating an
"available_externally alwaysinline" IR function for it and then failing to
inline all the calls. This happens when a call to such function is in dead
code. As the inliner is an SCC pass, it does not process dead code.

Libc++ relies on the compiler never emitting such undefined reference.

With this patch, we emit a pair of
1. internal alwaysinline definition (called F.alwaysinline)
2a. A stub F() { musttail call F.alwaysinline }
  -- or, depending on the linkage --
2b. A declaration of F.

The frontend ensures that F.inlinefunction is only used for direct
calls, and the stub is used for everything else (taking the address of
the function, really). Declaration (2b) is emitted in the case when
"inline" is meant for inlining only (like __gnu_inline__ and some
other cases).

This approach, among other nice properties, ensures that alwaysinline
functions are always internal, making it impossible for a direct call
to such function to produce an undefined symbol reference.

This patch is based on ideas by Chandler Carruth and Richard Smith.

llvm-svn: 247494

9 years agoubsan: Disable vptr validation on powerpc64.
Peter Collingbourne [Sat, 12 Sep 2015 00:08:28 +0000 (00:08 +0000)]
ubsan: Disable vptr validation on powerpc64.

Should fix sanitizer-ppc64-linux1 bot.

llvm-svn: 247493

9 years agoMove asserts from PHINode::addIncoming to PHINode::setIncoming*
Hal Finkel [Sat, 12 Sep 2015 00:08:21 +0000 (00:08 +0000)]
Move asserts from PHINode::addIncoming to PHINode::setIncoming*

We had asserts in PHINode::addIncoming to check that the value types matched
the type of the PHI, and that the associated BB was not null. These did not
catch, however, later uses of setIncomingValue and setIncomingBlock (which are
called by addIncoming as well). Moving the asserts to PHINode::setIncoming*
provides better coverage. NFC.

llvm-svn: 247492

9 years agoRevert "Specify target triple in alwaysinline tests."
Evgeniy Stepanov [Fri, 11 Sep 2015 23:48:37 +0000 (23:48 +0000)]
Revert "Specify target triple in alwaysinline tests."
Revert "Always_inline codegen rewrite."

Breaks gdb & lldb tests.
Breaks on Fedora 22 x86_64.

llvm-svn: 247491

9 years agodsymutil: Factor out the relocation handling into a RelocationManager (NFC)
Adrian Prantl [Fri, 11 Sep 2015 23:45:30 +0000 (23:45 +0000)]
dsymutil: Factor out the relocation handling into a RelocationManager (NFC)

llvm-svn: 247490

9 years ago[clang-tidy] misc-sizeof-container: whitelist std::bitset<>.
Alexander Kornienko [Fri, 11 Sep 2015 22:54:44 +0000 (22:54 +0000)]
[clang-tidy] misc-sizeof-container: whitelist std::bitset<>.

It's fine to use sizeof on std::bitset<>, since it doesn't have any external
storage, everything's inside.

llvm-svn: 247489

9 years agoAdd new test file missing from r247486.
Richard Smith [Fri, 11 Sep 2015 22:54:01 +0000 (22:54 +0000)]
Add new test file missing from r247486.

llvm-svn: 247488

9 years agoStart adding support for creating shared libraries.
Rafael Espindola [Fri, 11 Sep 2015 22:42:45 +0000 (22:42 +0000)]
Start adding support for creating shared libraries.

They are not fully functional yet, but this implements enough support for lld
itself to read them.

With that, delete the .so binary we were using for tests and start eating our
own dog food.

llvm-svn: 247487

9 years ago[modules] When picking one of two template declarations as a lookup result,
Richard Smith [Fri, 11 Sep 2015 22:39:35 +0000 (22:39 +0000)]
[modules] When picking one of two template declarations as a lookup result,
it's not sufficient to prefer the declaration with more default arguments, or
the one that's visible; they might both be visible, but one of them might have
a visible default argument where the other has a hidden default argument.

llvm-svn: 247486

9 years ago[clang-tidy] Fix minor issues in the testing script.
Alexander Kornienko [Fri, 11 Sep 2015 22:38:26 +0000 (22:38 +0000)]
[clang-tidy] Fix minor issues in the testing script.

llvm-svn: 247485

9 years agoubsan: Implement memory permission validation for vtables.
Peter Collingbourne [Fri, 11 Sep 2015 22:18:35 +0000 (22:18 +0000)]
ubsan: Implement memory permission validation for vtables.

If the pointer passed to the getVtablePrefix function was read from a freed
object, we may end up following pointers into objects on the heap and
printing bogus dynamic type names in diagnostics. However, we know that
vtable pointers will generally only point into memory mapped from object
files, not objects on the heap.

This change causes us to only follow pointers in a vtable if the vtable
and one of the virtual functions it points to appear to have appropriate
permissions (i.e. non-writable, and maybe executable), which will generally
exclude heap pointers.

Only enabled for Linux; this hasn't been tested on FreeBSD, and vtables are
writable on Mac (PR24782) so this won't work there.

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

llvm-svn: 247484

9 years ago[MC] Fix style bugs introduced in r247471. Reported by Rafael Espindola.
Davide Italiano [Fri, 11 Sep 2015 22:04:21 +0000 (22:04 +0000)]
[MC] Fix style bugs introduced in r247471. Reported by Rafael Espindola.

llvm-svn: 247483

9 years agoWhen comparing two block captures for layout, don't crash
John McCall [Fri, 11 Sep 2015 22:00:51 +0000 (22:00 +0000)]
When comparing two block captures for layout, don't crash
if they have the same alignment and one was 'this'.

Fixes PR24780.

llvm-svn: 247482

9 years agoFix handling of _start being undefined.
Rafael Espindola [Fri, 11 Sep 2015 21:44:55 +0000 (21:44 +0000)]
Fix handling of _start being undefined.

We were crashing before.

llvm-svn: 247481

9 years agoMerge TempScop into Scop
Michael Kruse [Fri, 11 Sep 2015 21:41:48 +0000 (21:41 +0000)]
Merge TempScop into Scop

Summary:
TempScop is basically a holder for AccFuncMap, the dictionary from BasicBlocks to IRAccess lists. We move the list into polly::Scop and remove the polly::TempScop class.

There is one small change in behavior: If ScopInfo finds that its AssumedContext is impossible, it bails out by deleting the Scop object. The TempScop::print (invoked with opt -polly-scops -analyze) cannot print the AccFuncMap anymore as it would with a separate TempScop.

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

llvm-svn: 247480

9 years agoFix a thinko causing test logs for crashes to not get written.
Zachary Turner [Fri, 11 Sep 2015 21:27:37 +0000 (21:27 +0000)]
Fix a thinko causing test logs for crashes to not get written.

llvm-svn: 247479

9 years agoFix a copy and paste error. Sorry about that.
Rafael Espindola [Fri, 11 Sep 2015 21:26:42 +0000 (21:26 +0000)]
Fix a copy and paste error. Sorry about that.

llvm-svn: 247478

9 years agoLet selector-expr-lvalue.mm actually test something.
Nico Weber [Fri, 11 Sep 2015 21:24:40 +0000 (21:24 +0000)]
Let selector-expr-lvalue.mm actually test something.

I accidentally introduced a bug locally, and noticed that none of the tests
caught it. No longer!

llvm-svn: 247477

9 years ago[Static Analyzer] Properly cash the configuration option for lambda support.
Gabor Horvath [Fri, 11 Sep 2015 21:19:39 +0000 (21:19 +0000)]
[Static Analyzer] Properly cash the configuration option for lambda support.

llvm-svn: 247476

9 years agoImplement -rpath.
Rafael Espindola [Fri, 11 Sep 2015 21:18:56 +0000 (21:18 +0000)]
Implement -rpath.

llvm-svn: 247475

9 years ago[Shave]: pass -isystem dirs and "-Wa," args to moviAsm
Douglas Katzman [Fri, 11 Sep 2015 21:13:46 +0000 (21:13 +0000)]
[Shave]: pass -isystem dirs and "-Wa," args to moviAsm

llvm-svn: 247474

9 years agoSpecify target triple in alwaysinline tests.
Evgeniy Stepanov [Fri, 11 Sep 2015 21:10:12 +0000 (21:10 +0000)]
Specify target triple in alwaysinline tests.

This should fix the tests on Windows (failing due to mangling differencies).

llvm-svn: 247473

9 years agoSimplify logic introduced in r247464.
David Majnemer [Fri, 11 Sep 2015 20:55:29 +0000 (20:55 +0000)]
Simplify logic introduced in r247464.

llvm-svn: 247472

9 years ago[MC] Don't crash on division by zero.
Davide Italiano [Fri, 11 Sep 2015 20:47:35 +0000 (20:47 +0000)]
[MC] Don't crash on division by zero.

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

llvm-svn: 247471

9 years agoIntrospect llvm-config --assertion-mode in cmake out-of-tree builds
Michael Kruse [Fri, 11 Sep 2015 20:47:14 +0000 (20:47 +0000)]
Introspect llvm-config --assertion-mode in cmake out-of-tree builds

When compiling Polly without LLVM sources but with system-installed
LLVM, the build process would not honor the LLVM_ENABLE_ASSERTIONS
setting LLVM was compiled with, but effectively assume that it is
switched off when compiling. During unit-tests llvm-lit would still
query the LLVM_ENABLE_ASSERTIONS flag and enable tests which require
assertions. Even if enabled for LLVM, Polly does not output its debug
info and statistics in this this mode such that 7 tests fail.

To fix, we query llvm-config --assertion-mode and if on, enable
assertions as HandleLLVMOptions.cmake would do.

We cannot reliably use HandleLLVMOptions.cmake itself as the host's
LLVM build might have been built using automake and distributions
change file locations (e.g. Debian to
/usr/share/llvm-${VERSION}/cmake/HandleLLVMOptions.cmake).

llvm-svn: 247470

9 years agoAdd missed import lldbtest.
Oleksiy Vyalov [Fri, 11 Sep 2015 20:46:46 +0000 (20:46 +0000)]
Add missed import lldbtest.

llvm-svn: 247469

9 years ago[tooling] In CompileCommand, Expose the 'file' that was associated with the command.
Argyrios Kyrtzidis [Fri, 11 Sep 2015 20:43:05 +0000 (20:43 +0000)]
[tooling] In CompileCommand, Expose the 'file' that was associated with the command.

llvm-svn: 247468

9 years ago[CMake] [Darwin] Add support for building bootstrap builds with -flto
Chris Bieneman [Fri, 11 Sep 2015 20:42:57 +0000 (20:42 +0000)]
[CMake] [Darwin] Add support for building bootstrap builds with -flto

When building with LTO the bootstrap builds need to depend on libLTO, llvm-ar, and llvm-ranlib, which all need to be passed into the bootstrap build. This functionality only works on Darwin.

llvm-svn: 247467

9 years ago[analyzer] Improve behavior if Clang not found.
Anton Yartsev [Fri, 11 Sep 2015 20:41:09 +0000 (20:41 +0000)]
[analyzer] Improve behavior if Clang not found.

- Eliminate 'No such file or directory at scan-build line ...' error if '$RealBin/bin/clang' or '$RealBin/clang' directory does not exist.
- Eliminate 'Use of uninitialized value $Clang in concatenation (.) or string at scan-build line ...' error if help is displayed while $Clang was not found.

llvm-svn: 247466

9 years agoAlways_inline codegen rewrite.
Evgeniy Stepanov [Fri, 11 Sep 2015 20:29:07 +0000 (20:29 +0000)]
Always_inline codegen rewrite.

Current implementation may end up emitting an undefined reference for
an "inline __attribute__((always_inline))" function by generating an
"available_externally alwaysinline" IR function for it and then failing to
inline all the calls. This happens when a call to such function is in dead
code. As the inliner is an SCC pass, it does not process dead code.

Libc++ relies on the compiler never emitting such undefined reference.

With this patch, we emit a pair of
1. internal alwaysinline definition (called F.alwaysinline)
2a. A stub F() { musttail call F.alwaysinline }
  -- or, depending on the linkage --
2b. A declaration of F.

The frontend ensures that F.inlinefunction is only used for direct
calls, and the stub is used for everything else (taking the address of
the function, really). Declaration (2b) is emitted in the case when
"inline" is meant for inlining only (like __gnu_inline__ and some
other cases).

This approach, among other nice properties, ensures that alwaysinline
functions are always internal, making it impossible for a direct call
to such function to produce an undefined symbol reference.

This patch is based on ideas by Chandler Carruth and Richard Smith.

llvm-svn: 247465

9 years ago[MS ABI] Select an inheritance model in template arguments
David Majnemer [Fri, 11 Sep 2015 20:18:09 +0000 (20:18 +0000)]
[MS ABI] Select an inheritance model in template arguments

We used to only select an inheritance model if the pointer to member was
nullptr.  Instead, select a model regardless of the member pointer's
value.

N.B.  This bug was exposed by making member pointers report true for
isIncompleteType but has been latent since the member pointer scheme's
inception.

llvm-svn: 247464

9 years ago[analyzer] Add -analyzer-config option for function size the inliner considers as...
Devin Coughlin [Fri, 11 Sep 2015 20:14:05 +0000 (20:14 +0000)]
[analyzer] Add -analyzer-config option for function size the inliner considers as large

Add an option (-analyzer-config min-blocks-for-inline-large=14) to control the function
size the inliner considers as large, in relation to "max-times-inline-large". The option
defaults to the original hard coded behaviour, which I believe should be adjustable with
the other inlining settings.

The analyzer-config test has been modified so that the analyzer will reach the
getMinBlocksForInlineLarge() method and store the result in the ConfigTable, to ensure it
is dumped by the debug checker.

A patch by Sean Eveson!

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

llvm-svn: 247463

9 years ago[Edit] Fix issue with tracking what macro argument inputs have been edited.
Argyrios Kyrtzidis [Fri, 11 Sep 2015 20:09:11 +0000 (20:09 +0000)]
[Edit] Fix issue with tracking what macro argument inputs have been edited.

This was not working correctly, leading to erroneously rejecting valid edits.

llvm-svn: 247462

9 years agoAdd a non-exiting diagnostic handler for LTO.
Yunzhong Gao [Fri, 11 Sep 2015 20:01:53 +0000 (20:01 +0000)]
Add a non-exiting diagnostic handler for LTO.
This is in order to give LTO clients a chance to do some clean-up before
terminating the process.

llvm-svn: 247461

9 years agoXFAIL miscellaneous tests on windows.
Zachary Turner [Fri, 11 Sep 2015 20:01:24 +0000 (20:01 +0000)]
XFAIL miscellaneous tests on windows.

llvm.org/pr24778

llvm-svn: 247460

9 years agoXFAIL 2 breakpoint tests on Windows.
Zachary Turner [Fri, 11 Sep 2015 20:00:39 +0000 (20:00 +0000)]
XFAIL 2 breakpoint tests on Windows.

llvm.org/pr24777

llvm-svn: 247459

9 years agoXFAIL some more tests related to value api
Zachary Turner [Fri, 11 Sep 2015 20:00:25 +0000 (20:00 +0000)]
XFAIL some more tests related to value api

llvm.org/pr24772

llvm-svn: 247458

9 years agoXFAIL TestDisassembleBreakpoint.
Zachary Turner [Fri, 11 Sep 2015 20:00:09 +0000 (20:00 +0000)]
XFAIL TestDisassembleBreakpoint.

This is a trivial issue to fix, just marking it for later.
Windows prints function signatures a bit differently, and the
test expects a specific format.

llvm-svn: 247457

9 years agoXFAIL tests that try to call a function in the inferior.
Zachary Turner [Fri, 11 Sep 2015 20:00:00 +0000 (20:00 +0000)]
XFAIL tests that try to call a function in the inferior.

llvm.org/pr21765

llvm-svn: 247456

9 years agoXFAIL some C++ language specific tests on Windows.
Zachary Turner [Fri, 11 Sep 2015 19:59:39 +0000 (19:59 +0000)]
XFAIL some C++ language specific tests on Windows.

http://llvm.org/pr24764

llvm-svn: 247455

9 years agotypo; NFC
Sanjay Patel [Fri, 11 Sep 2015 19:29:18 +0000 (19:29 +0000)]
typo; NFC

llvm-svn: 247454

9 years agoDon't make assumptions about the size of the dynamic string table.
Rafael Espindola [Fri, 11 Sep 2015 19:12:37 +0000 (19:12 +0000)]
Don't make assumptions about the size of the dynamic string table.

It contains pathnames, so it can be different in each machine.

llvm-svn: 247453

9 years agoFix a small typo in ObjectFileELF.cpp.
Stephane Sezer [Fri, 11 Sep 2015 18:56:59 +0000 (18:56 +0000)]
Fix a small typo in ObjectFileELF.cpp.

llvm-svn: 247452

9 years agoRecord function attribute "stackrealign" instead of using backend option
Akira Hatanaka [Fri, 11 Sep 2015 18:55:09 +0000 (18:55 +0000)]
Record function attribute "stackrealign" instead of using backend option
-force-align-stack.

Also, make changes to the driver so that -mno-stack-realign is no longer
an option exposed to the end-user that disallows stack realignment in
the backend.

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

llvm-svn: 247451

9 years agoUse function attribute "stackrealign" to decide whether stack
Akira Hatanaka [Fri, 11 Sep 2015 18:54:38 +0000 (18:54 +0000)]
Use function attribute "stackrealign" to decide whether stack
realignment should be forced.

With this commit, we can now force stack realignment when doing LTO and
do so on a per-function basis. Also, add a new cl::opt option
"stackrealign" to CommandFlags.h which is used to force stack
realignment via llc's command line.

Out-of-tree projects currently using -force-align-stack to force stack
realignment should make changes to attach the attribute to the functions
in the IR.

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

llvm-svn: 247450

9 years agoFix a typo and make this test stricter.
Adrian Prantl [Fri, 11 Sep 2015 18:54:34 +0000 (18:54 +0000)]
Fix a typo and make this test stricter.

llvm-svn: 247449

9 years agoRemove an unnecessary check. NFC
Adrian Prantl [Fri, 11 Sep 2015 18:54:31 +0000 (18:54 +0000)]
Remove an unnecessary check. NFC

llvm-svn: 247448

9 years agoRemove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).
Adrian Prantl [Fri, 11 Sep 2015 18:54:28 +0000 (18:54 +0000)]
Remove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).

llvm-svn: 247447

9 years agoImplement the -dynamic-linker option.
Rafael Espindola [Fri, 11 Sep 2015 18:49:42 +0000 (18:49 +0000)]
Implement the -dynamic-linker option.

With this dynamic executables can be executed with just ./t instead of
/lib64/ld-2.20.so ./t

llvm-svn: 247446

9 years agoCleanup: Get rid of a bunch of unnecessary invocations of internString()
Adrian Prantl [Fri, 11 Sep 2015 18:45:02 +0000 (18:45 +0000)]
Cleanup: Get rid of a bunch of unnecessary invocations of internString()
in CGDebugInfo.cpp: MDString::get() copies its arguments.

llvm-svn: 247445

9 years ago[Static Analyzer] Fixed a typo in a diagnostic message.
Gabor Horvath [Fri, 11 Sep 2015 18:41:50 +0000 (18:41 +0000)]
[Static Analyzer] Fixed a typo in a diagnostic message.

llvm-svn: 247444

9 years ago[CMake] [Darwin] Need to set lto_library on CMAKE_MODULE_LINKER_FLAGS as well
Chris Bieneman [Fri, 11 Sep 2015 18:39:19 +0000 (18:39 +0000)]
[CMake] [Darwin] Need to set lto_library on CMAKE_MODULE_LINKER_FLAGS as well

This is a follow-on to r247308.

llvm-svn: 247443

9 years agoExtend the Token visualizer used by MSVC to display the identifier text for tok:...
Aaron Ballman [Fri, 11 Sep 2015 18:35:18 +0000 (18:35 +0000)]
Extend the Token visualizer used by MSVC to display the identifier text for tok::identifier tokens.

Patch by Mike Spertus.

llvm-svn: 247442

9 years agoFix some typos in comments
Tobias Grosser [Fri, 11 Sep 2015 18:26:59 +0000 (18:26 +0000)]
Fix some typos in comments

llvm-svn: 247441

9 years agoMake this test a bit more resistant to section number changes.
Rafael Espindola [Fri, 11 Sep 2015 17:53:01 +0000 (17:53 +0000)]
Make this test a bit more resistant to section number changes.

llvm-svn: 247439

9 years agoUse Itanium C++ ABI triple for new modules+debug test
Reid Kleckner [Fri, 11 Sep 2015 17:50:14 +0000 (17:50 +0000)]
Use Itanium C++ ABI triple for new modules+debug test

llvm-svn: 247438

9 years ago[test] Specify exception object type in two tests
Vedant Kumar [Fri, 11 Sep 2015 17:39:34 +0000 (17:39 +0000)]
[test] Specify exception object type in two tests

Replace:
    'try { throw 0; } catch (...)'
with
    'try { throw 0; } catch (int e)'

in two test cases.

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

llvm-svn: 247437