George Rimar [Tue, 16 May 2017 10:04:42 +0000 (10:04 +0000)]
[ELF] - Detemplate access to SymTab, DynSymTab, GnuHashTab. NFC.
Follow up for r303150.
llvm-svn: 303153
James Henderson [Tue, 16 May 2017 09:43:21 +0000 (09:43 +0000)]
[LTO] Print time-passes information at conclusion of LTO codegen
The information collected when requested by -time-passes is only printed when
llvm_shutdown is called at the moment. This means that when linking against the LTO
library dynamically and using the C interface, it is not possible to see the timing
information, because llvm_shutdown cannot be called. This change modifies the LTO
code generation functions for both regular LTO and thin LTO to explicitly print and
reset the timing information.
I have tested that this works with our proprietary linker. However, as this relies
on a specific method of building and linking against the LTO library, I'm not sure
how or if this can be tested in the LLVM testsuite.
Reviewed by: mehdi_amini
Differential Revision: https://reviews.llvm.org/D32803
llvm-svn: 303152
Ilya Biryukov [Tue, 16 May 2017 09:38:59 +0000 (09:38 +0000)]
Restored r303067 and fixed failing test.
Summary:
This commit restores r303067(reverted by r303094) and fixes the 'formatting.test'
failure.
The failure is due to destructors of `ClangdLSPServer`'s fields(`FixItsMap` and
`FixItsMutex`) being called before destructor of `Server`. It led to the worker
thread calling `consumeDiagnostics` after `FixItsMutex` and `FixItsMap`
destructors were called.
Also, clangd is now run with '-run-synchronously' flag in 'formatting.test'.
Reviewers: bkramer, krasimir
Reviewed By: krasimir
Subscribers: mgorny, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D33233
llvm-svn: 303151
George Rimar [Tue, 16 May 2017 08:53:30 +0000 (08:53 +0000)]
[ELF] - Detemplate GnuHashTableSection and SymbolTableSection sections.
SymbolTableBaseSection was introduced.
Detemplation of SymbolTableSection should allow to detemplate more things.
Differential revision: https://reviews.llvm.org/D33124
llvm-svn: 303150
George Rimar [Tue, 16 May 2017 08:19:25 +0000 (08:19 +0000)]
[ELF] - Use llvm::to_integer() instead of StringRef::getAsInteger().
Switch to llvm::to_integer() everywhere in LLD instead of
StringRef::getAsInteger() because API of latter is confusing.
It returns true on error and false otherwise what makes reading
the code incomfortable.
Differential revision: https://reviews.llvm.org/D33187
llvm-svn: 303149
Max Kazantsev [Tue, 16 May 2017 07:27:06 +0000 (07:27 +0000)]
[SCEV] Fix sorting order for AddRecExprs
The existing sorting order in defined CompareSCEVComplexity sorts AddRecExprs
by loop depth, but does not pay attention to dominance of loops. This can
lead us to the following buggy situation:
for (...) { // loop1
op1 = {A,+,B}
}
for (...) { // loop2
op2 = {A,+,B}
S = add op1, op2
}
In this case there is no guarantee that in operand list of S the op2 comes
before op1 (loop depth is the same, so they will be sorted just
lexicographically), so we can incorrectly treat S as a recurrence of loop1,
which is wrong.
This patch changes the sorting logic so that it places the dominated recs
before the dominating recs. This ensures that when we pick the first recurrency
in the operands order, it will be the bottom-most in terms of domination tree.
The attached test set includes some tests that produce incorrect SCEV
estimations and crashes with oldlogic.
Reviewers: sanjoy, reames, apilipenko, anna
Reviewed By: sanjoy
Subscribers: llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D33121
llvm-svn: 303148
Craig Topper [Tue, 16 May 2017 07:05:38 +0000 (07:05 +0000)]
[CorrelatedValuePropagation] Don't use -> to call a static method of ConstantRange. NFC
llvm-svn: 303147
Jakub Kuderski [Tue, 16 May 2017 06:32:38 +0000 (06:32 +0000)]
[clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple calls
Summary:
This patch makes modernize-use-emplace remove unnecessary make_ calls from push_back calls and turn them into emplace_back -- the same way make_pair calls are handled.
Custom make_ calls can be removed for custom tuple-like types -- two new options that control that are `TupleTypes` and `TupleMakeFunctions`. By default, the check removes calls to `std::make_pair` and `std::make_tuple`.
Eq.
```
std::vector<std::tuple<int, char, bool>> v;
v.push_back(std::make_tuple(1, 'A', true)); // --> v.emplace_back(1, 'A', true);
```
Reviewers: alexfh, aaron.ballman, Prazek, hokein
Reviewed By: Prazek
Subscribers: JDevlieghere, xazax.hun, JonasToth, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D32690
llvm-svn: 303145
Daniel Berlin [Tue, 16 May 2017 06:06:15 +0000 (06:06 +0000)]
NewGVN: Use StoreExpression StoredValue instead of looking it up again, since it was already looked up when it was created
llvm-svn: 303144
Daniel Berlin [Tue, 16 May 2017 06:06:12 +0000 (06:06 +0000)]
NewGVN: Formatting fixes
llvm-svn: 303143
Davide Italiano [Tue, 16 May 2017 05:51:21 +0000 (05:51 +0000)]
Revert "[NewGVN] Replace predicate info leftovers."
It's breaking the bots.
llvm-svn: 303142
Davide Italiano [Tue, 16 May 2017 05:23:23 +0000 (05:23 +0000)]
[NewGVN] Replace predicate info leftovers.
Fixes PR32945.
Differential Revision: https://reviews.llvm.org/D33226
llvm-svn: 303141
Jakub Kuderski [Tue, 16 May 2017 05:07:40 +0000 (05:07 +0000)]
Revert "[clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple calls"
This reverts commit r303139. The commit made docs build emit a warning.
llvm-svn: 303140
Jakub Kuderski [Tue, 16 May 2017 04:25:42 +0000 (04:25 +0000)]
[clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple calls
Summary:
This patch makes modernize-use-emplace remove unnecessary make_ calls from push_back calls and turn them into emplace_back -- the same way make_pair calls are handled.
Custom make_ calls can be removed for custom tuple-like types -- two new options that control that are `TupleTypes` and `TupleMakeFunctions`. By default, the check removes calls to `std::make_pair` and `std::make_tuple`.
Eq.
```
std::vector<std::tuple<int, char, bool>> v;
v.push_back(std::make_tuple(1, 'A', true)); // --> v.emplace_back(1, 'A', true);
```
Reviewers: alexfh, aaron.ballman, Prazek, hokein
Reviewed By: Prazek
Subscribers: JDevlieghere, xazax.hun, JonasToth, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D32690
llvm-svn: 303139
Saleem Abdulrasool [Tue, 16 May 2017 04:17:12 +0000 (04:17 +0000)]
builtins: use reserved spelling (NFC)
llvm-svn: 303138
NAKAMURA Takumi [Tue, 16 May 2017 04:01:23 +0000 (04:01 +0000)]
AMDGPUCodeGen: Fix warnings in r303111. [-Wunused-variable]
llvm-svn: 303137
Vitaly Buka [Tue, 16 May 2017 02:06:15 +0000 (02:06 +0000)]
[tsan] Update tsan test for r303084
Tail duplication changed number of pop instruction, but TSAN performance was not
affected.
llvm-svn: 303136
Rui Ueyama [Tue, 16 May 2017 01:16:20 +0000 (01:16 +0000)]
Merge a test YAML file and a test file.
llvm-svn: 303135
Peter Collingbourne [Tue, 16 May 2017 00:39:01 +0000 (00:39 +0000)]
IR: Give function GlobalValue::getRealLinkageName() a less misleading name: dropLLVMManglingEscape().
This function gives the wrong answer on some non-ELF platforms in some
cases. The function that does the right thing lives in Mangler.h. To try to
discourage people from using this function, give it a different name.
Differential Revision: https://reviews.llvm.org/D33162
llvm-svn: 303134
Sanjay Patel [Mon, 15 May 2017 23:59:28 +0000 (23:59 +0000)]
[InstCombine] add tests for PR32791; NFC
llvm-svn: 303133
Kostya Serebryany [Mon, 15 May 2017 23:37:54 +0000 (23:37 +0000)]
[asan] make asan under sandboxes more robust
llvm-svn: 303132
Manoj Gupta [Mon, 15 May 2017 23:13:54 +0000 (23:13 +0000)]
Fix executable stack directive on Linux.
Summary: Use __linux__ to check for Linux and bring back the check for __GNU__.
Reviewers: echristo, krytarowski, compnerd, rengolin
Reviewed By: krytarowski
Subscribers: phosek, llvm-commits, srhines
Differential Revision: https://reviews.llvm.org/D33219
llvm-svn: 303131
Francis Visoiu Mistrih [Mon, 15 May 2017 23:13:35 +0000 (23:13 +0000)]
[ShrinkWrapping] Handle restores on no-return paths
Shrink-wrapping uses post-dominators to find a restore point that
post-dominates all the uses of CSR / stack.
The way dominator trees are modeled in LLVM today is that unreachable
blocks are not present in a generic dominator tree, so, an unreachable node is
dominated by anything: include/llvm/Support/GenericDomTree.h:467.
Since for post-dominators, a no-return block is considered
"unreachable", calling findNearestCommonDominator on an unreachable node
A and a non-unreachable node B, will return B, which can be false. If we
find such node, we bail out since there is no good restore point
available.
rdar://problem/
30186931
llvm-svn: 303130
Alex Shlyapnikov [Mon, 15 May 2017 23:11:01 +0000 (23:11 +0000)]
[lsan] Report the missing linker only when the linker is actually missing.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33218
llvm-svn: 303129
Kostya Serebryany [Mon, 15 May 2017 22:55:00 +0000 (22:55 +0000)]
[libFuzzer] fix tests on Windows
llvm-svn: 303128
Sanjay Patel [Mon, 15 May 2017 22:54:37 +0000 (22:54 +0000)]
[InstSimplify] add tests for unnecessary mask of shifted values; NFC
llvm-svn: 303127
Xinliang David Li [Mon, 15 May 2017 22:43:52 +0000 (22:43 +0000)]
Fix memory leak
llvm-svn: 303126
Kostya Serebryany [Mon, 15 May 2017 22:38:29 +0000 (22:38 +0000)]
[libFuzzer] improve the afl driver and it's tests. Make it possible to run individual inputs with afl driver
llvm-svn: 303125
Rui Ueyama [Mon, 15 May 2017 22:32:34 +0000 (22:32 +0000)]
Fix git command line in the Getting Started guide.
By default, git creates "llvm-project-
20170507" directory,
but we want to create "llvm-project" directory.
llvm-svn: 303124
Justin Bogner [Mon, 15 May 2017 22:15:22 +0000 (22:15 +0000)]
Add "REQUIRES:" to the last few tests that use target specific intrinsics
llvm-svn: 303123
Davide Italiano [Mon, 15 May 2017 22:10:15 +0000 (22:10 +0000)]
[AMDGPU] Kill now unused phiInfoElementGetDebugLoc(). NFCI.
llvm-svn: 303122
Vitaly Buka [Mon, 15 May 2017 22:04:03 +0000 (22:04 +0000)]
[Sema] Use CK_NoOp instead CK_Invalid in tryGCCVectorConvertAndSplat
This fix UBSAN bots after r302935. Storing non-defined values in enum is
undefined behavior.
Other places, where "if (ScalarCast != CK_Invalid)" is used, never get to the
"if" with CK_Invalid. tryGCCVectorConvertAndSplat can get to the "if" with
CK_Invalid and it looks like expected case. So we have to use something other
than CK_Invalid, e.g. CK_NoOp.
llvm-svn: 303121
Craig Topper [Mon, 15 May 2017 22:01:03 +0000 (22:01 +0000)]
[APInt] Simplify a for loop initialization based on the fact that 'n' is known to be 1 by an earlier 'if'.
llvm-svn: 303120
Eugene Zelenko [Mon, 15 May 2017 21:57:41 +0000 (21:57 +0000)]
[IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC).
llvm-svn: 303119
Tim Northover [Mon, 15 May 2017 21:51:38 +0000 (21:51 +0000)]
AArch64: use linker-private symbols for globals in MachO.
We don't use section-relative relocations on AArch64, so all symbols must be at
least visible to the linker (i.e. properly global or l_whatever, but not
L_whatever).
llvm-svn: 303118
David Blaikie [Mon, 15 May 2017 21:34:01 +0000 (21:34 +0000)]
PR32288: Describe a bool parameter's DWARF location with a simple register
There's no need (& a bit incorrect) to mask off the high bits of the
register reference when describing a simple bool value.
Reviewers: aprantl
Differential Revision: https://reviews.llvm.org/D31062
llvm-svn: 303117
Adam Nemet [Mon, 15 May 2017 21:15:01 +0000 (21:15 +0000)]
[SLP] Enable 64-bit wide vectorization on AArch64
ARM Neon has native support for half-sized vector registers (64 bits). This
is beneficial for example for 2D and 3D graphics. This patch adds the option
to lower MinVecRegSize from 128 via a TTI in the SLP Vectorizer.
*** Performance Analysis
This change was motivated by some internal benchmarks but it is also
beneficial on SPEC and the LLVM testsuite.
The results are with -O3 and PGO. A negative percentage is an improvement.
The testsuite was run with a sample size of 4.
** SPEC
* CFP2006/482.sphinx3 -3.34%
A pretty hot loop is SLP vectorized resulting in nice instruction reduction.
This used to be a +22% regression before rL299482.
* CFP2000/177.mesa -3.34%
* CINT2000/256.bzip2 +6.97%
My current plan is to extend the fix in rL299482 to i16 which brings the
regression down to +2.5%. There are also other problems with the codegen in
this loop so there is further room for improvement.
** LLVM testsuite
* SingleSource/Benchmarks/Misc/ReedSolomon -10.75%
There are multiple small SLP vectorizations outside the hot code. It's a bit
surprising that it adds up to 10%. Some of this may be code-layout noise.
* MultiSource/Benchmarks/VersaBench/beamformer/beamformer -8.40%
The opt-viewer screenshot can be seen at
F3218284. We start at a colder store
but the tree leads us into the hottest loop.
* MultiSource/Applications/lambda-0.1.3/lambda -2.68%
* MultiSource/Benchmarks/Bullet/bullet -2.18%
This is using 3D vectors.
* SingleSource/Benchmarks/Shootout-C++/Shootout-C++-lists +6.67%
Noise, binary is unchanged.
* MultiSource/Benchmarks/Ptrdist/anagram/anagram +4.90%
There is an additional SLP in the cold code. The test runs for ~1sec and
prints out over 2000 lines. This is most likely noise.
* MultiSource/Applications/aha/aha +1.63%
* MultiSource/Applications/JM/lencod/lencod +1.41%
* SingleSource/Benchmarks/Misc/richards_benchmark +1.15%
Differential Revision: https://reviews.llvm.org/D31965
llvm-svn: 303116
Hans Wennborg [Mon, 15 May 2017 20:59:32 +0000 (20:59 +0000)]
Revert r302678 "[AArch64] Enable use of reduction intrinsics."
This caused PR33053.
Original commit message:
> The new experimental reduction intrinsics can now be used, so I'm enabling this
> for AArch64. We will need this for SVE anyway, so it makes sense to do this for
> NEON reductions as well.
>
> The existing code to match shufflevector patterns are replaced with a direct
> lowering of the reductions to AArch64-specific nodes. Tests updated with the
> new, simpler, representation.
>
> Differential Revision: https://reviews.llvm.org/D32247
llvm-svn: 303115
Evgeniy Stepanov [Mon, 15 May 2017 20:43:48 +0000 (20:43 +0000)]
[asan] One more test for -fsanitize-address-globals-dead-stripping.
llvm-svn: 303114
Evgeniy Stepanov [Mon, 15 May 2017 20:43:42 +0000 (20:43 +0000)]
[asan] Better workaround for gold PR19002.
See the comment for more details. Test in a follow-up CFE commit.
llvm-svn: 303113
Manoj Gupta [Mon, 15 May 2017 20:41:17 +0000 (20:41 +0000)]
[builtins] Fix a check from __GNU__ to __GNUC__ for disabling executable stack.
Summary:
Neither GCC nor Clang define __GNU__. Instead use __GNUC__ for the check.
Reviewers: echristo, rengolin, compnerd
Subscribers: srhines, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D33211
llvm-svn: 303112
Jan Sjodin [Mon, 15 May 2017 20:18:37 +0000 (20:18 +0000)]
Re-submit AMDGPUMachineCFGStructurizer.
Differential Revision: https://reviews.llvm.org/D23209
llvm-svn: 303111
Sean Callanan [Mon, 15 May 2017 19:55:20 +0000 (19:55 +0000)]
[TypeSystem] Fix inspection of Objective-C object types
ptr_refs exposed a problem in ClangASTContext's implementation: it
uses an accessor to downcast a QualType to an
ObjCObjectPointerType, but the accessor is not fully general.
getAs() is the safer way to go.
I've added a test case that uses ptr_refs in a way that would
crash before the fix.
<rdar://problem/
31363513>
llvm-svn: 303110
Tim Northover [Mon, 15 May 2017 19:42:15 +0000 (19:42 +0000)]
AArch64: diagnose unrecognized features in .cpu directive.
We were silently ignoring any features we couldn't match up, which led to
errors in an inline asm block missing the conventional "\n\t".
llvm-svn: 303108
Davide Italiano [Mon, 15 May 2017 19:35:40 +0000 (19:35 +0000)]
[NewGVN] Remove unused setDefiningExpr(). NFCI.
llvm-svn: 303107
Martin Probst [Mon, 15 May 2017 19:33:20 +0000 (19:33 +0000)]
clang-format: [JS] for async loops.
Summary:
JavaScript supports asynchronous loop iteration in async functions:
for async (const x of y) ...
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33193
llvm-svn: 303106
Sanjay Patel [Mon, 15 May 2017 19:27:53 +0000 (19:27 +0000)]
[InstCombine] restrict icmp fold with 2 sdiv exact operands (PR32949)
This is the InstCombine counterpart to D32954.
I added some comments about the code duplication in:
rL302436
Alive-based verification:
http://rise4fun.com/Alive/dPw
This is a 2nd fix for the problem reported in:
https://bugs.llvm.org/show_bug.cgi?id=32949
Differential Revision: https://reviews.llvm.org/D32970
llvm-svn: 303105
Sanjay Patel [Mon, 15 May 2017 19:16:49 +0000 (19:16 +0000)]
[InstSimplify] restrict icmp fold with 2 sdiv exact operands (PR32949)
These folds were introduced with https://reviews.llvm.org/rL127064 as part of solving:
https://bugs.llvm.org/show_bug.cgi?id=9343
As shown here:
http://rise4fun.com/Alive/C8
...however, the sdiv exact case needs a stronger predicate.
I opted for duplicated code instead of adding another fallthrough because I think that's
easier to read (and edit in case we need/want to restrict/loosen the predicates any more).
This should fix:
https://bugs.llvm.org/show_bug.cgi?id=32949
https://bugs.llvm.org/show_bug.cgi?id=32948
Differential Revision: https://reviews.llvm.org/D32954
llvm-svn: 303104
Saleem Abdulrasool [Mon, 15 May 2017 19:09:13 +0000 (19:09 +0000)]
builtins: fix filtering aliased targets
Some build targets (e.g. i686) have aliased names (e.g. i386). We would
get multiple definitions previously and have the linker arbitrarily
select a definition on those aliased targets. Make this more
deterministic by checking those aliases.
llvm-svn: 303103
Evgeny Stupachenko [Mon, 15 May 2017 19:08:56 +0000 (19:08 +0000)]
The patch adds CTLZ idiom recognition.
Summary:
The following loops should be recognized:
i = 0;
while (n) {
n = n >> 1;
i++;
body();
}
use(i);
And replaced with builtin_ctlz(n) if body() is empty or
for CPUs that have CTLZ instruction converted to countable:
for (j = 0; j < builtin_ctlz(n); j++) {
n = n >> 1;
i++;
body();
}
use(builtin_ctlz(n));
Reviewers: rengolin, joerg
Differential Revision: http://reviews.llvm.org/D32605
From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 303102
Jonathan Peyton [Mon, 15 May 2017 19:05:59 +0000 (19:05 +0000)]
Fix for KMP_AFFINITY=respect with multiple processor groups
An assert() was being tripped when KMP_AFFINITY=respect + Multiple Processor
Groups. Let __kmp_affinity_create_proc_group_map() function be able to create
address2os object which contains a single group by deleting restriction that
process affinity mask must span multiple groups.
llvm-svn: 303101
Davide Italiano [Mon, 15 May 2017 18:50:53 +0000 (18:50 +0000)]
[NewGVN] Fix verification of MemoryPhis in verifyMemoryCongruency().
verifyMemoryCongruency() filters out trivially dead MemoryDef(s),
as we find them immediately dead, before moving from TOP to a new
congruence class.
This fixes the same problem for PHI(s) skipping MemoryPhis if all
the operands are dead.
Differential Revision: https://reviews.llvm.org/D33044
llvm-svn: 303100
Geoff Berry [Mon, 15 May 2017 18:50:22 +0000 (18:50 +0000)]
[AArch64][Falkor] Fix sched details for FMOV
llvm-svn: 303099
Jan Sjodin [Mon, 15 May 2017 18:39:47 +0000 (18:39 +0000)]
Revert 303091.
llvm-svn: 303098
Rafael Espindola [Mon, 15 May 2017 18:29:14 +0000 (18:29 +0000)]
Disable threads in a few tests.
They are too slow otherwise. We track the issue in pr32942.
llvm-svn: 303097
Teresa Johnson [Mon, 15 May 2017 18:28:29 +0000 (18:28 +0000)]
Add support for handling ifuncs to GlobalValue::getBaseObject
Summary:
All GlobalIndirectSymbol types (not just GlobalAlias) should return
their base object.
Without this patch LTO would warn "Unable to determine comdat of
alias!" for an ifunc.
Reviewers: pcc
Subscribers: mehdi_amini, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D33202
llvm-svn: 303096
Haojian Wu [Mon, 15 May 2017 18:18:28 +0000 (18:18 +0000)]
[clang-tidy] Fix a typo: dequeue => deque
llvm-svn: 303095
Adam Nemet [Mon, 15 May 2017 18:14:35 +0000 (18:14 +0000)]
Revert "[ClangD] Refactor clangd into separate components"
This reverts commit r303067.
Caused http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/34305/
And even after Simon's fix there is still a test failure.
llvm-svn: 303094
Adam Nemet [Mon, 15 May 2017 18:14:31 +0000 (18:14 +0000)]
Revert "Fix windows buildbots - missing include and namespace"
This reverts commit r303078.
One test is still failing even after this:
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA_check/31374/consoleFull#
18373900728254eaf0-7326-4999-85b0-
388101f2d404
llvm-svn: 303093
Craig Topper [Mon, 15 May 2017 18:14:16 +0000 (18:14 +0000)]
[SCEV] Use copy initialization of APInts instead of direct initialization.
This is based on post commit feed back from r302769.
llvm-svn: 303092
Jan Sjodin [Mon, 15 May 2017 18:13:56 +0000 (18:13 +0000)]
Add AMDGPUMachineCFGStructurizer.
Differential Revision: https://reviews.llvm.org/D23209
llvm-svn: 303091
Sanjay Patel [Mon, 15 May 2017 18:08:17 +0000 (18:08 +0000)]
[InstCombine] use m_OneUse to reduce code; NFCI
llvm-svn: 303090
Peter Collingbourne [Mon, 15 May 2017 17:59:21 +0000 (17:59 +0000)]
ELF: --gdb-index: Change findSection to return an InputSection.
We should only ever expect this function to return a regular
InputSection; I would not expect a function definition to be in a
MergeInputSection or EhInputSection. We were previously crashing
in writeTo if this function returned a section that was not an
InputSection because we do not set OutSec for such sections.
This can happen in practice if a function is defined in an empty
section which shares its offset-in-file with a MergeInputSection,
as in the provided test case.
A better fix for this bug would be to fix the
DWARFUnit::collectAddressRanges() interface to provide section
information (see D33183), but this at least fixes the crash.
Differential Revision: https://reviews.llvm.org/D33176
llvm-svn: 303089
Peter Collingbourne [Mon, 15 May 2017 17:53:26 +0000 (17:53 +0000)]
ELF: --gdb-index: Do not add dead sections to the address area.
Fixes PR33032.
Differential Revision: https://reviews.llvm.org/D33175
llvm-svn: 303088
Kostya Serebryany [Mon, 15 May 2017 17:39:42 +0000 (17:39 +0000)]
[libFuzzer] fix a warning from Wunreachable-code-loop-increment reported by Christian Holler. This also fixes a logical bug, which however does not affect the libFuzzer's ability too much (I wasn't able to create a differentiating test)
llvm-svn: 303087
Jonathan Peyton [Mon, 15 May 2017 17:39:16 +0000 (17:39 +0000)]
Remove some outdated comments
llvm-svn: 303086
Alexander Kornienko [Mon, 15 May 2017 17:37:48 +0000 (17:37 +0000)]
Make google-build-using-namespace skip std::.*literals
Summary:
C++14 added a couple of user-defined literals in the standard library. E.g.
std::chrono_literals and std::literals::chrono_literals . Using them
requires a using directive so do not warn in google-build-using-namespace
if namespace name starts with "std::" and ends with "literals".
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: cfe-commits
Patch by Martin Ejdestig!
Differential Revision: https://reviews.llvm.org/D33010
llvm-svn: 303085
Kyle Butt [Mon, 15 May 2017 17:30:47 +0000 (17:30 +0000)]
CodeGen: BlockPlacement: Increase tail duplication size for O3.
At O3 we are more willing to increase size if we believe it will improve
performance. The current threshold for tail-duplication of 2 instructions is
conservative, and can be relaxed at O3.
Benchmark results:
llvm test-suite:
6% improvement in aha, due to duplication of loop latch
3% improvement in hexxagon
2% slowdown in lpbench. Seems related, but couldn't completely diagnose.
Internal google benchmark:
Produces 4% improvement on internal google protocol buffer serialization
benchmarks.
Differential-Revision: https://reviews.llvm.org/D32324
llvm-svn: 303084
Reid Kleckner [Mon, 15 May 2017 17:25:10 +0000 (17:25 +0000)]
[ubsan] Don't enable debug info in all tests
Add a lit substitution (I chose %gmlt) so that only stack trace tests
get debug info.
We need a lit substition so that this expands to -gline-tables-only
-gcodeview on Windows. I think in the future we should reconsider the
need for -gcodeview from the GCC driver, but for now, this is necessary.
llvm-svn: 303083
Simon Pilgrim [Mon, 15 May 2017 17:17:44 +0000 (17:17 +0000)]
[NVPTX] Don't flag StoreParam/LoadParam memory chain operands as ReadMem/WriteMem (PR32146)
Follow up to D33147
NVPTXTargetLowering::LowerCall was trusting the default argument values.
Fixes another 17 of the NVPTX '-verify-machineinstrs with EXPENSIVE_CHECKS' errors in PR32146.
Differential Revision: https://reviews.llvm.org/D33189
llvm-svn: 303082
Alexander Kornienko [Mon, 15 May 2017 17:06:51 +0000 (17:06 +0000)]
[clang-tidy] Partly rewrite readability-simplify-boolean-expr using RAV
The check was using AST matchers in a very inefficient manner. By rewriting the
BinaryOperator-related parts using RAV, the check was sped up by a factor of
up to 10000 on some files (mostly, generated code using binary operators in
tables), but also significantly sped up for regular large files.
As a side effect, the code became clearer and more readable.
llvm-svn: 303081
Hans Wennborg [Mon, 15 May 2017 16:50:48 +0000 (16:50 +0000)]
build_llvm_package.bat: Minor updates
llvm-svn: 303080
Jonathan Peyton [Mon, 15 May 2017 16:39:42 +0000 (16:39 +0000)]
Add the .clang-format file which the formatting was based on
llvm-svn: 303079
Simon Pilgrim [Mon, 15 May 2017 16:36:11 +0000 (16:36 +0000)]
Fix windows buildbots - missing include and namespace
llvm-svn: 303078
Alexey Bataev [Mon, 15 May 2017 16:26:15 +0000 (16:26 +0000)]
[OPENMP] Check DSA for variables captured by value.
Currently clang checks for default data sharing attributes only for
variables captured in OpenMP regions by reference. Patch adds checks for
variables captured by value.
llvm-svn: 303077
Pavel Labath [Mon, 15 May 2017 16:25:28 +0000 (16:25 +0000)]
Disable a test in TestReturnValue on arm64 linux
as described in pr33042, we cannot reliably retrieve the return value on
arm64 in cases it is returned via x8 pointer. I tried to do this as
surgically as possible and disabled it only on targets I know to be
affected, as the code is still useful, even though it can only work on
best-effort basis.
llvm-svn: 303076
Rafael Espindola [Mon, 15 May 2017 15:56:23 +0000 (15:56 +0000)]
Add an extra test for archive symbol tables.
The table should include only defined symbols.
llvm-svn: 303075
Simon Pilgrim [Mon, 15 May 2017 15:48:15 +0000 (15:48 +0000)]
[SLPVectorizer][X86] Add vectorization tests for vXi64/vXi32/vXi16/VXi8 add/sub/mul
llvm-svn: 303074
Florian Hahn [Mon, 15 May 2017 15:15:22 +0000 (15:15 +0000)]
[AArch64] Enable FeatureFuseAES on Cortex-A72.
This patch enables fusing dependent AESE/AESMC and AESD/AESIMC
instruction pairs on Cortex-A72, as recommended in the Software
Optimization Guide, section 4.10.
llvm-svn: 303073
Yaxun Liu [Mon, 15 May 2017 14:47:47 +0000 (14:47 +0000)]
[OpenCL] Emit function-scope variable in constant address space as static variable
Differential Revision: https://reviews.llvm.org/D32977
llvm-svn: 303072
Kostya Kortchinsky [Mon, 15 May 2017 14:47:19 +0000 (14:47 +0000)]
[sanitizer] Change SizeClassAllocator32 to accept just one template
Summary:
With rL279771, SizeClassAllocator64 was changed to accept only one template
instead of 5, for the following reasons: "First, this will make the mangled
names shorter. Second, this will make adding more parameters simpler". This
patch mirrors that work for SizeClassAllocator32.
This is in preparation for introducing the randomization of chunks in the
32-bit SizeClassAllocator in a later patch.
Reviewers: kcc, alekseyshl, dvyukov
Reviewed By: alekseyshl
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D33141
llvm-svn: 303071
Dmitry Preobrazhensky [Mon, 15 May 2017 14:28:23 +0000 (14:28 +0000)]
[AMDGPU][MC] Corrected several VI opcodes to avoid printing _e64
See bug 32936: https://bugs.llvm.org//show_bug.cgi?id=32936
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D33123
llvm-svn: 303070
Simon Pilgrim [Mon, 15 May 2017 14:27:11 +0000 (14:27 +0000)]
[SLPVectorizer][X86] Add vectorization tests for vXi64/vXi32/vXi16/VXi8 shifts
llvm-svn: 303069
Alex Lorenz [Mon, 15 May 2017 14:26:22 +0000 (14:26 +0000)]
[index] References to fields from template instantiations should refer to
fields in base templates
rdar://
32197158
llvm-svn: 303068
Ilya Biryukov [Mon, 15 May 2017 14:17:35 +0000 (14:17 +0000)]
[ClangD] Refactor clangd into separate components
Summary: Major refactoring to split LSP implementation, Clang API calls and threading(mostly synchronization)
Reviewers: bkramer, krasimir
Reviewed By: bkramer
Subscribers: cfe-commits, mgorny, klimek
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D33047
llvm-svn: 303067
Tobias Grosser [Mon, 15 May 2017 14:12:30 +0000 (14:12 +0000)]
Drop nonexisting ScopPassManager directory
llvm-svn: 303066
Tobias Grosser [Mon, 15 May 2017 14:12:27 +0000 (14:12 +0000)]
Adjust formatting
llvm-svn: 303065
Philip Pfaffe [Mon, 15 May 2017 13:52:10 +0000 (13:52 +0000)]
[Polly][NewPM] Add missing Unittests
llvm-svn: 303064
Ilya Biryukov [Mon, 15 May 2017 13:50:46 +0000 (13:50 +0000)]
Test commit(changed comment)
llvm-svn: 303063
Philip Pfaffe [Mon, 15 May 2017 13:43:01 +0000 (13:43 +0000)]
[Polly][NewPM][WIP] Add a ScopPassManager
This patch adds both a ScopAnalysisManager and a ScopPassManager.
The ScopAnalysisManager is itself a Function-Analysis, and manages
analyses on Scops. The ScopPassManager takes care of building Scop pass
pipelines.
This patch is marked WIP because I've left two FIXMEs which I need to
think about some more. Both of these deal with invalidation:
Deferred invalidation is currently not implemented. Deferred
invalidation deals with analyses which cache references to other
analysis results. If these results are invalidated, invalidation needs
to be propagated into the caching analyses.
The ScopPassManager as implemented assumes that ScopPasses do not affect
other Scops in any way. There has been some discussion about this on
other patch threads, however it makes sense to reiterate this for this
specific patch.
I'm uploading this patch even though it's incomplete to encourage
discussion and give you an impression of how this is going to work.
Differential Revision: https://reviews.llvm.org/D33192
llvm-svn: 303062
Pavel Labath [Mon, 15 May 2017 13:41:38 +0000 (13:41 +0000)]
Fix darwin build for r303058
llvm-svn: 303061
Philip Pfaffe [Mon, 15 May 2017 13:20:26 +0000 (13:20 +0000)]
[Polly][CMake] Exclude isl_config from the polly-check-format target.
Summary:
The custom `polly-check-format` target runs clang-format over all source files in the directory tree excluding lib/External. `isl_config.h` is a header file that is generated by CMake in the build directory, and it's not correctly formatted (which I also wouldn't consider necessary, as it is a generated file).
If the build directory is actually inside the Polly source directory (which it might be if you're building Polly out-of-tree), that check always fails. Hence this patch excludes this file from the check-format target.
Reviewers: Meinersbur, grosser
Reviewed By: grosser
Subscribers: mgorny, llvm-commits, pollydev
Tags: #polly
Differential Revision: https://reviews.llvm.org/D33192
llvm-svn: 303060
Dinar Temirbulatov [Mon, 15 May 2017 13:14:04 +0000 (13:14 +0000)]
Test commit.
llvm-svn: 303059
Pavel Labath [Mon, 15 May 2017 13:02:37 +0000 (13:02 +0000)]
Remove an expensive lock from Timer
The Timer destructor would grab a global mutex in order to update
execution time. Add a class to define a category once, statically; the
class adds itself to an atomic singly linked list, and thus subsequent
updates only need to use an atomic rather than grab a lock and perform a
hashtable lookup.
Differential Revision: https://reviews.llvm.org/D32823
Patch by Scott Smith <scott.smith@purestorage.com>.
llvm-svn: 303058
Philip Pfaffe [Mon, 15 May 2017 12:58:31 +0000 (12:58 +0000)]
[Polly][Fortran Support] Fix two testcases for the loadable-library use-case
llvm-svn: 303057
Philip Pfaffe [Mon, 15 May 2017 12:55:14 +0000 (12:55 +0000)]
[Polly][NewPM] Port ScopInfo to the new PassManager
llvm-svn: 303056
Dmitry Preobrazhensky [Mon, 15 May 2017 12:37:03 +0000 (12:37 +0000)]
[AMDGPU][MC] Removed V_MQSAD_U16_U8
This instruction does not really exist
See Bug 33018: https://bugs.llvm.org//show_bug.cgi?id=33018
Reviewers: vpykhtin, artem.tamazov
Differential Revision: https://reviews.llvm.org/D33126
llvm-svn: 303055
John Brawn [Mon, 15 May 2017 11:57:54 +0000 (11:57 +0000)]
[ARM] Mark LEApcrel instructions as isAsCheapAsAMove
Doing this means that if an LEApcrel is used in two places we will rematerialize
instead of generating two MOVs. This is particularly useful for printfs using
the same format string, where we want to generate an address into a register
that's going to get corrupted by the call.
Differential Revision: https://reviews.llvm.org/D32858
llvm-svn: 303054
John Brawn [Mon, 15 May 2017 11:50:21 +0000 (11:50 +0000)]
[ARM] Mark LEApcrel as not having side effects
Doing this lets us hoist it out of loops, and I've also marked it as
rematerializable the same as the thumb1 and thumb2 counterparts.
It looks like it being marked as such was just a mistake, as the commit that
made that change only mentions LEApcrelJT and in thumb1 and thumb2 only the
LEApcrelJT instructions were marked as having side-effects, so it looks like
the intent was to only mark LEApcrelJT as having side-effects but LEApcrel was
accidentally marked as such also.
Differential Revision: https://reviews.llvm.org/D32857
llvm-svn: 303053
Siddharth Bhat [Mon, 15 May 2017 11:49:19 +0000 (11:49 +0000)]
[NFC] [Fortran Support] Fix findFADGlobalNonAlloc pattern match comment
llvm-svn: 303052