Bill Wendling [Thu, 22 Nov 2018 22:58:06 +0000 (22:58 +0000)]
A __builtin_constant_p() returns 0 with a function type.
llvm-svn: 347480
Craig Topper [Thu, 22 Nov 2018 22:56:52 +0000 (22:56 +0000)]
[LegalizeVectorTypes] Have SplitVecOp_TruncateHelper fall back to SplitVecOp_UnaryOp if splitting the output type would be a legal type.
SplitVecOp_TruncateHelper tries to introduce a multilevel truncate to avoid scalarization. But if splitting the result type would still be a legal type we don't need to do that.
The comment block at the top of the function implied that this was already implemented. I looked back through the history and it doesn't look to have ever been checked.
llvm-svn: 347479
Sanjay Patel [Thu, 22 Nov 2018 19:24:10 +0000 (19:24 +0000)]
[DAGCombiner] form 'not' ops ahead of shifts (PR39657)
We fail to canonicalize IR this way (prefer 'not' ops to arbitrary 'xor'),
but that would not matter without this patch because DAGCombiner was
reversing that transform. I think we need this transform in the backend
regardless of what happens in IR to catch cases where the shift-xor
is formed late from GEP or other ops.
https://rise4fun.com/Alive/NC1
Name: shl
Pre: (-1 << C2) == C1
%shl = shl i8 %x, C2
%r = xor i8 %shl, C1
=>
%not = xor i8 %x, -1
%r = shl i8 %not, C2
Name: shr
Pre: (-1 u>> C2) == C1
%sh = lshr i8 %x, C2
%r = xor i8 %sh, C1
=>
%not = xor i8 %x, -1
%r = lshr i8 %not, C2
https://bugs.llvm.org/show_bug.cgi?id=39657
llvm-svn: 347478
Louis Dionne [Thu, 22 Nov 2018 19:10:28 +0000 (19:10 +0000)]
[NFC] Fix typo in comment
llvm-svn: 347477
Vladimir Stefanovic [Thu, 22 Nov 2018 18:18:58 +0000 (18:18 +0000)]
Reland test/MC/Mips/reloc-directive-label-offset.s
The test was reverted because it failed on
llvm-clang-x86_64-expensive-checks-win builder, and that was because
-DEXPENSIVE_CHECKS adds randomness to llvm::sort(), affecting the order of
relocation table entries.
Modified the test to not have two relocations at the same offset.
llvm-svn: 347476
Louis Dionne [Thu, 22 Nov 2018 17:43:22 +0000 (17:43 +0000)]
[libcxx] Reintroduce UNSUPPORTED annotation for strstreambuf overflow test
This is a revert of r347421, except I'm using the with_system_cxx_lib
lit feature instead of availability to mark the test as unsupported
(because the problem is a bug in the dylib itself). In r347421, I said
I wasn't able to reproduce the issue and that's why I was removing it:
this was because I ran lit slightly wrong. The problem mentioned really
exists.
llvm-svn: 347475
Ilya Biryukov [Thu, 22 Nov 2018 17:27:08 +0000 (17:27 +0000)]
[clangd] Cleanup: make the diags callback global in TUScheduler
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54760
llvm-svn: 347474
Louis Dionne [Thu, 22 Nov 2018 16:38:03 +0000 (16:38 +0000)]
[libcxx] Add XFAIL for test on OS X 10.12 to 10.14
llvm-svn: 347473
Ilya Biryukov [Thu, 22 Nov 2018 16:20:12 +0000 (16:20 +0000)]
[clangd] Cleanup error consumption code. NFC
- Remove reimplementations of llvm::consumeError.
- Simplify test code by using EXPECT_ERROR where it fits.
llvm-svn: 347472
Louis Dionne [Thu, 22 Nov 2018 16:10:49 +0000 (16:10 +0000)]
[NFC][libcxx] Print human-friendly command line when lit test fails
We used to print a Python list corresponding to the command. It is more
useful to print the joined string so it can be copy/pasted directly when
a test fails.
llvm-svn: 347471
Alexander Kornienko [Thu, 22 Nov 2018 16:10:18 +0000 (16:10 +0000)]
[clang-tidy] Ignore template instantiations in modernize-use-using
The test I'm adding passes without the change due to the deduplication logic in
ClangTidyDiagnosticConsumer::take(). However this bug manifests in our internal
integration with clang-tidy.
I've verified the fix by locally changing LessClangTidyError to consider
replacements.
llvm-svn: 347470
Andrea Di Biagio [Thu, 22 Nov 2018 15:47:44 +0000 (15:47 +0000)]
[llvm-mca] LSUnit: use a SmallSet to model load/store queues. NFCI
Also, try to minimize the number of queries to the memory queues to speedup the
analysis.
On average, this change gives a small 2% speedup. For memcpy-like kernels, the
speedup is up to 5.5%.
llvm-svn: 347469
Ilya Biryukov [Thu, 22 Nov 2018 15:39:54 +0000 (15:39 +0000)]
[clangd] Cleanup: make diagnostics callbacks from TUScheduler non-racy
Summary:
Previously, removeDoc followed by an addDoc to TUScheduler resulted in
racy diagnostic responses, i.e. the old dianostics could be delivered
to the client after the new ones by TUScheduler.
To workaround this, we tracked a version number in ClangdServer and
discarded stale diagnostics. After this commit, the TUScheduler will
stop delivering diagnostics for removed files and the workaround in
ClangdServer is not required anymore.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54829
llvm-svn: 347468
Eric Liu [Thu, 22 Nov 2018 15:02:05 +0000 (15:02 +0000)]
[clangd] Cleanup: stop passing around list of supported URI schemes.
Summary:
Instead of passing around a list of supported URI schemes in clangd, we
expose an interface to convert a path to URI using any compatible scheme
that has been registered. It favors customized schemes and falls
back to "file" when no other scheme works.
Changes in this patch are:
- URI::create(AbsPath, URISchemes) -> URI::create(AbsPath). The new API finds a
compatible scheme from the registry.
- Remove URISchemes option everywhere (ClangdServer, SymbolCollecter, FileIndex etc).
- Unit tests will use "unittest" by default.
- Move "test" scheme from ClangdLSPServer to ClangdMain.cpp, and only
register the test scheme when lit-test or enable-lit-scheme is set.
(The new flag is added to make lit protocol.test work; I wonder if there
is alternative here.)
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54800
llvm-svn: 347467
Eric Liu [Thu, 22 Nov 2018 14:59:22 +0000 (14:59 +0000)]
[clangd] Cleanup: use index file instead of header in workspace symbols lit test.
Summary:
The full path of the input header depends on the execution environment
and may result in different behavior (e.g. when different URI schemes are used).
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54833
llvm-svn: 347466
Krasimir Georgiev [Thu, 22 Nov 2018 14:49:55 +0000 (14:49 +0000)]
[clang-format] Do not treat asm clobber [ as ObjCExpr, refined
Summary:
r346756 refined clang-format to not treat the `[` in `asm (...: [] ..)` as an
ObjCExpr. However that's not enough, as we might have a comma-separated list of
such clobbers as in the newly added test.
This updates the detection to instead look at the Line's first token being `asm`
and not mark `[`-s as ObjCExprs in this case.
Reviewers: djasper, benhamilton
Reviewed By: djasper, benhamilton
Subscribers: benhamilton, cfe-commits
Differential Revision: https://reviews.llvm.org/D54795
llvm-svn: 347465
Andrea Di Biagio [Thu, 22 Nov 2018 14:48:53 +0000 (14:48 +0000)]
[llvm-mca] Use a SmallVector instead of std::vector to track register reads/writes. NFCI
This avoids a heap allocation most of the times.
This patch gives a small but consistent 3% speedup on a release build (up to ~5%
on a debug build).
llvm-svn: 347464
Clement Courbet [Thu, 22 Nov 2018 14:26:33 +0000 (14:26 +0000)]
Revert rL347462 "[ASTMatchers] Add hasSideEffect() matcher."
Breaks some buildbots.
llvm-svn: 347463
Clement Courbet [Thu, 22 Nov 2018 14:00:56 +0000 (14:00 +0000)]
[ASTMatchers] Add hasSideEffect() matcher.
Summary: Exposes Expr::HasSideEffects.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D54830
llvm-svn: 347462
Louis Dionne [Thu, 22 Nov 2018 13:40:56 +0000 (13:40 +0000)]
[libcxx] Remove incorrect XFAIL on macos 10.12
llvm-svn: 347461
Benjamin Kramer [Thu, 22 Nov 2018 12:54:25 +0000 (12:54 +0000)]
[clangd] Fix use-after-scope in unit test
The scheduler holds a reference to `Proceed`, so it has to be destroyed
after the scheduler. Found by asan.
llvm-svn: 347460
Andrea Di Biagio [Thu, 22 Nov 2018 12:48:57 +0000 (12:48 +0000)]
[llvm-mca] Fix an invalid memory read introduced by r346487.
This patch fixes an invalid memory read introduced by r346487.
Before this patch, partial register write had to query the latency of the
dependent full register write by calling a method on the full write descriptor.
However, if the full write is from an already retired instruction, chances are
that the EntryStage already reclaimed its memory.
In some parial register write tests, valgrind was reporting an invalid
memory read.
This change fixes the invalid memory access problem. Writes are now responsible
for tracking dependent partial register writes, and notify them in the event of
instruction issued.
That means, partial register writes no longer need to query their associated
full write to check when they are ready to execute.
Added test X86/BtVer2/partial-reg-update-7.s
llvm-svn: 347459
Max Kazantsev [Thu, 22 Nov 2018 12:43:27 +0000 (12:43 +0000)]
[NFC] Assert that all blocks staying in loop are live
llvm-svn: 347458
Max Kazantsev [Thu, 22 Nov 2018 12:33:41 +0000 (12:33 +0000)]
[NFC] Ensure deterministic order of dead exit blocks
llvm-svn: 347457
John Brawn [Thu, 22 Nov 2018 11:45:23 +0000 (11:45 +0000)]
[AArch64] Fix SelectionDAG infinite loop for v1i64 SCALAR_TO_VECTOR
A consequence of r347274 is that SCALAR_TO_VECTOR can be converted into
BUILD_VECTOR by SimplifyDemandedBits, but LowerBUILD_VECTOR can turn
BUILD_VECTOR into SCALAR_TO_VECTOR so we get an infinite loop.
Fix this by making LowerBUILD_VECTOR not do this transformation for those
vectors that would get transformed back, i.e. BUILD_VECTOR of a single-element
constant vector. Doing that means we get a DUP, which we then need to recognise
in ISel as a copy.
llvm-svn: 347456
George Rimar [Thu, 22 Nov 2018 11:40:08 +0000 (11:40 +0000)]
[ELF] - Make SymbolTable::addDefined return Defined.
Now it returns Symbol. This should be NFC that
avoids doing cast at the caller's sides.
Differential revision: https://reviews.llvm.org/D54627
llvm-svn: 347455
Max Kazantsev [Thu, 22 Nov 2018 10:48:30 +0000 (10:48 +0000)]
[NFC] Simplify code by using standard exit blocks collection
llvm-svn: 347454
Clement Courbet [Thu, 22 Nov 2018 10:44:36 +0000 (10:44 +0000)]
[ASTMatchers] Re-generate ast matchers doc after rL346455.
llvm-svn: 347453
Chandler Carruth [Thu, 22 Nov 2018 10:31:35 +0000 (10:31 +0000)]
[TI removal] Leverage the fact that TerminatorInst is gone to create
a normal base class that provides all common "call" functionality.
This merges two complex CRTP mixins for the common "call" logic and
common operand bundle logic into a single, normal base class of
`CallInst` and `InvokeInst`. Going forward, users can typically
`dyn_cast<CallBase>` and use the resulting API. No more need for the
`CallSite` wrapper. I'm planning to migrate current usage of the wrapper
to directly use the base class and then it can be removed, but those are
simpler and much more incremental steps. The big change is to introduce
this abstraction into the type system.
I've tried to do some basic simplifications of the APIs that I couldn't
really help but touch as part of this:
- I've tried to organize the attribute API and bundle API into groups to
make understanding the API of `CallBase` easier. Without this,
I wasn't able to navigate the API sanely for all of the ways I needed
to modify it.
- I've added what seem like more clear and consistent APIs for getting
at the called operand. These ended up being especially useful to
consolidate the *numerous* duplicated code paths trying to do this.
- I've largely reworked the organization and implementation of the APIs
for computing the argument operands as they needed to change to work
with the new subclass approach.
To minimize any cost associated with this abstraction, I've moved the
operand layout in memory to store the called operand last. This makes
its position relative to the end of the operand array the same,
regardless of the subclass. It should make it much cheaper to reference
from the `CallBase` abstraction, and this is likely one of the most
frequent things to query.
We do still pay one abstraction penalty here: we have to branch to
determine whether there are 0 or 2 extra operands when computing the end
of the argument operand sequence. However, that seems both rare and
should optimize well. I've implemented this in a way specifically
designed to allow it to optimize fairly well. If this shows up in
profiles, we can add overrides of the relevant methods to the subclasses
that bypass this penalty. It seems very unlikely that this will be an
issue as the code was *already* dealing with an ever present abstraction
of whether or not there are operand bundles, so this isn't the first
branch to go into the computation.
I've tried to remove as much of the obvious vestigial API surface of the
old CRTP implementation as I could, but I suspect there is further
cleanup that should now be possible, especially around the operand
bundle APIs. I'm leaving all of that for future work in this patch as
enough things are changing here as-is.
One thing that made this harder for me to reason about and debug was the
pervasive use of unsigned values in subtraction and other arithmetic
computations. I had to debug more than one unintentional wrap. I've
switched a few of these to use `int` which seems substantially simpler,
but I've held back from doing this more broadly to avoid creating
confusing divergence within a single class's API.
I also worked to remove all of the magic numbers used to index into
operands, putting them behind named constants or putting them into
a single method with a comment and strictly using the method elsewhere.
This was necessary to be able to re-layout the operands as discussed
above.
Thanks to Ben for reviewing this (somewhat large and awkward) patch!
Differential Revision: https://reviews.llvm.org/D54788
llvm-svn: 347452
David Carlier [Thu, 22 Nov 2018 10:31:01 +0000 (10:31 +0000)]
Unbreak FreeBSD build.
M lib/sanitizer_common/sanitizer_platform_limits_posix.cc
llvm-svn: 347451
Sam McCall [Thu, 22 Nov 2018 10:22:16 +0000 (10:22 +0000)]
[clangd] Respect task cancellation in TUScheduler.
Summary:
- Reads are never executed if canceled before ready-to run.
In practice, we finalize cancelled reads eagerly and out-of-order.
- Cancelled reads don't prevent prior updates from being elided, as they don't
actually depend on the result of the update.
- Updates are downgraded from WantDiagnostics::Yes to WantDiagnostics::Auto when
cancelled, which allows them to be elided when all dependent reads are
cancelled and there are subsequent writes. (e.g. when the queue is backed up
with cancelled requests).
The queue operations aren't optimal (we scan the whole queue for cancelled
tasks every time the scheduler runs, and check cancellation twice in the end).
However I believe these costs are still trivial in practice (compared to any
AST operation) and the logic can be cleanly separated from the rest of the
scheduler.
Reviewers: ilya-biryukov
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54746
llvm-svn: 347450
Haojian Wu [Thu, 22 Nov 2018 10:14:55 +0000 (10:14 +0000)]
Move the llvm lit test dependencies to clang-tools-extra.
Summary: Part of revert r343473
Reviewers: mgorny
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D54798
llvm-svn: 347449
Haojian Wu [Thu, 22 Nov 2018 10:14:24 +0000 (10:14 +0000)]
Revert r343473 "Move llvm util dependencies from clang-tools-extra to add_lit_target."
Summary:
It will cause test tools `FileCheck`, `count`, `not` being built blindly, these
dependencies should move back to clang-tools-extra.
Reviewers: mgorny
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D54797
llvm-svn: 347448
Diana Picus [Thu, 22 Nov 2018 09:54:14 +0000 (09:54 +0000)]
[ARM GlobalISel] Add test for BFC. NFCI
r334871 has made it possible for TableGen'erated code to select BFC, but
it has not added a test for it on the ARM side. Add it now to make sure
we don't introduce regressions if we ever change anything about that
rule.
llvm-svn: 347447
Bill Wendling [Thu, 22 Nov 2018 09:31:08 +0000 (09:31 +0000)]
The result of is.constant() is unsigned.
llvm-svn: 347446
Jonas Paulsson [Thu, 22 Nov 2018 07:17:29 +0000 (07:17 +0000)]
[SystemZTTIImpl] Give correct cost values for vector bswap intrinsics.
Implement getIntrinsicInstrCost() and return costs reflecting that bswap can
be done with a vperm per vector register.
Review: Ulrich Weigand
https://reviews.llvm.org/D54789
llvm-svn: 347445
Petr Hosek [Thu, 22 Nov 2018 02:36:47 +0000 (02:36 +0000)]
[Driver] Support XRay on Fuchsia
This enables support for XRay in Fuchsia Clang driver.
Differential Revision: https://reviews.llvm.org/D52160
llvm-svn: 347444
Petr Hosek [Thu, 22 Nov 2018 02:00:44 +0000 (02:00 +0000)]
[XRay] Support for Fuchsia
This extends XRay to support Fuchsia.
Differential Revision: https://reviews.llvm.org/D52162
llvm-svn: 347443
Peter Collingbourne [Thu, 22 Nov 2018 00:47:37 +0000 (00:47 +0000)]
tsan: Update measurements in check_analyze.sh.
These changed as a result of r347379. Unfortunately there was a
regression; filed PR39748 to track it.
Differential Revision: https://reviews.llvm.org/D54821
llvm-svn: 347442
Fangrui Song [Thu, 22 Nov 2018 00:44:17 +0000 (00:44 +0000)]
[llvm-size] Use empty() and range-based for loop. NFC
llvm-svn: 347441
Evandro Menezes [Thu, 22 Nov 2018 00:38:36 +0000 (00:38 +0000)]
[llvm-mca] Add test case (NFC)
Add test case that will serve as the base for D54820.
llvm-svn: 347440
Peter Collingbourne [Thu, 22 Nov 2018 00:00:26 +0000 (00:00 +0000)]
tsan: Correct the name of an executable.
llvm-svn: 347439
Sanjay Patel [Wed, 21 Nov 2018 23:39:19 +0000 (23:39 +0000)]
[x86] use FileCheck to verify output; NFC
llvm-svn: 347438
Evandro Menezes [Wed, 21 Nov 2018 23:36:40 +0000 (23:36 +0000)]
[llvm-mca] Add test case (NFC)
Fix previous commit r347434.
llvm-svn: 347437
Peter Collingbourne [Wed, 21 Nov 2018 23:04:39 +0000 (23:04 +0000)]
Add a ubsan blacklist entry for libstdc++ 8.0.1.
llvm-svn: 347436
Louis Dionne [Wed, 21 Nov 2018 23:00:45 +0000 (23:00 +0000)]
[libcxx] Improve error message when an invalid directory is provided as use_system_cxx_lib
llvm-svn: 347435
Evandro Menezes [Wed, 21 Nov 2018 22:57:46 +0000 (22:57 +0000)]
[llvm-mca] Add test case (NFC)
Add test case that will serve as the base for D54777.
llvm-svn: 347434
Vladimir Stefanovic [Wed, 21 Nov 2018 22:08:34 +0000 (22:08 +0000)]
Removing test/MC/Mips/reloc-directive-label-offset.s temporarily
This test is failing on llvm-clang-x86_64-expensive-checks-win builder.
Removing it until I get it fixed.
llvm-svn: 347433
Fedor Sergeev [Wed, 21 Nov 2018 22:01:19 +0000 (22:01 +0000)]
[PM] correcting return value for new-pass-manager version of Scalarizer
Obvious mistake missed during D54695 review.
llvm-svn: 347432
Reid Kleckner [Wed, 21 Nov 2018 22:01:10 +0000 (22:01 +0000)]
[mingw] Use unmangled name after the $ in the section name
GCC does it this way, and we have to be consistent. This includes
stdcall and fastcall functions with suffixes. I confirmed that a
fastcall function named "foo" ends up in ".text$foo", not
".text$@foo@8".
Based on a patch by Andrew Yohn!
Fixes PR39218.
Differential Revision: https://reviews.llvm.org/D54762
llvm-svn: 347431
Petr Hosek [Wed, 21 Nov 2018 21:59:39 +0000 (21:59 +0000)]
Revert "[Driver] Use --push/pop-state with Sanitizer link deps"
This reverts commit r347413: older versions of ld.gold that are used
by Android don't support --push/pop-state which broke sanitizer bots.
llvm-svn: 347430
Peter Collingbourne [Wed, 21 Nov 2018 21:29:35 +0000 (21:29 +0000)]
COFF: ICF: Include contents of referenced sections in initial partitioning hash. NFCI.
Previously we were taking over 13 minutes to link Firefox's xul.dll
on ARM64; this reduces link time to around 18s on my machine.
The root cause of the problem was that all of the input .pdata sections
had the same unrelocated section data and therefore the same hash,
which made segregation quadratic in the number of .pdata sections. The
reason why we weren't observing this on other architectures was that
ARM has a different .pdata format. On non-ARM the format is (start
address, end address, .xdata), which caused the size of the function
to appear in the unrelocated section data where the end address field
is. However, the ARM format omits the end address field.
Fixes PR39667.
Differential Revision: https://reviews.llvm.org/D54809
llvm-svn: 347429
Stefan Pintilie [Wed, 21 Nov 2018 21:23:50 +0000 (21:23 +0000)]
[PowerPC][NFC] Split PPCMCCodeEmitter into header and cpp file.
This is further cleanup for PPCMCCodeEmitter. The class had been contained
within the cpp file alone. Now it has been split up between a header file and
a cpp file which allows other classes to make use of the functions in this class
if required.
llvm-svn: 347428
Louis Dionne [Wed, 21 Nov 2018 21:22:08 +0000 (21:22 +0000)]
[libcxx] Remove unused definition of aligned allocation macro on old OS X
We don't support mac OS 10.6 and older anymore, so this macro can never
be defined. This bit of code had been added in D28931 as a fix for
PR31448, but it doesn't seem necessary anymore.
llvm-svn: 347427
David Carlier [Wed, 21 Nov 2018 21:17:46 +0000 (21:17 +0000)]
[Sanitizer] Adding setvbuf in supported platforms and other stream buffer functions
- Enabling setvbuf interceptions for non NetBSD platforms.
- setbuf, setbuffer, setlinebuf as well.
Reviewers: vitalybuka, krytarowski
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D54779
llvm-svn: 347426
Alexey Bataev [Wed, 21 Nov 2018 21:04:34 +0000 (21:04 +0000)]
[OPENMP][NVPTX]Emit default locations as constant with undefined mode.
For the NVPTX target default locations should be emitted as constants +
additional info must be emitted in the reserved_2 field of the ident_t
structure. The 1st bit controls the execution mode and the 2nd bit
controls use of the lightweight runtime. The combination of the bits for
Non-SPMD mode + lightweight runtime represents special undefined mode,
used outside of the target regions for orphaned directives or functions.
Should allow and additional optimization inside of the target regions.
llvm-svn: 347425
Sanjay Patel [Wed, 21 Nov 2018 20:54:47 +0000 (20:54 +0000)]
[DAGCombiner] refactor select-of-FP-constants transform
This transform needs to be limited.
We are converting to a constant pool load very early, and we
are turning loads that are independent of the select condition
(and therefore speculatable) into a dependent non-speculatable
load.
We may also be transferring a condition code from an FP register
to integer to create that dependent load.
llvm-svn: 347424
Louis Dionne [Wed, 21 Nov 2018 20:53:07 +0000 (20:53 +0000)]
[libcxx] Fix incorrect iterator type in vector container test
The iterator types for different specializations of containers with the
same element type but different allocators are not required to be
convertible. This patch makes the test to take the iterator type from
the same container specialization as the created container.
Reviewed as https://reviews.llvm.org/D54806.
Thanks to Andrey Maksimov for the patch.
llvm-svn: 347423
Stefan Pintilie [Wed, 21 Nov 2018 20:47:59 +0000 (20:47 +0000)]
[PowerPC][NFC] Minor Code Cleaup for PPCMCCodeEmitter.
llvm-svn: 347422
Louis Dionne [Wed, 21 Nov 2018 20:47:00 +0000 (20:47 +0000)]
[libcxx] Mark strstreams tests as being supported on all OS X versions
I wasn't able to reproduce the issue referred to by the comment using
the libc++'s shipped with mac OS X 10.7 and 10.8, so I assume this may
have been fixed in a function that is now shipped in the headers. In
that case, the tests will pass no matter what dylib we're using.
In the worst case, some test bots will start failing and I'll understand
why I was wrong, and I can create an actual lit feature for it. Note
that I could just leave this test alone, but this change is on the path
towards eradicating vendor-specific availability markup from the test
suite.
llvm-svn: 347421
Eric Fiselier [Wed, 21 Nov 2018 20:46:50 +0000 (20:46 +0000)]
[LLVM] Allow modulemap installation
Summary:
Currently we can't install the modulemaps provided by LLVM, since they are not structured to support headers generated as part of the build (ex. `llvm/IR/Attributes.gen`).
This patch restructures the module maps in order to support installation.
Modules containing generated headers are defined in the new `module.extern.modulemap` file, and are referenced from the main `module.modulemap` using `extern module`. There are two versions of the `module.extern.modulemap` file; one used when building and another, `module.install.modulemap`, which is re-named during installation.
Users can opt-into module map installation using `-DLLVM_INSTALL_MODULEMAPS=ON`. The default value is `OFF` due to llvm.org/PR31905.
Reviewers: rsmith, mehdi_amini, bruno, EricWF
Reviewed By: EricWF
Subscribers: tschuett, chapuni, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D53510
llvm-svn: 347420
Bill Wendling [Wed, 21 Nov 2018 20:45:00 +0000 (20:45 +0000)]
Update call to EvaluateAsInt() to the new syntax.
llvm-svn: 347419
Bill Wendling [Wed, 21 Nov 2018 20:44:38 +0000 (20:44 +0000)]
Update call to EvaluateAsInt() to the new syntax.
llvm-svn: 347418
Bill Wendling [Wed, 21 Nov 2018 20:44:18 +0000 (20:44 +0000)]
Re-Reinstate 347294 with a fix for the failures.
Don't try to emit a scalar expression for a non-scalar argument to
__builtin_constant_p().
Third time's a charm!
llvm-svn: 347417
Eric Fiselier [Wed, 21 Nov 2018 20:39:24 +0000 (20:39 +0000)]
Fix missing includes in test header
llvm-svn: 347416
Roman Lebedev [Wed, 21 Nov 2018 20:35:43 +0000 (20:35 +0000)]
[compiler-rt][UBSan] silence_unsigned_overflow: do *NOT* ignore *fatal* unsigned overflows
Summary:
D48660 / rL335762 added a `silence_unsigned_overflow` env flag for [[ https://github.com/google/oss-fuzz/pull/1717 | oss-fuzz needs ]],
that allows to silence the reports from unsigned overflows.
It makes sense, it is there because `-fsanitize=integer` sanitizer is not enabled on oss-fuzz,
so this allows to still use it as an interestingness signal, without getting the actual reports.
However there is a slight problem here.
All types of unsigned overflows are ignored.
Even if `-fno-sanitize-recover=unsigned` was used (which means the program will die after the report)
there will still be no report, the program will just silently die.
At the moment there are just two projects on oss-fuzz that care:
* [[ https://github.com/google/oss-fuzz/blob/
8eeffa627f937040aaf8ba1b7d93f43f77d74fb9/projects/llvm_libcxx/build.sh#L18-L20 | libc++ ]]
* [[ https://github.com/google/oss-fuzz/blob/
8eeffa627f937040aaf8ba1b7d93f43f77d74fb9/projects/librawspeed/build.sh | RawSpeed ]] (me)
I suppose this could be overridden there ^, but i really don't think this is intended behavior in any case..
Reviewers: kcc, Dor1s, #sanitizers, filcab, vsk, kubamracek
Reviewed By: Dor1s
Subscribers: dberris, mclow.lists, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D54771
llvm-svn: 347415
Nikita Popov [Wed, 21 Nov 2018 20:34:11 +0000 (20:34 +0000)]
[InstCombine] Add tests for funnel shift with zero operand; NFC
These are additional baseline tests for D54778.
llvm-svn: 347414
Petr Hosek [Wed, 21 Nov 2018 20:33:12 +0000 (20:33 +0000)]
[Driver] Use --push/pop-state with Sanitizer link deps
Sanitizer runtime link deps handling passes --no-as-needed because of
PR15823, but it never undoes it and this flag may affect other libraries
that come later on the link line. To avoid this, wrap Sanitizer link
deps in --push/pop-state.
Differential Revision: https://reviews.llvm.org/D54805
llvm-svn: 347413
Stella Stamenova [Wed, 21 Nov 2018 20:16:06 +0000 (20:16 +0000)]
[lit] Add pthread to the compilation of the tests on Linux
Summary: Right now only some platforms add pthread to the compilation, however, at least one of the tests requires the pthread library on Linux as well. Since the library is available, this change adds it by default on Linux.
Reviewers: labath, zturner, asmith
Subscribers: stella.stamenova, jfb, lldb-commits
Differential Revision: https://reviews.llvm.org/D54808
llvm-svn: 347412
Kelvin Li [Wed, 21 Nov 2018 20:15:57 +0000 (20:15 +0000)]
[OPENMP] Refactor code for parsing omp declare target directive and its clauses (NFC)
This patch refactor the code for parsing omp declare target directive and
its clauses.
Patch by pjeeva01 (Jeeva P.)
Differential Revision: https://reviews.llvm.org/D54708
llvm-svn: 347411
Sanjay Patel [Wed, 21 Nov 2018 20:00:32 +0000 (20:00 +0000)]
[DAGCombiner] reduce code duplication; NFC
llvm-svn: 347410
Alexey Bataev [Wed, 21 Nov 2018 19:41:10 +0000 (19:41 +0000)]
[OPENMP]Fix handling of the LCVs in loop-based directives.
Loop-control variables with the default data-sharing attributes should
not be captured in the OpenMP region as they are private by default.
Also, default attributes should be emitted for such variables in the
inner OpenMP regions for the correct data sharing during codegen.
llvm-svn: 347409
Kelvin Li [Wed, 21 Nov 2018 19:38:53 +0000 (19:38 +0000)]
[OPENMP] remove redundant MapTypeModifierSpecified flag in ParseOpenMP.cpp (NFC)
Whether the map type modifier is specified or not, the flag
MapTypeModifierSpecified is always set to true.
Patch by Ahsan Saghir
Differential Revision: https://reviews.llvm.org/D54638
llvm-svn: 347408
Nikita Popov [Wed, 21 Nov 2018 19:37:19 +0000 (19:37 +0000)]
[MergeFuncs] Generate alias instead of thunk if possible
The MergeFunctions pass was originally intended to emit aliases
instead of thunks where possible (unnamed_addr). However, for a
long time this functionality was behind a flag hardcoded to false,
bitrotted and was eventually removed in r309313.
Originally the functionality was first disabled in r108417 due to
lack of support for aliases in Mach-O. I believe that this is no
longer the case nowadays, but not really familiar with this area.
In the interest of being conservative, this patch reintroduces the
aliasing functionality behind a default disabled -mergefunc-use-aliases
flag.
Differential Revision: https://reviews.llvm.org/D53285
llvm-svn: 347407
Sanjay Patel [Wed, 21 Nov 2018 19:14:38 +0000 (19:14 +0000)]
[x86] add tests for select-of-FP-constants; NFC
llvm-svn: 347406
Kelvin Li [Wed, 21 Nov 2018 19:10:48 +0000 (19:10 +0000)]
[OPENMP] Support relational-op != (not-equal) as one of the canonical
forms of random access iterator
In OpenMP 4.5, only 4 relational operators are supported: <, <=, >,
and >=. This work is to enable support for relational operator
!= (not-equal) as one of the canonical forms.
Patch by Anh Tuyen Tran
Differential Revision: https://reviews.llvm.org/D54441
llvm-svn: 347405
Fangrui Song [Wed, 21 Nov 2018 18:10:00 +0000 (18:10 +0000)]
[ELF] Write IPLT header in -static -z retpolineplt mode
Summary:
This fixes PR39711: -static -z retpolineplt does not produce retpoline PLT header.
-z now is not relevant.
Statically linked executable does not have PLT, but may have IPLT with no header. When -z retpolineplt is specified, however, the repoline PLT header should still be emitted.
I've checked that this fixes the FreeBSD reproduce in PR39711 and a Linux program statically linked against glibc. The programm print "Hi" rather than SIGILL/SIGSEGV.
getPltEntryOffset may look dirty after this patch, but it can be cleaned up later.
Another possible improvement is that when there are non-preemptible IFUNC symbols (rare case, e.g. -Bsymbolic), both In.Plt and In.Iplt can be non-empty and we'll emit the retpoline PLT header twice.
Reviewers: espindola, emaste, chandlerc, ruiu
Reviewed By: emaste
Subscribers: emaste, arichardson, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D54782
llvm-svn: 347404
Sanjay Patel [Wed, 21 Nov 2018 18:02:50 +0000 (18:02 +0000)]
[x86] fix predicate for avoiding vblendv
It only makes sense to produce the logic ops when 1 of the
constants is +0.0. Otherwise, go with vblendv to reduce code.
llvm-svn: 347403
Jorge Gorbe Moya [Wed, 21 Nov 2018 17:49:37 +0000 (17:49 +0000)]
Mark lambda decl as invalid if a captured variable has an invalid type.
This causes the compiler to crash when trying to compute a layout for
the lambda closure type (see included test).
llvm-svn: 347402
Sanjay Patel [Wed, 21 Nov 2018 17:47:18 +0000 (17:47 +0000)]
[x86] add test for FP select with constant; NFC
llvm-svn: 347401
Louis Dionne [Wed, 21 Nov 2018 17:31:55 +0000 (17:31 +0000)]
[libcxx] Make sure operator+ is declared with the right visibility attribute
Otherwise, Clang complains about internal_linkage not being applied to the
first declaration of the operator (and rightfully so).
llvm-svn: 347400
Louis Dionne [Wed, 21 Nov 2018 17:00:52 +0000 (17:00 +0000)]
[libcxx] Mark stray symbols as hidden to try and fix the build
r347395 changed the ABI list on Linux, but two of those symbols are still
being exported from the shared object:
_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_
_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_
This commit makes sure those symbols are not exported, as they should be.
llvm-svn: 347399
Vladimir Stefanovic [Wed, 21 Nov 2018 16:38:34 +0000 (16:38 +0000)]
[mips][mc] Add basic support for R_MIPS_JALR/R_MICROMIPS_JALR
R_MIPS_JALR/R_MICROMIPS_JALR can now be parsed in .s files and emitted to .o.
They are still not generated with JALR.
Differential revision: https://reviews.llvm.org/D54721
llvm-svn: 347398
Vladimir Stefanovic [Wed, 21 Nov 2018 16:28:39 +0000 (16:28 +0000)]
[MC] Support labels as offsets in .reloc directive
Currently, expressions like
.reloc 1f, R_MIPS_JALR, foo
1: nop
are not allowed, ie. an offset in .reloc can only be absolute value.
This patch adds support for labels as offsets.
If offset is a forward declared label, MCObjectStreamer keeps the fixup locally
and adds it to the fixups vector after the label (and its offset) is defined.
label+number is not supported yet.
Differential revision: https://reviews.llvm.org/D53990
llvm-svn: 347397
Louis Dionne [Wed, 21 Nov 2018 16:27:14 +0000 (16:27 +0000)]
[NFC][libcxx] Add revision number to ABI changelog
llvm-svn: 347396
Louis Dionne [Wed, 21 Nov 2018 16:24:46 +0000 (16:24 +0000)]
[libcxx] Make sure we can build with -fvisibility=hidden on Linux
Summary:
This commit marks a few functions as hidden and removes them from the ABI list
on Linux such that libc++ can be built with -fvisibility=hidden. The functions
marked as hidden by this patch were exported from the shared object only
because they were implicitly instantiated function templates. It is safe
to stop exporting those symbols from the shared object because nobody could
actually depend on them: implicit instantiations are not taken from shared
objects.
The symbols removed in this commit are basically the same that had been
removed in https://reviews.llvm.org/D53868, but that patch had to be reverted
because it broke the build (because the functions were not marked as hidden
like this patch does).
Reviewers: EricWF, mclow.lists
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54639
llvm-svn: 347395
Sanjay Patel [Wed, 21 Nov 2018 15:26:35 +0000 (15:26 +0000)]
[x86] add checks for asm to test; NFC
llvm-svn: 347394
Simon Pilgrim [Wed, 21 Nov 2018 14:26:19 +0000 (14:26 +0000)]
[TargetLowering] SimplifyDemandedBits - only reduce known bits for integer constants
Avoids fuzzing crash found by Mikael Holmén.
llvm-svn: 347393
Mikael Holmen [Wed, 21 Nov 2018 14:00:17 +0000 (14:00 +0000)]
[PM] Port Scalarizer to the new pass manager.
Patch by: markus (Markus Lavin)
Reviewers: chandlerc, fedor.sergeev
Reviewed By: fedor.sergeev
Subscribers: llvm-commits, Ka-Ka, bjope
Differential Revision: https://reviews.llvm.org/D54695
llvm-svn: 347392
Nico Weber [Wed, 21 Nov 2018 12:50:13 +0000 (12:50 +0000)]
Revert 347365, its prerequisite 347364 got reverted.
llvm-svn: 347391
Nico Weber [Wed, 21 Nov 2018 12:49:22 +0000 (12:49 +0000)]
Revert 347366, its prerequisite 347364 got reverted.
llvm-svn: 347390
Nico Weber [Wed, 21 Nov 2018 12:47:43 +0000 (12:47 +0000)]
Revert r347364 again, the fix was incomplete.
llvm-svn: 347389
Peter Smith [Wed, 21 Nov 2018 11:30:03 +0000 (11:30 +0000)]
[ARM] Change REQUIRES: ARM to Requires: arm
When REQUIRES: ARM is used the test is skipped as ARM is not recognized.
Change to REQUIRES: arm so that it is run. This required updating one of the
tests due to changes in expected output.
Differential Revision: https://reviews.llvm.org/D54786
llvm-svn: 347388
Michal Gorny [Wed, 21 Nov 2018 11:25:01 +0000 (11:25 +0000)]
[nios2] Add missing Nios2CodeGen -> Nios2AsmPrinter linkage
Add missing linkage from Nios2CodeGen library to Nios2AsmPrinter
library. The missing dependency causes shared-lib build to fail with
the following reason:
lib/Target/Nios2/CMakeFiles/LLVMNios2CodeGen.dir/Nios2AsmPrinter.cpp.o: In function `(anonymous namespace)::Nios2AsmPrinter::PrintAsmMemoryOperand(llvm::MachineInstr const*, unsigned int, unsigned int, char const*, llvm::raw_ostream&)':
Nios2AsmPrinter.cpp:(.text._ZN12_GLOBAL__N_115Nios2AsmPrinter21PrintAsmMemoryOperandEPKN4llvm12MachineInstrEjjPKcRNS1_11raw_ostreamE+0x2b): undefined reference to `llvm::Nios2InstPrinter::getRegisterName(unsigned int)'
lib/Target/Nios2/CMakeFiles/LLVMNios2CodeGen.dir/Nios2AsmPrinter.cpp.o: In function `(anonymous namespace)::Nios2AsmPrinter::PrintAsmOperand(llvm::MachineInstr const*, unsigned int, unsigned int, char const*, llvm::raw_ostream&)':
Nios2AsmPrinter.cpp:(.text._ZN12_GLOBAL__N_115Nios2AsmPrinter15PrintAsmOperandEPKN4llvm12MachineInstrEjjPKcRNS1_11raw_ostreamE+0x97): undefined reference to `llvm::Nios2InstPrinter::getRegisterName(unsigned int)'
collect2: error: ld returned 1 exit status
Differential Revision: https://reviews.llvm.org/D47810
llvm-svn: 347387
Simon Pilgrim [Wed, 21 Nov 2018 11:00:09 +0000 (11:00 +0000)]
[X86][AVX] Remove BROADCAST if we only need the 0'th element
We don't catch this with target shuffle simplification if the src/dst types are different.
llvm-svn: 347386
Nikita Popov [Wed, 21 Nov 2018 10:57:22 +0000 (10:57 +0000)]
Test commit: Delete trailing space in comment
llvm-svn: 347385
Max Kazantsev [Wed, 21 Nov 2018 09:55:09 +0000 (09:55 +0000)]
[NFC] More complex tests for LoopSimplifyCFG
llvm-svn: 347384
Dmitry Vyukov [Wed, 21 Nov 2018 09:31:21 +0000 (09:31 +0000)]
tsan: add pthread_tryjoin_np and pthread_timedjoin_np interceptors
Add pthread_tryjoin_np() and pthread_timedjoin_np() interceptors on Linux,
so that ThreadSanitizer can handle programs using these functions.
Author: Yuri Per (yuri)
Reviewed in: https://reviews.llvm.org/D54521
llvm-svn: 347383
Douglas Yung [Wed, 21 Nov 2018 08:54:40 +0000 (08:54 +0000)]
Add header <atomic> which is needed to compile with some older library versions.
llvm-svn: 347382
Max Kazantsev [Wed, 21 Nov 2018 07:22:06 +0000 (07:22 +0000)]
[NFC] Add some sophisticated tests on LoopSimplifyCFG
llvm-svn: 347381