Craig Topper [Fri, 7 Apr 2017 07:31:55 +0000 (07:31 +0000)]
[InstCombine] Add additional tests with varied commuting to show missing combines. NFC
llvm-svn: 299746
Craig Topper [Fri, 7 Apr 2017 05:57:51 +0000 (05:57 +0000)]
[InstSimplify] Use Instruction::BinaryOps instead of unsigned for a few function operands to remove some casts. NFC
llvm-svn: 299745
Akira Hatanaka [Fri, 7 Apr 2017 05:55:28 +0000 (05:55 +0000)]
Revert "Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions."
This reverts commit r299734.
llvm-svn: 299744
Shoaib Meenai [Fri, 7 Apr 2017 02:20:52 +0000 (02:20 +0000)]
[libc++] Drop support for CRTs older than VS 2015
LLVM dropped support for Visual Studio versions older than 2015 quite
some time ago, so I consider it safe to drop libc++'s support for older
CRTs. The CRT in Visual Studio 2015 provides a lot of previously missing
functions, so targeting it requires less special casing.
Differential Revision: https://reviews.llvm.org/D31798
llvm-svn: 299743
Rafael Espindola [Fri, 7 Apr 2017 01:40:21 +0000 (01:40 +0000)]
Move a cast out of a function. NFC.
The argument was always casted, so cast it in the caller.
llvm-svn: 299742
Daniel Berlin [Fri, 7 Apr 2017 01:28:36 +0000 (01:28 +0000)]
AliasAnalysis: Be less conservative about volatile than atomic.
Summary:
getModRefInfo is meant to answer the question "what impact does this
instruction have on a given memory location" (not even another
instruction).
Long debate on this on IRC comes to the conclusion the answer should be "nothing special".
That is, a noalias volatile store does not affect a memory location
just by being volatile. Note: DSE and GVN and memdep currently
believe this, because memdep just goes behind AA's back after it says
"modref" right now.
see line 635 of memdep. Prior to this patch we would get modref there, then check aliasing,
and if it said noalias, we would continue.
getModRefInfo *already* has this same AA check, it just wasn't being used because volatile was
lumped in with ordering.
(I am separately testing whether this code in memdep is now dead except for the invariant load case)
Reviewers: jyknight, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31726
llvm-svn: 299741
Rafael Espindola [Fri, 7 Apr 2017 01:25:01 +0000 (01:25 +0000)]
Remove unnecessary cast.
llvm-svn: 299740
Reid Kleckner [Fri, 7 Apr 2017 01:24:48 +0000 (01:24 +0000)]
Add missing import
llvm-svn: 299739
Reid Kleckner [Fri, 7 Apr 2017 01:23:15 +0000 (01:23 +0000)]
[lit] Fix Darwin pickling errors with process pools
For a function to be pickle-able, it has to be in the top-level of a
real Python module. So, I made one for this code snippet.
llvm-svn: 299738
Craig Topper [Fri, 7 Apr 2017 00:29:47 +0000 (00:29 +0000)]
[InstCombine] Add more commuted patterns to support folding ((~A & B) | A) -> (A | B).
llvm-svn: 299737
Derek Schuff [Thu, 6 Apr 2017 23:52:01 +0000 (23:52 +0000)]
[WebAssembly] Fix -Wcovered-switch-default warning
llvm-svn: 299736
Billy Robert O'Neal III [Thu, 6 Apr 2017 23:50:33 +0000 (23:50 +0000)]
Add noexcept(false) to more strongly indicate that not being noexcept is important for hash tests.
llvm-svn: 299735
Billy Robert O'Neal III [Thu, 6 Apr 2017 23:50:21 +0000 (23:50 +0000)]
Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions.
These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way.
Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions.
llvm-svn: 299734
Zachary Turner [Thu, 6 Apr 2017 23:43:39 +0000 (23:43 +0000)]
Allow specification of what kinds of class members to dump.
Previously when dumping class definitions, there were only
two modes - on or off. But it's useful to sometimes get a
little more fine-grained. For example, you might only want
to see the record layout (for example to look for extraneous
padding). This patch adds a third mode, layout mode, which
does exactly that. Only this-relative data members are
displayed in this mode.
Differential Revision: https://reviews.llvm.org/D31794
llvm-svn: 299733
Zachary Turner [Thu, 6 Apr 2017 23:43:12 +0000 (23:43 +0000)]
[llvm-pdbdump] Allow pretty to only dump specific types of types.
Previously we just had the -types option, which would dump all
classes, typedefs, and enums. But this produces a lot of output
if you only want to view classes, for example. This patch breaks
this down into 3 additional options, -classes, -enums, and
-typedefs, and keeps the -types option around which implies all
3 more specific options.
Differential Revision: https://reviews.llvm.org/D31791
llvm-svn: 299732
Adrian Prantl [Thu, 6 Apr 2017 23:36:44 +0000 (23:36 +0000)]
Add an end-to-end testcase for address sanitizer.
llvm-svn: 299731
Adrian Prantl [Thu, 6 Apr 2017 23:30:51 +0000 (23:30 +0000)]
Add a test for debug info with the safestack sanitizer enabled.
llvm-svn: 299730
Eugene Zemtsov [Thu, 6 Apr 2017 23:12:43 +0000 (23:12 +0000)]
Add more tests for ExtractContextAndIdentifier
llvm-svn: 299729
Saleem Abdulrasool [Thu, 6 Apr 2017 23:07:53 +0000 (23:07 +0000)]
COFF: support the /appcontainer flag
The /appcontainer flag indicates that the module may only be used inside
an application container (for isolation). This has been supported by
link.exe since Windows 8.0. It sets an additional bit in the PE DLL
Characteristics flag to indicate the behavioural change.
llvm-svn: 299728
Konstantin Zhuravlyov [Thu, 6 Apr 2017 23:02:33 +0000 (23:02 +0000)]
AMDGPU/GFX9: Fix shared and private aperture queries
Differential Revision: https://reviews.llvm.org/D31786
llvm-svn: 299727
Eric Christopher [Thu, 6 Apr 2017 23:01:30 +0000 (23:01 +0000)]
Remove the default subtarget from the Power port. It's unnecessary and harmful if used.
llvm-svn: 299726
Craig Topper [Thu, 6 Apr 2017 23:00:22 +0000 (23:00 +0000)]
[InstCombine] Add a few cases for OR we fail to optimize due to missing commuted patterns checks.
llvm-svn: 299725
Yi Kong [Thu, 6 Apr 2017 22:47:47 +0000 (22:47 +0000)]
Revert "Revert "[ARM] Add Kryo to available targets""
This reverts commit
dc9458d5a747a02a9a8f198b84c2b92a6939a8dd.
Added missing case for PreISelOperandLatencyAdjustment.
llvm-svn: 299724
Eli Friedman [Thu, 6 Apr 2017 22:42:18 +0000 (22:42 +0000)]
Turn on -addr-sink-using-gep by default.
The new codepath has been in the tree for years, and there isn't any
reason to use two codepaths here.
Differential Revision: https://reviews.llvm.org/D30596
llvm-svn: 299723
Rui Ueyama [Thu, 6 Apr 2017 22:39:11 +0000 (22:39 +0000)]
Rename refersToGotEntry needsGot and add comments.
This patch addresses a post-commit review comment for r299615.
Differential Revision: https://reviews.llvm.org/D31792
llvm-svn: 299722
Eugene Zemtsov [Thu, 6 Apr 2017 22:36:02 +0000 (22:36 +0000)]
New C++ function name parsing logic (Resubmit)
Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't
get anywhere close to covering full extent of possible function declarations.
It causes incorrect behavior in avoid-stepping and sometimes messes
printing of thread backtrace.
This change implements more methodical parsing logic based on clang
lexer and simple recursive parser.
Examples:
void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&)
void (*&std::_Any_data::_M_access<void (*)()>())()
Previous version of this change (D31451) was rolled back due to an issue
with Objective-C selectors being incorrectly recognized as a C++ identifier.
Differential Revision: https://reviews.llvm.org/D31451
llvm-svn: 299721
Michael Kuperstein [Thu, 6 Apr 2017 22:33:25 +0000 (22:33 +0000)]
[X86] Revert r299387 due to AVX legalization infinite loop.
llvm-svn: 299720
Zachary Turner [Thu, 6 Apr 2017 22:18:59 +0000 (22:18 +0000)]
Try to fix FreeBSD build after IWYU changes.
llvm-svn: 299719
Zachary Turner [Thu, 6 Apr 2017 21:57:39 +0000 (21:57 +0000)]
Fix build failure in unit test.
llvm-svn: 299718
Rafael Espindola [Thu, 6 Apr 2017 21:40:22 +0000 (21:40 +0000)]
Call updateAlignment before assignAddresses.
The alignment expression cannot depend on '.', so we can compute it
early.
llvm-svn: 299717
Rafael Espindola [Thu, 6 Apr 2017 21:31:24 +0000 (21:31 +0000)]
Move call to findMemoryRegion before assignAddresses.
This removes a bit more work from assignAddresses.
llvm-svn: 299716
Craig Topper [Thu, 6 Apr 2017 21:29:43 +0000 (21:29 +0000)]
[InstCombine] Remove testing assert I accidentally left in r299710.
llvm-svn: 299715
Zachary Turner [Thu, 6 Apr 2017 21:28:29 +0000 (21:28 +0000)]
iwyu fixes for lldbCore.
This adjusts header file includes for headers and source files
in Core. In doing so, one dependency cycle is eliminated
because all the includes from Core to that project were dead
includes anyway. In places where some files in other projects
were only compiling due to a transitive include from another
header, fixups have been made so that those files also include
the header they need. Tested on Windows and Linux, and plan
to address failures on OSX and FreeBSD after watching the
bots.
llvm-svn: 299714
Rafael Espindola [Thu, 6 Apr 2017 21:26:03 +0000 (21:26 +0000)]
Remove redundant argument. NFC.
llvm-svn: 299713
Matt Arsenault [Thu, 6 Apr 2017 21:09:53 +0000 (21:09 +0000)]
AMDGPU: Diagnose illegal SGPR to VGPR copies
This is possible in ways that are not compiler bugs,
so stop asserting on them.
This emits an extra error when emitting objects when it
can't encode the new pseudo, but I'm not sure that matters.
llvm-svn: 299712
Petr Hosek [Thu, 6 Apr 2017 21:06:33 +0000 (21:06 +0000)]
[CMake][libcxx] Use check_c_compiler_flag to check for nodefaultlibs
We're using -nodefaultlibs to avoid the dependency on C++ library
when using check_cxx_compiler_flag, and as such we cannot use
check_cxx_compiler_flag to check the availability of -nodefaultlibs
itself.
llvm-svn: 299711
Craig Topper [Thu, 6 Apr 2017 21:06:03 +0000 (21:06 +0000)]
[InstCombine] When checking to see if we can turn subtracts of 2^n - 1 into xor, we only need to call computeKnownBits on the RHS not the whole subtract. While there use isMask instead of isPowerOf2(C+1)
Calling computeKnownBits on the RHS should allows us to recurse one step further. isMask is equivalent to the isPowerOf2(C+1) except in the case where C is all ones. But that was already handled earlier by creating a not which is an Xor with all ones. So this should be fine.
llvm-svn: 299710
Rafael Espindola [Thu, 6 Apr 2017 21:05:39 +0000 (21:05 +0000)]
Cache the result of findSection.
This avoids calling it multiple times. In particular, we don't have to
call in in assignAddresses any more.
llvm-svn: 299709
Matt Arsenault [Thu, 6 Apr 2017 20:58:30 +0000 (20:58 +0000)]
AMDGPU: Replace fp16SrcZerosHighBits with a whitelist
FCOPYSIGN is lowered to bit operations which don't clear the high
bits.
llvm-svn: 299708
Rong Xu [Thu, 6 Apr 2017 20:56:00 +0000 (20:56 +0000)]
[PGO] Preserve GlobalsAA in pgo-memop-opt pass.
Preserve GlobalsAA analysis in memory intrinsic calls optimization based on
profiled size.
llvm-svn: 299707
Keno Fischer [Thu, 6 Apr 2017 20:51:40 +0000 (20:51 +0000)]
[llvm-extract] Add option for recursive extraction
Summary:
Particularly, with --delete, this can be very useful for testing
new optimizations on some hotspots, without having to run it on the whole
application. E.g. as such:
```
llvm-extract app.bc --recursive --rfunc .*hotspot.* > hotspot.bc
llvm-extract app.bc --recursive --delete --rfunc .*hotspot.* > residual.bc
llc -filetype=obj residual.bc > residual.o
llc -filetype=obj hotspot.bc > hotspot.o
cc -o app residual.o hotspot.o
```
Reviewed By: davide
Differential Revision: https://reviews.llvm.org/D31722
llvm-svn: 299706
Zachary Turner [Thu, 6 Apr 2017 20:51:22 +0000 (20:51 +0000)]
Try to fix FreeBSD build after iwyu changes.
llvm-svn: 299705
Craig Topper [Thu, 6 Apr 2017 20:41:48 +0000 (20:41 +0000)]
[InstCombine] Remove redundant combine from visitAnd
This combine is fully handled by SimplifyDemandedInstructionBits as of r299658 where I fixed this code to ensure the Add/Sub had only a single user. Otherwise it would fire and create additional instructions. That fix resulted in an improvement to code generated for tsan which is why I committed it before deleting.
Differential Revision: https://reviews.llvm.org/D31543
llvm-svn: 299704
Davide Italiano [Thu, 6 Apr 2017 20:32:10 +0000 (20:32 +0000)]
[BFIterator] Remove an assertion that doesn't hold. NFCI.
llvm-svn: 299703
Mehdi Amini [Thu, 6 Apr 2017 20:23:57 +0000 (20:23 +0000)]
Revert "Turn some C-style vararg into variadic templates"
This reverts commit r299699, the examples needs to be updated.
llvm-svn: 299702
Huihui Zhang [Thu, 6 Apr 2017 20:22:51 +0000 (20:22 +0000)]
[SelectionDAG] [ARM CodeGen] Fix chain information of LowerMUL
In LowerMUL, the chain information is not preserved for the new
created Load SDNode.
For example, if a Store alias with one of the operand of Mul.
The Load for that operand need to be scheduled before the Store.
The dependence is recorded in the chain of Store, in TokenFactor.
However, when lowering MUL, the SDNodes for the new Loads for
VMULL are not updated in the TokenFactor for the Store. Thus the
chain is not preserved for the lowered VMULL.
llvm-svn: 299701
Chih-Hung Hsieh [Thu, 6 Apr 2017 20:19:26 +0000 (20:19 +0000)]
[clang-tidy] Reuse FileID in getLocation
One FileID per warning will increase and overflow NextLocalOffset
when input file is large with many warnings.
Reusing FileID avoids this problem.
This requires changes in getColumnNumber, D31406, rL299681.
Differential Revision: http://reviews.llvm.org/D31406
llvm-svn: 299700
Mehdi Amini [Thu, 6 Apr 2017 20:09:31 +0000 (20:09 +0000)]
Turn some C-style vararg into variadic templates
Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.
From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.
Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>
Differential Revision: https://reviews.llvm.org/D31070
llvm-svn: 299699
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:52 +0000 (19:55 +0000)]
[asan] Fix dead stripping of globals on Linux (compiler-rt).
This is a re-land of r298173, r298169, r298159.
llvm-svn: 299698
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:17 +0000 (19:55 +0000)]
[asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.
Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.
This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.
At this moment it does not work on Gold (as in the globals are never
stripped).
This is a re-land of r298158 rebased on D31358. This time,
asan.module_ctor is put in a comdat as well to avoid quadratic
behavior in Gold.
llvm-svn: 299697
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:13 +0000 (19:55 +0000)]
[asan] Put ctor/dtor in comdat.
When possible, put ASan ctor/dtor in comdat.
The only reason not to is global registration, which can be
TU-specific. This is not the case when there are no instrumented
globals. This is also limited to ELF targets, because MachO does
not have comdat, and COFF linkers may GC comdat constructors.
The benefit of this is a lot less __asan_init() calls: one per DSO
instead of one per TU. It's also necessary for the upcoming
gc-sections-for-globals change on Linux, where multiple references to
section start symbols trigger quadratic behaviour in gold linker.
This is a rebase of r298756.
llvm-svn: 299696
Evgeniy Stepanov [Thu, 6 Apr 2017 19:55:09 +0000 (19:55 +0000)]
[asan] Delay creation of asan ctor.
Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat in some cases, but we don't know about that in the function
pass.
This is a rebase of r298731 which was reverted due to a false alarm.
llvm-svn: 299695
Peter Collingbourne [Thu, 6 Apr 2017 19:39:24 +0000 (19:39 +0000)]
Bitcode: Do not create FNENTRYs for aliases of functions.
There doesn't seem to be any point in doing this.
Differential Revision: https://reviews.llvm.org/D31691
llvm-svn: 299694
Rafael Espindola [Thu, 6 Apr 2017 19:38:24 +0000 (19:38 +0000)]
Replace a few uses of basename.
This replaces a few uses of basename with the recently introduced lit
replacements.
llvm-svn: 299693
Keno Fischer [Thu, 6 Apr 2017 19:26:22 +0000 (19:26 +0000)]
[StripDeadDebugInfo] Drop dead CUs entirely
Summary:
Prior to this while it would delete the dead DIGlobalVariables, it would
leave dead DICompileUnits and everything referenced therefrom. For a bit
bitcode file with thousands of compile units those dead nodes easily
outnumbered the real ones. Clean that up.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D31720
llvm-svn: 299692
Yaxun Liu [Thu, 6 Apr 2017 19:18:36 +0000 (19:18 +0000)]
[AMDGPU] Temporarily change constant address space from 4 to 2 for the new address space mapping
Change constant address space from 4 to 2 for the new address space mapping in Clang.
Differential Revision: https://reviews.llvm.org/D31771
llvm-svn: 299691
Yaxun Liu [Thu, 6 Apr 2017 19:17:32 +0000 (19:17 +0000)]
[AMDGPU] Temporarily change constant address space from 4 to 2
Our final address space mapping is to let constant address space to be 4 to match nvptx.
However for now we will make it 2 to avoid unnecessary work in FE/BE/devlib
about intrinsics returning constant pointers.
Differential Revision: https://reviews.llvm.org/D31770
llvm-svn: 299690
Yi Kong [Thu, 6 Apr 2017 19:16:14 +0000 (19:16 +0000)]
Revert "[ARM] Add Kryo to available targets"
This reverts commit
942d6e6f58bf7e63810dd7cbcbce1fdfa5ebc6d4.
Build breakage.
llvm-svn: 299689
Nirav Dave [Thu, 6 Apr 2017 19:05:41 +0000 (19:05 +0000)]
[SDAG] Fix visitAND optimization to deal with vector extract case again.
Summary:
Fix case elided by rL298920.
Fixes PR32545.
Reviewers: eli.friedman, RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31759
llvm-svn: 299688
Craig Topper [Thu, 6 Apr 2017 18:59:08 +0000 (18:59 +0000)]
[InstSimplify] Remove unreachable default from SimplifyBinOp.
We have dedicated handlers for every opcode so nothing can get here anymore. The switch doesn't get detected as fully covered because Opcode is an unsigned. Casting to Instruction::BinaryOps still doesn't detect it because BinaryOpsEnd is in the enum and 1 past the last opcode.
llvm-svn: 299687
Marshall Clow [Thu, 6 Apr 2017 18:54:37 +0000 (18:54 +0000)]
Some of Eric's buildbots don't like this test. Disable it while I figure out why.
llvm-svn: 299686
Daniel Berlin [Thu, 6 Apr 2017 18:52:58 +0000 (18:52 +0000)]
NewGVN: Rename some functions for consistency
llvm-svn: 299685
Daniel Berlin [Thu, 6 Apr 2017 18:52:55 +0000 (18:52 +0000)]
NewGVN: Fixup some small issues
llvm-svn: 299684
Daniel Berlin [Thu, 6 Apr 2017 18:52:53 +0000 (18:52 +0000)]
NewGVN: Fix a small formatting issue in performSymbolicLoadEvaluation.
llvm-svn: 299683
Daniel Berlin [Thu, 6 Apr 2017 18:52:50 +0000 (18:52 +0000)]
NewGVN: This patch makes memory congruence work for all types of
memorydefs, not just stores. Along the way, we audit and fixup issues
about how we were tracking memory leaders, and improve the verifier
to notice more memory congruency issues.
llvm-svn: 299682
Chih-Hung Hsieh [Thu, 6 Apr 2017 18:36:50 +0000 (18:36 +0000)]
[Basic] getColumnNumber returns location of CR+LF on Windows
When fixing a Clang-Tidy bug in D31406,
reuse of FileID enabled the missing highlightRange function.
Assertion in highlightRange failed because the end-of-range column
number was 2 + the last column of a line on Windows.
This fix is required to enable D31406.
Differential Revision: https://reviews.llvm.org/D31713
llvm-svn: 299681
Marshall Clow [Thu, 6 Apr 2017 18:34:36 +0000 (18:34 +0000)]
Recommit awk tests with warnings removed. Initial commit r299652, reverted r299656.
llvm-svn: 299680
Ivan Krasin [Thu, 6 Apr 2017 18:22:25 +0000 (18:22 +0000)]
Revert r299672: Add a virtual destructor to a class with virtual methods.
Reason: breaks sanitizers builds.
Original Differential Revision: https://reviews.llvm.org/D317
llvm-svn: 299679
Stanislav Mekhanoshin [Thu, 6 Apr 2017 18:15:44 +0000 (18:15 +0000)]
[AMDGPU] Translate reqd_work_group_size into amdgpu_flat_work_group_size
These two attributes specify the same info in a different way.
AMGPU BE only checks the latter as a target specific attribute
as opposed to language specific reqd_work_group_size.
This change produces amdgpu_flat_work_group_size out of
reqd_work_group_size if specified.
Differential Revision: https://reviews.llvm.org/D31728
llvm-svn: 299678
Tamas Berghammer [Thu, 6 Apr 2017 18:15:43 +0000 (18:15 +0000)]
XFAIL TestDataFormatterLibcxxVBool on Linux & Android
The skipping logic for the test have been fixed recently but the test is
very flakey on the buildbot.
llvm-svn: 299677
Zachary Turner [Thu, 6 Apr 2017 18:12:24 +0000 (18:12 +0000)]
iwyu fixes on lldbUtility.
This patch makes adjustments to header file includes in
lldbUtility based on recommendations by the iwyu tool
(include-what-you-use). The goal here is to make sure that
all files include the exact set of headers which are needed
for that file only, to eliminate cases of dead includes (e.g.
someone deleted some code but forgot to delete the header
includes that that code necessitated), and to eliminate the
case where header includes are picked up transitively.
llvm-svn: 299676
Dimitry Andric [Thu, 6 Apr 2017 18:12:02 +0000 (18:12 +0000)]
Add __ffssi2 implementation to compiler-rt builtins
Summary:
During MIPS implementation work for FreeBSD, John Baldwin (jhb@FreeBSD.org)
found that gcc 6.x emits calls to __ffssi2() when compiling libc and some
userland programs in the base system.
Add it to compiler-rt's builtins, based off of the existing __ffsdi2()
implementation. Also update the CMake files and add a test case.
Reviewers: howard.hinnant, weimingz, rengolin, compnerd
Reviewed By: weimingz
Subscribers: dberris, mgorny, llvm-commits, emaste
Differential Revision: https://reviews.llvm.org/D31721
llvm-svn: 299675
Yi Kong [Thu, 6 Apr 2017 18:10:08 +0000 (18:10 +0000)]
[ARM] Add Kryo to available targets
Summary:
Host CPU detection now supports Kryo, so we need to recognize it in ARM
target.
Reviewers: mcrosier, t.p.northover, rengolin, echristo, srhines
Reviewed By: t.p.northover, echristo
Subscribers: aemerson
Differential Revision: https://reviews.llvm.org/D31775
llvm-svn: 299674
Adrian Prantl [Thu, 6 Apr 2017 17:59:50 +0000 (17:59 +0000)]
Add DEBUGGER and CHECKs back to dbg-arg.c
When this testcase was migrated from IR to source the DEBUGGER
commands were not migrated together with the rest of the testcase. It
was also compiling without debug info.
Make the testcase slightly less useless by adding them back in :-)
llvm-svn: 299673
Ivan Krasin [Thu, 6 Apr 2017 17:58:45 +0000 (17:58 +0000)]
Add a virtual destructor to a class with virtual methods.
Summary:
Recently, Clang enabled the check for virtual destructors
in the presence of virtual methods. That broke the bootstrap
build. Fixing it.
Reviewers: pcc
Reviewed By: pcc
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D31776
llvm-svn: 299672
Ivan Krasin [Thu, 6 Apr 2017 17:42:05 +0000 (17:42 +0000)]
Fix unused lambda capture. Follow up to r299653.
llvm-svn: 299671
Francis Ricci [Thu, 6 Apr 2017 17:41:26 +0000 (17:41 +0000)]
Enable builds of darwin lsan by default
Summary: Testing and asan leak detection are disabled by default.
Reviewers: kubamracek, kcc
Subscribers: srhines, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D31307
llvm-svn: 299669
Adrian Prantl [Thu, 6 Apr 2017 17:40:31 +0000 (17:40 +0000)]
Add a testcase for variable-length arrays.
VLAs are special-cased in the frontend. This testcase ensures that the
contract between clang and llvm won't be accidentally broken by future
refactorings.
llvm-svn: 299668
Matt Arsenault [Thu, 6 Apr 2017 17:37:27 +0000 (17:37 +0000)]
AMDGPU: Stop using CCAssignToRegWithShadow
This does not do what it is attempting to use it for
and requires working around in LowerFormalArguments.
llvm-svn: 299667
Ivan Krasin [Thu, 6 Apr 2017 17:35:35 +0000 (17:35 +0000)]
Fix unused typedef. Follow up to r299575.
llvm-svn: 299666
Craig Topper [Thu, 6 Apr 2017 17:33:37 +0000 (17:33 +0000)]
[InstSimplify] Teach SimplifyMulInst to recognize vectors of i1 as And. Not just scalar i1.
llvm-svn: 299665
Krzysztof Parzyszek [Thu, 6 Apr 2017 17:28:21 +0000 (17:28 +0000)]
[Hexagon] Change the vector scaling for vector offsets
Keep full offset value on MI-level instructions, but have it scaled down
in the MC-level instructions.
llvm-svn: 299664
Roman Gareev [Thu, 6 Apr 2017 17:25:08 +0000 (17:25 +0000)]
[FIX] Fix ScheduleTreeOptimizer::optimizeMatMulPattern
Use new values of the dimensions during their permutation.
llvm-svn: 299663
Roman Gareev [Thu, 6 Apr 2017 17:09:54 +0000 (17:09 +0000)]
Restore the initial ordering of dimensions before applying the pattern matching
Dimensions of band nodes can be implicitly permuted by the algorithm applied
during the schedule generation.
For example, in case of the following matrix-matrix multiplication,
for (i = 0; i < 1024; i++)
for (k = 0; k < 1024; k++)
for (j = 0; j < 1024; j++)
C[i][j] += A[i][k] * B[k][j];
it can produce the following schedule tree
domain: "{ Stmt_for_body6[i0, i1, i2] : 0 <= i0 <= 1023 and 0 <= i1 <= 1023 and
0 <= i2 <= 1023 }"
child:
schedule: "[{ Stmt_for_body6[i0, i1, i2] -> [(i0)] },
{ Stmt_for_body6[i0, i1, i2] -> [(i1)] },
{ Stmt_for_body6[i0, i1, i2] -> [(i2)] }]"
permutable: 1
coincident: [ 1, 1, 0 ]
The current implementation of the pattern matching optimizations relies on the
initial ordering of dimensions. Otherwise, it can produce the miscompilation
(e.g., [1]).
This patch helps to restore the initial ordering of dimensions by recreating
the band node when the corresponding conditions are satisfied.
Refs.:
[1] - https://bugs.llvm.org/show_bug.cgi?id=32500
Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D31741
llvm-svn: 299662
Craig Topper [Thu, 6 Apr 2017 17:09:08 +0000 (17:09 +0000)]
[TSan] Adjust expectation for check_analyze.sh
r299658 fixed a case where InstCombine was replicating instructions instead of combining. Fixing this reduced the number of pushes and pops in the __tsan_read and __tsan_write functions.
Adjust the expectations to account for this after talking to Dmitry Vyukov.
llvm-svn: 299661
Davide Italiano [Thu, 6 Apr 2017 17:03:04 +0000 (17:03 +0000)]
[ADT] Add a generic breadth-first-search graph iterator.
This will be used in LCSSA to speed up the canonicalization.
Differential Revision: https://reviews.llvm.org/D31694
llvm-svn: 299660
Stanislav Mekhanoshin [Thu, 6 Apr 2017 16:48:30 +0000 (16:48 +0000)]
[AMDGPU] Eliminate barrier if workgroup size is not greater than wavefront size
If a workgroup size is known to be not greater than wavefront size
the s_barrier instruction is not needed since all threads are guarantied
to come to the same point at the same time.
Differential Revision: https://reviews.llvm.org/D31731
llvm-svn: 299659
Craig Topper [Thu, 6 Apr 2017 16:42:46 +0000 (16:42 +0000)]
[InstCombine] Fix a case where we weren't checking that an instruction had a single use resulting in extra instructions being created.
llvm-svn: 299658
Gabor Horvath [Thu, 6 Apr 2017 15:58:57 +0000 (15:58 +0000)]
[clang-tidy] Temporarily disable a test-case that does not work on windows.
llvm-svn: 299657
Mehdi Amini [Thu, 6 Apr 2017 15:56:55 +0000 (15:56 +0000)]
Revert "Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541"
This reverts commit r299652, 32bits MacOS is broken.
llvm-svn: 299656
James Henderson [Thu, 6 Apr 2017 15:22:58 +0000 (15:22 +0000)]
Revert r299635 because it exposed a latent bug.
llvm-svn: 299655
Sam Kolton [Thu, 6 Apr 2017 15:03:28 +0000 (15:03 +0000)]
[AMDGPU] Resubmit SDWA peephole: enable by default
Reviewers: vpykhtin, rampitec, arsenm
Subscribers: qcolombet, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye
Differential Revision: https://reviews.llvm.org/D31671
llvm-svn: 299654
Artem Dergachev [Thu, 6 Apr 2017 14:34:07 +0000 (14:34 +0000)]
[analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector"
Hopefully fix crashes by unshadowing the variable.
Original commit message:
A big part of the clone detection code is functionality for filtering clones and
clone groups based on different criteria. So far this filtering process was
hardcoded into the CloneDetector class, which made it hard to understand and,
ultimately, to extend.
This patch splits the CloneDetector's logic into a sequence of reusable
constraints that are used for filtering clone groups. These constraints
can be turned on and off and reodreder at will, and new constraints are easy
to implement if necessary.
Unit tests are added for the new constraint interface.
This is a refactoring patch - no functional change intended.
Patch by Raphael Isemann!
Differential Revision: https://reviews.llvm.org/D23418
llvm-svn: 299653
Marshall Clow [Thu, 6 Apr 2017 14:32:42 +0000 (14:32 +0000)]
Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541
llvm-svn: 299652
Alexander Kornienko [Thu, 6 Apr 2017 14:27:00 +0000 (14:27 +0000)]
[clang-tidy] Update docs and help message
llvm-svn: 299651
Alex Lorenz [Thu, 6 Apr 2017 14:03:25 +0000 (14:03 +0000)]
Avoid the -Wdocumentation-unknown-command warning in Clang's C API docs
rdar://
20441985
llvm-svn: 299650
Alexander Kornienko [Thu, 6 Apr 2017 13:41:29 +0000 (13:41 +0000)]
[clang-tidy] Add FormatStyle configuration option.
llvm-svn: 299649
Alex Lorenz [Thu, 6 Apr 2017 13:06:34 +0000 (13:06 +0000)]
[ObjC++] Conversions from specialized to non-specialized Objective-C generic
object types should be preferred over conversions to other object pointers
This change ensures that Clang will select the correct overload for the
following code sample:
void overload(Base *b);
void overload(Derived *d);
void test(Base<Base *> b) {
overload(b); // Select overload(Base *), not overload(Derived *)
}
rdar://
20124827
Differential Revision: https://reviews.llvm.org/D31597
llvm-svn: 299648
Jonas Paulsson [Thu, 6 Apr 2017 13:00:37 +0000 (13:00 +0000)]
[SelectionDAG] NFC patch removing a redundant check.
Since the BUILD_VECTOR has already been checked by
isBuildVectorOfConstantSDNodes() in SelectionDAG::getNode() for a
SIGN_EXTEND_INREG, it can be assumed that Op is always either undef or a
ConstantSDNode, and Ops.size() will always equal VT.getVectorNumElements().
llvm-svn: 299647
Alex Lorenz [Thu, 6 Apr 2017 12:53:43 +0000 (12:53 +0000)]
Fix lambda to block conversion in C++17 by avoiding copy elision for the
lambda capture used by the created block
The commit r288866 introduced guaranteed copy elision to C++ 17. This
unfortunately broke the lambda to block conversion in C++17 (the compiler
crashes when performing IRGen). This commit fixes the conversion by avoiding
copy elision for the capture that captures the lambda that's used in the block
created by the lambda to block conversion process.
rdar://
31385153
Differential Revision: https://reviews.llvm.org/D31669
llvm-svn: 299646