Commit Graph

263052 Commits

Author SHA1 Message Date
Pavel Labath 45dde23756 Recommit "RunThreadPlan: Fix halting logic in IgnoreBreakpoints = false"
This is a resubmit of r303732, which was reverted due to a regression.

The original patch caused a regression in TestLoadUnload, which has only showed
up when running the remote test suite. The problem there was that we interrupted
the target just as it has hit the rendezvous breakpoint in the dlopen call. This
meant that the stop reason was set to "breakpoint" even though the event would
not have been broadcast if we had not stopped the process. I fix this by
checking StopInfo->ShouldNotify() before stopping.

I also add a new test for the handling of conditional breakpoints in
expressions, which I noticed to be broken (pr33164)

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

llvm-svn: 303848
2017-05-25 10:50:06 +00:00
Hafiz Abid Qadeer 0b5d6e5d0e Fix FDE indexing while scan debug_info section.
There are some differences between eh_frame and debug_frame formats that
are not considered by DWARFCallFrameInfo::GetFDEIndex. An FDE entry
contains CIE_pointer in debug_frame in same place as cie_id in eh_frame.
As described in dwarf standard (section 6.4.1), CIE_pointer is an
"offset into the .debug_frame section". So, variable cie_offset should
be equal cie_id for debug_frame.

FDE entries with zeroth CIE pointer (which is actually placed in cie_id
variable) shouldn't be ignored also.

I have also added a little change which allow to use debug_info section
when eh_frame is absent. This case really can take place on some platforms.

Patch from tatyana-krasnukha.
https://reviews.llvm.org/D33504

llvm-svn: 303847
2017-05-25 10:21:29 +00:00
Egor Churaev 1db4c88a9a [OpenCL] reserve_id_t cannot be used as argument to kernel function
Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

llvm-svn: 303846
2017-05-25 07:18:37 +00:00
Chandler Carruth f4d62c480c [PM] Teach the PGO instrumentation pasess to run GlobalDCE before
instrumenting code.

This is important in the new pass manager. The old pass manager's
inliner has a small DCE routine embedded within it. The new pass manager
relies on the actual GlobalDCE pass for this.

Without this patch, instrumentation profiling with the new PM results in
massive code bloat in the object files because the instrumentation
itself ends up preventing DCE from working to remove the code.

We should probably change the instrumentation (and/or DCE) so that we
can eliminate dead code even if instrumented, but we shouldn't even
spend the time generating instrumentation for that code so this still
seems like a good patch.

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

llvm-svn: 303845
2017-05-25 07:15:09 +00:00
Egor Churaev c1e4611754 [OpenCL] Added regression test on invalid vector initialization.
Summary: This patch increases code coverage.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: cfe-commits, bader, yaxunl

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

llvm-svn: 303844
2017-05-25 06:55:02 +00:00
Chandler Carruth dd2e275a47 [PM/Unswitch] Fix a bug in the domtree update logic for the new unswitch
pass.

The original logic only considered direct successors of the hoisted
domtree nodes, but that isn't really enough. If there are other basic
blocks that are completely within the subtree, their successors could
just as easily be impacted by the hoisting.

The more I think about it, the more I think the correct update here is
to hoist every block on the dominance frontier which has an idom in the
chain we hoist across. However, this is subtle enough that I'd
definitely appreciate some more eyes on it.

Sadly, if this is the correct algorithm, it requires computing a (highly
localized) dominance frontier. I've done this in the simplest (IE, least
code) way I could come up with, but that may be too naive. Suggestions
welcome here, dominance update algorithms are not an area I've studied
much, so I don't have strong opinions.

In good news, with this patch, turning on simple unswitch passes the
LLVM test suite for me with asserts enabled.

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

llvm-svn: 303843
2017-05-25 06:33:36 +00:00
Vitaly Buka 4974f108ac [compiler-rt] Change default of allow_user_segv_handler to true
Reviewers: eugenis

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 303842
2017-05-25 06:29:30 +00:00
Craig Topper ae066a0d47 [MVT] Fix the identation of the start of the MVT class. NFC
llvm-svn: 303841
2017-05-25 06:15:05 +00:00
Craig Topper 37e46bfbf5 [SelectionDAG] Fix off by one in a compare in getOperationAction.
If Op is equal to array_lengthof, the lookup would be out of bounds, but we were only checking for greater than. I suspect nothing ever passes in the equal value because its a sentinel to mark the end of the builtin opcodes and not a real opcode.

So really this fix is just so that the code looks right and makes sense.

llvm-svn: 303840
2017-05-25 05:38:40 +00:00
Tobias Grosser 6e770813c9 Drop newline in docs builder to see if Polly docs are updated
llvm-svn: 303839
2017-05-25 05:38:05 +00:00
Eric Fiselier 39b56d80a1 Remove <experimental/coroutine> from the module map for now. It doesn't work unless modules are enabled
llvm-svn: 303838
2017-05-25 05:30:05 +00:00
Eric Fiselier d791d4ea3c Disable the coroutines tests until Clang bumps __cpp_coroutines to reflect recent changes
llvm-svn: 303837
2017-05-25 05:11:40 +00:00
Eric Fiselier 3ca9185073 Add <experimental/coroutine>
This patch adds the library portions of the coroutines PDTS,
which should now be supported by Clang.

llvm-svn: 303836
2017-05-25 04:36:24 +00:00
Eric Fiselier c81c8cbe77 Fix broken links on C++1z status page
llvm-svn: 303835
2017-05-25 04:09:07 +00:00
Chandler Carruth 29c22d2835 [LegacyPM] Make the 'addLoop' method accept a loop to add rather than
having it internally allocate the loop.

This is a much more flexible API and necessary in the new loop unswitch
to reasonably support both new and old PMs in common code. It also just
seems like a cleaner separation of concerns.

NFC, this should just be a pure refactoring.

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

llvm-svn: 303834
2017-05-25 03:01:31 +00:00
Marshall Clow d5c65ffa8d Add non-parallel version of for_each_n (+tests) from the Parallelism TS
llvm-svn: 303833
2017-05-25 02:29:54 +00:00
Jim Ingham d2a7e8538b Fix the warning when you pass -c to step/next/si/ni.
During some cleanup the test for whether the thread plan
accepted an iteration count was reversed, so we give a 
warning when it will actually work, and don't when it won't.

<rdar://problem/32379280>

llvm-svn: 303832
2017-05-25 02:24:18 +00:00
Eric Fiselier da8f9b5b1b [coroutines] Fix fallthrough diagnostics for coroutines
Summary:
This patch fixes a number of issues with the analysis warnings emitted when a coroutine may reach the end of the function w/o returning.

* Fix bug where coroutines with `return_value` are incorrectly diagnosed as missing `co_return`'s.
* Rework diagnostic message to no longer say "non-void coroutine", because that implies the coroutine doesn't have a void return type, which it might. In this case a non-void coroutine is one who's promise type does not contain `return_void()`

As a side-effect of this patch, coroutine bodies that contain an invalid coroutine promise objects are marked as invalid.

Reviewers: GorNishanov, rsmith, aaron.ballman, majnemer

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

llvm-svn: 303831
2017-05-25 02:16:53 +00:00
Galina Kistanova 1754fee864 Fixed nondeterminism in RuleMatcher::emit.
llvm-svn: 303829
2017-05-25 01:51:53 +00:00
Vitaly Buka bf40f1b6dd [libFuzzer] Don't replace custom signal handlers.
Summary:
This allows to keep handlers installed by sanitizers.
In other cases third-party code can replace handlers after libFuzzer
initialization anyway.

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 303828
2017-05-25 01:43:13 +00:00
George Karpenkov a1c532784d Fix coverage check for full post-dominator basic blocks.
Coverage instrumentation which does not instrument full post-dominators
and full-dominators may skip valid paths, as the reasoning for skipping
blocks may become circular.
This patch fixes that, by only skipping
full post-dominators with multiple predecessors, as such predecessors by
definition can not be full-dominators.

llvm-svn: 303827
2017-05-25 01:41:46 +00:00
Gor Nishanov 1fbc01f70f [coroutines] CoroFrame.cpp conform to coding convention (s/repeat/Repeat) (NFC)
llvm-svn: 303826
2017-05-25 01:07:10 +00:00
Gor Nishanov 0ea1863b27 [coroutines] Relocate instructions that maybe spilled after coro.begin
Summary:
Frontend generates store instructions after allocas, for example:

```
define i8* @f(i64 %this) "coroutine.presplit"="1" personality i32 0 {
entry:
  %this.addr = alloca i64
  store i64 %this, i64* %this.addr
  ..
  %hdl = call i8* @llvm.coro.begin(token %id, i8* %alloc)

```
Such instructions may require spilling into coro.frame, but, coro-frame address is only available after coro.begin and thus needs to be moved after coro.begin.
The only instructions that should not be moved are the arguments of coro.begin and all of their operands.

Reviewers: GorNishanov, majnemer

Reviewed By: GorNishanov

Subscribers: llvm-commits, EricWF

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

llvm-svn: 303825
2017-05-25 00:46:20 +00:00
Marshall Clow 29b75d6986 Add some constexpr tests for optional's move/copy ctor
llvm-svn: 303824
2017-05-25 00:22:33 +00:00
Kamil Rytarowski 269eec03d6 Correct compiler warnings and Debug build of the NetBSD target
Correct files present only in the NetBSD build.

llvm-svn: 303823
2017-05-24 23:59:50 +00:00
Tony Jiang 0a429f040e [PowerPC] Fix a performance bug for PPC::XXSLDWI.
There are some VectorShuffle Nodes in SDAG which can be selected to XXSLDWI
instruction, this patch recognizes them and does the selection to improve the
PPC performance.

llvm-svn: 303822
2017-05-24 23:48:29 +00:00
Rafael Espindola 8b78185e00 Print symbols from COFF import libraries.
This change allows llvm-nm to print symbols found in import libraries,
in part by allowing COFFImportFiles to be casted to SymbolicFiles.

Patch by Dave Lee!

llvm-svn: 303821
2017-05-24 23:40:36 +00:00
Eugene Zelenko 75480cce12 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 303820
2017-05-24 23:10:29 +00:00
Gor Nishanov 1f72d75714 [coroutines] Allow rematerialization upto 4 times. Remove incorrect assert
Reviewers: majnemer

Subscribers: EricWF, llvm-commits

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

llvm-svn: 303819
2017-05-24 23:01:02 +00:00
Sanjay Patel 07b1ba54b5 [InstCombine] use m_APInt to allow icmp-mul-mul vector fold
The swapped operands in the first test is a manifestation of an 
inefficiency for vectors that doesn't exist for scalars because 
the IRBuilder checks for an all-ones mask for scalars, but not 
vectors.

llvm-svn: 303818
2017-05-24 22:58:17 +00:00
Jonathan Roelofs 3c8f953f61 Allow builds to set COMPILER_RT_OS_DIR differently from CMAKE_SYSTEM_NAME
llvm-svn: 303817
2017-05-24 22:41:49 +00:00
Sanjay Patel a8ac360a0c [InstCombine] add tests for icmp eq (mul X, C), (mul Y, C); NFC
llvm-svn: 303816
2017-05-24 22:36:14 +00:00
Rui Ueyama 0e8521c05a Reduce indentation. NFC.
llvm-svn: 303815
2017-05-24 22:36:11 +00:00
Rui Ueyama 9aa82f76ac Garbage collect dllimported symbols.
This is a different implementation than r303225 (which was reverted
in r303270, re-submitted in r303304 and then re-reverted in r303527).

In the previous patch, I tried to add Live bit to each dllimported
symbol. It turned out that it didn't work with "oldnames.lib" which
contains a lot of weak aliases to dllimported symbols.

The way we handle weak aliases is to check if undefined symbols
can be resolved using weak aliases, and if so, memcpy the Defined
symbols to weak Undefined symbols, so that any references to weak
aliases automatically see defined symbols instead of undefined ones.

This memcpy happens before MarkLive kicks in.

That means we may have multiple copies of dllimported symbols. So
turning on one instance's Live bit is not enough.

This patch moves the Live bit to dllimport file. Since multiple
copies of dllsymbols still point to the same file, we can use it as the
central repository to keep track of liveness.

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

llvm-svn: 303814
2017-05-24 22:30:06 +00:00
Tim Northover 9d891185ad Revert "Sema: allow imaginary constants via GNU extension if UDL overloads not present."
This reverts commit r303697. It broke libc++ tests that were specifically
checking incompatibility in C++14 mode.

llvm-svn: 303813
2017-05-24 22:18:35 +00:00
Rafael Espindola a28414d7ec Simplify MipsRldMapSection::writeTo.
It is not clear why a synthetic section wants to use padding defined
in the linker script. The padding is for the space between sections.

It was also missing a test.

llvm-svn: 303812
2017-05-24 22:04:32 +00:00
Hans Wennborg 0eec1f0b96 Fix negate-overflow.cpp test on Windows after r303440
lit would interpret the exit code as failuire.

llvm-svn: 303809
2017-05-24 21:52:40 +00:00
Sanjay Patel 3e8935bdc5 [InstCombine] move tests and use FileCheck; NFC
llvm-svn: 303808
2017-05-24 21:48:25 +00:00
Tobias Grosser c8d13f50cc [ScopInfo] Tighten compute out introduced in r303404
It seems we are still spending too much time on rare inputs, which continue to
timeout the AOSP buildbot. Let's see if a further reduction is sufficient.

llvm-svn: 303807
2017-05-24 21:24:04 +00:00
Erik Pilkington 00efd50476 [Demangler] Remove a failing assert introduced in r303718
llvm-svn: 303806
2017-05-24 20:53:13 +00:00
Rui Ueyama 96cbf8bca6 Fix the sanitizer-windows bot.
Looks like r303801 broke the sanitizer-windows bot. I don't fully
understand what is going on, so I'll partially revert that patch.

llvm-svn: 303805
2017-05-24 20:32:23 +00:00
Saleem Abdulrasool b6e946b164 Basic: fix whitespace in file header (NFC)
llvm-svn: 303804
2017-05-24 20:27:09 +00:00
Gor Nishanov 33d5fd24a0 [coroutines] Add support for coroutines with non-scalar parameters
Summary:
Simple types like int are handled by LLVM Coroutines just fine.
But for non-scalar parameters we need to create copies of those parameters in the coroutine frame and make all uses of those parameters to refer to parameter copies.

Reviewers: rsmith, EricWF, GorNishanov

Subscribers: cfe-commits

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

llvm-svn: 303803
2017-05-24 20:09:14 +00:00
Nirav Dave 7a8717d216 [DAG] Prevent crashes when merging constant stores with high-bit set. NFC.
llvm-svn: 303802
2017-05-24 19:56:39 +00:00
Rui Ueyama 27abe98cfa Close the gap between ELF and COFF ICF implementations. NFC.
We originally wrote the ICF code for COFF and ported it to ELF.
They started diverging since then. This patch closes the gap.

llvm-svn: 303801
2017-05-24 19:56:29 +00:00
Nirav Dave bb20b5d5c3 [AArch64] Prevent nested ADDs from address calc in splitStoreSplat. NFC
In preparation for late-stage store merging.

llvm-svn: 303800
2017-05-24 19:55:49 +00:00
Erich Keane 25411b7684 For Microsoft compatibility, set fno_operator_names
There's a Microsoft header in the Windows SDK which won't 
compile with clang because it uses an operator name (and) 
as a field name. This patch allows that file to compile by 
setting the option which disables operator names. 
The header which doesn't compile <Query.h> C:/Program Files (x86)/
Windows Kits/10/include/10.0.14393.0/um\Query.h:259:40: 
error: expected member name or ';' after declaration specifiers

  /* [case()] */ NODERESTRICTION or;
                   ~~~~~~~~~~~~~~~ ^

                   1 error generated.

Contributed for Melanie Blower

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

llvm-svn: 303798
2017-05-24 19:31:19 +00:00
Rui Ueyama f04c04837c Improve parallelism of ICF.
This is the only place we use threads for ICF. The intention of this code
was to split an input vector into 256 shards and process them in parallel.
What the code was actually doing was to split an input into 257 shards,
process the first 256 shards in parallel, and the remaining one in serial.

That means this code takes ceil(256/n)+1 instead of ceil(256/n) where n
is the number of available CPU cores. The former converges to 2 while
the latter converges to 1.

This patches fixes the above issue.

llvm-svn: 303797
2017-05-24 19:22:34 +00:00
Vitaly Buka 46fe6d47cc Revert "Revert "Attempt to pacify ASan and UBSan reports in CrashRecovery tests""
This dependents on r303729 which was reverted.

This reverts commit r303783.

llvm-svn: 303796
2017-05-24 19:11:12 +00:00
Vitaly Buka 62882c93c8 Revert "[compiler-rt] Change default of allow_user_segv_handler to true"
Breaks sanitizer-x86_64-linux-fuzzer bot.

This reverts commit r303729.

llvm-svn: 303795
2017-05-24 19:09:24 +00:00