Commit Graph

252250 Commits

Author SHA1 Message Date
Sanjay Patel 14715b3c2a [InstCombine] refactor foldICmpShlConstant(); NFCI
This reduces the size of and increases the symmetry with the planned functional change in:
https://reviews.llvm.org/D28406

llvm-svn: 292260
2017-01-17 21:25:16 +00:00
Alexei Starovoitov efefbc4a19 [bpf] fix stack-use-after-scope
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 292258
2017-01-17 21:14:00 +00:00
Michal Gorny 7b97bf233f [test] [builtins] Remove obsolete/UB tests in __fixuns?fdi based
Remove the failing tests for __fixunssfdi() and __fixunsdfdi() that
relied on undefined (and most likely obsolete in terms of compiler-rt
implementation behavior).

Both tests presumed that 0x1.p+64 would be converted to
0xFFFFFFFFFFFFFFFFLL, that is the largest value in uint64 range.
However, the C/C++ standards do not specify the behavior for converting
a floating-point value to an integer of smaller range, and in this case
both libgcc and compiler-rt implementations return 0 instead.

Since the current behavior is correct with regards to standards
and there is no good way of expressing 0xFFFFFFFFFFFFFFFFLL in single-
or double-precision float, I've removed the failing test altogether.

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

llvm-svn: 292257
2017-01-17 21:08:25 +00:00
Vitaly Buka 729a039ec2 Enabled -fsanitize-address-use-after-scope for -DLLVM_USE_SANITIZER=Address
Subscribers: mgorny, llvm-commits

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

llvm-svn: 292256
2017-01-17 21:04:23 +00:00
Michal Gorny 608319101a [cmake] Update SOVERSION for the new versioning scheme
Update SOVERSION to use just the major version number rather than
major+minor, to match the new versioning scheme where only major is used
to indicate API/ABI version.

Since two-digit SOVERSIONs were introduced post 3.9 branching, this
change does not risk any SOVERSION collisions. In the past,
two-component X.Y SOVERSIONs were shortly used but those will not
interfere with the new ones since the new versions start at 4.

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

llvm-svn: 292255
2017-01-17 21:04:19 +00:00
Matthew Simpson 3fbdaa5906 [LV] Mark non-consecutive-like pointers non-uniform
If a memory instruction will be vectorized, but it's pointer operand is
non-consecutive-like, the instruction is a gather or scatter operation. Its
pointer operand will be non-uniform. This should fix PR31671.

Reference: https://llvm.org/bugs/show_bug.cgi?id=31671
Differential Revision: https://reviews.llvm.org/D28819

llvm-svn: 292254
2017-01-17 20:51:39 +00:00
Petr Hosek 97ab7fe6b7 [scudo] Eliminate the runtime dependency on libc++abi
Making this variable non-static avoids the need for locking to ensure
that the initialization is thread-safe which in turns eliminates the
runtime dependency on libc++abi library (for __cxa_guard_acquire and
__cxa_guard_release) which makes it possible to link scudo against
pure C programs.

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

llvm-svn: 292253
2017-01-17 20:41:04 +00:00
Dan Gohman 1209c7ac16 [WebAssembly] Add triple support for the new wasm object format
Differential Revision: https://reviews.llvm.org/D26701

llvm-svn: 292252
2017-01-17 20:34:09 +00:00
Xin Tong 8343b5096d Rename scalar_promote.ll to scalar-promote.ll and scalar_promote-unwind.ll to scalar-promote-unwind.ll. NFCI
llvm-svn: 292251
2017-01-17 20:28:36 +00:00
Xin Tong 43c1a26400 Refactor out LoopInfo computation so that it can be used by
other test cases.

Summary: Refactor out LoopInfo computation so that it can be
used by other test cases.

So i am changing this test proactively for later commit, which will use
this function.

Reviewers: sanjoy, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 292250
2017-01-17 20:24:39 +00:00
Sanjoy Das 6de072a712 [EarlyCSE] Don't DSE across readnone functions that may throw
Summary: Depends on D28740

Reviewers: dberlin, chandlerc, hfinkel, majnemer

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 292249
2017-01-17 20:15:47 +00:00
Sanjay Patel f42a955c3e [InstCombine] add tests for shl nsw + icmp sle; NFC
We want to handle these cases similarly to icmp sgt, so add the tests for it.
See: https://reviews.llvm.org/D28406

llvm-svn: 292248
2017-01-17 20:15:26 +00:00
Jonathan Coe e02a3908cf Fix Python 3 language issues and add an explicit check for Python version == 2.
Summary:
Python bindings cannot support Python 3 without work being done to fix Unicode c-string conversion.

This was attempted in https://reviews.llvm.org/D26082. That patch was reverted due to memory access issues on Linux.

This revision fixes enough language compatibility issues for the clang module to be loaded and raise an error if the Python version is not 2.

Reviewers: mgorny, MathieuDuponchelle, rengolin, compnerd

Reviewed By: compnerd

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

llvm-svn: 292247
2017-01-17 20:03:54 +00:00
Ahmed Bougacha 86b680a372 [TLI] Appease spurious MSVC warning using llvm_unreachable. NFC.
r292188 confused MSVC because of the combined lack of a default
case and return statement.

Move the unreachable outside of the NumLibFuncs case, to make it
obvious that all cases should be handled.

llvm_unreachable is __declspec(noreturn), so I'm assuming this
does appease MSVC.

llvm-svn: 292246
2017-01-17 19:54:18 +00:00
Akira Hatanaka 8eccb9bbb1 [Sema] Fix bug in handling of designated initializer.
CheckDesignatedInitializer wasn't taking into account the base classes
when computing the index for the field in the derived class, which
caused the test case to crash during IRGen because of a malformed AST.

rdar://problem/26795040

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

llvm-svn: 292245
2017-01-17 19:35:54 +00:00
Joerg Sonnenberger 270dd41f75 Remove an overeager assert from r288844.
llvm-svn: 292244
2017-01-17 19:29:15 +00:00
Bob Wilson f2d0b68b3b Revert r291640 change to fold X86 comparison with atomic_load_add.
Even with the fix from r291630, this still causes problems. I get
widespread assertion failures in the Swift runtime's WeakRefCount::increment()
function. I sent a reduced testcase in reply to the commit.

llvm-svn: 292242
2017-01-17 19:18:57 +00:00
Chandler Carruth b6e32daa81 [PM] Teach the LoopPassManager to automatically canonicalize loops by
runnig LCSSA over them prior to running the loop pipeline.

This also teaches the loop PM to verify that LCSSA form is preserved
throughout the pipeline's run across the loop nest.

Most of the test updates just leverage this new functionality. One has to be
relaxed with the new PM as IVUsers is less powerful when it sees LCSSA input.

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

llvm-svn: 292241
2017-01-17 19:18:12 +00:00
Bob Haarman 6c8f736ba7 COFF: add error() and warn() to Error.{cpp,h}
Summary: This copies over some functionality we have in ELF/Error.{cpp,h} and makes it available in COFF/Error.{cpp,h}

Reviewers: pcc, rafael, ruiu

Subscribers:

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

llvm-svn: 292240
2017-01-17 19:07:42 +00:00
Sanjay Patel 9666996563 [ValueTracking] recognize a 'not' of an assumed condition as false
Also, add the corresponding match to the AssumptionCache's 'Affected Values' list.

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

llvm-svn: 292239
2017-01-17 18:15:49 +00:00
David Majnemer de55c606d1 [InstCombine] Fold ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2)
This further extends r292179 to support additional binary operators
beyond subtraction.

llvm-svn: 292238
2017-01-17 18:08:06 +00:00
Kuba Mracek e7d1f92344 Revert r292231.
llvm-svn: 292237
2017-01-17 18:06:38 +00:00
Kuba Mracek 5da6f6db9a Revert r292232.
llvm-svn: 292236
2017-01-17 18:06:07 +00:00
Simon Pilgrim 60662cb5d0 [X86][AVX512] Add all_of/any_of avx512vl tests
llvm-svn: 292235
2017-01-17 17:33:18 +00:00
Philipp Stephani 13dbe27075 Make sure that clang-format input is in the right encoding
Summary: Add unit tests.

Reviewers: klimek, massberg

Reviewed By: massberg

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

llvm-svn: 292234
2017-01-17 17:30:55 +00:00
Chad Rosier 8520429bdd [ValueTracking] Extend known bits to understand @llvm.bitreverse.
Differential Revision: https://reviews.llvm.org/D28780

llvm-svn: 292233
2017-01-17 17:23:51 +00:00
Kuba Mracek a802a50963 [lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part]
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests.

This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests.

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

llvm-svn: 292232
2017-01-17 17:18:18 +00:00
Kuba Mracek 53013e9e6f [lit] Limit parallelism of sanitizer tests on Darwin [llvm part]
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests.

This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests.

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

llvm-svn: 292231
2017-01-17 17:15:02 +00:00
Sanjay Patel 5424bd2625 [InstCombine] reduce indent; NFCI
llvm-svn: 292230
2017-01-17 16:59:09 +00:00
Alexander Kornienko 0d7a7cdb28 [clang-tidy] Fix crash in modernize-use-using (http://llvm.org/PR29135)
llvm-svn: 292229
2017-01-17 16:14:03 +00:00
Rafael Espindola 1d6d1b44cc Add a isInCurrentDSO helper. NFC.
llvm-svn: 292228
2017-01-17 16:08:06 +00:00
George Rimar c39f5491a4 [Clang] - Update code to match upcoming llvm::zlib API.
D28684 changed llvm::zlib to return Error instead of Status.
It was accepted and committed in r292214, but then reverted in r292217
because I missed that clang code also needs to be updated.

Patch do that.

D28684 recommitted again as r292226

Differential revision: https://reviews.llvm.org/D28807

llvm-svn: 292227
2017-01-17 15:45:31 +00:00
George Rimar 167ca4ae7e Recommit r292214 "[Support/Compression] - Change zlib API to return Error instead of custom status"
No any changes, will follow up with D28807 commit containing APLi change for clang
to fix build issues happened.

Original commit message:
[Support/Compression] - Change zlib API to return Error instead of custom status.

Previously API returned custom enum values.
Patch changes it to return Error with string description.
That should help users to report errors in universal way.

Differential revision: https://reviews.llvm.org/D28684

llvm-svn: 292226
2017-01-17 15:45:07 +00:00
George Rimar 7185a1acec [ELF] - Support optional comma after output section command.
I found this when tried to link linux kernel with LLD:

https://github.com/torvalds/linux/blob/master/arch/x86/entry/vdso/vdso-layout.lds.S#L86

Output section command can have optional comma at the end:

.text		: { *(.text*) }			:text	=0x90909090,

It was documented about 3 years ago for binutils:
https://sourceware.org/ml/binutils/2014-04/msg00045.html

Differential revision: https://reviews.llvm.org/D28803

llvm-svn: 292225
2017-01-17 15:32:12 +00:00
Sam Kolton 9dffada98b [AMDGPU] Assembler: fix v_mac_f16 immediates
Reviewers: vpykhtin, artem.tamazov, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

llvm-svn: 292224
2017-01-17 15:26:02 +00:00
Simon Pilgrim 8b2996fe1a [X86][SSE] Tests showing horizontal all_of/any_of of vector comparison results
llvm-svn: 292223
2017-01-17 15:02:01 +00:00
Krasimir Georgiev 4cbe21a43c [llvm-objdump tests] Copy the inputs of tests closer to tests.
Summary:
Tests under tools/llvm-objdump should not use inputs from Object. Copied the
required inputs and aligned the new tests to be more consistent with the existing
tests in this respect.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: davide, djasper, cfe-commits

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

llvm-svn: 292222
2017-01-17 14:22:29 +00:00
George Rimar 4b0253af7e [ELF] - Fix for huge-temporary-file.s
Removed mentioning of checks. Sorry for noise.

llvm-svn: 292221
2017-01-17 14:06:44 +00:00
George Rimar ad530b2ac7 [ELF] - Added huge-temporary-file.s testcase.
Inputs shown in that testcase previously created
a huge temporarily file under 32 bits.

It was fixed by D28107. During review was suggested to
add a testcase even without CHECKs for documentation purposes.

Patch do that.

llvm-svn: 292220
2017-01-17 14:04:16 +00:00
George Rimar 2ddab6d186 [ELF] - Do not create huge garbage files on section offset overflow.
Patch changes behavior to not try open the output 
file if we already know about error.

That is not just cleaner, but also fixes nasty behavior of linker that
could create huge temporarily files under certain conditions.

Differential revision: https://reviews.llvm.org/D28107

llvm-svn: 292219
2017-01-17 13:50:34 +00:00
Haojian Wu 903d35e50e Remove dead code.
llvm-svn: 292218
2017-01-17 13:46:59 +00:00
George Rimar 715540f207 Revert r292214 "[Support/Compression] - Change zlib API to return Error instead of custom status."
It broked clang:
http://lab.llvm.org:8080/green//job/clang-stage1-cmake-RA-incremental_build/34218/consoleFull#46141505449ba4694-19c4-4d7e-bec5-911270d8a58c

llvm-svn: 292217
2017-01-17 13:27:58 +00:00
Boris Ulasevich a2a0213179 BrainF example: fixing output buffering issue
Differential Revision: https://reviews.llvm.org/D27824

llvm-svn: 292216
2017-01-17 13:27:28 +00:00
Haojian Wu 4775ce56ec [clang-move] Handle helpers with forward declarations.
Reviewers: ioeric

Reviewed By: ioeric

Subscribers: cfe-commits

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

llvm-svn: 292215
2017-01-17 13:22:37 +00:00
George Rimar e29a32e9ce [Support/Compression] - Change zlib API to return Error instead of custom status.
Previously API returned custom enum values.
Patch changes it to return Error with string description.
That should help users to report errors in universal way.

Differential revision: https://reviews.llvm.org/D28684

llvm-svn: 292214
2017-01-17 13:20:17 +00:00
Tobias Grosser e1ff0cf2eb Relax assert when setting access functions with invariant base pointers
Summary:
Instead of forbidding such access functions completely, we verify that their
base pointer has been hoisted and only assert in case the base pointer was
not hoisted.

I was trying for a little while to get a test case that ensures the assert is
correctly fired in case of invariant load hoisting being disabled, but I could
not find a good way to do so, as llvm-lit immediately aborts if a command
yields a non-zero return value. As we do not generally test our asserts,
not having a test case here seems OK.

This resolves http://llvm.org/PR31494

Suggested-by: Michael Kruse <llvm@meinersbur.de>

Reviewers: efriedma, jdoerfert, Meinersbur, gareevroman, sebpop, zinob, huihuiz, pollydev

Reviewed By: Meinersbur

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

llvm-svn: 292213
2017-01-17 12:00:42 +00:00
Pavel Labath e5cfc67113 [cmake] Make lldb build with the android ndk toolchain file
Summary:
The NDK cmake toolchain file defines CMAKE_SYSTEM_NAME=Android, so switch the
build to use that. I have also updated the in-tree toolchain file to do that
(instead of defining __ANDROID_NDK__), so it can still be used to build.
After migrating the last bits of non-toolchainy bits out of the in-tree
toolchain, I intend to delete it.

Reviewers: tberghammer, danalbert

Subscribers: srhines, mgorny, lldb-commits

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

llvm-svn: 292212
2017-01-17 11:55:00 +00:00
Serge Rogatch 1bcd53f0e7 [XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests
Summary:
Testing of XRay was occasionally disabled on 32-bit Arm targets (someone assumed that XRay was supported on 64-bit targets only). This patch should fix that problem. Also here the instruction&data cache incoherency problem is fixed, because it may be causing a test to fail.
This patch is one of a series: see also
- https://reviews.llvm.org/D28624

Reviewers: dberris, rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown

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

llvm-svn: 292211
2017-01-17 11:53:38 +00:00
Serge Rogatch 50be6b45a9 [XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify such problem earlier
Summary:
Emission of XRay table was occasionally disabled for Arm32, but this bug was not then detected because earlier (also by mistake) testing of XRay was occasionally disabled on 32-bit Arm targets. This patch should fix that problem and detect such problems in the future.
This patch is one of a series, see also
- https://reviews.llvm.org/D28623

Reviewers: rengolin, dberris

Reviewed By: dberris

Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown

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

llvm-svn: 292210
2017-01-17 11:52:10 +00:00
Simon Pilgrim d4eb800b03 [InstCombine][X86][AVX] Add DemandedElts support for VPERMILPD/VPERMILPS instructions
Simplify a vpermilvar shuffle mask based on the elements of the mask that are actually demanded.

llvm-svn: 292209
2017-01-17 11:35:03 +00:00