Commit Graph

242077 Commits

Author SHA1 Message Date
Sjoerd Meijer 520a18df9c Revert of r281304 as it is causing build bot failures in hexagon
hwloop regression tests. These tests pass locally; will be investigating
where these differences come from.

llvm-svn: 281306
2016-09-13 08:51:59 +00:00
Tobias Grosser a82c4b5df8 GPGPU: Allow region statements
llvm-svn: 281305
2016-09-13 08:42:10 +00:00
Sjoerd Meijer 05453991fe This adds a new field isAdd to MCInstrDesc. The ARM and Hexagon instruction
descriptions now tag add instructions, and the Hexagon backend is using this to
identify loop induction statements.

Patch by Sam Parker and Sjoerd Meijer.

Differential Revision: https://reviews.llvm.org/D23601

llvm-svn: 281304
2016-09-13 08:08:06 +00:00
Tobias Grosser b79f4d3970 GPGPU: Extend types when array sizes have smaller types
This prevents a compiler crash.

llvm-svn: 281303
2016-09-13 08:02:14 +00:00
Elena Demikhovsky b906df9fe5 AVX-512: Fix for PR28175 - Scalar code optimization.
Optimized (truncate (assertzext x) to i1) and anyext i1 to i8/16/32.
Optimization of this patterns is a one more step towards i1 optimization on AVX-512.

Differential Revision: https://reviews.llvm.org/D24456

llvm-svn: 281302
2016-09-13 07:57:00 +00:00
Diana Picus 4b97288184 [AArch64] Support stackmap/patchpoint in getInstSizeInBytes
We currently return 4 for stackmaps and patchpoints, which is very optimistic
and can in rare cases cause the branch relaxation pass to fail to relax certain
branches.

This patch causes getInstSizeInBytes to return a pessimistic estimate of the
size as the number of bytes requested in the stackmap/patchpoint. In the future,
we could provide a more accurate estimate by sharing some of the logic in
AArch64::LowerSTACKMAP/PATCHPOINT.

Fixes part of https://llvm.org/bugs/show_bug.cgi?id=28750

Differential Revision: https://reviews.llvm.org/D24073

llvm-svn: 281301
2016-09-13 07:45:17 +00:00
Craig Topper 4619c9e6a8 [X86] Remove masked shufpd/shufps intrinsics and autoupgrade to native vector shuffles. They were removed from clang previously but accidentally left in the backend.
llvm-svn: 281300
2016-09-13 07:40:53 +00:00
Craig Topper 3f029ae6e1 [X86] Remove some dead intrinsics. They aren't implemented and clang doesn't reference them.
llvm-svn: 281299
2016-09-13 07:40:48 +00:00
Nikola Smiljanic 98d2e59d72 Allow register variables in naked functions.
llvm-svn: 281298
2016-09-13 07:02:02 +00:00
Davide Italiano 11cfa45bec [Docs] Fix a broken link in the Kaleidoscope tutorial.
Patch by:	Alfred Perlstein <alfred@FreeBSD.org>

llvm-svn: 281297
2016-09-13 06:31:37 +00:00
Davide Italiano d0f70eb557 [LTO] Only expose the dataLayout string instead of the whole module.
Differential Revision:	https://reviews.llvm.org/D24494

llvm-svn: 281296
2016-09-13 06:29:17 +00:00
Tobias Grosser b51d507c74 Adapt test case to recent change in Global Variable Definition
llvm-svn: 281295
2016-09-13 05:19:26 +00:00
Stephen Hines 815e9bbdbd clang-format: Add Java detection to git-clang-format.
Summary: This change adds "java" to the list of known extensions that clang-format supports.

Patch by Luis Hector Chavez

Reviewers: djasper

Subscribers: srhines, cfe-commits

Differential Revision: https://reviews.llvm.org/D24401

llvm-svn: 281294
2016-09-13 05:00:20 +00:00
Adam Nemet 1eea3e577d Reapply r281276 with passing -emit-llvm in one of the tests
Original commit message:

Add -fdiagnostics-show-hotness

Summary:
I've recently added the ability for optimization remarks to include the
hotness of the corresponding code region.  This uses PGO and allows
filtering of the optimization remarks by relevance.  The idea was first
discussed here:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334

The general goal is to produce a YAML file with the remarks.  Then, an
external tool could dynamically filter these by hotness and perhaps by
other things.

That said it makes sense to also expose this at the more basic level
where we just include the hotness info with each optimization remark.
For example, in D22694, the clang flag was pretty useful to measure the
overhead of the additional analyses required to include hotness.
(Without the flag we don't even run the analyses.)

For the record, Hal has already expressed support for the idea of this
patch on IRC.

Differential Revision: https://reviews.llvm.org/D23284

llvm-svn: 281293
2016-09-13 04:32:40 +00:00
Zachary Turner d97d5a2cee Revert "[Support][CommandLine] Add cl::getRegisteredSubcommands()"
This reverts r281290, as it breaks unit tests.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/303

llvm-svn: 281292
2016-09-13 04:11:57 +00:00
Jason Molenda e1489bde3b Reduce the number of simultaneous debug sessions to 10 and remove
the expectedFlakeyDarwin annotation.

I've been running this test in isolation on my macOS Sierra system
and haven't seen a failure in 20-30 runs.  The number of simultaneous
debug sessions that it spins up could be a problem when the testbots
are running under load, so I'm reducing this from 20 simultaneous
debug sessions to see if we can get enough stability to leave this
enabled.

llvm-svn: 281291
2016-09-13 02:45:45 +00:00
Dean Michael Berris d9d290c0c6 [Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
	// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24489

llvm-svn: 281290
2016-09-13 02:35:00 +00:00
Davide Italiano b69efb9e8d [lib/LTO] Expose getModule() in lto::InputFile.
lld will use this to get the datalayout string and emit a
diagnostic if empty.

llvm-svn: 281289
2016-09-13 02:22:02 +00:00
Jim Ingham 1a81b27378 Add a few const's (thanks Zachary) and return shared or unique pointers
in places where they help prevent leaks.

llvm-svn: 281288
2016-09-13 01:58:08 +00:00
Richard Trieu f3b7766266 Handle empty message in static_asserts.
llvm-svn: 281287
2016-09-13 01:37:01 +00:00
Richard Trieu ffa532d7a1 Fix interaction between serialization and c++1z feature.
In c++1z, static_assert is not required to have a StringLiteral message, where
previously it was required.  Update the AST Reader to be able to handle a
null StringLiteral.

llvm-svn: 281286
2016-09-13 01:20:40 +00:00
Peter Collingbourne eeb56abe64 Update Clang for D20147 ("DebugInfo: New metadata representation for global variables.")
Differential Revision: http://reviews.llvm.org/D20415

llvm-svn: 281285
2016-09-13 01:13:19 +00:00
Peter Collingbourne d4135bbc30 DebugInfo: New metadata representation for global variables.
This patch reverses the edge from DIGlobalVariable to GlobalVariable.
This will allow us to more easily preserve debug info metadata when
manipulating global variables.

Fixes PR30362. A program for upgrading test cases is attached to that
bug.

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

llvm-svn: 281284
2016-09-13 01:12:59 +00:00
Michael Kuperstein efc0667583 [DAG] Refactor BUILD_VECTOR combine to make it easier to extend. NFCI.
This should make it easier to add cases that we currently don't cover,
like supporting more kinds of type mismatches and more than 2 input vectors.

llvm-svn: 281283
2016-09-13 00:57:43 +00:00
Enrico Granata b82825b6d5 Fix an issue where LLDB was not masking enough bits off of objc classes data() pointers, effectively rendering us unable to generate descriptors for some classes
Fixes rdar://27758358

llvm-svn: 281282
2016-09-13 00:22:49 +00:00
Hans Wennborg 8a42d4b9cc X86: Conditional tail calls should not have isBarrier = 1
That confuses e.g. machine basic block placement, which then doesn't
realize that control can fall through a block that ends with a conditional
tail call. Instead, isBranch=1 should be set.

Also, mark EFLAGS as used by these instructions.

llvm-svn: 281281
2016-09-13 00:21:32 +00:00
Eric Christopher 04c7db31e8 Temporarily Revert "[MC] Defer asm errors to post-statement failure" as it's causing errors on the sanitizer bots.
This reverts commit r281249.

llvm-svn: 281280
2016-09-13 00:19:29 +00:00
Adam Nemet f2b6883ac8 Revert "Add -fdiagnostics-show-hotness"
This reverts commit r281276.

Many bots are failing.

llvm-svn: 281279
2016-09-13 00:16:49 +00:00
Reid Kleckner 6c7b1c6212 [DebugInfo] Deduplicate debug info limiting logic
We should be doing the same checks when a type is completed as we do
when a complete type is used during emission. Previously, we duplicated
the logic, and it got out of sync. This could be observed with
dllimported classes.

Also reduce a test case for this slightly.

Implementing review feedback from David Blaikie on r281057.

llvm-svn: 281278
2016-09-13 00:01:23 +00:00
George Burgess IV f8f6324983 [Sema] Fix PR30346: relax __builtin_object_size checks.
This patch makes us act more conservatively when trying to determine
the objectsize for an array at the end of an object. This is in
response to code like the following:

```
struct sockaddr {
  /* snip */
  char sa_data[14];
};

void foo(const char *s) {
  size_t slen = strlen(s) + 1;
  size_t added_len = slen <= 14 ? 0 : slen - 14;
  struct sockaddr *sa = malloc(sizeof(struct sockaddr) + added_len);
  strcpy(sa->sa_data, s);
  // ...
}
```

`__builtin_object_size(sa->sa_data, 1)` would return 14, when there
could be more than 14 bytes at `sa->sa_data`.

Code like this is apparently not uncommon. FreeBSD's manual even
explicitly mentions this pattern:
https://www.freebsd.org/doc/en/books/developers-handbook/sockets-essential-functions.html
(section 7.5.1.1.2).

In light of this, we now just give up on any array at the end of an
object if we can't find the object's initial allocation.

I lack numbers for how much more conservative we actually become as a
result of this change, so I chose the fix that would make us as
compatible with GCC as possible. If we want to be more aggressive, I'm
happy to consider some kind of whitelist or something instead.

llvm-svn: 281277
2016-09-12 23:50:35 +00:00
Adam Nemet a340eff335 Add -fdiagnostics-show-hotness
Summary:
I've recently added the ability for optimization remarks to include the
hotness of the corresponding code region.  This uses PGO and allows
filtering of the optimization remarks by relevance.  The idea was first
discussed here:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334

The general goal is to produce a YAML file with the remarks.  Then, an
external tool could dynamically filter these by hotness and perhaps by
other things.

That said it makes sense to also expose this at the more basic level
where we just include the hotness info with each optimization remark.
For example, in D22694, the clang flag was pretty useful to measure the
overhead of the additional analyses required to include hotness.
(Without the flag we don't even run the analyses.)

For the record, Hal has already expressed support for the idea of this
patch on IRC.

Differential Revision: https://reviews.llvm.org/D23284

llvm-svn: 281276
2016-09-12 23:48:16 +00:00
Adam Nemet d2a4da09ad Fix a long comment line
llvm-svn: 281275
2016-09-12 23:48:11 +00:00
Adam Nemet fd84f48f9f [OptDiag] Add getHotness accessor
llvm-svn: 281274
2016-09-12 23:46:34 +00:00
Jim Ingham e14dc26857 This is the main part of a change to add breakpoint save and restore to lldb.
Still to come:
1) SB API's
2) Testcases
3) Loose ends:
   a) serialize Thread options
   b) serialize Exception resolvers
4) "break list --file" should list breakpoints contained in a file and
   "break read -f 1 3 5" should then read in only those breakpoints.

<rdar://problem/12611863>

llvm-svn: 281273
2016-09-12 23:10:56 +00:00
Philip Reames 9db7948e90 [LVI] Complete the abstract of the cache layer [NFCI]
Convert the previous introduced is-a relationship between the LVICache and LVIImple clases into a has-a relationship and hide all the implementation details of the cache from the lazy query layer.

The only slightly concerning change here is removing the addition of a queried block into the SeenBlock set in LVIImpl::getBlockValue.  As far as I can tell, this was effectively dead code.  I think it *used* to be the case that getCachedValueInfo wasn't const and might end up inserting elements in the cache during lookup.  That's no longer true and hasn't been for a while.  I did fixup the const usage to make that more obvious.

llvm-svn: 281272
2016-09-12 22:38:44 +00:00
Chris Bieneman 5a805df1a5 [CMake] Fix linker-as-ld to symlink instead of copy lld
Summary: This test fails if you're building with BUILD_SHARED_LIBS because the LLVM libraries are found via @rpath. Symlinking instead of copying should be sufficiently robust for the test case.

Reviewers: llvm-commits

Subscribers: davide

Differential Revision: https://reviews.llvm.org/D24476

llvm-svn: 281271
2016-09-12 22:38:43 +00:00
Sanjay Patel ff00fae8e6 add more tests for PR30273
llvm-svn: 281270
2016-09-12 22:28:29 +00:00
Lang Hames a506d50744 [ORC] Clang-format RPCSerialization.h.
llvm-svn: 281269
2016-09-12 22:05:14 +00:00
Lang Hames c83e39b9e2 [ORC] Add some more documentation to RPCSerialization.h.
llvm-svn: 281268
2016-09-12 22:05:12 +00:00
Philip Reames b627aec407 [LVI] Sink a couple more cache manipulation routines into the cache itself [NFCI]
The only interesting bit here is the refactor of the handle callback and even that's pretty straight-forward.

llvm-svn: 281267
2016-09-12 22:03:36 +00:00
Philip Reames 92e5e1b92d [LVI] Abstract out the actual cache logic [NFCI]
Seperate the caching logic from the implementation of the lazy analysis.  For the moment, the lazy analysis impl has a is-a relationship with the cache; this will change to a has-a relationship shortly.  This was done as two steps merely to keep the changes simple and the diff understandable.

llvm-svn: 281266
2016-09-12 21:46:58 +00:00
Rui Ueyama 0eb2a1bd7a Add comments.
llvm-svn: 281265
2016-09-12 21:44:29 +00:00
Shoaib Meenai 7afc8fa44c config: Use _LIBCPP_TYPE_VIS_ONLY with enum class
An enum class has associated type info. In the Microsoft ABI, type info
is emitted in the COMDAT section and isn't exported, so clang rightfully
complains about __declspec(dllexport) being unused for an enum class.
On other platforms, we still want to export the type info.

Differential Revision: https://reviews.llvm.org/D24065

llvm-svn: 281264
2016-09-12 21:41:12 +00:00
Nico Weber 7c31d0ebc0 Revert r281215, it caused PR30358.
llvm-svn: 281263
2016-09-12 21:40:50 +00:00
Nico Weber 8ad01c303e attempt to unbreak build after r281254
llvm-svn: 281262
2016-09-12 21:15:44 +00:00
Saleem Abdulrasool 62c07eb2fa CodeGen: use some range-based for loops
Use range-based for loops to simplify the logic.  Add an explicit check for
MachO as the inline asm uses MachO specific directives.

llvm-svn: 281261
2016-09-12 21:15:23 +00:00
Davide Italiano f6c1d2c158 [MachO] Factor out a fair amount of duplicated code. NFCI.
llvm-svn: 281260
2016-09-12 21:07:26 +00:00
Richard Smith 7707c4a109 Add a couple of test files missed in r281258.
llvm-svn: 281259
2016-09-12 21:07:09 +00:00
Richard Smith 6561f92b62 [modules] When we merge two definitions of a function, mark the retained
definition as visible in the discarded definition's module, as we do for
other kinds of definition.

llvm-svn: 281258
2016-09-12 21:06:40 +00:00
Lang Hames 2f98f31c77 [ORC] Add missing <thread> header to RPCSerialization.h.
llvm-svn: 281257
2016-09-12 20:45:01 +00:00