Zachary Turner [Tue, 30 Aug 2016 17:38:28 +0000 (17:38 +0000)]
Appease buildbots after r280114.
llvm-svn: 280117
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 17:34:58 +0000 (17:34 +0000)]
IR: Appease MSVC after r280107 with an & or two
Fixes the bot:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15192
llvm-svn: 280116
Sanjay Patel [Tue, 30 Aug 2016 17:31:34 +0000 (17:31 +0000)]
[InstCombine] replace divide-by-constant checks with asserts; NFC
These folds already have tests for scalar and vector types, except
for the vector div-by-0 case, so I'm adding tests for that.
llvm-svn: 280115
Zachary Turner [Tue, 30 Aug 2016 17:29:59 +0000 (17:29 +0000)]
Add StringRef::take_front and StringRef::take_back
Reviewed By: majnemer, rnk
Differential Revision: https://reviews.llvm.org/D23965
llvm-svn: 280114
Zachary Turner [Tue, 30 Aug 2016 17:29:46 +0000 (17:29 +0000)]
Add StringRef::contains()
llvm-svn: 280113
Sanjay Patel [Tue, 30 Aug 2016 17:10:49 +0000 (17:10 +0000)]
[InstCombine] clean up foldICmpDivConstant; NFCI
1. Fix comments to match variable names
2. Remove redundant CmpRHS variable
3. Add FIXME to replace some checks with asserts
llvm-svn: 280112
Filipe Cabecinhas [Tue, 30 Aug 2016 17:08:55 +0000 (17:08 +0000)]
Start reifying error descriptions (Re-do of D23672 supporting VS2013)
Summary:
@kcc: I know you've accepted the other revision, but since this is a
non-trivial change, I'm updating it to show why D24029 would help.
This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.
After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.
ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).
Reviewers: kcc, samsonov, timurrrr
Subscribers: kcc, llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24030
llvm-svn: 280111
Filipe Cabecinhas [Tue, 30 Aug 2016 17:08:47 +0000 (17:08 +0000)]
Split ScarinessScore between its "storage" (POD), and an initializing object.
Summary:
This is needed so we can use it for D23672 on VS2013, since this VS
version doesn't support unrestricted unions, and doesn't allow us to
uses an object without a trivial default constructor inside a union.
Reviewers: kcc, samsonov
Subscribers: kubabrecka, llvm-commits
Differential Revision: https://reviews.llvm.org/D24029
llvm-svn: 280110
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 17:01:05 +0000 (17:01 +0000)]
ADT: Clean up docs and formatting for ilist_traits, NFC
This is a prep commit before splitting up ilist_node_traits and
updating/simplifying call sites.
- Move to top of file (I considered moving to a different file,
llvm/ADT/ilist_traits.h, but it's really not much code).
- Clang-format.
- Convert comments to doxygen, clean them up, and add TODOs for what I'm
doing next.
llvm-svn: 280109
Chris Bieneman [Tue, 30 Aug 2016 16:51:34 +0000 (16:51 +0000)]
[CMake] Copy headers relative to LLVM_BINARY_DIR
Summary: This copy phase is only needed for in-tree builds, so we should be copying to the LLVM build directory's include dir instead of the sub-project include dir.
Reviewers: bogner, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24015
llvm-svn: 280108
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 16:23:55 +0000 (16:23 +0000)]
ADT: Split out simple_ilist, a simple intrusive list
Split out a new, low-level intrusive list type with clear semantics.
Unlike iplist (and ilist), all operations on simple_ilist are intrusive,
and simple_ilist never takes ownership of its nodes. This enables an
intuitive API that has the right defaults for intrusive lists.
- insert() takes references (not pointers!) to nodes (in iplist/ilist,
passing a reference will cause the node to be copied).
- erase() takes only iterators (like std::list), and does not destroy
the nodes.
- remove() takes only references and has the same behaviour as erase().
- clear() does not destroy the nodes.
- The destructor does not destroy the nodes.
- New API {erase,remove,clear}AndDispose() take an extra Disposer
functor for callsites that want to call some disposal routine (e.g.,
std::default_delete).
This list is not currently configurable, and has no callbacks.
The initial motivation was to fix iplist<>::sort to work correctly (even
with callbacks in ilist_traits<>). iplist<> uses simple_ilist<>::sort
directly. The new test in unittests/IR/ModuleTest.cpp crashes without
this commit.
Fixing sort() via a low-level layer provided a good opportunity to:
- Unit test the low-level functionality thoroughly.
- Modernize the API, largely inspired by other intrusive list
implementations.
Here's a sketch of a longer-term plan:
- Create BumpPtrList<>, a non-intrusive list implemented using
simple_ilist<>, and use it for the Token list in
lib/Support/YAMLParser.cpp. This will factor out the only real use of
createNode().
- Evolve the iplist<> and ilist<> APIs in the direction of
simple_ilist<>, making allocation/deallocation explicit at call sites
(similar to simple_ilist<>::eraseAndDispose()).
- Factor out remaining calls to createNode() and deleteNode() and remove
the customization from ilist_traits<>.
- Transition uses of iplist<>/ilist<> that don't need callbacks over to
simple_ilist<>.
llvm-svn: 280107
Reid Kleckner [Tue, 30 Aug 2016 16:13:07 +0000 (16:13 +0000)]
XFAIL cfi/stats.cpp on Windows until we fix our DIA usage
llvm-svn: 280106
NAKAMURA Takumi [Tue, 30 Aug 2016 15:47:13 +0000 (15:47 +0000)]
Fixup r279618, instantiate *AnalysisManagerProxy<*AnalysisManager,LazyCallGraph::SCC>, instead of *AnalysisManagerProxy<*AnalysisManager,LazyCallGraph::SCC,LazyCallGraph&>, for PassID.
Or they were not instantiated as expected;
llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::Function>, llvm::LazyCallGraph::SCC>::PassID
llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager<llvm::Function>, llvm::LazyCallGraph::SCC>::PassID
llvm-svn: 280105
NAKAMURA Takumi [Tue, 30 Aug 2016 15:38:18 +0000 (15:38 +0000)]
Disable clang/test/SemaTemplate/instantiation-depth-default.cpp temporarily for targeting mingw32. It crashes. Investigating.
llvm-svn: 280104
Ed Maste [Tue, 30 Aug 2016 15:38:10 +0000 (15:38 +0000)]
consistently add \n to log and trace messages
Previously most messages included a newline in the string, but a few of
them were missing. Fix these and simplify by just adding the newline in
the _LIBUNWIND_LOG macro itself.
Differential Revision: https://reviews.llvm.org/D24026
llvm-svn: 280103
Tamas Berghammer [Tue, 30 Aug 2016 15:32:52 +0000 (15:32 +0000)]
Remove mention of autoconf from the build instructions
autoconf+make have been removed from LLVM and LLDB ~6month ago. We
shouldn't advertise it on the website as a valid way to build LLDB.
Differential revision: https://reviews.llvm.org/D24025
llvm-svn: 280102
Valery Pykhtin [Tue, 30 Aug 2016 15:20:31 +0000 (15:20 +0000)]
[AMDGPU] Refactor SOP instructions TD files.
Differential revision: https://reviews.llvm.org/D23617
llvm-svn: 280101
Reid Kleckner [Tue, 30 Aug 2016 15:12:58 +0000 (15:12 +0000)]
Revert "[ORC][RPC] Make the future type of an Orc RPC call Error/Expected rather than"
This reverts commit r280016, and the followups of r280017, r280027,
r280051, r280058, and r280059.
MSVC's implementation of std::promise does not get along with
llvm::Error. It uses its promised value too much like a normal value
type.
llvm-svn: 280100
Ed Maste [Tue, 30 Aug 2016 15:10:08 +0000 (15:10 +0000)]
libunwind: fix X86 register numbers for FreeBSD/i386
For historical reasons i386 has ebp and esp swapped in the eh_frame
register numbering on at least Darwin. That is:
Darwin FreeBSD
Reg # eh_frame eh_frame DWARF
===== ======== ======== =====
4 ebp esp esp
5 esp ebp ebp
Although the UNW_X86_* constants are not intended to be coupled with
DWARF / eh_frame numbering they are currently conflated in libunwind.
Differential Revision: https://reviews.llvm.org/D22508
llvm-svn: 280099
Kostya Serebryany [Tue, 30 Aug 2016 14:52:05 +0000 (14:52 +0000)]
[libFuzzer] fix a bug when running a single unit of N bytes with -max_len=M, M<N, caused a buffer overflow
llvm-svn: 280098
Alexey Bader [Tue, 30 Aug 2016 14:42:54 +0000 (14:42 +0000)]
[OpenCL] Make is_valid_event, create_user_event overloadable.
Summary: Make is_valid_event and create_user_event overloadable like other built-ins.
Patch by Evgeniy Tyurin.
Reviewers: bader, yaxunl
Subscribers: Anastasia, cfe-commits
Differential Revision: https://reviews.llvm.org/D23914
llvm-svn: 280097
Kostya Serebryany [Tue, 30 Aug 2016 14:39:33 +0000 (14:39 +0000)]
[libFuzzer] stop using bits for memcmp's value profile -- seems to blow up the corpus too much
llvm-svn: 280096
Haojian Wu [Tue, 30 Aug 2016 14:29:36 +0000 (14:29 +0000)]
[clang-tidy docs] Fix build errors on Sphinx 1.4.6
llvm-svn: 280095
Nico Weber [Tue, 30 Aug 2016 14:24:28 +0000 (14:24 +0000)]
Fix typo in comment
llvm-svn: 280094
Krzysztof Parzyszek [Tue, 30 Aug 2016 14:17:10 +0000 (14:17 +0000)]
[Hexagon] Use handleTargetFeaturesGroup to process target-specific features
llvm-svn: 280093
Nirav Dave [Tue, 30 Aug 2016 14:15:43 +0000 (14:15 +0000)]
[MC] Move parser helper functions from Asmparser to MCAsmParser
NFC Intended.
llvm-svn: 280092
Nico Weber [Tue, 30 Aug 2016 14:12:06 +0000 (14:12 +0000)]
Revert r280035 (and followups r280057, r280085), it caused PR30195
llvm-svn: 280091
Chad Rosier [Tue, 30 Aug 2016 13:58:35 +0000 (13:58 +0000)]
[Reassociate] Add additional debug output. NFC.
llvm-svn: 280090
Krzysztof Parzyszek [Tue, 30 Aug 2016 13:57:50 +0000 (13:57 +0000)]
Handle -mlong-calls on Hexagon
Differential Revision:://reviews.llvm.org/D22766
llvm-svn: 280089
Pavel Labath [Tue, 30 Aug 2016 13:56:11 +0000 (13:56 +0000)]
Revert "gdb-remote: Make the sequence mutex non-recursive"
This reverts commit r279725 as it breaks "dynamic register size" feature of mips.
llvm-svn: 280088
Pavel Labath [Tue, 30 Aug 2016 13:18:46 +0000 (13:18 +0000)]
Fix darwin cmake build for r279997
llvm-svn: 280087
Ed Maste [Tue, 30 Aug 2016 13:08:21 +0000 (13:08 +0000)]
libunwind: correct 'libuwind' typo
There were several instances of libuwind (missing an "n"), dating to
the initial import of libunwind.
llvm-svn: 280086
NAKAMURA Takumi [Tue, 30 Aug 2016 13:07:53 +0000 (13:07 +0000)]
clang/test/Driver/modules-ts.cpp: Satisfy quoted filename.
On win32, backslashed filename is emitted like;
-o "C:\\bb-win\\ninja-clang-i686-msc19-R\\build\\tools\\clang\\test\\Driver\\Output\\modules-ts.cpp.tmp.o"
llvm-svn: 280085
Vasileios Kalintiris [Tue, 30 Aug 2016 13:01:04 +0000 (13:01 +0000)]
[mips][tsan] XFAIL on every MIPS platform an x86_64-specific test.
The map32bit.cc test uses the MMAP_32BIT flag which is supported only
on x86-64.
llvm-svn: 280084
Tobias Grosser [Tue, 30 Aug 2016 12:41:29 +0000 (12:41 +0000)]
Add forgotten image
llvm-svn: 280083
Tobias Grosser [Tue, 30 Aug 2016 12:41:08 +0000 (12:41 +0000)]
www: homepage "Overview and News"
llvm-svn: 280082
Tobias Grosser [Tue, 30 Aug 2016 12:41:04 +0000 (12:41 +0000)]
www: shorten links in menu
llvm-svn: 280081
Tobias Grosser [Tue, 30 Aug 2016 12:41:02 +0000 (12:41 +0000)]
www: link to github source mirror, drop the other old source viewers
llvm-svn: 280080
Tobias Grosser [Tue, 30 Aug 2016 12:40:59 +0000 (12:40 +0000)]
www: improve formatting of external links
llvm-svn: 280079
NAKAMURA Takumi [Tue, 30 Aug 2016 12:34:03 +0000 (12:34 +0000)]
clang-tools-extra/test/clang-tidy/misc-move-forwarding-reference.cpp: Appease ms targets with -fno-delayed-template-parsing.
llvm-svn: 280078
Martin Bohme [Tue, 30 Aug 2016 12:11:12 +0000 (12:11 +0000)]
[clang-tidy] Add check 'misc-move-forwarding-reference'
Summary:
The check emits a warning if std::move() is applied to a forwarding reference, i.e. an rvalue reference of a function template argument type.
If a developer is unaware of the special rules for template argument deduction on forwarding references, it will seem reasonable to apply std::move() to the forwarding reference, in the same way that this would be done for a "normal" rvalue reference.
This has a consequence that is usually unwanted and possibly surprising: If the function that takes the forwarding reference as its parameter is called with an lvalue, that lvalue will be moved from (and hence placed into an indeterminate state) even though no std::move() was applied to the lvalue at the callsite.
As a fix, the check will suggest replacing the std::move() with a std::forward().
This patch requires D23004 to be submitted before it.
Reviewers: sbenza, aaron.ballman
Subscribers: klimek, etienneb, alexfh, aaron.ballman, Prazek, Eugene.Zelenko, mgehre, cfe-commits
Projects: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D22220
llvm-svn: 280077
Tobias Grosser [Tue, 30 Aug 2016 12:08:25 +0000 (12:08 +0000)]
www: Add links to Polly Labs and Polyhedral.info
llvm-svn: 280076
NAKAMURA Takumi [Tue, 30 Aug 2016 11:50:21 +0000 (11:50 +0000)]
SILoadStoreOptimizer.cpp: Fix a warning in r279991. [-Wunused-variable]
llvm-svn: 280075
Pavel Labath [Tue, 30 Aug 2016 11:17:00 +0000 (11:17 +0000)]
Fix fallout from the GetNameColonValue() refactor (r280000)
This fixes the linux test suite.
llvm-svn: 280074
James Molloy [Tue, 30 Aug 2016 10:56:08 +0000 (10:56 +0000)]
[SimplifyCFG] Properly CSE metadata in SinkThenElseCodeToEnd
This was missing, meaning the metadata in sunk instructions was potentially bogus and could cause miscompiles.
llvm-svn: 280072
Peter Zotov [Tue, 30 Aug 2016 10:48:31 +0000 (10:48 +0000)]
docs: mention that clobbering output regs in inline asm is illegal.
I've found this out the hard way; LLVM will not normally catch this
error (unless -verify-machineinstrs is passed), and under certain
very specific circumstances (such as register scavenger running
under pressure) this would result in an opaque crash in codegen.
llvm-svn: 280071
George Rimar [Tue, 30 Aug 2016 09:54:01 +0000 (09:54 +0000)]
[ELF] - Linkerscript: implemented ADDR command.
ADDR(section)
Return the absolute address (the VMA) of the named section.
Used in the wild, eg.: https://searchcode.com/file/
53617342/arch/x86/kernel/vmlinux.lds.S
Differential revision: https://reviews.llvm.org/D23913
llvm-svn: 280070
George Rimar [Tue, 30 Aug 2016 09:46:59 +0000 (09:46 +0000)]
[ELF] - Fix for: bug 29115 - linkerscript does not support non-wildcard filename spec.
FreeBSD/mips script has non-wildcard filename specifications:
.text :
{
start.o(.text*)
Patch adds support for that, this is PR29115.
Differential revision: https://reviews.llvm.org/D23839
llvm-svn: 280069
George Rimar [Tue, 30 Aug 2016 09:39:36 +0000 (09:39 +0000)]
[ELF] - Use early return. NFC.
This addresses forgotten review comment for r280067:
"[ELF] - Versionscript: support wildcards for extern "c++" tag."
llvm-svn: 280068
George Rimar [Tue, 30 Aug 2016 09:35:03 +0000 (09:35 +0000)]
[ELF] - Versionscript: support wildcards for extern "c++" tag.
Previously for extern keyword only names in quotes (exact match) was supported.
Patch adds support for wildcards, so next scripts can be handled properly:
LIBSAMPLE_1.0 {
global:
extern "C++" {
foo*;
};
};
Differential revision: https://reviews.llvm.org/D23794
llvm-svn: 280067
George Rimar [Tue, 30 Aug 2016 09:29:37 +0000 (09:29 +0000)]
[ELF] - Cleanup of scanVersionScript(): do not change local Demangled variable. NFC.
llvm-svn: 280066
Sjoerd Meijer [Tue, 30 Aug 2016 08:56:00 +0000 (08:56 +0000)]
Fix for commit 280064 that break the build.
llvm-svn: 280065
Sjoerd Meijer [Tue, 30 Aug 2016 08:09:45 +0000 (08:09 +0000)]
This adds new options -fdenormal-fp-math and passes through option -ffast-math
to CC1, which are translated to function attributes and can e.g. be mapped on
build attributes FP_exceptions and FP_denormal. Setting these build attributes
allows better selection of floating point libraries.
Differential Revision: https://reviews.llvm.org/D23840
llvm-svn: 280064
Miklos Vajna [Tue, 30 Aug 2016 07:24:57 +0000 (07:24 +0000)]
clang-rename: fix formatting in USRFinder
As detected by clang-format.
llvm-svn: 280063
Miklos Vajna [Tue, 30 Aug 2016 07:23:24 +0000 (07:23 +0000)]
clang-rename: improve error message when -old-name is used and could not find symbol
Old output was:
clang-rename: could not find symbol at tools/clang/tools/extra/test/clang-rename/ClassFindByName.cpp:1:1 (offset 0).
Reviewers: omtcyfz
Differential Revision: https://reviews.llvm.org/D24002
llvm-svn: 280062
Ying Yi [Tue, 30 Aug 2016 07:01:37 +0000 (07:01 +0000)]
[llvm-cov] Use the native path in the coverage report.
The coverage reports contain the source or binary file paths. On Windows,
the file path might contain the seperators of both '/' and '\'. This patch
uses the native path in the coverage reports. For example, on Windows,
all '/' are converted to '\'.
Differential Revision: https://reviews.llvm.org/D23922
llvm-svn: 280061
Tobias Grosser [Tue, 30 Aug 2016 06:35:17 +0000 (06:35 +0000)]
www: Add IMPACT 2017 announcement to news page
llvm-svn: 280060
Lang Hames [Tue, 30 Aug 2016 06:00:21 +0000 (06:00 +0000)]
[Support][Error] Suppress warning about unused result.
llvm-svn: 280059
Lang Hames [Tue, 30 Aug 2016 05:32:41 +0000 (05:32 +0000)]
[Support] Add a conditionally defined default constructor (available on MSVC
only) for Expected<T> so that it can interoperate with MSVC's std::future
implementation.
MSVC 2013's std::future implementation requires the wrapped type to be default
constructible.
Hopefully this will fix the bot breakage in
http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9937 .
llvm-svn: 280058
Richard Smith [Tue, 30 Aug 2016 05:14:38 +0000 (05:14 +0000)]
Combine two FileCheck patterns to prevent overzealous matching of .*
llvm-svn: 280057
James Y Knight [Tue, 30 Aug 2016 03:16:16 +0000 (03:16 +0000)]
Replace incorrect "#ifdef DEBUG" with "#ifndef NDEBUG".
The former is simply wrong -- the code will either never be used or will
always be used, rather than being dependent upon whether it's built with
debug assertions enabled.
The macro DEBUG isn't ever set by the llvm build system. But, the macro
DEBUG(X) is defined (unconditionally) if you happen to include
llvm/Support/Debug.h.
The code in Value.h which was erroneously protected by the #ifdef DEBUG
didn't even compile -- you can't cast<> from an LLVMOpaqueValue
directly. Fortunately, it was never invoked, as Core.cpp included
Value.h before Debug.h.
The conditionalized code in AArch64CollectLOH.cpp was previously always
used, as it includes Debug.h.
llvm-svn: 280056
Akira Hatanaka [Tue, 30 Aug 2016 03:10:19 +0000 (03:10 +0000)]
[asan] Mark failing test as UNSUPPORTED.
llvm-svn: 280055
Kostya Serebryany [Tue, 30 Aug 2016 03:05:50 +0000 (03:05 +0000)]
[libFuzzer] use bits instead of bytes for memcmp/strcmp value profile -- the fuzzer reaches the goal much faster, at least on the simple puzzles
llvm-svn: 280054
Hal Finkel [Tue, 30 Aug 2016 02:38:34 +0000 (02:38 +0000)]
[PowerPC] Update the DWARF register-size table
The PPC64 DWARF register-size table did not match the ABI specification (or
GCC, for that matter). Fix that, and add a regression test.
Fixes PR27931.
llvm-svn: 280053
Anna Thomas [Tue, 30 Aug 2016 02:36:48 +0000 (02:36 +0000)]
[RewriteStatepointsForGC] Update comment for same PHI node check. NFC
llvm-svn: 280052
Lang Hames [Tue, 30 Aug 2016 01:57:06 +0000 (01:57 +0000)]
[ORC][RPC] Reword 'async' to 'non-blocking' to better reflect call primitive
behaviors, and add a callB (blacking call) primitive.
callB is a blocking call primitive for threaded code where the RPC responses are
being processed on a separate thread. (For single threaded code callST should
continue to be used instead).
No unit test yet: Last time I commited a threaded unit test it deadlocked on
one of the s390x builders. I'll try to re-enable that test first, and add a new
test if I can sort out the deadlock issue.
llvm-svn: 280051
Eric Fiselier [Tue, 30 Aug 2016 01:46:43 +0000 (01:46 +0000)]
Add "FLAKY_TEST" test directive to support re-running flaky tests.
Some of the mutex tests fail on machines with high load. This patch implements
the test directive "// FLAKY_TEST" which allows a test to be run 3 times
before it's considered a failure.
llvm-svn: 280050
Hal Finkel [Tue, 30 Aug 2016 01:43:38 +0000 (01:43 +0000)]
[PowerPC] Force entry alignment in .got2
Implement Bill's suggested fix for 32-bit targets for PR22711 (for the
alignment of each entry). As pointed out in the bug report, we could just force
the section alignment, since we only add pointer-sized things currently, but
this fix is somewhat more future-proof.
llvm-svn: 280049
Sanjoy Das [Tue, 30 Aug 2016 01:38:59 +0000 (01:38 +0000)]
Fix coding style; NFC
Avoid variables starting with lowercase.
llvm-svn: 280048
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 01:37:58 +0000 (01:37 +0000)]
ADT: Explode include/llvm/ADT/{ilist,ilist_node}.h, NFC
I'm working on a lower-level intrusive list that can be used
stand-alone, and splitting the files up a bit will make the code easier
to organize. Explode the ilist headers in advance to improve blame
lists in the future.
- Move ilist_node_base from ilist_node.h to ilist_node_base.h.
- Move ilist_base from ilist.h to ilist_base.h.
- Move ilist_iterator from ilist.h to ilist_iterator.h.
- Move ilist_node_access from ilist.h to ilist_node.h to support
ilist_iterator.
- Update unit tests to #include smaller headers.
- Clang-format the moved things.
I noticed in transit that there is a simplify_type specialization for
ilist_iterator. Since there is no longer an implicit conversion from
ilist<T>::iterator to T*, this doesn't make sense (effectively it's a
form of implicit conversion). For now I've added a FIXME.
llvm-svn: 280047
Kostya Serebryany [Tue, 30 Aug 2016 01:30:14 +0000 (01:30 +0000)]
[libFuzzer] use trace-div and trace-gep for guided fuzzing, add tests
llvm-svn: 280046
Kostya Serebryany [Tue, 30 Aug 2016 01:27:46 +0000 (01:27 +0000)]
[sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep, mostly usaful for value-profile-based fuzzing; run-time part
llvm-svn: 280045
Kostya Serebryany [Tue, 30 Aug 2016 01:27:03 +0000 (01:27 +0000)]
[sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep, mostly usaful for value-profile-based fuzzing; clang part
llvm-svn: 280044
Kostya Serebryany [Tue, 30 Aug 2016 01:12:10 +0000 (01:12 +0000)]
[sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep, mostly usaful for value-profile-based fuzzing; llvm part
llvm-svn: 280043
Eric Fiselier [Tue, 30 Aug 2016 01:10:33 +0000 (01:10 +0000)]
Fix syntax error in recent CMake change.
llvm-svn: 280042
Hal Finkel [Tue, 30 Aug 2016 01:07:03 +0000 (01:07 +0000)]
[PowerPC] Add support for -mlongcall
Add support for GCC's PowerPC -mlongcall option; the backend supports the
corresponding target feature as of r280040.
Fixes PR19098.
llvm-svn: 280041
Hal Finkel [Tue, 30 Aug 2016 00:59:23 +0000 (00:59 +0000)]
[PowerPC] Add support for -mlongcall
The "long call" option forces the use of the indirect calling sequence for all
calls (even those that don't really need it). GCC provides this option; This is
helpful, under certain circumstances, for building very-large binaries, and
some other specialized use cases.
Fixes PR19098.
llvm-svn: 280040
Jason Molenda [Tue, 30 Aug 2016 00:58:23 +0000 (00:58 +0000)]
Update debugserver project to pull in StdStringExtractor.cpp instead of the new
llvm-using StringExtractor.cpp in the xcode project file settings.
llvm-svn: 280039
Vitaly Buka [Tue, 30 Aug 2016 00:57:40 +0000 (00:57 +0000)]
[asan] Disable test on darwin bot
According logs asan detects the bug but string with file name is not found.
I will investigate and fix the test.
llvm-svn: 280038
Eric Fiselier [Tue, 30 Aug 2016 00:54:37 +0000 (00:54 +0000)]
Fix PR28831 - Bad logic around CMAKE_OSX_SYSROOT and CMAKE_OSX_ARCHITECTURES.
See https://llvm.org/bugs/show_bug.cgi?id=28831 for more information about
the changes.
llvm-svn: 280037
Piotr Padlewski [Tue, 30 Aug 2016 00:46:26 +0000 (00:46 +0000)]
NFC: add early exit in ModuleSummaryAnalysis
Summary:
Changed this code because it was not very readable.
The one question that I got after changing it is, should we
count calls to intrinsics? We don't add them to caller summary,
so maybe we shouldn't also count them?
Reviewers: tejohnson, eraman, mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23949
llvm-svn: 280036
Richard Smith [Tue, 30 Aug 2016 00:44:54 +0000 (00:44 +0000)]
C++ Modules TS: driver support for building modules.
This works as follows: we add --precompile to the existing gamut of options for
specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag
specifies that an input is taken to the precompilation step and no further, and
this can be specified when building a .pcm from a module interface or when
building a .pch from a header file.
The .cppm extension (and some related extensions) are implicitly recognized as
C++ module interface files. If --precompile is /not/ specified, the file is
compiled (via a .pcm) to a .o file containing the code for the module (and then
potentially also assembled and linked, if -S, -c, etc. are not specified). We
do not yet suppress the emission of object code for other users of the module
interface, so for now this will only work if everything in the .cppm file has
vague linkage.
As with the existing support for module-map modules, prebuilt modules can be
provided as compiler inputs either via the -fmodule-file= command-line argument
or via files named ModuleName.pcm in one of the directories specified via
-fprebuilt-module-path=.
This also exposes the -fmodules-ts cc1 flag in the driver. This is still
experimental, and in particular, the concrete syntax is subject to change as
the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does
not enable support for implicitly loading module maps nor building modules via
the module cache, but those features can be turned on separately and used in
conjunction with the Modules TS support.
llvm-svn: 280035
Hal Finkel [Tue, 30 Aug 2016 00:22:22 +0000 (00:22 +0000)]
[PowerPC] Add triple to test/CodeGen/PowerPC/atomic-2.ll for ppc64le
Otherwise, running the test on Darwin systems will not work.
llvm-svn: 280034
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 00:18:43 +0000 (00:18 +0000)]
Rename unittests/ADT/ilistTestTemp.cpp => IListTest.cpp
And rename the tests inside from ilistTest to IListTest. This makes the
file sort properly in the CMakeLists.txt (previously, sorting would
throw it down to the end of the list) and is consistent with the tests
I've added more recently.
Why use IListNodeBaseTest.cpp (and a test name of IListNodeBaseTest)?
- ilist_node_base_test is the obvious thing, since this is testing
ilist_node_base. However, gtest disallows underscores in test names.
- ilist_node_baseTest fails for the same reason.
- ilistNodeBaseTest is weird, because it isn't in our usual
TitleCaseTest form that we use for tests, and it also doesn't have the
name of the tested class in it.
- IlistNodeBaseTest matches TitleCaseTest, but "Ilist" is hard to read,
and really "ilist" is an abbreviation for "IntrusiveList" so the
lowercase "list" is strange.
- That left IListNodeBaseTest.
Note: I made this move in two stages, with a temporary filename of
ilistTestTemp in between in r279524. This was in the hopes of avoiding
problems on Git and SVN clients on case-insensitive filesystems,
particularly on buildbots with incremental checkouts.
llvm-svn: 280033
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 00:13:12 +0000 (00:13 +0000)]
ADT: Give ilist<T>::reverse_iterator a handle to the current node
Reverse iterators to doubly-linked lists can be simpler (and cheaper)
than std::reverse_iterator. Make it so.
In particular, change ilist<T>::reverse_iterator so that it is *never*
invalidated unless the node it references is deleted. This matches the
guarantees of ilist<T>::iterator.
(Note: MachineBasicBlock::iterator is *not* an ilist iterator, but a
MachineInstrBundleIterator<MachineInstr>. This commit does not change
MachineBasicBlock::reverse_iterator, but it does update
MachineBasicBlock::reverse_instr_iterator. See note at end of commit
message for details on bundle iterators.)
Given the list (with the Sentinel showing twice for simplicity):
[Sentinel] <-> A <-> B <-> [Sentinel]
the following is now true:
1. begin() represents A.
2. begin() holds the pointer for A.
3. end() represents [Sentinel].
4. end() holds the poitner for [Sentinel].
5. rbegin() represents B.
6. rbegin() holds the pointer for B.
7. rend() represents [Sentinel].
8. rend() holds the pointer for [Sentinel].
The changes are #6 and #8. Here are some properties from the old
scheme (which used std::reverse_iterator):
- rbegin() held the pointer for [Sentinel] and rend() held the pointer
for A;
- operator*() cost two dereferences instead of one;
- converting from a valid iterator to its valid reverse_iterator
involved a confusing increment; and
- "RI++->erase()" left RI invalid. The unintuitive replacement was
"RI->erase(), RE = end()".
With vector-like data structures these properties are hard to avoid
(since past-the-beginning is not a valid pointer), and don't impose a
real cost (since there's still only one dereference, and all iterators
are invalidated on erase). But with lists, this was a poor design.
Specifically, the following code (which obviously works with normal
iterators) now works with ilist::reverse_iterator as well:
for (auto RI = L.rbegin(), RE = L.rend(); RI != RE;)
fooThatMightRemoveArgFromList(*RI++);
Converting between iterator and reverse_iterator for the same node uses
the getReverse() function.
reverse_iterator iterator::getReverse();
iterator reverse_iterator::getReverse();
Why doesn't iterator <=> reverse_iterator conversion use constructors?
In order to catch and update old code, reverse_iterator does not even
have an explicit conversion from iterator. It wouldn't be safe because
there would be no reasonable way to catch all the bugs from the changed
semantic (see the changes at call sites that are part of this patch).
Old code used this API:
std::reverse_iterator::reverse_iterator(iterator);
iterator std::reverse_iterator::base();
Here's how to update from old code to new (that incorporates the
semantic change), assuming I is an ilist<>::iterator and RI is an
ilist<>::reverse_iterator:
[Old] ==> [New]
reverse_iterator(I) (--I).getReverse()
reverse_iterator(I) ++I.getReverse()
--reverse_iterator(I) I.getReverse()
reverse_iterator(++I) I.getReverse()
RI.base() (--RI).getReverse()
RI.base() ++RI.getReverse()
--RI.base() RI.getReverse()
(++RI).base() RI.getReverse()
delete &*RI, RE = end() delete &*RI++
RI->erase(), RE = end() RI++->erase()
=======================================
Note: bundle iterators are out of scope
=======================================
MachineBasicBlock::iterator, also known as
MachineInstrBundleIterator<MachineInstr>, is a wrapper to represent
MachineInstr bundles. The idea is that each operator++ takes you to the
beginning of the next bundle. Implementing a sane reverse iterator for
this is harder than ilist. Here are the options:
- Use std::reverse_iterator<MBB::i>. Store a handle to the beginning of
the next bundle. A call to operator*() runs a loop (usually
operator--() will be called 1 time, for unbundled instructions).
Increment/decrement just works. This is the status quo.
- Store a handle to the final node in the bundle. A call to operator*()
still runs a loop, but it iterates one time fewer (usually
operator--() will be called 0 times, for unbundled instructions).
Increment/decrement just works.
- Make the ilist_sentinel<MachineInstr> *always* store that it's the
sentinel (instead of just in asserts mode). Then the bundle iterator
can sniff the sentinel bit in operator++().
I initially tried implementing the end() option as part of this commit,
but updating iterator/reverse_iterator conversion call sites was
error-prone. I have a WIP series of patches that implements the final
option.
llvm-svn: 280032
Evgeniy Stepanov [Mon, 29 Aug 2016 23:42:34 +0000 (23:42 +0000)]
[cfi] Export __cfi_check when linking with -fsanitize-cfi-cross-dso.
Multi-DSO CFI model requires every DSO to export a __cfi_check function.
llvm-svn: 280031
Jan Vesely [Mon, 29 Aug 2016 23:21:46 +0000 (23:21 +0000)]
AMDGPU/R600: Cleanup DAGCombine
Move SDLoc initialization to comon place.
fall back to AMDGPU version in one place
Differential Revision: https://reviews.llvm.org/D23900
llvm-svn: 280030
Evgeniy Stepanov [Mon, 29 Aug 2016 23:15:46 +0000 (23:15 +0000)]
Fix typo in test.
llvm-svn: 280028
Lang Hames [Mon, 29 Aug 2016 23:10:20 +0000 (23:10 +0000)]
[ORC] Fix unit-test breakage from r280016.
Void functions returning error now boolean convert to 'false' if they succeed.
Unit tests updated to reflect this.
llvm-svn: 280027
Vitaly Buka [Mon, 29 Aug 2016 22:59:02 +0000 (22:59 +0000)]
[asan] Attempt to fix test on darwin bot
llvm-svn: 280026
Michael Kuperstein [Mon, 29 Aug 2016 22:49:05 +0000 (22:49 +0000)]
Fix typo in comment. NFC.
llvm-svn: 280025
Teresa Johnson [Mon, 29 Aug 2016 22:46:56 +0000 (22:46 +0000)]
[ThinLTO] Indirect call promotion fixes for promoted local functions
Summary:
Fix a couple issues limiting the application of indirect call promotion
in ThinLTO mode:
- Invoke indirect call promotion before globalopt, since it may
eliminate imported functions which appear unreferenced.
- Invoke indirect call promotion with InLTO=true so that the PGOFuncName
metadata is used to get the name for locals which would have been
renamed during promotion.
Reviewers: davidxl, mehdi_amini
Subscribers: Prazek, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D24004
llvm-svn: 280024
Chris Bieneman [Mon, 29 Aug 2016 22:26:00 +0000 (22:26 +0000)]
[CMake] Trying to fix the bots I broke
See: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z/builds/981/steps/build.libcxxabi/logs/stdio
llvm-svn: 280023
Hal Finkel [Mon, 29 Aug 2016 22:25:36 +0000 (22:25 +0000)]
[PowerPC] Fix i8/i16 atomics for little-Endian targets without partword atomics
For little-Endian PowerPC, we generally target only P8 and later by default.
However, generic (older) 64-bit configurations are still an option, and in that
case, partword atomics are not available (e.g. stbcx.). To lower i8/i16 atomics
without true i8/i16 atomic operations, we emulate using i32 atomics in
combination with a bunch of shifting and masking, etc. The amount by which to
shift in little-Endian mode is different from the amount in big-Endian mode (it
is inverted -- meaning we can leave off the xor when computing the amount).
Fixes PR22923.
llvm-svn: 280022
Chris Bieneman [Mon, 29 Aug 2016 22:12:21 +0000 (22:12 +0000)]
[CMake] Use -std=c++11 if supported
Summary: This patch adds a check for if -std=c++11 is a supported flag, and adds it to CMAKE_CXX_FLAGS if it is supported.
Reviewers: EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24007
llvm-svn: 280021
Chad Rosier [Mon, 29 Aug 2016 22:09:51 +0000 (22:09 +0000)]
[SLP] Return a boolean value for these static helpers. NFC.
Differential Revision: https://reviews.llvm.org/D24008
llvm-svn: 280020
Jan Vesely [Mon, 29 Aug 2016 22:05:06 +0000 (22:05 +0000)]
AMDGPU/R600: Remove MergeVectorStores from legalization
This is handled by DAGCombiner in a more generic way
Differential Revision: https://reviews.llvm.org/D23970
llvm-svn: 280019
Rui Ueyama [Mon, 29 Aug 2016 22:01:21 +0000 (22:01 +0000)]
Make lld actually compatible with gold in terms of filler handling.
GNU gold handles output section fillers as 32-bit values.
This patch makes LLD compatible with that behavior.
Differential revision: https://reviews.llvm.org/D23181
llvm-svn: 280018
Lang Hames [Mon, 29 Aug 2016 21:57:52 +0000 (21:57 +0000)]
[ORC][RPC] Fix typo in RPC comments: call primitives on void functions return
future<Error>, not future<bool>.
llvm-svn: 280017
Lang Hames [Mon, 29 Aug 2016 21:56:30 +0000 (21:56 +0000)]
[ORC][RPC] Make the future type of an Orc RPC call Error/Expected rather than
Optional.
For void functions the return type of a nonblocking call changes from
Expected<future<Optional<bool>>> to Expected<future<Error>>, and for functions
returning T the return type changes from Expected<future<Optional<T>>> to
Expected<future<Expected<T>>>.
Inner results need to be checked (since the RPC connection may have dropped
out before a result came back) and Error/Expected provide stronger checking
requirements. It also allows us drop the crufty 'optionalToError' function and
just collapse Errors in the single-threaded call primitives.
llvm-svn: 280016