Geoff Berry [Wed, 27 Sep 2017 17:14:10 +0000 (17:14 +0000)]
[AArch64][Falkor] Ignore SP based loads in HW prefetch fixups.
Reviewers: mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls
Differential Revision: https://reviews.llvm.org/D38301
llvm-svn: 314319
Alex Shlyapnikov [Wed, 27 Sep 2017 17:10:49 +0000 (17:10 +0000)]
[Sanitizer] Disable compact size class tests on Android
Fixing test failure on Android introduced in D38245. Compact size class
maps defined there are not to be used on Android.
llvm-svn: 314318
Anastasia Stulova [Wed, 27 Sep 2017 17:03:35 +0000 (17:03 +0000)]
[OpenCL] Fixed CL version in failing test.
llvm-svn: 314317
Javed Absar [Wed, 27 Sep 2017 16:39:17 +0000 (16:39 +0000)]
[Misched] : Fix typo in comment. NFC.
llvm-svn: 314316
Sanjay Patel [Wed, 27 Sep 2017 16:32:56 +0000 (16:32 +0000)]
[SLP] fix typos/formatting; NFC
llvm-svn: 314315
Sean Eveson [Wed, 27 Sep 2017 16:20:07 +0000 (16:20 +0000)]
Revert "[llvm-cov] Create directory structure when filtering using -name*= options"
Test failures.
llvm-svn: 314314
Roman Lebedev [Wed, 27 Sep 2017 16:08:33 +0000 (16:08 +0000)]
[Support] mapped_file_region::size() returns size_t
Fixup last commit, found by clang-stage1-cmake-RA-incremental bot.
llvm-svn: 314313
Roman Lebedev [Wed, 27 Sep 2017 15:59:16 +0000 (15:59 +0000)]
[Support] mapped_file_region: store size as size_t
Summary:
Found when testing stage-2 build with D38101.
```
In file included from /build/llvm/lib/Support/Path.cpp:1045:
/build/llvm/lib/Support/Unix/Path.inc:648:14: error: comparison 'uint64_t' (aka 'unsigned long') >
18446744073709551615 is always false [-Werror,-Wtautological-constant-compare]
if (length > std::numeric_limits<size_t>::max()) {
~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
`size_t` is `uint64_t` here, apparently, thus any `uint64_t` value
always fits into `size_t`.
Initial patch was to use some preprocessor logic to
not check if the size is known to fit at compile time.
But Zachary Turner suggested using this approach.
Reviewers: Bigcheese, rafael, zturner, mehdi_amini
Reviewed by (via email): zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38132
llvm-svn: 314312
Alex Shlyapnikov [Wed, 27 Sep 2017 15:38:05 +0000 (15:38 +0000)]
[Sanitizers] Allocator: new "release memory to OS" implementation
Summary:
The current implementation of the allocator returning freed memory
back to OS (controlled by allocator_release_to_os_interval_ms flag)
requires sorting of the free chunks list, which has two major issues,
first, when free list grows to millions of chunks, sorting, even the
fastest one, is just too slow, and second, sorting chunks in place
is unacceptable for Scudo allocator as it makes allocations more
predictable and less secure.
The proposed approach is linear in complexity (altough requires quite
a bit more temporary memory). The idea is to count the number of free
chunks on each memory page and release pages containing free chunks
only. It requires one iteration over the free list of chunks and one
iteration over the array of page counters. The obvious disadvantage
is the allocation of the array of the counters, but even in the worst
case we support (4T allocator space, 64 buckets, 16 bytes bucket size,
full free list, which leads to 2 bytes per page counter and ~17M page
counters), requires just about 34Mb of the intermediate buffer (comparing
to ~64Gb of actually allocated chunks) and usually it stays under 100K
and released after each use. It is expected to be a relatively rare event,
releasing memory back to OS, keeping the buffer between those runs
and added complexity of the bookkeeping seems unnesessary here (it can
always be improved later, though, never say never).
The most interesting problem here is how to calculate the number of chunks
falling into each memory page in the bucket. Skipping all the details,
there are three cases when the number of chunks per page is constant:
1) P >= C, P % C == 0 --> N = P / C
2) C > P , C % P == 0 --> N = 1
3) C <= P, P % C != 0 && C % (P % C) == 0 --> N = P / C + 1
where P is page size, C is chunk size and N is the number of chunks per
page and the rest of the cases, where the number of chunks per page is
calculated on the go, during the page counter array iteration.
Among the rest, there are still cases where N can be deduced from the
page index, but they require not that much less calculations per page
than the current "brute force" way and 2/3 of the buckets fall into
the first three categories anyway, so, for the sake of simplicity,
it was decided to stick to those two variations. It can always be
refined and improved later, should we see that brute force way slows
us down unacceptably.
Reviewers: eugenis, cryptoad, dvyukov
Subscribers: kubamracek, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D38245
llvm-svn: 314311
Sean Eveson [Wed, 27 Sep 2017 15:37:40 +0000 (15:37 +0000)]
[llvm-cov] Create directory structure when filtering using -name*= options
Before this change using any of the -name*= command line options with an output
directory would result in a single file (functions.txt/functions.html)
containing the coverage for those specific functions. Now you get the same
directory structure as when not using any -name*= options.
Differential Revision: https://reviews.llvm.org/D38280
llvm-svn: 314310
Marc-Andre Laperle [Wed, 27 Sep 2017 15:31:17 +0000 (15:31 +0000)]
[clangd] Handle InitializeParams and store rootUri
Summary:
The root Uri is the workspace location and will be useful in the context of
indexing. We could also add more things to InitializeParams in order to
configure Clangd for C/C++ sepecific extensions.
Reviewers: ilya-biryukov, bkramer, krasimir, Nebiroth
Reviewed By: ilya-biryukov
Subscribers: ilya-biryukov
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D38093
llvm-svn: 314309
Sanjay Patel [Wed, 27 Sep 2017 14:54:16 +0000 (14:54 +0000)]
[SimplifyCFG] add a struct to house optional folds (PR34603)
This was intended to be no-functional-change, but it's not - there's a test diff.
So I thought I should stop here and post it as-is to see if this looks like what was expected
based on the discussion in PR34603:
https://bugs.llvm.org/show_bug.cgi?id=34603
Notes:
1. The test improvement occurs because the existing 'LateSimplifyCFG' marker is not carried
through the recursive calls to 'SimplifyCFG()->SimplifyCFGOpt().run()->SimplifyCFG()'.
The parameter isn't passed down, so we pick up the default value from the function signature
after the first level. I assumed that was a bug, so I've passed 'Options' down in all of the
'SimplifyCFG' calls.
2. I split 'LateSimplifyCFG' into 2 bits: ConvertSwitchToLookupTable and KeepCanonicalLoops.
This would theoretically allow us to differentiate the transforms controlled by those params
independently.
3. We could stash the optional AssumptionCache pointer and 'LoopHeaders' pointer in the struct too.
I just stopped here to minimize the diffs.
4. Similarly, I stopped short of messing with the pass manager layer. I have another question that
could wait for the follow-up: why is the new pass manager creating the pass with LateSimplifyCFG
set to true no matter where in the pipeline it's creating SimplifyCFG passes?
// Create an early function pass manager to cleanup the output of the
// frontend.
EarlyFPM.addPass(SimplifyCFGPass());
-->
/// \brief Construct a pass with the default thresholds
/// and switch optimizations.
SimplifyCFGPass::SimplifyCFGPass()
: BonusInstThreshold(UserBonusInstThreshold),
LateSimplifyCFG(true) {} <-- switches get converted to lookup tables and loops may not be in canonical form
If this is unintended, then it's possible that the current behavior of dropping the 'LateSimplifyCFG'
setting via recursion was masking this bug.
Differential Revision: https://reviews.llvm.org/D38138
llvm-svn: 314308
Haicheng Wu [Wed, 27 Sep 2017 14:44:56 +0000 (14:44 +0000)]
[InlineCost] add visitSelectInst()
InlineCost can understand Select IR now. This patch finds free Select IRs and
continue the propagation of SimplifiedValues, ConstantOffsetPtrs, and
SROAArgValues.
Differential Revision: https://reviews.llvm.org/D37198
llvm-svn: 314307
Gadi Haber [Wed, 27 Sep 2017 14:44:15 +0000 (14:44 +0000)]
[X86][SKX][KNL] Updated regression tests to use -mattr instead of -mcpu flag.NFC.
NFC.
Updated 8 regression tests to use -mattr instead of -mcpu flag as follows:
-mcpu=knl --> -mattr=+avx512f
-mcpu=skx --> -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq
The updates are as part of the preparation of a large commit to add all instruction scheduling for the SKX target.
Reviewers: delena, zvi, RKSimon
Differential Revision: https://reviews.llvm.org/D38222
Change-Id: I2381c9b5bb75ecacfca017243c22d054f6eddd14
llvm-svn: 314306
Zvi Rackover [Wed, 27 Sep 2017 14:38:05 +0000 (14:38 +0000)]
X86 Tests: Unsigned saturation subtraction tests. NFC.
Summary:
Adding tests for D37534.
Commit on behalf of julia.koval@intel.com
Reviewers: n.bozhenov, zvi, spatel, DavidKreitzer
Reviewed By: zvi
Differential Revision: https://reviews.llvm.org/D37510
llvm-svn: 314305
Anastasia Stulova [Wed, 27 Sep 2017 14:37:00 +0000 (14:37 +0000)]
[OpenCL] Handle address space conversion while setting type alignment.
Added missing addrspacecast case in alignment computation
logic of pointer type emission in IR generation.
Differential Revision: https://reviews.llvm.org/D37804
llvm-svn: 314304
Gheorghe-Teodor Bercea [Wed, 27 Sep 2017 14:31:08 +0000 (14:31 +0000)]
[OpenMP] Add an additional test for D34888
Summary: Test for checking if the mapping is performed correctly. This is a test initially included in Patch https://reviews.llvm.org/D29905
Reviewers: Hahnfeld, carlo.bertolli, caomhin, ABataev
Reviewed By: Hahnfeld
Subscribers: tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D38040
llvm-svn: 314303
Coby Tayree [Wed, 27 Sep 2017 13:02:44 +0000 (13:02 +0000)]
revert rL314300
accidently added only tests w/o the respective changes..
llvm-svn: 314302
Krzysztof Parzyszek [Wed, 27 Sep 2017 12:48:48 +0000 (12:48 +0000)]
Typo: const MCSchedModel SchedModel -> const MCSchedModel &SchedModel
llvm-svn: 314301
Coby Tayree [Wed, 27 Sep 2017 12:36:54 +0000 (12:36 +0000)]
[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions
Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized.
supersedes D33277, D35775
Corrsponds with D37412, D37413
llvm-svn: 314300
Mikael Holmen [Wed, 27 Sep 2017 11:27:50 +0000 (11:27 +0000)]
[RegAllocGreedy] Fix spelling error, "inteference" -> "interference", NFC
llvm-svn: 314299
Artem Dergachev [Wed, 27 Sep 2017 10:59:06 +0000 (10:59 +0000)]
[analyzer] Fix an outdated comment in a test. NFC.
llvm-svn: 314298
Hiroshi Inoue [Wed, 27 Sep 2017 10:33:02 +0000 (10:33 +0000)]
[PowerPC] eliminate unconditional branch to the next instruction
This patch makes analyzeBranch eliminate unconditional branch to the next instruction.
After basic blocks are re-organized by optimizers, such as machine block placement, a BB may end with an unconditional branch to the next (fallthrough) BB. This patch removes such redundant branch instruction.
Differential Revision: https://reviews.llvm.org/D37730
llvm-svn: 314297
Javed Absar [Wed, 27 Sep 2017 10:31:58 +0000 (10:31 +0000)]
[Misched]: Remove double call getMicroOpFactor.NFC.
Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D38176
llvm-svn: 314296
Coby Tayree [Wed, 27 Sep 2017 10:29:29 +0000 (10:29 +0000)]
[X86][AsmParser] fix PR32035
Differential Revision: https://reviews.llvm.org/D37473
llvm-svn: 314295
Jonas Devlieghere [Wed, 27 Sep 2017 10:23:34 +0000 (10:23 +0000)]
[test] Don't verify .debug_line offsets in bitcode tests.
The exact values of the .debug_line offsets should not be hard-coded in
the checks for bitcode tests.
Fixes: http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/543
llvm-svn: 314294
Simon Pilgrim [Wed, 27 Sep 2017 10:10:17 +0000 (10:10 +0000)]
[X86][AVX] Improve (i4 bitcast (v4i1 x)) handling for 256-bit vector compare results.
As commented on D37849 and rL313547, AVX1 targets were missing a chance to use vmovmskpd for v4f64/v4i64 results for bool vector bitcasts
llvm-svn: 314293
Simon Pilgrim [Wed, 27 Sep 2017 10:03:17 +0000 (10:03 +0000)]
Use const where possible. NFCI.
llvm-svn: 314292
Jonas Devlieghere [Wed, 27 Sep 2017 10:00:27 +0000 (10:00 +0000)]
[dwarfdump] Fix printing of .debug_line offset.
Fixes 32-bit buildbots:
http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/542
http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/11533
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/11494
llvm-svn: 314291
Artem Dergachev [Wed, 27 Sep 2017 09:50:45 +0000 (09:50 +0000)]
[analyzer] Match more patterns in bugreporter::getDerefExpr() API.
This function can now track null pointer through simple pointer arithmetic,
such as '*&*(p + 2)' => 'p' and so on, displaying intermediate diagnostic pieces
for the user to understand where the null pointer is coming from.
Differential Revision: https://reviews.llvm.org/D37025
llvm-svn: 314290
Manoj Gupta [Wed, 27 Sep 2017 09:49:32 +0000 (09:49 +0000)]
[builtins] fix build error on non-ARM for r314285.
llvm-svn: 314289
Jonas Devlieghere [Wed, 27 Sep 2017 09:33:45 +0000 (09:33 +0000)]
[dwarfdump] Add support for -debug-line=OFFSET
This patch adds support for passing an offset to -debug-line.
Differential revision: https://reviews.llvm.org/D38240
llvm-svn: 314288
Artem Dergachev [Wed, 27 Sep 2017 09:33:37 +0000 (09:33 +0000)]
[analyzer] Fix and refactor bugreporter::getDerefExpr() API.
This API is used by checkers (and other entities) in order to track where does
a value originate from, by jumping from an expression value of which is equal
to that value to the expression from which this value has "appeared". For
example, it may be an lvalue from which the rvalue was loaded, or a function
call from which the dereferenced pointer was returned.
The function now avoids incorrectly unwrapping implicit lvalue-to-rvalue casts,
which caused crashes and incorrect intermediate diagnostic pieces. It also no
longer relies on how the expression is written when guessing what it means.
Fixes pr34373 and pr34731.
rdar://problem/
33594502
Differential Revision: https://reviews.llvm.org/D37023
llvm-svn: 314287
Jonas Devlieghere [Wed, 27 Sep 2017 09:33:36 +0000 (09:33 +0000)]
[dwarfdump] Add support for -debug-loc=OFFSET
This patch adds support for passing an offset to -debug-loc.
Differential revision: https://reviews.llvm.org/D38237
llvm-svn: 314286
Manoj Gupta [Wed, 27 Sep 2017 09:33:14 +0000 (09:33 +0000)]
[Builtins] ARM: Fix assembling files in thumb mode.
Summary:
clang does not assemble files in thumb mode unless .thumb declaration
is present. Add .thumb/.arm decl to _FUNCTION macros to ensure that
files are assembled correctly.
Fixes PR 34715.
Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin
Reviewed By: compnerd
Subscribers: aemerson, javed.absar, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D38227
llvm-svn: 314285
Manoj Gupta [Wed, 27 Sep 2017 09:29:57 +0000 (09:29 +0000)]
[Builtins] ARM: Fix msr assembly instruction use for Thumb2.
Summary:
MSR instruction in Thumb2 does not support immediate operand.
Fix this by moving the condition for V7-M to Thumb2 since V7-M support
Thumb2 only. With this change, aeabi_cfcmp.s and aeabi_cdcmp.S files can
be assembled in Thumb2 mode. (This is split out from the review D38227).
Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin, kristof.beyls
Reviewed By: compnerd
Subscribers: aemerson, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D38268
llvm-svn: 314284
George Rimar [Wed, 27 Sep 2017 09:14:59 +0000 (09:14 +0000)]
[ELF] - Detemplate of HashTableSection<ELFT>
Detemplation of one more synthetic section.
Differential revision: https://reviews.llvm.org/D38241
llvm-svn: 314283
George Rimar [Wed, 27 Sep 2017 09:08:53 +0000 (09:08 +0000)]
[ELF] - Speedup -r and --emit-relocs
This is "Bug 34688 - lld much slower than bfd when linking the linux kernel"
Inside copyRelocations() we have O(N*M) algorithm, where N - amount of
relocations and M - amount of symbols in symbol table. It isincredibly slow
for linking linux kernel.
Patch creates local search tables to speedup.
With this fix link time goes for me from 12.95s to 0.55s what is almost 23x
faster. (used release LLD).
Differential revision: https://reviews.llvm.org/D38129
llvm-svn: 314282
Sean Eveson [Wed, 27 Sep 2017 08:32:36 +0000 (08:32 +0000)]
[llvm-cov] Improve const-correctness of filters. NFC.
llvm-svn: 314281
Sam Parker [Wed, 27 Sep 2017 08:30:45 +0000 (08:30 +0000)]
[ARM] isTruncateFree fix
I implemented isTruncateFree in rL313533, this patch fixes the logic
to match my comment, as the previous logic was too general. Now the
only truncates that are free are i64 -> i32.
Differential Revision: https://reviews.llvm.org/D38234
llvm-svn: 314280
Marek Kurdej [Wed, 27 Sep 2017 07:51:51 +0000 (07:51 +0000)]
[clang-format] Fix FixNamespaceComments when BraceWrapping AfterNamespace is true.
Summary:
NamespaceEndCommentsFixer did not fix namespace comments when the brace opening the namespace was not on the same line as the "namespace" keyword.
It occurs in Allman, GNU and Linux styles and whenever BraceWrapping.AfterNamespace is true.
Before:
```lang=cpp
namespace a
{
void f();
void g();
}
```
After:
```lang=cpp
namespace a
{
void f();
void g();
} // namespace a
```
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D37904
llvm-svn: 314279
Martin Pelikan [Wed, 27 Sep 2017 07:30:48 +0000 (07:30 +0000)]
[XRay] initialize all members of YAMLXRayRecord for -Wmissing-field-initializers
llvm-svn: 314278
Martin Storsjo [Wed, 27 Sep 2017 06:08:23 +0000 (06:08 +0000)]
[X86] Fix SJLJ struct offsets for x86_64
This is necessary, but not sufficient, for having working SJLJ exception
handling on x86_64.
Differential Revision: https://reviews.llvm.org/D38254
llvm-svn: 314277
Martin Storsjo [Wed, 27 Sep 2017 06:08:16 +0000 (06:08 +0000)]
[X86] Remove erroneous callsite offsetting in SJLJ landing pads
The callsite value is already stored indexed from 0 in
the _Unwind_Context struct. When accessed via the functions
_Unwind_GetIP and _Unwind_SetIP, the value is indexed from 1,
but those functions handle the offseting. When reading directly
from the struct here, we shouldn't subtract 1.
This matches the code generated by the ARM target, where SJLJ
exception handling is used by default on iOS.
This makes clang-built object files for 32 bit x86 mingw work when
linked with libgcc/libstdc++.
Differential Revision: https://reviews.llvm.org/D38251
llvm-svn: 314276
Martin Storsjo [Wed, 27 Sep 2017 06:08:04 +0000 (06:08 +0000)]
[X86] Correct byte offsets and data types in a comment. NFC.
This matches the types of the struct members defined in
lib/CodeGen/SjLjEHPrepare.cpp, and the definition of this struct in libgcc.
Differential Revision: https://reviews.llvm.org/D38248
llvm-svn: 314275
Craig Topper [Wed, 27 Sep 2017 06:04:55 +0000 (06:04 +0000)]
[X86] Use extract128BitVector in LowerMULH so we can extract from constant build vectors.
llvm-svn: 314274
Daniel Berlin [Wed, 27 Sep 2017 05:35:19 +0000 (05:35 +0000)]
MemorySSAUpdater: Only add phis to insertedphis if we actually inserted them, not if we just found existing ones
llvm-svn: 314273
Craig Topper [Wed, 27 Sep 2017 05:17:15 +0000 (05:17 +0000)]
[X86] Add avx512bw command lines to the 256-bit vector idiv tests.
Some of the operations are being sign extended to 512 bits with avx512bw.
llvm-svn: 314272
Craig Topper [Wed, 27 Sep 2017 05:17:14 +0000 (05:17 +0000)]
[SelectionDAG] Make NewSDValueDbgMsg print target specific nodes correctly by passing in the SelectionDAG.
llvm-svn: 314271
Martin Pelikan [Wed, 27 Sep 2017 05:10:31 +0000 (05:10 +0000)]
[XRay] fix the -Werror build by handling all enum cases in switches
Followup to D32840.
llvm-svn: 314270
Martin Pelikan [Wed, 27 Sep 2017 04:48:03 +0000 (04:48 +0000)]
[XRay] convert FDR arg1 log entries
Summary:
A new FDR metadata record will support logging a function call argument;
appending multiple metadata records will represent a sequence of arguments
meaning that "holes" are not representable by the buffer format. Each
call argument is currently a 64-bit value (useful for "this" pointers and
synchronization objects).
If present, we put this argument to the function call "entry" record it
belongs to, and alter its type to notify the user of its presence.
Reviewers: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32840
llvm-svn: 314269
Erich Keane [Wed, 27 Sep 2017 03:23:02 +0000 (03:23 +0000)]
Add test forgotten in r314262.
llvm-svn: 314268
Erich Keane [Wed, 27 Sep 2017 03:20:13 +0000 (03:20 +0000)]
Fix capitalization of a bunch of parameters in SemaDeclAttr [NFC]
llvm-svn: 314267
Hongbin Zheng [Wed, 27 Sep 2017 03:11:46 +0000 (03:11 +0000)]
[SimplifyIndVar] Constant fold IV users
This patch tries to transform cases like:
for (unsigned i = 0; i < N; i += 2) {
bool c0 = (i & 0x1) == 0;
bool c1 = ((i + 1) & 0x1) == 1;
}
To
for (unsigned i = 0; i < N; i += 2) {
bool c0 = true;
bool c1 = true;
}
This commit also update test/Transforms/IndVarSimplify/replace-srem-by-urem.ll to prevent constant folding.
Differential Revision: https://reviews.llvm.org/D38272
llvm-svn: 314266
Jason Molenda [Wed, 27 Sep 2017 02:49:18 +0000 (02:49 +0000)]
Update ABIMacOSX_arm::PrepareTrivialCall to correctly align the
stack pointer for apple's armv7 ABI. When in a frameless function
or in a prologue/epilogue where sp wasn't properly aligned, we could
try to make function calls with an unaligned sp; the expression
would crash.
llvm-svn: 314265
Chih-Hung Hsieh [Wed, 27 Sep 2017 00:58:45 +0000 (00:58 +0000)]
[clang-format] Adjust space around &/&& of structured bindings
Keep space before or after the &/&& tokens, but not both. For example,
auto [x,y] = a;
auto &[xr, yr] = a; // LLVM style
auto& [xr, yr] = a; // google style
Differential Revision:https://reviews.llvm.org/D35743
llvm-svn: 314264
Jake Ehrlich [Wed, 27 Sep 2017 00:44:00 +0000 (00:44 +0000)]
Reland: [llvm-objcopy] Add support for dynamic relocations
This change adds support for dynamic relocations (allocated
SHT_REL/SHT_RELA sections with a dynamic symbol table as their link).
I had to reland this because of a I wasn't initilizing some pointers.
llvm-svn: 314263
Erich Keane [Tue, 26 Sep 2017 23:42:34 +0000 (23:42 +0000)]
Emit section information for extern variables.
Currently, if _attribute_((section())) is used for extern variables,
section information is not emitted in generated IR when the variables are used.
This is expected since sections are not generated for external linkage objects.
However NiosII requires this information as it uses special GP-relative accesses
for any objects that use attribute section (.sdata). GCC keeps this attribute in
middle-end.
This change emits the section information for all targets.
Patch By: Elizabeth Andrews
Differential Revision:https://reviews.llvm.org/D36487
llvm-svn: 314262
Jan Vesely [Tue, 26 Sep 2017 23:15:54 +0000 (23:15 +0000)]
Add missing HAVE_LLVM define to fix build with latest llvm
Broken since r314111
V2: pointed out by Jan Vesely
- Use format() instead of % formating
Patch-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 314261
Stephan T. Lavavej [Tue, 26 Sep 2017 23:08:43 +0000 (23:08 +0000)]
[libcxx] [test] Fix unused local typedef warnings.
llvm-svn: 314259
Stephan T. Lavavej [Tue, 26 Sep 2017 23:08:41 +0000 (23:08 +0000)]
[libcxx] [test] Strip trailing whitespace.
llvm-svn: 314258
Stephan T. Lavavej [Tue, 26 Sep 2017 23:08:39 +0000 (23:08 +0000)]
[libcxx] [test] Silence warning C4324 for MSVC.
This warning "structure was padded due to alignment specifier" says
that the compiler is going to do exactly what you asked it to do.
It's triggered by the tests for over-aligned dynamic memory allocation.
llvm-svn: 314257
James Y Knight [Tue, 26 Sep 2017 22:44:01 +0000 (22:44 +0000)]
Initialize the RelocationSectionBase::Section member.
In r314227, it wasn't always, and would thus contain random garbage.
llvm-svn: 314256
Manoj Gupta [Tue, 26 Sep 2017 22:37:08 +0000 (22:37 +0000)]
[Builtins] Use 4 byte alignment for __aeabi_memclr.
Summary:
Align __aeabi_memclr to 4 bytes. All other ARM functions are already aligned to
4-bytes in compiler-rt.
(Split off from review D38227)
Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin, kristof.beyls
Reviewed By: compnerd
Subscribers: aemerson, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D38271
llvm-svn: 314255
Jakub Kuderski [Tue, 26 Sep 2017 21:56:55 +0000 (21:56 +0000)]
[Dominators] Invalidate DFS numbers upon edge deletions
This patch makes DeleteEdge correctly invalidate DFS numbers in the
incremental updater. This should fix PR34466 and related bugs.
llvm-svn: 314254
Sanjoy Das [Tue, 26 Sep 2017 21:54:27 +0000 (21:54 +0000)]
[BypassSlowDivision] Improve our handling of divisions by constants
Summary:
Don't bail out on constant divisors for divisions that can be narrowed without
introducing control flow . This gives us a 32 bit multiply instead of an
emulated 64 bit multiply in the generated PTX assembly.
Reviewers: jlebar
Subscribers: jholewinski, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D38265
llvm-svn: 314253
Geoff Berry [Tue, 26 Sep 2017 21:40:46 +0000 (21:40 +0000)]
[AArch64][Falkor] Fix bug in falkor prefetcher fix pass.
Summary:
In rare cases, loads that don't get prefetched that were marked as
strided loads could cause a crash if they occurred in a loop with other
colliding loads.
Reviewers: mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls
Differential Revision: https://reviews.llvm.org/D38261
llvm-svn: 314252
Geoff Berry [Tue, 26 Sep 2017 21:40:41 +0000 (21:40 +0000)]
[AArch64][Falkor] Fix correctness bug in falkor prefetcher fix pass and correct some opcode tag computations.
Summary:
This addresses a correctness bug for LD[1234]*_POST opcodes that have
the prefetcher fix applied to them: the base register was not being
written back from the temp after being incremented, so it would appear
to never be incremented.
Also, fix some opcode tag computations based on some updated HW details
to get better tag avoidance and thus better prefetcher performance.
Reviewers: mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls
Differential Revision: https://reviews.llvm.org/D38256
llvm-svn: 314251
Craig Topper [Tue, 26 Sep 2017 21:35:11 +0000 (21:35 +0000)]
[X86] Fix register class name in a comment. NFC
llvm-svn: 314250
Craig Topper [Tue, 26 Sep 2017 21:35:09 +0000 (21:35 +0000)]
Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST.""
The late MOV8rr_NOREX that caused the crash has been removed.
llvm-svn: 314249
Craig Topper [Tue, 26 Sep 2017 21:35:06 +0000 (21:35 +0000)]
[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg.
This hook is called after register allocation with two physical registers. We don't need a separate instruction at that time to force register class constraints. I left in the assert though. We also have a fatal error in X86MCCodeEmitter if we ever encode an H-reg and a REX prefix.
llvm-svn: 314248
Craig Topper [Tue, 26 Sep 2017 21:35:04 +0000 (21:35 +0000)]
[X86] Fix typo in comment. NFC
llvm-svn: 314247
Richard Smith [Tue, 26 Sep 2017 21:33:43 +0000 (21:33 +0000)]
Fix uninitialized member found by msan build bot.
llvm-svn: 314246
Sam Clegg [Tue, 26 Sep 2017 21:10:09 +0000 (21:10 +0000)]
[WebAssembly] Model weakly defined symbols as wasm exports
Previously these were being included as both imports and
exports, with the import being satisfied by the export
(or some strong symbol) at runtime. However proved
unnecessary and actually complicated linking as it meant
there was not a 1-to-1 mapping between a wasm function
/global index and a linker symbol.
Differential Revision: https://reviews.llvm.org/D38246
llvm-svn: 314245
Nemanja Ivanovic [Tue, 26 Sep 2017 20:42:47 +0000 (20:42 +0000)]
[PowerPC] Reverting sequence of patches for elimination of comparison instructions
In the past while, I've committed a number of patches in the PowerPC back end
aimed at eliminating comparison instructions. However, this causes some failures
in proprietary source and these issues are not observed in SPEC or any open
source packages I've been able to run.
As a result, I'm pulling the entire series and will refactor it to:
- Have a single entry point for easy control
- Have fine-grained control over which patterns we transform
A side-effect of this is that test cases for these patches (and modified by
them) are XFAIL-ed. This is a temporary measure as it is counter-productive
to remove/modify these test cases and then have to modify them again when
the refactored patch is recommitted.
The failure will be investigated in parallel to the refactoring effort and
the recommit will either have a fix for it or will leave this transformation
off by default until the problem is resolved.
llvm-svn: 314244
Jonathan Peyton [Tue, 26 Sep 2017 20:33:53 +0000 (20:33 +0000)]
Allow printing of KMP_TOPOLOGY_METHOD when KMP_SETTINGS=true
llvm-svn: 314243
Jonathan Peyton [Tue, 26 Sep 2017 20:12:16 +0000 (20:12 +0000)]
Remove unused t_single_lock
Add padding inside team structure to keep same structure size.
llvm-svn: 314242
Saleem Abdulrasool [Tue, 26 Sep 2017 20:12:04 +0000 (20:12 +0000)]
Sema: rename SemaBuiltinVAStart to SemaBuiltinVAStartMicrosoft
This function is used to perform semantic analysis on Microsoft style
`__va_start`. Rename it to make this more explicit. `__va_start` is
marked as `ALL_MS_LANGUAGES`, and requires Microsoft compatibility.
Other GNU targets will use `__builtin_va_start` instead. NFC.
Addresses post-commit review comments from David Majnemer.
llvm-svn: 314241
Gheorghe-Teodor Bercea [Tue, 26 Sep 2017 19:58:23 +0000 (19:58 +0000)]
Revert commmit 314228.
llvm-svn: 314240
Saleem Abdulrasool [Tue, 26 Sep 2017 19:26:01 +0000 (19:26 +0000)]
Basic: support Preserve{Most,All} CC on Windows
Add support for the `preserve_mostcc` and `preserve_allcc` on Windows
x86_64 and AArch64. This is used by Swift.
llvm-svn: 314236
Erich Keane [Tue, 26 Sep 2017 18:55:16 +0000 (18:55 +0000)]
Allow IUnknown/IInterface types to come from extern C++
It was brought up in response to my last implementation for
this struct-as-interface features that at least 1 header in
the MS SDK uses "extern C++" around an IUnknown declaration.
The previous implementation demanded that this type exist
in the TranslationUnit DeclContext. This small change simply
also allows in the situation where we're extern "C++".
llvm-svn: 314235
Michael Zuckerman [Tue, 26 Sep 2017 18:49:11 +0000 (18:49 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF{8|16|32} stride 3)
This patch expands the support of lowerInterleavedStore to {8|16|32}x8i stride 3.
LLVM creates suboptimal shuffle code-gen for AVX2. In overall, this patch is a specific fix for the pattern (Strid=3 VF={8|16|32}) .
This patch is part two of two patches and it covers the store (interlevaed) side.
The patch goal is to optimize the following sequence:
a0 a1 a2 a3 a4 a5 a6 a7
b0 b1 b2 b3 b4 b5 b6 b7
c0 c1 c2 c3 c4 c5 c6 c7
into
a0 b0 c0 a1 b1 c1 a2 b2
c2 a3 b3 c3 a4 b4 c4 a5
b5 c5 a6 b6 c6 a7 b7 c7
Reviewers:
zvi
guyblank
dorit
Ayal
Differential Revision: https://reviews.llvm.org/D37117
Change-Id: I56ced8bcbea809a37654060771911ade20246ccc
llvm-svn: 314234
Craig Topper [Tue, 26 Sep 2017 18:47:25 +0000 (18:47 +0000)]
[InstCombine] Remove one use restriction on the shift for calls to foldICmpAndShift.
If this transformation succeeds, we're going to remove our dependency on the shift by rewriting the and. So it doesn't matter how many uses the shift has.
This distributes the one use check to other transforms in foldICmpAndConstConst that do need it.
Differential Revision: https://reviews.llvm.org/D38206
llvm-svn: 314233
Nico Weber [Tue, 26 Sep 2017 18:38:56 +0000 (18:38 +0000)]
Delete trailing whitespace.
llvm-svn: 314232
Richard Smith [Tue, 26 Sep 2017 18:37:55 +0000 (18:37 +0000)]
Resolve a defect in C++17 copy omission.
When selecting constructors for initializing an object of type T from a single
expression of class type U, also consider conversion functions of U that
convert to T (rather than modeling such conversions as calling a conversion
function and then calling a constructor).
This approach is proposed as the resolution for the defect, and is also already
implemented by GCC.
llvm-svn: 314231
Sam Clegg [Tue, 26 Sep 2017 18:21:12 +0000 (18:21 +0000)]
[WebAssembly] Use function/global index space in WasmSymbol
It is useful for the symbol to contain the index of the
function of global it represents in the function/global
index space.
For imports we also store the import index so that the
linker can find, for example, the signature of the
corresponding function, which is defined by the import
In the long run we need to decide whether this API
surface should be closer to binary (where imported
functions are seperate) or the wasm spec (where the
function index space is unified).
Differential Revision: https://reviews.llvm.org/D38189
llvm-svn: 314230
Erich Keane [Tue, 26 Sep 2017 18:20:39 +0000 (18:20 +0000)]
[Sema] Corrected the warn-on-throw-from-noexcept behavior to include nothrow
Discovered that 'nothrow' (which is supposed to be an alias for noexcept)
was not warning with a throw inside of it. This patch corrects the behavior
previously created to add 'nothrow' to this list.
Differential Revision: https://reviews.llvm.org/D38203
llvm-svn: 314229
Gheorghe-Teodor Bercea [Tue, 26 Sep 2017 18:12:12 +0000 (18:12 +0000)]
[OpenMP] Add an additional test for D34888
Summary: Test for checking if the mapping is performed correctly. This is a test initially included in Patch https://reviews.llvm.org/D29905
Reviewers: Hahnfeld, carlo.bertolli, caomhin
Reviewed By: Hahnfeld
Subscribers: tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D38040
llvm-svn: 314228
Jake Ehrlich [Tue, 26 Sep 2017 18:02:25 +0000 (18:02 +0000)]
[llvm-objcopy] Add support for dynamic relocations
This change adds support for dynamic relocations (allocated
SHT_REL/SHT_RELA sections with a dynamic symbol table as their link).
The binary I added for the test is here:
https://drive.google.com/file/d/0B3gtIAmiMwZXSjJUZE9pUjd4M0k/view?usp=sharing
Unless support for dynamic symbol tables in yaml2obj is added this is
needed.
Differential Revision: https://reviews.llvm.org/D37915
llvm-svn: 314227
Saleem Abdulrasool [Tue, 26 Sep 2017 17:44:10 +0000 (17:44 +0000)]
Sema: Windows/ARM __va_start is not const correct
The `__va_start` intrinsic for Windows ARM does not account for const
correctness when performing a check. All local qualifiers are ignored
when validating the invocation. This was exposed by building the swift
stdlib against the Windows 10586 SDK for ARM. Simply expand out the
check for the two parameters and ignore the qualifiers for the check.
llvm-svn: 314226
Sean Callanan [Tue, 26 Sep 2017 17:25:34 +0000 (17:25 +0000)]
[Expression Parser] Inhibit global lookups for symbols in the IR dynamic checks
The IR dynamic checks are self-contained functions whose job is to
- verify that pointers referenced in an expression are valid at runtime; and
- verify that selectors sent to Objective-C objects by an expression are
actually supported by that object.
These dynamic checks forward-declare all the functions they use and should not
require any external debug information. The way they ensure this is by marking
all the names they use with a dollar sign ($). The expression parser recognizes
such symbols and perform no lookups for them.
This patch fixes three issues surrounding the use of the dollar sign:
- to fix a MIPS issue, the name of the pointer checker was changed from
starting with $ to starting with _$, but this was not properly ignored; and
- the Objective-C object checker used a temporary variable that did not start
with $.
- the Objective-C object checker used an externally-defined struct (struct
objc_selector) but didn't need to.
The patch also implements some cleanup in the area:
- it reformats the string containing the Objective-C object checker,
which was mangled horribly when the code was transformed to a uniform width
of 80 columns, and
- it factors out the logic for ignoring global $-symbols into common code
shared between ClangASTSource and ClangExpressionDeclMap.
Differential Revision: https://reviews.llvm.org/D38153
llvm-svn: 314225
Kostya Kortchinsky [Tue, 26 Sep 2017 17:20:02 +0000 (17:20 +0000)]
[scudo] Scudo thread specific data refactor, part 3
Summary:
Previous parts: D38139, D38183.
In this part of the refactor, we abstract the Linux vs Android TSD dissociation
in favor of a Exclusive vs Shared one, allowing for easier platform introduction
and configuration.
Most of this change consist of shuffling the files around to reflect the new
organization.
We introduce `scudo_platform.h` where platform specific definition lie. This
involves the TSD model and the platform specific allocator parameters. In an
upcoming CL, those will be configurable via defines, but we currently stick
with conservative defaults.
Reviewers: alekseyshl, dvyukov
Reviewed By: alekseyshl, dvyukov
Subscribers: srhines, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D38244
llvm-svn: 314224
Artem Belevich [Tue, 26 Sep 2017 17:07:23 +0000 (17:07 +0000)]
[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.
Differential Revision: https://reviews.llvm.org/D38191
llvm-svn: 314223
Simon Atanasyan [Tue, 26 Sep 2017 17:02:35 +0000 (17:02 +0000)]
[mips] Use llvm-dwarfdump to simplify the test. NFC
llvm-svn: 314222
Craig Topper [Tue, 26 Sep 2017 16:43:57 +0000 (16:43 +0000)]
[X86] Add support for v16i32 UMUL_LOHI/SMUL_LOHI
Summary: This patch extends the v8i32/v4i32 custom lowering to support v16i32
Reviewers: zvi, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38274
llvm-svn: 314221
Alexey Bataev [Tue, 26 Sep 2017 16:19:04 +0000 (16:19 +0000)]
[OPENMP] Fix handling of implicit mapping of array sections.
llvm-svn: 314220
Francis Ricci [Tue, 26 Sep 2017 16:12:56 +0000 (16:12 +0000)]
Invalidate symbolizer module list from dlopen/dlclose interceptors
Summary:
The module list should only be invalidated by dlopen and dlclose,
so the symbolizer should only re-generate it when we've hit one of those functions.
Reviewers: kubamracek, rnk, vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D37268
llvm-svn: 314219
Artem Dergachev [Tue, 26 Sep 2017 15:49:53 +0000 (15:49 +0000)]
[analyzer] Keep track of design discusions as part of analyzer documentation.
Create a directory to store discussions on potentially useful features that are
not yet implemented in the analyzer.
Fill it with a discussion on representing checker-specific parts of the program
state for C++ object modeling, that occured in D35216.
Differential Revision: https://reviews.llvm.org/D36737
llvm-svn: 314218
Gheorghe-Teodor Bercea [Tue, 26 Sep 2017 15:36:20 +0000 (15:36 +0000)]
[OpenMP] Don't throw cudalib not found error if only front-end is required.
Summary: If we only use the compiler front-end, do not throw an error about the cuda device library not being found. This allows the front-end to be run on systems where no Cuda installation is found.
Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, tra
Reviewed By: tra
Subscribers: hfinkel, tra, cfe-commits
Differential Revision: https://reviews.llvm.org/D37914
llvm-svn: 314217
Krzysztof Parzyszek [Tue, 26 Sep 2017 15:31:15 +0000 (15:31 +0000)]
[Hexagon] Fix a typo: #ifndef DEBUG -> #ifndef NDEBUG
llvm-svn: 314216