Aleksandr Urakov [Wed, 15 Aug 2018 10:54:06 +0000 (10:54 +0000)]
[X86] Add sibling-call test cases
This commit adds new sibling-call test cases, so it will be possible to see
how these test cases will be changed after applying D45653.
See D45653 for details.
llvm-svn: 339760
David Green [Wed, 15 Aug 2018 10:39:43 +0000 (10:39 +0000)]
Fix ASTMatchersTraversalTest testcase compile on older compilers
Some versions of gcc, especially when invoked through ccache (-E), can have
trouble with raw string literals inside macros. This moves the string out of
the macro.
llvm-svn: 339759
Simon Pilgrim [Wed, 15 Aug 2018 10:11:13 +0000 (10:11 +0000)]
[TargetLowering] Minor refactor to TargetLowering::BuildUDIV to merge scalar/vector magic value collection. NFCI.
Use the same ISD::matchUnaryPredicate pattern that was used in D50392.
llvm-svn: 339758
Simon Pilgrim [Wed, 15 Aug 2018 10:02:54 +0000 (10:02 +0000)]
[DagCombiner] Don't bother adding to the work list if TLI.BuildSDIVPow2 failed. NFCI.
Matches the code in BuildSDIV/BuildUDIV
llvm-svn: 339757
Simon Pilgrim [Wed, 15 Aug 2018 09:35:12 +0000 (09:35 +0000)]
[TargetLowering] Add support for non-uniform vectors to BuildExactSDIV
This patch refactors the existing BuildExactSDIV implementation to support non-uniform constant vector denominators.
Differential Revision: https://reviews.llvm.org/D50392
llvm-svn: 339756
Sam Parker [Wed, 15 Aug 2018 08:23:03 +0000 (08:23 +0000)]
[ARM] Allow signed icmps in ARMCodeGenPrepare
Treat signed icmps as 'sinks', allowing them to be in the use-def
tree, enabling more promotions to be performed. As a sink, any
promoted incoming values need to be truncated before being used by
the signed icmp.
Differential Revision: https://reviews.llvm.org/D50067
llvm-svn: 339755
Sam Parker [Wed, 15 Aug 2018 07:52:35 +0000 (07:52 +0000)]
[ARM] Allow pointer values in ARMCodeGenPrepare
Add pointers to the list of allowed types, but don't try to promote
them. Also fixed a bug with the promotion of undef values, so a new
value is now created instead of mutating in place. We also now only
promote if there's an instruction in the use-def chains other than
the icmp, sinks and sources.
Differential Revision: https://reviews.llvm.org/D50054
llvm-svn: 339754
Max Kazantsev [Wed, 15 Aug 2018 06:21:02 +0000 (06:21 +0000)]
[AliasSetTracker] Do not treat experimental_guard intrinsic as memory writing instruction
The `experimental_guard` intrinsic has memory write semantics to model the thread-exiting
logic, but does not do any actual writes to memory. Currently, `AliasSetTracker` treats it as a
normal memory write. As result, a loop-invariant load cannot be hoisted out of loop because
the guard may possibly alias with it.
This patch makes `AliasSetTracker` so that it doesn't treat guards as memory writes.
Differential Revision: https://reviews.llvm.org/D50497
Reviewed By: reames
llvm-svn: 339753
Max Kazantsev [Wed, 15 Aug 2018 05:55:43 +0000 (05:55 +0000)]
[NFC] Refactoring of LoopSafetyInfo, step 1
Turn structure into class, encapsulate methods, add clarifying comments.
Differential Revision: https://reviews.llvm.org/D50693
Reviewed By: reames
llvm-svn: 339752
Max Kazantsev [Wed, 15 Aug 2018 05:50:38 +0000 (05:50 +0000)]
[NFC] Add sanitizing assertion to ICF tracker
llvm-svn: 339751
Max Kazantsev [Wed, 15 Aug 2018 02:49:12 +0000 (02:49 +0000)]
[NFC][LICM] Make hoist method void
Method hoist always returns true. This patch makes it void.
Differential Revision: https://reviews.llvm.org/D50696
Reviewed By: hiraditya
llvm-svn: 339750
Craig Topper [Wed, 15 Aug 2018 01:23:00 +0000 (01:23 +0000)]
[X86] Change legacy SSE scalar fp to integer intrinsics to use specific ISD opcodes instead of keeping as intrinsics. Unify SSE and AVX512 isel patterns.
AVX512 added new versions of these intrinsics that take a rounding mode. If the rounding mode is 4 the new intrinsics are equivalent to the old intrinsics.
The AVX512 intrinsics were being lowered to ISD opcodes, but the legacy SSE intrinsics were left as intrinsics. This resulted in the AVX512 instructions needing separate patterns for the ISD opcodes and the legacy SSE intrinsics.
Now we convert SSE intrinsics and AVX512 intrinsics with rounding mode 4 to the same ISD opcode so we can share the isel patterns.
llvm-svn: 339749
Chandler Carruth [Wed, 15 Aug 2018 01:22:50 +0000 (01:22 +0000)]
[SDAG] Update the AVR backend for the SelectionDAG API changes in
r339740, fixing the build for this target.
llvm-svn: 339748
Richard Smith [Wed, 15 Aug 2018 01:06:30 +0000 (01:06 +0000)]
Silence "unused variable" warning.
llvm-svn: 339747
Evgeniy Stepanov [Wed, 15 Aug 2018 00:39:35 +0000 (00:39 +0000)]
[hwasan] Add a basic API.
Summary:
Add user tag manipulation functions:
__hwasan_tag_memory
__hwasan_tag_pointer
__hwasan_print_shadow (very simple and ugly, for now)
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D50746
llvm-svn: 339746
Artem Dergachev [Wed, 15 Aug 2018 00:33:55 +0000 (00:33 +0000)]
[analyzer] Add support for constructors of arguments.
Once CFG-side support for argument construction contexts landed in r338436,
the analyzer could make use of them to evaluate argument constructors properly.
When evaluated as calls, constructors of arguments now use the variable region
of the parameter as their target. The corresponding stack frame does not yet
exist when the parameter is constructed, and this stack frame is created
eagerly.
Construction of functions whose body is unavailable and of virtual functions
is not yet supported. Part of the reason is the analyzer doesn't consistently
use canonical declarations o identify the function in these cases, and every
re-declaration or potential override comes with its own set of parameter
declarations. Also it is less important because if the function is not
inlined, there's usually no benefit in inlining the argument constructor.
Differential Revision: https://reviews.llvm.org/D49443
llvm-svn: 339745
Derek Schuff [Wed, 15 Aug 2018 00:30:27 +0000 (00:30 +0000)]
[WebAssembly] SIMD Splats
Implement and test SIMD splat ops.
Patch by Thomas Lively
Differential Revision: https://reviews.llvm.org/D50741
llvm-svn: 339744
Louis Dionne [Wed, 15 Aug 2018 00:30:03 +0000 (00:30 +0000)]
[libcxx] Fix XFAILs for aligned allocation tests on older OSX versions
Summary:
Since r338934, Clang emits an error when aligned allocation functions are
used in conjunction with a system libc++ dylib that does not support those
functions. This causes some tests to fail when testing against older libc++
dylibs. This commit marks those tests as UNSUPPORTED, and also documents the
various reasons for the tests being unsupported.
Reviewers: vsapsai, EricWF
Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF
Differential Revision: https://reviews.llvm.org/D50341
llvm-svn: 339743
Louis Dionne [Wed, 15 Aug 2018 00:18:01 +0000 (00:18 +0000)]
[libc++] Disable failing C11 feature tests for <cfloat> and <float.h>
Summary:
Those tests are breaking the test bots. A Bugzilla has been filed to
make sure those tests are re-enabled: https://bugs.llvm.org/show_bug.cgi?id=38572
Reviewers: mclow.lists, EricWF
Subscribers: krytarowski, christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50748
llvm-svn: 339742
Louis Dionne [Wed, 15 Aug 2018 00:16:41 +0000 (00:16 +0000)]
[libc++] Detect C11 features on non-Clang compilers
Summary:
The macros were inside `#if defined(_LIBCPP_COMPILER_CLANG)`, which means
we would never detect C11 features on non-Clang compilers. According to
Marshall Clow, this is not the intended behavior.
Reviewers: mclow.lists, EricWF
Subscribers: krytarowski, christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50748
llvm-svn: 339741
Chandler Carruth [Tue, 14 Aug 2018 23:30:32 +0000 (23:30 +0000)]
[SDAG] Remove the reliance on MI's allocation strategy for
`MachineMemOperand` pointers attached to `MachineSDNodes` and instead
have the `SelectionDAG` fully manage the memory for this array.
Prior to this change, the memory management was deeply confusing here --
The way the MI was built relied on the `SelectionDAG` allocating memory
for these arrays of pointers using the `MachineFunction`'s allocator so
that the raw pointer to the array could be blindly copied into an
eventual `MachineInstr`. This creates a hard coupling between how
`MachineInstr`s allocate their array of `MachineMemOperand` pointers and
how the `MachineSDNode` does.
This change is motivated in large part by a change I am making to how
`MachineFunction` allocates these pointers, but it seems like a layering
improvement as well.
This would run the risk of increasing allocations overall, but I've
implemented an optimization that should avoid that by storing a single
`MachineMemOperand` pointer directly instead of allocating anything.
This is expected to be a net win because the vast majority of uses of
these only need a single pointer.
As a side-effect, this makes the API for updating a `MachineSDNode` and
a `MachineInstr` reasonably different which seems nice to avoid
unexpected coupling of these two layers. We can map between them, but we
shouldn't be *surprised* at where that occurs. =]
Differential Revision: https://reviews.llvm.org/D50680
llvm-svn: 339740
Alex Lorenz [Tue, 14 Aug 2018 22:27:03 +0000 (22:27 +0000)]
[clangd] update the new test to check for diagnostic's category as well
llvm-svn: 339739
Alex Lorenz [Tue, 14 Aug 2018 22:21:40 +0000 (22:21 +0000)]
[clangd] add an extension field to LSP to transfer the diagnostic's category
This patch adds a 'category' extension field to the LSP diagnostic that's sent
by Clangd. This extension is always on by default.
Differential Revision: https://reviews.llvm.org/D50571
llvm-svn: 339738
Alex Lorenz [Tue, 14 Aug 2018 22:20:35 +0000 (22:20 +0000)]
[clangd] add missing test from r339454
I forgot to checkin the test for the fixits into SVN.
llvm-svn: 339737
Heejin Ahn [Tue, 14 Aug 2018 22:14:51 +0000 (22:14 +0000)]
[WebAssembly] Delete a specific push number from test expectations
Summary:
This shouldn't have been a specific number but rather a regex. This was
a part of rL339474 which got reverted.
Reviewers: aardappel
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D50728
llvm-svn: 339736
Cameron McInally [Tue, 14 Aug 2018 22:13:11 +0000 (22:13 +0000)]
[FPEnv] Scalarize StrictFP vector operations
Add a helper function to scalarize constrained FP operations as needed.
Differential Revision: https://reviews.llvm.org/D50720
llvm-svn: 339735
Eli Friedman [Tue, 14 Aug 2018 22:10:25 +0000 (22:10 +0000)]
[ARM] Make PerformSHLSimplify add nodes to the DAG worklist correctly.
Intentionally excluding nodes from the DAGCombine worklist is likely to
lead to weird optimizations and infinite loops, so it's generally a bad
idea.
To avoid the infinite loops, fix DAGCombine to use the
isDesirableToCommuteWithShift target hook before performing the
transforms in question, and implement the target hook in the ARM backend
disable the transforms in question.
Fixes https://bugs.llvm.org/show_bug.cgi?id=38530 . (I don't have a
reduced testcase for that bug. But we should have sufficient test
coverage for PerformSHLSimplify given that we're not playing weird
tricks with the worklist. I can try to bugpoint it if necessary,
though.)
Differential Revision: https://reviews.llvm.org/D50667
llvm-svn: 339734
Matt Morehouse [Tue, 14 Aug 2018 22:04:34 +0000 (22:04 +0000)]
[SanitizerCoverage] Add associated metadata to PC guards.
Summary:
Without this metadata LLD strips unused PC table entries
but won't strip unused guards. This metadata also seems
to influence the linker to change the ordering in the PC
guard section to match that of the PC table section.
The libFuzzer runtime library depends on the ordering
of the PC table and PC guard sections being the same. This
is not generally guaranteed, so we may need to redesign
PC tables/guards/counters in the future.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: kcc, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D50483
llvm-svn: 339733
Vlad Tsyrklevich [Tue, 14 Aug 2018 21:38:50 +0000 (21:38 +0000)]
SafeStack: Disable Darwin support
SafeStack support for Darwin has not been functional and was disabled in
r339719/r339720. Disable Darwin for the safestack debuginfo test.
llvm-svn: 339732
Stephen Kelly [Tue, 14 Aug 2018 21:34:29 +0000 (21:34 +0000)]
Remove obsolete comment
This related to the code as first checked in in r266292 ([ASTImporter]
Implement some expression-related AST node import., 2016-04-14).
llvm-svn: 339731
Stephen Kelly [Tue, 14 Aug 2018 21:33:28 +0000 (21:33 +0000)]
Fix Stmt::ignoreImplicit
Summary:
A CXXBindTemporaryExpr can appear inside an ImplicitCastExpr, and was
not ignored previously.
Fixes the case reported in PR37327.
Reviewers: rsmith, dblaikie, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50666
llvm-svn: 339730
Stephen Kelly [Tue, 14 Aug 2018 21:25:49 +0000 (21:25 +0000)]
Remove vestiges of configure buildsystem
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D50528
llvm-svn: 339729
Reid Kleckner [Tue, 14 Aug 2018 21:15:57 +0000 (21:15 +0000)]
Fix lit fatal errors about requiring a USE_Z3_SOLVER param
llvm-svn: 339728
Artem Dergachev [Tue, 14 Aug 2018 21:10:46 +0000 (21:10 +0000)]
[CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.
CXXTemporaryObjectExpr is a sub-class of CXXConstructExpr. If it has arguments
that are structures passed by value, their respective constructors need to be
handled by providing a ConstructionContext, like for regular function calls and
for regular constructors.
Differential Revision: https://reviews.llvm.org/D50487
llvm-svn: 339727
Artem Dergachev [Tue, 14 Aug 2018 21:06:30 +0000 (21:06 +0000)]
[analyzer] Add a test forgotten in r339088.
Differential Revision: https://reviews.llvm.org/D50363
llvm-svn: 339726
Alina Sbirlea [Tue, 14 Aug 2018 20:49:19 +0000 (20:49 +0000)]
Add proper headers in CFGUpdate.h and add CFGDiff.h in the list of delayed headers for LLVM_intrinsic_gen.
Summary:
Fix module build after r339694.
Add headers needed in CFGUpdate.h.
Add CFGDiff.h in the list of delayed headers for LLVM_intrinsic_gen.
Up for post-commit review.
Subscribers: sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D50734
llvm-svn: 339724
Vlad Tsyrklevich [Tue, 14 Aug 2018 20:28:58 +0000 (20:28 +0000)]
Reland "SafeStack: Delay thread stack clean-up""
This relands commit r339405 (reverted in commit r339408.) The original
revert was due to tests failing on a darwin buildbot; however, after
looking at the affected code more I realized that the Darwin safestack
support has always been broken and disabled it in r339719. This relands
the original commit.
llvm-svn: 339723
Anna Thomas [Tue, 14 Aug 2018 20:25:13 +0000 (20:25 +0000)]
NFC: Clarify comment in loop vectorization legality
Clarifying the comment about PSCEV and external IV users by referencing
the bug in question.
llvm-svn: 339722
Craig Topper [Tue, 14 Aug 2018 20:21:05 +0000 (20:21 +0000)]
[InlineAsm] Update the min-legal-vector-width function attribute based on inputs and outputs to inline assembly
Summary:
Another piece of my ongoing to work for prefer-vector-width.
min-legal-vector-width will eventually be used by the X86 backend to know whether it needs to make 512 bits type legal when prefer-vector-width=256. If the user used inline assembly that passed in/out a 512-bit register, we need to make sure 512 bits are considered legal. Otherwise we'll get an assert failure when we try to wire up the inline assembly to the rest of the code.
This patch just checks the LLVM IR types to see if they are vectors and then updates the attribute based on their total width. I'm not sure if this is the best way to do this or if there's any subtlety I might have missed. So if anyone has other opinions on how to do this I'm open to suggestions.
Reviewers: chandlerc, rsmith, rnk
Reviewed By: rnk
Subscribers: eraman, cfe-commits
Differential Revision: https://reviews.llvm.org/D50678
llvm-svn: 339721
Vlad Tsyrklevich [Tue, 14 Aug 2018 19:50:41 +0000 (19:50 +0000)]
SafeStack: Disable Darwin support
Summary:
Darwin support does not appear to be used as evidenced by the fact that
the runtime has never supported non-trivial programs.
Reviewers: pcc, kubamracek
Reviewed By: pcc
Subscribers: cfe-commits, kcc
Differential Revision: https://reviews.llvm.org/D50724
llvm-svn: 339720
Vlad Tsyrklevich [Tue, 14 Aug 2018 19:46:16 +0000 (19:46 +0000)]
SafeStack: Disable Darwin support
Summary:
Darwin support does not appear to be used as evidenced by the fact that
the pthread interceptors have never worked and there is no support for
other common threading mechanisms like GCD.
Reviewers: pcc, eugenis, kubamracek
Reviewed By: pcc, kubamracek
Subscribers: kubamracek, mgorny, delcypher, llvm-commits, #sanitizers, kcc
Differential Revision: https://reviews.llvm.org/D50718
llvm-svn: 339719
Stefan Granitz [Tue, 14 Aug 2018 19:38:54 +0000 (19:38 +0000)]
Remove asseration from ConstString::GetConstCStringAndSetMangledCounterPart() to fix more tests first
llvm-svn: 339716
Raphael Isemann [Tue, 14 Aug 2018 19:36:58 +0000 (19:36 +0000)]
Stability improvements for CompletionTest
Summary:
CompletionTest.DirCompletionAbsolute had a random failure on a CI node
(in the failure, the completion count was 0, while we expected it to be 1),
but there seems no good reason for it to fail. The sanitizers don't complain
about the test when it's run, so I think we don't have some uninitialized
memory that we access here.
My best bet is that the unique directory selection randomly failed on the CI
node because maybe the FS there doesn't actually guarantee the atomic fopen
assumptions we make in the LLVM code (or some other funny race condition).
In this case a different test run could get the same directory and clean its contents
which would lead to 0 results.
The other possible explanation is that someone changed the CI configuration
on the node and changed the working dir to something very long, which would
make our PATH_MAX test fail (which also leads to 0 results), but I think that case
is unlikely.
This patch is just a stab in the dark that (hopefully) fixes this random failure by
giving each test a (more) unique working directory by appending the unique
test name to the temp-dir prefix. Also adds one more ASSERT_NO_ERROR to
one of our chdir calls just in case that is the reason for failing.
The good thing is that this refactor gets rid of most of the static variables
and files that we previously had as shared state between the different tests.
Potentially fixes rdar://problem/
43150260
Reviewers: aprantl
Reviewed By: aprantl
Subscribers: jfb, lldb-commits
Differential Revision: https://reviews.llvm.org/D50722
llvm-svn: 339715
Adrian Prantl [Tue, 14 Aug 2018 19:35:34 +0000 (19:35 +0000)]
[DebugInfoMetadata] Added DIFlags interface in DIBasicType.
Flags in DIBasicType will be used to pass attributes used in
DW_TAG_base_type, such as DW_AT_endianity.
Patch by Chirag Patel!
Differential Revision: https://reviews.llvm.org/D49610
llvm-svn: 339714
Sanjay Patel [Tue, 14 Aug 2018 19:13:07 +0000 (19:13 +0000)]
[InstCombine] fix typos in tests; NFC
See D50036.
llvm-svn: 339713
Heejin Ahn [Tue, 14 Aug 2018 19:10:50 +0000 (19:10 +0000)]
[WebAssembly] SIMD encoding tests
Modifies existing SIMD tests to also check that SIMD instructions are
lowered to the expected bytes. This CL depends on D50597.
Reviewers: aheejin
Subscribers: sunfish, jgravelle-google, sbc100, llvm-commits
Differential Revision: https://reviews.llvm.org/D50660
Patch by Thomas Lively (tlively)
llvm-svn: 339712
Sanjay Patel [Tue, 14 Aug 2018 19:05:37 +0000 (19:05 +0000)]
[InstCombine] add tests for pow->sqrt; NFC
D50036 should fix the missed optimizations.
llvm-svn: 339711
Heejin Ahn [Tue, 14 Aug 2018 19:03:36 +0000 (19:03 +0000)]
[WebAssembly] Fix encoding of non-SIMD vector-typed instructions
Previously SIMD_I was the same as a normal instruction except for the
addition of a HasSIM128 predicate. However, rL339186 changed the
encoding of SIMD_I instructions to automatically contain the SIMD
prefix byte. This broke the encoding of non-SIMD vector-typed
instructions, which had instantiated SIMD_I. This CL corrects this
error.
Reviewers: aheejin
Subscribers: sunfish, jgravelle-google, sbc100, llvm-commits
Differential Revision: https://reviews.llvm.org/D50682
Patch by Thomas Lively (tlively)
llvm-svn: 339710
George Karpenkov [Tue, 14 Aug 2018 18:55:34 +0000 (18:55 +0000)]
[analyzer] Fix bots by removing new check-clang-analyzer commands from CHECK-ALL
llvm-svn: 339709
Zachary Turner [Tue, 14 Aug 2018 18:54:28 +0000 (18:54 +0000)]
[MS Demangler] Fix some minor formatting bugs.
1) We print __restrict twice on member pointers. This is fixed
and relevant tests are re-enabled.
2) Several tests were disabled because of printing slightly
different output than undname. These were confirmed to be
bugs in undname, so we just re-enable the tests.
3) The test for printing reference temporaries is re-enabled. This
is a clang mangling extension, so we have some flexibility with
how we demangle it. The output currently looks fine, so we just
re-enable the test with no fixes.
llvm-svn: 339708
Heejin Ahn [Tue, 14 Aug 2018 18:53:27 +0000 (18:53 +0000)]
[WebAssembly] SIMD extract_lane
Implement instruction selection for all versions of the extract_lane
instruction. Use explicit sext/zext to differentiate between
extract_lane_s and extract_lane_u for applicable types, otherwise
default to extract_lane_u.
Reviewers: aheejin
Subscribers: sunfish, jgravelle-google, sbc100, llvm-commits
Differential Revision: https://reviews.llvm.org/D50597
Patch by Thomas Lively (tlively)
llvm-svn: 339707
Andrea Di Biagio [Tue, 14 Aug 2018 18:36:54 +0000 (18:36 +0000)]
[Tablegen][MCInstPredicate] Removed redundant template argument from class TIIPredicate, and implemented verification rules for TIIPredicates.
This patch removes redundant template argument `TargetName` from TIIPredicate.
Tablegen can always infer the target name from the context. So we don't need to
force users of TIIPredicate to always specify it.
This allows us to better modularize the tablegen class hierarchy for the
so-called "function predicates". class FunctionPredicateBase has been added; it
is currently used as a building block for TIIPredicates. However, I plan to
reuse that class to model other function predicate classes too (i.e. not just
TIIPredicates). For example, this can be a first step towards implementing
proper support for dependency breaking instructions in tablegen.
This patch also adds a verification step on TIIPredicates in tablegen.
We cannot have multiple TIIPredicates with the same name. Otherwise, this will
cause build errors later on, when tablegen'd .inc files are included by cpp
files and then compiled.
Differential Revision: https://reviews.llvm.org/D50708
llvm-svn: 339706
Kostya Kortchinsky [Tue, 14 Aug 2018 18:34:52 +0000 (18:34 +0000)]
[scudo] Fix race condition in deallocation path when Quarantine is bypassed
Summary:
There is a race window in the deallocation path when the Quarantine is bypassed.
Initially we would just erase the header of a chunk if we were not to use the
Quarantine, as opposed to using a compare-exchange primitive, to make things
faster.
It turned out to be a poor decision, as 2 threads (or more) could simultaneously
deallocate the same pointer, and if the checks were to done before the header
got erased, this would result in the pointer being added twice (or more) to
distinct thread caches, and eventually be reused.
Winning the race is not trivial but can happen with enough control over the
allocation primitives. The repro added attempts to trigger the bug, with a
moderate success rate, but it should be enough to notice if the bug ever make
its way back into the code.
Since I am changing things in this file, there are 2 smaller changes tagging
along, marking a variable `const`, and improving the Quarantine bypass test at
runtime.
Reviewers: alekseyshl, eugenis, kcc, vitalybuka
Reviewed By: eugenis, vitalybuka
Subscribers: delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D50655
llvm-svn: 339705
Alexey Bataev [Tue, 14 Aug 2018 18:31:20 +0000 (18:31 +0000)]
[OPENMP] Fix processing of declare target construct.
The attribute marked as inheritable since OpenMP 5.0 supports it +
additional fixes to support new functionality.
llvm-svn: 339704
Anna Thomas [Tue, 14 Aug 2018 18:22:19 +0000 (18:22 +0000)]
[LV] Teach about non header phis that have uses outside the loop
Summary:
This patch teaches the loop vectorizer to vectorize loops with non
header phis that have have outside uses. This is because the iteration
dependence distance for these phis can be widened upto VF (similar to
how we do for induction/reduction) if they do not have a cyclic
dependence with header phis. When identifying reduction/induction/first
order recurrence header phis, we already identify if there are any cyclic
dependencies that prevents vectorization.
The vectorizer is taught to extract the last element from the vectorized
phi and update the scalar loop exit block phi to contain this extracted
element from the vector loop.
This patch can be extended to vectorize loops where instructions other
than phis have outside uses.
Reviewers: Ayal, mkuper, mssimpso, efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50579
llvm-svn: 339703
Louis Dionne [Tue, 14 Aug 2018 18:16:56 +0000 (18:16 +0000)]
[libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
Summary:
The macro was not defined in C++11 mode when it should have been, at least
according to how _LIBCPP_HAS_C11_FEATURES is defined.
Reviewers: mclow.lists, EricWF, jfb, dexonsmith
Subscribers: christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50719
llvm-svn: 339702
Petr Hosek [Tue, 14 Aug 2018 18:01:19 +0000 (18:01 +0000)]
[CMake] Don't parse target triple except for arch
compiler-rt CMake build currently tries to parse the triple and then
put it back together, but doing so inherently tricky, and doing so
from CMake is just crazy and currently doesn't handle triples that
have more than three components. Fortunatelly, the CMake really only
needs the architecture part, which is typically the first component,
to construct variants for other architectures. This means we can keep
the rest of the triple as is and avoid the parsing altogether.
Differential Revision: https://reviews.llvm.org/D50548
llvm-svn: 339701
Bruno Cardoso Lopes [Tue, 14 Aug 2018 17:54:41 +0000 (17:54 +0000)]
Revert "[DebugInfo] Generate DWARF debug information for labels. (Fix leak problems)"
This reverts commit
cb8c5e417d55141f3f079a8a876e786f44308336 / r339676.
This causing a test to fail in http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/48406/
LLVM :: DebugInfo/Generic/debug-label.ll
llvm-svn: 339700
Alina Sbirlea [Tue, 14 Aug 2018 17:43:24 +0000 (17:43 +0000)]
[GraphDiff] Make InverseGraph a property of a GraphDiff.
Summary:
Treating a graph in reverse is a property of the GraphDiff and should instead be a template argument, just like IsPostDom is one for DomTrees.
If it's just an argument to all methods, we could have mismatches between the constructor of the GraphDiff which may reverse the updates when filtering them, and the calls retrieving the filtered delete/insert updates.
Also, since this will be used in IDF, where we're using a DomTree, this creates a cleaner interface for the GraphTraits to use the existing template argument of DomTreeBase.
Separate patch from the one adding GraphDiff, so get a clear diff of what changed.
Reviewers: timshen, kuhar
Subscribers: sanjoy, llvm-commits, jlebar
Differential Revision: https://reviews.llvm.org/D50687
llvm-svn: 339699
Martin Storsjo [Tue, 14 Aug 2018 17:33:10 +0000 (17:33 +0000)]
[CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY option
This option should be available if LIBCXX_ENABLE_SHARED is enabled,
not LIBCXX_ENABLE_STATIC.
This fixes a typo from SVN r337814.
Differential Revision: https://reviews.llvm.org/D50691
llvm-svn: 339697
Simon Pilgrim [Tue, 14 Aug 2018 17:22:37 +0000 (17:22 +0000)]
[X86][SSE] Avoid duplicate shuffle input sources in combineX86ShufflesRecursively
rL339686 added the case where a faux shuffle might have repeated shuffle inputs coming from either side of the OR().
This patch improves the insertion of the inputs into the source ops lists to account for this, as well as making it trivial to add support for shuffles with more than 2 inputs in the future.
llvm-svn: 339696
Raphael Isemann [Tue, 14 Aug 2018 17:12:54 +0000 (17:12 +0000)]
Remove manual byte counting from Highlighter code.
Summary:
This removes the manual byte counting mechanism from the syntax highlighting
code. This is no longer necessary as the Stream class now has built-in support for
automatically counting the bytes that were written to it so far.
The advantage of automatic byte counting via Stream is that it is less error-prone
than the manual version and we need to write less boilerplate code.
Reviewers: labath
Reviewed By: labath
Subscribers: labath, lldb-commits
Differential Revision: https://reviews.llvm.org/D50676
llvm-svn: 339695
Alina Sbirlea [Tue, 14 Aug 2018 17:12:30 +0000 (17:12 +0000)]
[DomTree] Cleanup Update and LegalizeUpdate API moved to Support header.
Summary:
Clean-up following D50479.
Make Update and LegalizeUpdate refer to the utilities in Support/CFGUpdate.
Reviewers: kuhar
Subscribers: sanjoy, jlebar, mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D50669
llvm-svn: 339694
Kevin P. Neal [Tue, 14 Aug 2018 17:06:56 +0000 (17:06 +0000)]
We have in place support for parsing #pragma FENV_ACCESS, but that
information is then discarded with a warning to the user that we don't
support it.
This patch gets us one step closer by getting the info down into the
AST in most cases.
Reviewed by: rsmith
Differential Revision: https://reviews.llvm.org/D49865
llvm-svn: 339693
David Bolvansky [Tue, 14 Aug 2018 17:03:47 +0000 (17:03 +0000)]
[NFC] Tests for select with binop fold - FP opcodes
llvm-svn: 339692
Kevin P. Neal [Tue, 14 Aug 2018 16:57:10 +0000 (16:57 +0000)]
Revert test commit
llvm-svn: 339691
Kevin P. Neal [Tue, 14 Aug 2018 16:56:25 +0000 (16:56 +0000)]
Test commit
llvm-svn: 339690
Alina Sbirlea [Tue, 14 Aug 2018 16:44:28 +0000 (16:44 +0000)]
Expose CFG Update struct. Define GraphTraits to get children given a snapshot CFG.
Summary:
Certain passes or analysis need to view a CFG snapshot rather than the actual CFG. This patch provides GraphTraits to offer such a view.
The patch defines GraphTraits for BasicBlock* and Inverse<BasicBlock*> to provide CFG successors and predecessors based on a list of CFG updates.
An Update is defined as a triple {InsertOrDeleteKind, BlockStartOfEdge, BlockEndOfEdge}.
A GraphDiff is defined as a list of Updates that has been preprocessed to treat the CFG as a graph rather than a multi-graph. As such, there can only exist a single Update given two nodes. All duplicates will be filtered and Insert/Delete edges that cancel out will be ignored.
The methods GraphDiff exposes are:
- Determine if an existing child needs to be ignored, i.e. an Update exists in the correct direction to assume the removal of that edge.
- Return a list of new children to be considered, i.e. an Update exists in the correct direction for each child in the list to assume the insertion of that edge.
Reviewers: timshen, kuhar, chandlerc
Subscribers: sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D50479
llvm-svn: 339689
Nirav Dave [Tue, 14 Aug 2018 16:20:43 +0000 (16:20 +0000)]
[DAG] Avoid redundant chain transversal in store merge cycle check. NFCI.
Patch by Henric Karlsson.
llvm-svn: 339688
Kirill Bobyrev [Tue, 14 Aug 2018 16:03:32 +0000 (16:03 +0000)]
NFC: Enforce good formatting across multiple clang-tools-extra files
This patch improves readability of multiple files in clang-tools-extra
and enforces LLVM Coding Guidelines.
Reviewed by: ioeric
Differential Revision: https://reviews.llvm.org/D50707
llvm-svn: 339687
Simon Pilgrim [Tue, 14 Aug 2018 16:00:05 +0000 (16:00 +0000)]
[X86][SSE] Add shuffle combine support for OR(PSHUFB,PSHUFB) style patterns.
If each element is zero from one (or both) inputs then we can combine these into a single shuffle mask.
llvm-svn: 339686
Julie Hockett [Tue, 14 Aug 2018 15:38:59 +0000 (15:38 +0000)]
[clang-doc] Fix unused variable
Differential Revision: https://reviews.llvm.org/D50709
llvm-svn: 339685
Simon Pilgrim [Tue, 14 Aug 2018 15:21:26 +0000 (15:21 +0000)]
[X86][SSE] Add shuffle combine tests for OR(PSHUFB,PSHUFB) style patterns.
We generate these shuffle patterns but we fail to combine them.
llvm-svn: 339684
Sanjay Patel [Tue, 14 Aug 2018 15:21:13 +0000 (15:21 +0000)]
[InstCombine] regenerate checks; NFC
llvm-svn: 339683
Fedor Sergeev [Tue, 14 Aug 2018 15:19:14 +0000 (15:19 +0000)]
[Inliner] add inliner stats to new pm version of inliner
Increment existing NumInlined and NumDeleted stats in InlinerPass::run.
llvm-svn: 339682
Sanjay Patel [Tue, 14 Aug 2018 15:18:52 +0000 (15:18 +0000)]
[InstCombine] regenerate checks; NFC
llvm-svn: 339681
George Rimar [Tue, 14 Aug 2018 14:20:34 +0000 (14:20 +0000)]
[LLD][ELF] - Eliminate dead code from OffsetGetter::get().
We have a dead piece of code there which is impossible to trigger
using regular objects I believe.
Patch removes it and adds a test case showing how this condition
can be triggered with use of a broken object and crash the linker.
llvm-svn: 339680
Simon Pilgrim [Tue, 14 Aug 2018 14:00:14 +0000 (14:00 +0000)]
[X86][SSE] Generalize lowerVectorShuffleAsBlendOfPSHUFBs to work with any vXi8 type.
We still only use this for v16i8, but this cleans up the code to support v32i8/v64i8 sometime in the future.
llvm-svn: 339679
Sven van Haastregt [Tue, 14 Aug 2018 13:56:52 +0000 (13:56 +0000)]
[OpenCL] Add test for constant sampler argument
llvm-svn: 339678
Sid Manning [Tue, 14 Aug 2018 13:52:38 +0000 (13:52 +0000)]
[ELF][HEXAGON] Add R_HEX_32 support
Differential Revision: https://reviews.llvm.org/D50657
llvm-svn: 339677
Hsiangkai Wang [Tue, 14 Aug 2018 13:50:59 +0000 (13:50 +0000)]
[DebugInfo] Generate DWARF debug information for labels. (Fix leak problems)
There are two forms for label debug information in DWARF format.
1. Labels in a non-inlined function:
DW_TAG_label
DW_AT_name
DW_AT_decl_file
DW_AT_decl_line
DW_AT_low_pc
2. Labels in an inlined function:
DW_TAG_label
DW_AT_abstract_origin
DW_AT_low_pc
We will collect label information from DBG_LABEL. Before every DBG_LABEL,
we will generate a temporary symbol to denote the location of the label.
The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
The DBG_LABEL in the mapping is used to query the symbol before it.
The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
functions.
We also keep a mapping between scope and labels in DwarfFile to help to
generate correct tree structure of DIEs.
It also generates label debug information under global isel.
Differential Revision: https://reviews.llvm.org/D45556
llvm-svn: 339676
Louis Dionne [Tue, 14 Aug 2018 13:29:17 +0000 (13:29 +0000)]
[libc++] Add missing #include in C11 features tests
Summary:
These #includes are quite important, since otherwise any
#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
checks are always false, and so we don't actually test for C11 support
in the standard library.
Reviewers: mclow.lists, EricWF
Subscribers: christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50674
llvm-svn: 339675
Amara Emerson [Tue, 14 Aug 2018 12:04:25 +0000 (12:04 +0000)]
[GlobalISel][IRTranslator] Fix a bug in handling repeating struct types during argument lowering.
Differential Revision: https://reviews.llvm.org/D49442
llvm-svn: 339674
Kirill Bobyrev [Tue, 14 Aug 2018 12:00:39 +0000 (12:00 +0000)]
[clangd] NFC: Cleanup clangd help message
Add missed space, fix a typo.
Reviewed by: ioeric
Differential Revision: https://reviews.llvm.org/D50702
llvm-svn: 339673
George Rimar [Tue, 14 Aug 2018 11:55:31 +0000 (11:55 +0000)]
[LLD][ELF] - Remove UnresolvedPolicy::IgnoreAll and relative code. NFC.
The code involved was simply dead. `IgnoreAll` value is used in
`maybeReportUndefined` only which is never called for -r.
And at the same time `IgnoreAll` was set only for -r.
llvm-svn: 339672
Stefan Granitz [Tue, 14 Aug 2018 11:32:51 +0000 (11:32 +0000)]
Remove unused FastDemangle sources
llvm-svn: 339671
Simon Pilgrim [Tue, 14 Aug 2018 11:17:38 +0000 (11:17 +0000)]
[TableGen] Pass string/vector types by const reference (PR37666). NFCI
llvm-svn: 339670
Stefan Granitz [Tue, 14 Aug 2018 11:07:18 +0000 (11:07 +0000)]
Fix: ConstString::GetConstCStringAndSetMangledCounterPart() should update the value if the key exists already
Summary:
This issue came up because it caused problems in our unit tests. The StringPool did connect counterparts only once and silently ignored the values passed in subsequent calls.
The simplest solution for the unit tests would be silent overwrite. In practice, however, it seems useful to assert that we never overwrite a different mangled counterpart.
If we ever have mangled counterparts for other languages than C++, this makes it more likely to notice collisions.
I added an assertion that allows the following cases:
* inserting a new value
* overwriting the empty string
* overwriting with an identical value
I fixed the unit tests, which used "random" strings and thus produced collisions.
It would be even better if there was a way to reset or isolate the StringPool, but that's a different story.
Reviewers: jingham, friss, labath
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D50536
llvm-svn: 339669
David Chisnall [Tue, 14 Aug 2018 10:05:25 +0000 (10:05 +0000)]
[gnu-objc] Make selector order deterministic.
Summary:
This probably fixes PR35277, though there may be other sources of
nondeterminism (this was the only case of iterating over a DenseMap).
It's difficult to provide a test case for this, because it shows up only
on systems with ASLR enabled.
Reviewers: rjmccall
Reviewed By: rjmccall
Subscribers: bmwiedemann, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D50559
llvm-svn: 339668
David Chisnall [Tue, 14 Aug 2018 10:04:36 +0000 (10:04 +0000)]
Add a stub mangling for ObjC selectors in the Microsoft ABI.
This mangling is used only for outlined SEH finally blocks, which have
internal linkage.
This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with
expensive checks enabled, on Windows. This test should probably be
specifying a triple: it currently picks up whatever the host environment
is using. Unfortunately, I have no idea what it is trying to test,
because it contains no comments and predates Clang having working
Objective-C IR generation.
llvm-svn: 339667
Simon Pilgrim [Tue, 14 Aug 2018 10:04:14 +0000 (10:04 +0000)]
Fix MSVC "compiler limit: blocks nested too deeply" error. NFCI.
MSVC only accepts if-else chains up to 127 blocks long. I've had to merge a number of intrinsic cases together to get back below this limit, resulting in some duplication of string matches; this shouldn't cause any notable increase in runtime (and even then only for old IR, nothing that clang currently emits).
llvm-svn: 339666
Ilya Biryukov [Tue, 14 Aug 2018 09:36:32 +0000 (09:36 +0000)]
[clangd] Show non-instantiated decls in signatureHelp
Summary:
To avoid producing very verbose output in substitutions involving
typedefs, e.g.
T -> std::vector<std::string>::iterator
gets turned into an unreadable mess when printed out for libstdc++,
result contains internal types (std::__Vector_iterator<...>) and
expanded well-defined typedefs (std::basic_string<char>).
Until we improve the presentation code in clang, going with
non-instantiated decls looks like a better UX trade-off.
Reviewers: hokein, ioeric, kadircet
Reviewed By: hokein
Subscribers: MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D50645
llvm-svn: 339665
Dean Michael Berris [Tue, 14 Aug 2018 09:16:37 +0000 (09:16 +0000)]
[XRay][clang] Add more test cases of -fxray-modes= (NFC)
This confirms expectations for multiple values provided through the
driver when selecting specific modes and the order of appearance of
individual values for the `-fxray-modes=` flag.
This change just adds more test cases to an existing test file.
llvm-svn: 339662
Tomasz Krupa [Tue, 14 Aug 2018 09:04:01 +0000 (09:04 +0000)]
[X86] Constant folding of adds/subs intrinsics
Summary: This adds constant folding of signed add/sub with saturation intrinsics.
Reviewers: craig.topper, spatel, RKSimon, chandlerc, efriedma
Reviewed By: craig.topper
Subscribers: rnk, llvm-commits
Differential Revision: https://reviews.llvm.org/D50499
llvm-svn: 339659
Kristof Umann [Tue, 14 Aug 2018 08:38:35 +0000 (08:38 +0000)]
[analyzer] Made a buildbot happy.
llvm-svn: 339655
Roger Ferrer Ibanez [Tue, 14 Aug 2018 08:30:42 +0000 (08:30 +0000)]
[RISCV] Fix incorrect use of MCInstBuilder
This is a fix for r339314.
MCInstBuilder uses the named parameter idiom and an 'operator MCInst&' to ease
the creation of MCInsts. As the object of MCInstBuilder owns the MCInst is
manipulating, the lifetime of the MCInst is bound to that of MCInstBuilder.
In r339314 I bound a reference to the MCInst in an initializer. The
temporary of MCInstBuilder (and also its MCInst) is destroyed at the end of
the declaration leading to a dangling reference.
Fix this by using MCInstBuilder inside an argument of a function call.
Temporaries in function calls are destroyed in the enclosing full expression,
so the the reference to MCInst is still valid when emitToStreamer executes.
llvm-svn: 339654
Kristof Umann [Tue, 14 Aug 2018 08:20:51 +0000 (08:20 +0000)]
[analyzer][UninitializedObjectChecker] Void pointers are casted back to their dynamic type in note message
Differential Revision: https://reviews.llvm.org/D49228
llvm-svn: 339653
Chih-Mao Chen [Tue, 14 Aug 2018 08:08:39 +0000 (08:08 +0000)]
Test commit: fix punctuation
llvm-svn: 339652
Tomasz Krupa [Tue, 14 Aug 2018 08:01:38 +0000 (08:01 +0000)]
[X86] Lowering addus/subus intrinsics to native IR
Summary: This is the patch that lowers x86 intrinsics to native IR in order to enable optimizations.
Reviewers: craig.topper, spatel, RKSimon
Reviewed By: craig.topper
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46892
llvm-svn: 339651
Tomasz Krupa [Tue, 14 Aug 2018 08:00:56 +0000 (08:00 +0000)]
[X86] Lowering addus/subus intrinsics to native IR
Summary: This revision improves previous version (rL330322) which has been reverted due to crashes.
This is the patch that lowers x86 intrinsics to native IR
in order to enable optimizations. The patch also includes folding
of previously missing saturation patterns so that IR emits the same
machine instructions as the intrinsics.
Reviewers: craig.topper, spatel, RKSimon
Reviewed By: craig.topper
Subscribers: mike.dvoretsky, DavidKreitzer, sroland, llvm-commits
Differential Revision: https://reviews.llvm.org/D46179
llvm-svn: 339650