Commit Graph

246321 Commits

Author SHA1 Message Date
Akira Hatanaka 43556c14fe [Sema] Avoid instantiating templates only when UncompilableErrorOccurred
and FatalErrorOccurred are both set.

This fixes a crash that occurs when a warning promoted to a fatal error
leaves the AST in an incomplete state, and then later CFG analysis is
run on the incomplete AST.

rdar://problem/28558923

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

llvm-svn: 285923
2016-11-03 15:04:58 +00:00
Rafael Espindola 212b93d816 Delete dead code.
llvm-svn: 285922
2016-11-03 15:01:12 +00:00
Rafael Espindola a3008d2c17 Return existing error code.
Should fix the -Werror bots.

llvm-svn: 285921
2016-11-03 14:53:25 +00:00
Rafael Espindola 714c2959e6 Move a free function out of ELFFile.
llvm-svn: 285920
2016-11-03 14:41:17 +00:00
Alexander Timofeev f867a40bf6 [AMDGPU][CodeGen] To improve CGEMM performance: combine LDS reads.
hange explores the fact that LDS reads may be reordered even if access
the same location.

Prior the change, algorithm immediately stops as soon as any memory
access encountered between loads that are expected to be merged
together. Although, Read-After-Read conflict cannot affect execution
correctness.

Improves hcBLAS CGEMM manually loop-unrolled kernels performance by 44%.
Also improvement expected on any massive sequences of reads from LDS.

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

llvm-svn: 285919
2016-11-03 14:37:13 +00:00
Rafael Espindola 73aba6229f Use the getSectionIndex from llvm.
llvm-svn: 285918
2016-11-03 14:26:25 +00:00
Zvi Rackover a455864fdf Refactor creation of X86ISD::SETCC nodes to a helper function. NFC.
llvm-svn: 285917
2016-11-03 14:25:24 +00:00
Nicolai Haehnle bea772c6dc DAGCombiner: fix use-after-free when merging consecutive stores
Summary:
Have MergeConsecutiveStores explicitly return information about the stores
that were merged, so that we can safely determine whether the starting
node has been freed.

Reviewers: chandlerc, bogner, niravd

Subscribers: llvm-commits

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

llvm-svn: 285916
2016-11-03 14:25:04 +00:00
Rafael Espindola f75d9d5863 Split out a getSectionIndex.
That code is currently duplicated in lld.

llvm-svn: 285915
2016-11-03 14:24:53 +00:00
Rafael Espindola cc728b41b6 Use existing ELFObj function. NFC.
llvm-svn: 285913
2016-11-03 14:17:53 +00:00
James Molloy e7d97368f2 Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"
This reverts commit r285893. It caused (probably) http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/83 .

llvm-svn: 285912
2016-11-03 14:08:01 +00:00
Rafael Espindola 382200abb7 Update for llvm change.
llvm-svn: 285911
2016-11-03 13:58:26 +00:00
Rafael Espindola 7b2750afa5 replace a report_fatal_error with a ErrorOr.
llvm-svn: 285910
2016-11-03 13:58:15 +00:00
Jonathan Coe dad22c7cf0 Support for Python 3 in libclang python bindings
Summary:
Python bindings tests now pass in Python 3.

`map` in Python 3 is lazily evaluated so the method by which functions are registered needed updating.

Strings are unicode in Python 3 not UTF-8, I've tried to create an new c_types-like class (c_string_p) to automate the conversion.

String conversions made explicit where required.

Reviewers: eliben, nemanjai, skalinichev, compnerd

Subscribers: mgorny, cfe-commits

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

llvm-svn: 285909
2016-11-03 13:55:34 +00:00
John Brawn ec1bce853c [CMake] Make CMAKE_INSTALL_RPATH work again
r285714 made it so that when CMAKE_INSTALL_RPATH is set _install_rpath is not
set, but that means INSTALL_RPATH gets set to an empty string which isn't what
we want. Fix this by setting INSTALL_RPATH only when _install_rpath is set.

llvm-svn: 285908
2016-11-03 13:55:04 +00:00
Jonathan Coe 89f12c0c50 [clang-tidy] Ignore forward declarations without definitions in the same translation unit in readability-identifier-naming
Summary: This change ensures that forward declarations of classes are not considered for identifier naming checks within a translation unit.

Reviewers: alexfh, aaron.ballman

Subscribers: mgehre

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

llvm-svn: 285907
2016-11-03 13:52:09 +00:00
Rafael Espindola dd6abaad75 Update for llvm change.
llvm-svn: 285906
2016-11-03 13:43:51 +00:00
Rafael Espindola 9ea68341b9 Replace a report_fatal_error with an ErrorOr.
llvm-svn: 285905
2016-11-03 13:43:30 +00:00
Rafael Espindola 6d18d388c5 Pass the section table around instead of recomputing it.
llvm-svn: 285904
2016-11-03 13:24:29 +00:00
Rafael Espindola 2a33cec3ec Split getStringTableForSymtab.
For use in cases where we already have the section table.

llvm-svn: 285903
2016-11-03 13:22:51 +00:00
Aidan Dodds 21fed052e0 [Renderscript] Add commands for scriptgroup interaction.
This commit hooks the nofity function that signals script group
compilation.  By tracking scriptgroups compiled at runtine, users
are able to place breakpoints by script group name.  Breakpoints
will be placed on the kernels forming the group.

llvm-svn: 285902
2016-11-03 13:20:37 +00:00
Malcolm Parsons 8b70e2631c [clang-tidy] Handle data() in readability-redundant-string-cstr
Summary:
std::string::data() and std::string::c_str() are equivalent.
Enhance the readability-redundant-string-cstr check to also handle
calls to data().

Reviewers: etienneb, alexfh, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 285901
2016-11-03 12:56:48 +00:00
George Rimar a705ab175d [ELF] - Accept both "-" and "--" for Ttext/Tdata/Tbss options.
llvm-svn: 285900
2016-11-03 12:49:25 +00:00
Malcolm Parsons 731ca0e8e0 Remove redundant calls to std::string::data()
Reviewers: aaron.ballman, mehdi_amini, dblaikie

Subscribers: klimek, cfe-commits

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

llvm-svn: 285899
2016-11-03 12:25:51 +00:00
Rafael Espindola 4fccc827cf Split getSHNDXTable in two.
Some clients already have the section table available.

llvm-svn: 285898
2016-11-03 12:23:41 +00:00
Rafael Espindola 84d6a17134 We already have the sections, pass them to getSHNDXTable.
llvm-svn: 285897
2016-11-03 12:21:00 +00:00
Peter Smith 2227c7f425 [ELF] Do not create interworking thunks for undefined weak references.
An undefined weak reference is given an address of 0 this will
incorrectly trigger the creation of a Thumb to ARM interworking Thunk
if there is a Thumb branch instruction to the symbol. This results in
an error as Thunks only make sense to defined or shared symbols.

We prevent this by detecting an undefined symbol and not creating a thunk
for it.

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

llvm-svn: 285896
2016-11-03 11:49:23 +00:00
Eugene Leviant db68845485 Use globMatch() instead of llvm::regex in linker scripts
This can speed up lld up to 5 times when linking applications 
with large number of sections and using linker script.

Differential revision: https://reviews.llvm.org/D26241

llvm-svn: 285895
2016-11-03 10:54:58 +00:00
Pavel Labath 3aa330f98a Link lldb-mi only to the llvm components it uses
Summary:
liblldb does not re-export the llvm library contained within, so lldb-mi needs to
manage its own dependencies. Right now it only uses the llvm support library.

Reviewers: beanz, zturner, tfiala, clayborg, abidh

Subscribers: ki.stfu, mgorny, lldb-commits

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

llvm-svn: 285894
2016-11-03 10:52:17 +00:00
James Molloy b60d8b1987 [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently
This recommits r281323, which was backed out for two reasons. One, a selfhost failure, and two, it apparently caused Chromium failures. Actually, the latter was a red herring. The log has expired from the former, but I suspect that was a red herring too (actually caused by another problematic patch of mine). Therefore reapplying, and will watch the bots like a hawk.

For the common pattern (CMPZ (AND x, #bitmask), #0), we can do some more efficient instruction selection if the bitmask is one consecutive sequence of set bits (32 - clz(bm) - ctz(bm) == popcount(bm)).

1) If the bitmask touches the LSB, then we can remove all the upper bits and set the flags by doing one LSLS.
2) If the bitmask touches the MSB, then we can remove all the lower bits and set the flags with one LSRS.
3) If the bitmask has popcount == 1 (only one set bit), we can shift that bit into the sign bit with one LSLS and change the condition query from NE/EQ to MI/PL (we could also implement this by shifting into the carry bit and branching on BCC/BCS).
4) Otherwise, we can emit a sequence of LSLS+LSRS to remove the upper and lower zero bits of the mask.

1-3 require only one 16-bit instruction and can elide the CMP. 4 requires two 16-bit instructions but can elide the CMP and doesn't require materializing a complex immediate, so is also a win.

llvm-svn: 285893
2016-11-03 10:18:20 +00:00
Pavel Labath 174c578bfe Fix Timer unit test
I did not take into account that the output of the Dump function will be
non-deterministic. Fix that by increasing of the times, this also makes the test
check that the dump function sorts the output.

llvm-svn: 285892
2016-11-03 10:07:47 +00:00
Pavel Labath bfa601f6b8 Remove TimeSpecTimeout class
the class is unused.

llvm-svn: 285891
2016-11-03 09:29:56 +00:00
Pavel Labath 96a3c91e66 Refactor Timer class
Summary:
While removing TimeValue from this class I noticed a lot of room for small
simplifications here. Main are:
  - instead of complicated start-stop dances to compute own time, each Timer
    just starts the timer once, and keeps track of the durations of child
    timers. Then the own time can be computed at the end by subtracting the two
    values.
  - remove double accounting in TimerStack - the stack object already knows the
    number of timers.
The interface does not lend itself well to unit testing, but I have added a
couple of tests which can (and did) catch any obvious errors.

Reviewers: tberghammer, clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 285890
2016-11-03 09:14:09 +00:00
Serge Pavlov 093876838d Reverted r285882 (Enhancement to test for -ast-print)
It broke buildbot on Windows.

llvm-svn: 285889
2016-11-03 08:58:44 +00:00
George Rimar 4d2aad9da6 [ELF] - Update after LLVM change (r285886)
llvm-svn: 285888
2016-11-03 08:42:52 +00:00
George Rimar 02334f6cdc [tools/obj2yaml] - Update after LLVM change r285886
llvm-svn: 285887
2016-11-03 08:41:46 +00:00
George Rimar e1924f06d1 [Object/ELF] - Make getSymbol() return Error.
That is consistent with other methods around
and helps to handle error on a caller side.

Differential revision: https://reviews.llvm.org/D26247

llvm-svn: 285886
2016-11-03 08:40:55 +00:00
Ravitheja Addepally 0f80cc84f0 Test for YMMRegisters.
Summary:
This patch contains test for reading YMM Registers. The test basically
contains an inferior that loads the ymm registers with a bit pattern
and the python test executes register read to check if the bit pattern
is correctly written in the registers. This test is repeated twice for
each register with a different pattern for better sanity.

Reviewers: tberghammer, zturner, clayborg

Subscribers: tberghammer, danalbert, srhines

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

llvm-svn: 285885
2016-11-03 08:35:55 +00:00
George Rimar db37e5b5c2 [ELF] - Removed unused method declaration. NFC.
llvm-svn: 285884
2016-11-03 08:20:57 +00:00
Olivier Goffart 3cd1013739 Fix heuristics skipping invalid ctor-initializers with C++11
Use better heuristics to detect if a '{' might be the start of the constructor body
or not. Especially when there is a completion token.

Fix the test 'test/CodeCompletion/ctor-initializer.cpp ' when clang defaults to c++11

The problem was is how we recover invalid code in the ctor-init part as we skip the
function body. In particular, we want to know if a '{' is the begining of the body.
In C++03, we always consider it as the beginng of the body. The problem was that in
C++11, it may be the start of an initializer, so we skip over it, causing further
parse errors later. (It is important that we are able to parse correctly the rest
of the class definition, to know what are the class member, for example)

This commit is improving the heuristics to decide if the '{' is starting a function
body. The rules are the following: If we are not in a template argument, and that the
previous tokens are not an identifier, or a >, then it is much more likely to be the
function body. We verify that further by checking the token after the matching '}'

The commit also fix the behavior when there is a code_completion token in the
ctor-initializers.

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

llvm-svn: 285883
2016-11-03 07:36:17 +00:00
Serge Pavlov 459d409358 Enhancement to test for -ast-print
Present tests for the functionality provided by command lime option
`-ast-print` check only absence of crash. This change tries to make
testing better, - the output produced by the compiler is compiled again
with option `-print-ast` and both outputs are compared. Such test at
least checks that the output is valid code. This change fixes only the
test for pure C.

llvm-svn: 285882
2016-11-03 07:32:02 +00:00
Jonas Hahnfeld 277a09d9fa [CMake] Disable rpath for UnitTests
This was broken since rL285714.

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

llvm-svn: 285881
2016-11-03 06:58:16 +00:00
Vedant Kumar e03e5953f6 [Sema] Remove a dead assignment, NFC.
The assignment to NextIsDereference is either followed by (1) another,
unrelated assignment to NextIsDereference or by (2) an early loop exit.

Found by clang's static analyzer: http://llvm.org/reports/scan-build

(While we're at it fix a typo.)

llvm-svn: 285879
2016-11-03 06:35:16 +00:00
Craig Topper 7b9cc1474f [AVX-512] Use 'vnot' instead of 'not' in patterns involving vXi1 vectors.
This fixes selection of KANDN instructions and allows us to remove an extra set of patterns for KNOT and KXNOR.

Reviewers: delena, igorb

Subscribers: llvm-commits

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

llvm-svn: 285878
2016-11-03 06:04:28 +00:00
Elena Demikhovsky caaceef4b3 Expandload and Compressstore intrinsics
2 new intrinsics covering AVX-512 compress/expand functionality.
This implementation includes syntax, DAG builder, operation lowering and tests.
Does not include: handling of illegal data types, codegen prepare pass and the cost model.

llvm-svn: 285876
2016-11-03 03:23:55 +00:00
Rafael Espindola 7c7abafd81 Pass the sections to getShtGroupSignature.
This avoids fetching it again from the object.

llvm-svn: 285875
2016-11-03 02:28:13 +00:00
Rafael Espindola 203ff0d3c9 Split getSection in two.
This will allow avoiding repeated error checking in a few cases.

llvm-svn: 285874
2016-11-03 02:24:59 +00:00
George Burgess IV 70d15b36e5 [CodeGen] Use StringRef. NFC.
Looks like CurFn's name outlives FunctionName, so we can just pass
StringRefs around rather than going from a StringRef to a std::string
to a const char* to a StringRef.

llvm-svn: 285873
2016-11-03 02:21:43 +00:00
Eric Fiselier e4e9e281a1 [Sema] Allow static_cast<T&&>(e) to check explicit conversions for non-reference-related types.
Summary:
[expr.cast.static] states:
> 3. A glvalue of type “cv1 T1” can be cast to type “rvalue reference to cv2 T2” if “cv2 T2” is reference-compatible
> with “cv1 T1”. The result refers to the object or the specified base class subobject thereof. If T2 is
> an inaccessible or ambiguous base class of T1, a program that necessitates such a cast is
> ill-formed.
> 
> 4. Otherwise, an expression e can be explicitly converted to a type T using a static_cast of the form static_-
> cast<T>(e) if the declaration T t(e); is well-formed, for some invented temporary variable t. [...]

Currently when checking p3 Clang will diagnose `static_cast<T&&>(e)` as invalid if the argument is not reference compatible with `T`. However I believe the correct behavior is to also check p4 in those cases.  For example:

```
double y = 42;
static_cast<int&&>(y); // this should be OK.  'int&& t(y)' is well formed
```

Note that we still don't check p4 for non-reference-compatible types which are reference-related since  `T&& t(e);` should never be well formed in those cases.


Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 285872
2016-11-03 02:13:17 +00:00
Teresa Johnson 0515fb8d4b [ThinLTO] Handle distributed backend case when doing renaming
Summary:
The recent change I made to consult the summary when deciding whether to
rename (to handle inline asm) in r285513 broke the distributed build
case. In a distributed backend we will only have a portion of the
combined index, specifically for imported modules we only have the
summaries for any imported definitions. When renaming on import we were
asserting because no summary entry was found for a local reference being
linked in (def wasn't imported).

We only need to consult the summary for a renaming decision for the
exporting module. For imports, we would have prevented importing any
references to NoRename values already.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 285871
2016-11-03 01:07:16 +00:00