Eugene Zelenko [Thu, 26 Oct 2017 00:55:39 +0000 (00:55 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 316630
Pavel Labath [Wed, 25 Oct 2017 23:56:17 +0000 (23:56 +0000)]
Makefile.rules: move CFLAGS_EXTRAS to the end of compile line
This makes sure that any options specified there override generic
compiler options.
This fixes TestBreakpointIt.py
llvm-svn: 316629
Kostya Serebryany [Wed, 25 Oct 2017 23:24:45 +0000 (23:24 +0000)]
[libFuzzer] trying to make a test more stable on Mac
llvm-svn: 316627
Rui Ueyama [Wed, 25 Oct 2017 23:00:40 +0000 (23:00 +0000)]
Fix SizeOfImage in the PE header.
IIUC, SizeOfImage is the distance from the end of the last section to
the image base, rounded up to the page size. So the previous code is
wrong.
Should fix https://bugs.llvm.org/show_bug.cgi?id=34949
(It is nice to know that lld is already being used to create Putty
distribution binaries.)
llvm-svn: 316626
Matthew Simpson [Wed, 25 Oct 2017 22:46:34 +0000 (22:46 +0000)]
Attempt to unbreak the expensive-checks-win bot
llvm-svn: 316625
Bob Haarman [Wed, 25 Oct 2017 22:28:38 +0000 (22:28 +0000)]
[lld] unified COFF and ELF error handling on new Common/ErrorHandler
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D39259
llvm-svn: 316624
Jonathan Peyton [Wed, 25 Oct 2017 22:05:02 +0000 (22:05 +0000)]
Fix fatal error message displaying
Replacing call to __kmp_msg(kmp_ms_fatal,...) with __kmp_fatal(...) caused an
issue when incomplete message is displayed in case an error message is followed
by another message (e.g. by a hint messa)ge. This is because __kmp_fatal()
passes incomplete list of arguments to __kmp_msg().
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D39248
llvm-svn: 316623
Rui Ueyama [Wed, 25 Oct 2017 22:03:21 +0000 (22:03 +0000)]
Unassign sections if they are "assigned" to /DISCARD/.
"/DISCARD/" is a special section name in the linker script to discard
input sections. Previously, we handled it as if it were a real section,
so an input section can be assigned but dead. However, allowing sections
to be
- assigned and alive (will be emitted),
- not assigned and dead (removed), or
- assigned but dead (???)
feels logically wrong and practically error-prone. This patch removes
the last combination of the states.
llvm-svn: 316622
Alex Lorenz [Wed, 25 Oct 2017 22:01:23 +0000 (22:01 +0000)]
Handle PragmaDebug in PPChainedCallbacks
The test is in clang-tools-extra/test/pp-trace
llvm-svn: 316621
Kostya Kortchinsky [Wed, 25 Oct 2017 22:00:26 +0000 (22:00 +0000)]
[scudo] Remove comment about security of the 32-bit allocator
Summary:
The 32-bit allocator is now on par with the 64-bit in terms of security (chunks
randomization is done, batches separation is done).
Unless objection, the comment can go away.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39303
llvm-svn: 316620
Jonas Devlieghere [Wed, 25 Oct 2017 21:56:41 +0000 (21:56 +0000)]
Re-land "[dwarfdump] Add -lookup option"
Add the option to lookup an address in the debug information and print
out the file, function, block and line table details.
Differential revision: https://reviews.llvm.org/D38409
llvm-svn: 316619
George Karpenkov [Wed, 25 Oct 2017 21:49:46 +0000 (21:49 +0000)]
[Analyzer] [Tests] Do not discard output from CmpRuns.py when running integration tests
Contrary to the deleted comment, in most cases CmpRuns.py produces a
fairly small amount of output, which is useful to see straight away to
see what has changed when executing the integration tests.
llvm-svn: 316618
George Karpenkov [Wed, 25 Oct 2017 21:49:41 +0000 (21:49 +0000)]
[Analyzer] Give more descriptive name to BdyFrm field.
Discussion at: https://reviews.llvm.org/D39220
llvm-svn: 316617
Alexander Richardson [Wed, 25 Oct 2017 21:44:21 +0000 (21:44 +0000)]
Fix CodeGen/AMDGPU/fcanonicalize-elimination.ll on FreeBSD 11.0
Summary:
On FreeBSD11.0 the FileCheck NOT string "1.0" will be matched by
`.amd_amdgpu_isa "amdgcn-unknown-freebsd11.0--gfx802"` at the end of the
file. Add a CHECK for that directive to avoid failing the test.
Reviewers: rampitec, kzhuravl
Reviewed By: rampitec, kzhuravl
Subscribers: emaste, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D39306
llvm-svn: 316616
Sanjoy Das [Wed, 25 Oct 2017 21:41:00 +0000 (21:41 +0000)]
[SCEV] Fix an assertion failure in the max backedge taken count
Max backedge taken count is always expected to be a constant; and this is
usually true by construction -- it is a SCEV expression with constant inputs.
However, if the max backedge expression ends up being computed to be a udiv with
a constant zero denominator[0], SCEV does not fold the result to a constant
since there is no constant it can fold it to (SCEV has no representation for
"infinity" or "undef").
However, in computeMaxBECountForLT we already know the denominator is positive,
and thus at least 1; and we can use this fact to avoid dividing by zero.
[0]: We can end up with a constant zero denominator if the signed range of the
stride is more precise than the unsigned range.
llvm-svn: 316615
Sanjoy Das [Wed, 25 Oct 2017 21:40:59 +0000 (21:40 +0000)]
Add a comment to clarify a future change
llvm-svn: 316614
Evgeniy Stepanov [Wed, 25 Oct 2017 21:40:17 +0000 (21:40 +0000)]
[msan] Intercept __strxfrm_l.
llvm-svn: 316613
Balaram Makam [Wed, 25 Oct 2017 21:32:54 +0000 (21:32 +0000)]
Revert r316582 [Local] Fix a bug in the domtree update logic for MergeBasicBlockIntoOnlyPred.
Summary: This reverts commit r316582. It looks like this commit broke tests on one buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/5719
. . .
Failing Tests (1):
LLVM :: Transforms/CalledValuePropagation/simple-arguments.ll
Reviewers:
Subscribers:
llvm-svn: 316612
Justin Lebar [Wed, 25 Oct 2017 21:32:06 +0000 (21:32 +0000)]
[CUDA] Print an error if you try to compile with < sm_30 on CUDA 9.
Summary:
CUDA 9's minimum sm is sm_30.
Ideally we should also make sm_30 the default when compiling with CUDA
9, but that seems harder than it should be.
Subscribers: sanjoy
Differential Revision: https://reviews.llvm.org/D39109
llvm-svn: 316611
Mitch Phillips [Wed, 25 Oct 2017 21:21:16 +0000 (21:21 +0000)]
Add FileVerifier::isCFIProtected().
Add a CFI protection check that is implemented by building a graph and inspecting the output to deduce if the indirect CF instruction is CFI protected. Also added the output of this instruction to printIndirectInstructions().
Reviewers: vlad.tsyrklevich
Subscribers: llvm-commits, kcc, pcc, mgorny
Differential Revision: https://reviews.llvm.org/D38428
llvm-svn: 316610
Pavel Labath [Wed, 25 Oct 2017 21:05:31 +0000 (21:05 +0000)]
Move StopInfoOverride callback to the new architecture plugin
This creates a new Architecture plugin and moves the stop info override
callback to this place. The motivation for this is to remove complex
dependencies from the ArchSpec class because it is used in a lot of
places that (should) know nothing about Process instances and StopInfo
objects.
I also add a test for the functionality covered by the override
callback.
Differential Revision: https://reviews.llvm.org/D31172
llvm-svn: 316609
Pavel Labath [Wed, 25 Oct 2017 21:05:10 +0000 (21:05 +0000)]
Move testcases/arm_emulation to testcases/arm/emulation
This creates space for addidional arm-specific tests. I will be adding
one of those in a follow-up commit.
llvm-svn: 316608
Evgeniy Stepanov [Wed, 25 Oct 2017 20:39:22 +0000 (20:39 +0000)]
Enable -pie and --enable-new-dtags by default on Android.
Summary:
Also enable -no-pie on Gnu toolchain (previously available on Darwin only).
Non-PIE executables won't even start on recent Android, and DT_RPATH is ignored by the loader.
Reviewers: srhines, danalbert
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38430
llvm-svn: 316606
Erich Keane [Wed, 25 Oct 2017 20:23:13 +0000 (20:23 +0000)]
Ignore implicity casts for zero-as-null-pointer-constant warning
The repro in https://bugs.llvm.org/show_bug.cgi?id=34362
caused the left nullptr to be cast to a int* implicitly, which
resulted diagnosing this falsely.
Differential Revision: https://reviews.llvm.org/D39301
llvm-svn: 316605
David Blaikie [Wed, 25 Oct 2017 19:52:21 +0000 (19:52 +0000)]
Hexagon: Fold a single-use textual header into its use
llvm-svn: 316604
Aditya Nandakumar [Wed, 25 Oct 2017 18:49:18 +0000 (18:49 +0000)]
Make the combiner check if shifts are legal before creating them
Summary: Make sure shifts are legal/specified by the legalizerinfo before creating it
Reviewers: qcolombet, dsanders, rovka, t.p.northover
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39264
llvm-svn: 316602
Krzysztof Parzyszek [Wed, 25 Oct 2017 18:46:40 +0000 (18:46 +0000)]
[Hexagon] Account for negative offset when limiting max deviation
In getOffsetRange, Max can be set to 0 to force the extender replacement
to be at or below the original value. This would cause the new offset to
be non-negative, which is preferred for memory instructions (to reduce
the likelihood of it getting constant-extended due to predication). The
problem happens when the range is shifted by an offset (present in the
instruction being examined) and the offset is negative. The entire range
for the allowable deviation will then be strictly negative. This creates
a problem, since 0 is assumed to be a valid deviation.
llvm-svn: 316601
Rui Ueyama [Wed, 25 Oct 2017 18:09:54 +0000 (18:09 +0000)]
Simplify.
ArrayRef<T>() equals to ArrayRef<T>(nullptr, 0), so it looks like
we don't need to handle size 0 as a special case.
llvm-svn: 316600
Saleem Abdulrasool [Wed, 25 Oct 2017 17:56:50 +0000 (17:56 +0000)]
CodeGen: fix PPC Darwin variadics
Darwin uses char * for the variadic list type (va_list). We use the PPC
SVR4 ABI for PPC, which uses a structure type for the va_list. When
constructing the GEP, we would fail due to the incorrect handling for
the va_list. Correct this to use the right type.
llvm-svn: 316599
Kamil Rytarowski [Wed, 25 Oct 2017 17:56:36 +0000 (17:56 +0000)]
Try to unbreak Linux sanitizers
Add fallback definition of internal_syscall_ptr and internal_syscall64
for Linux/x86_64 and Linux/aarch64.
llvm-svn: 316598
Peter Collingbourne [Wed, 25 Oct 2017 17:42:00 +0000 (17:42 +0000)]
Remove dead function declaration.
llvm-svn: 316597
Kostya Kortchinsky [Wed, 25 Oct 2017 17:24:56 +0000 (17:24 +0000)]
[sanitizer] Random shuffling of chunks for the 32-bit Primary Allocator
Summary:
The 64-bit primary has had random shuffling of chunks for a while, this
implements it for the 32-bit primary. Scudo is currently the only user of
`kRandomShuffleChunks`.
This change consists of a few modifications:
- move the random shuffling functions out of the 64-bit primary to
`sanitizer_common.h`. Alternatively I could move them to
`sanitizer_allocator.h` as they are only used in the allocator, I don't feel
strongly either way;
- small change in the 64-bit primary to make the `rand_state` initialization
`UNLIKELY`;
- addition of a `rand_state` in the 32-bit primary's `SizeClassInfo` and
shuffling of chunks when populating the free list.
- enabling the `random_shuffle.cpp` test on platforms using the 32-bit primary
for Scudo.
Some comments on why the shuffling is done that way. Initially I just
implemented a `Shuffle` function in the `TransferBatch` which was simpler but I
came to realize this wasn't good enough: for chunks of 10000 bytes for example,
with a `CompactSizeClassMap`, a batch holds only 1 chunk, meaning shuffling the
batch has no effect, while a region is usually 1MB, eg: 104 chunks of that size.
So I decided to "stage" the newly gathered chunks in a temporary array that
would be shuffled prior to placing the chunks in batches.
The result is looping twice through n_chunks even if shuffling is not enabled,
but I didn't notice any significant significant performance impact.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D39244
llvm-svn: 316596
Alex Shlyapnikov [Wed, 25 Oct 2017 17:21:37 +0000 (17:21 +0000)]
[Sanitizers] ASan: detect new/delete calls with mismatched alignment.
ASan allocator stores the requested alignment for new and new[] calls
and on delete and delete[] verifies that alignments do match.
The representable alignments are: default alignment, 8, 16, 32, 64, 128,
256 and 512 bytes. Alignments > 512 are stored as 512, hence two
different alignments > 512 will pass the check (possibly masking the bug),
but limited memory requirements deemed to be a resonable tradeoff for
relaxed conditions.
The feature is controlled by new_delete_type_mismatch flag, the same one
protecting new/delete matching size check.
Differential revision: https://reviews.llvm.org/D38574
Issue: https://github.com/google/sanitizers/issues/799
llvm-svn: 316595
Shoaib Meenai [Wed, 25 Oct 2017 17:11:28 +0000 (17:11 +0000)]
[cmake] Restrict resource file usage to Windows build hosts
Resource file compilation requires a working resource compiler.
Unfortunately, llvm-rc isn't quite there yet [1], and cmake's rc
invocation only works on Windows [2]. Until both those issues are
addressed, disable resource file usage on non-Windows build hosts, to
unblock Windows cross-compilation. This is also consistent with the
existing comment, which says "If *on Windows* and building with MSVC".
[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118433.html
[2] https://public.kitware.com/pipermail/cmake/2017-October/066441.html
Differential Revision: https://reviews.llvm.org/D39265
llvm-svn: 316594
Craig Topper [Wed, 25 Oct 2017 17:10:58 +0000 (17:10 +0000)]
[X86] Add avx512vpopcntdq to Knights Mill
As indicated by Table 1-1 in Intel Architecture Instruction Set Extensions and Future Features Programming Reference from October 2017.
llvm-svn: 316593
Craig Topper [Wed, 25 Oct 2017 17:10:32 +0000 (17:10 +0000)]
[X86] Add avx512vpopcntdq to Knights Mill
As indicated by Table 1-1 in Intel Architecture Instruction Set Extensions and Future Features Programming Reference from October 2017.
llvm-svn: 316592
Kamil Rytarowski [Wed, 25 Oct 2017 17:09:05 +0000 (17:09 +0000)]
Add NetBSD improvements in sanitizers
Summary:
Changes:
* Add initial msan stub support.
* Handle NetBSD specific pthread_setname_np(3).
* NetBSD supports __attribute__((tls_model("initial-exec"))),
define it in SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE.
* Add ReExec() specific bits for NetBSD.
* Simplify code and add syscall64 and syscall_ptr for !NetBSD.
* Correct bunch of syscall wrappers for NetBSD.
* Disable test/tsan/map32bit on NetBSD as not applicable.
* Port test/tsan/strerror_r to a POSIX-compliant OSes.
* Disable __libc_stack_end on NetBSD.
* Disable ReadNullSepFileToArray() on NetBSD.
* Define struct_ElfW_Phdr_sz, detected missing symbol by msan.
* Change type of __sanitizer_FILE from void to char. This helps
to reuse this type as an array. Long term it will be properly
implemented along with SANITIZER_HAS_STRUCT_FILE setting to 1.
* Add initial NetBSD support in lib/tsan/go/buildgo.sh.
* Correct referencing stdout and stderr in tsan_interceptors.cc
on NetBSD.
* Document NetBSD x86_64 specific virtual memory layout in
tsan_platform.h.
* Port tests/rtl/tsan_test_util_posix.cc to NetBSD.
* Enable NetBSD tests in test/msan/lit.cfg.
* Enable NetBSD tests in test/tsan/lit.cfg.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, eugenis, kcc, dvyukov
Reviewed By: dvyukov
Subscribers: #sanitizers, llvm-commits, kubamracek
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D39124
llvm-svn: 316591
Konstantin Zhuravlyov [Wed, 25 Oct 2017 17:04:46 +0000 (17:04 +0000)]
AMDGPU: Cleanup memory legalizer load/store tests
llvm-svn: 316590
Reid Kleckner [Wed, 25 Oct 2017 16:54:12 +0000 (16:54 +0000)]
[asan] Don't print rows of shadow bytes outside shadow memory
Summary:
They might not be mapped on some platforms such as Win64. In
particular, this happens if the user address is null. There will not be
any shadow memory 5*16 bytes before the user address. This happens on
Win64 in the error_report_callback.cc test case. It's not clear why this
isn't a problem on Linux as well.
Fixes PR35058
Reviewers: vitalybuka
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D39260
llvm-svn: 316589
Jan Vesely [Wed, 25 Oct 2017 16:49:22 +0000 (16:49 +0000)]
math: Implement native_log10
Use llvm instrinsic by default
Provide amdgpu workaround
v2: drop old amd copyrights
Reviewer: Aaron Watry
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 316588
Jan Vesely [Wed, 25 Oct 2017 16:49:17 +0000 (16:49 +0000)]
amdgpu/math: Don't use llvm instrinsic for native_log
AMDGPU targets don't have insturction for it,
so it'll be expanded to C * log2 anyway.
v2: use native_log2 instead of the more precise sw implementation
v3: move to amdgpu
v4: drop old AMD copyright
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 316587
Konstantin Zhuravlyov [Wed, 25 Oct 2017 16:45:28 +0000 (16:45 +0000)]
AMDGPU/NFC: Rename memory legalizer tests:
- memory-legalizer-atomic-load.ll -> memory-legalizer-load.ll
- memory-legalizer-atomic-store.ll -> memory-legalizer-store.ll
llvm-svn: 316586
Alexey Bataev [Wed, 25 Oct 2017 15:54:04 +0000 (15:54 +0000)]
[OPENMP] Improve debug info for taskgroup implicitly generated
expressions.
llvm-svn: 316585
Alexey Bataev [Wed, 25 Oct 2017 15:44:52 +0000 (15:44 +0000)]
[OPENMP] Constify function parameters, NFC.
llvm-svn: 316584
George Rimar [Wed, 25 Oct 2017 15:20:30 +0000 (15:20 +0000)]
[ELF] - Implement --orphan-handling option.
It is PR34946.
Spec (http://man7.org/linux/man-pages/man1/ld.1.html) tells about
--orphan-handling=MODE, option where MODE can be one of four:
"place", "discard", "warn", "error".
Currently we already report orphans when -verbose given,
what becomes excessive with option implemented.
Patch stops reporting orphans when -versbose is given,
and support "place", "warn" and "error" modes.
It is not yet clear that "discard" mode is useful so it is not supported.
Differential revision: https://reviews.llvm.org/D39000
llvm-svn: 316583
Balaram Makam [Wed, 25 Oct 2017 14:55:48 +0000 (14:55 +0000)]
[Local] Fix a bug in the domtree update logic for MergeBasicBlockIntoOnlyPred.
Summary: For some irreducible CFG the domtree nodes might be dead, do not update domtree for dead nodes.
Reviewers: kuhar, dberlin, hfinkel
Reviewed By: kuhar
Subscribers: llvm-commits, mcrosier
Differential Revision: https://reviews.llvm.org/D38960
llvm-svn: 316582
John Baldwin [Wed, 25 Oct 2017 14:53:16 +0000 (14:53 +0000)]
Don't try to use a non-existent header on FreeBSD/mips.
Reviewers: dim
Differential Revision: https://reviews.llvm.org/D38807
llvm-svn: 316581
George Rimar [Wed, 25 Oct 2017 14:50:51 +0000 (14:50 +0000)]
[ELF] - Linkerscript: fix issue with SUBALIGN.
This is PR34886.
SUBALIGN command currently triggers failture if result expression
is zero. Patch fixes the issue, treating zero as 1, what is consistent with
other places and ELF spec it seems.
Patch also adds "is power of 2" check for this and other expressions
returning alignment.
Differential revision: https://reviews.llvm.org/D38846
llvm-svn: 316580
Sylvestre Ledru [Wed, 25 Oct 2017 14:25:28 +0000 (14:25 +0000)]
Add support of the next Debian (Debian buster - version 10)
llvm-svn: 316579
Sylvestre Ledru [Wed, 25 Oct 2017 14:23:27 +0000 (14:23 +0000)]
Also update IsUbuntu() with Ubuntu Bionic
Follow up of r316577
llvm-svn: 316578
Sylvestre Ledru [Wed, 25 Oct 2017 14:21:33 +0000 (14:21 +0000)]
Add support of the next Ubuntu (Ubuntu 18.04 - Bionic Beaver)
llvm-svn: 316577
Matthew Simpson [Wed, 25 Oct 2017 13:40:08 +0000 (13:40 +0000)]
Add CalledValuePropagation pass
This patch adds a new pass for attaching !callees metadata to indirect call
sites. The pass propagates values to call sites by performing an IPSCCP-like
analysis using the generic sparse propagation solver. For indirect call sites
having a small set of possible callees, the attached metadata indicates what
those callees are. The metadata can be used to facilitate optimizations like
intersecting the function attributes of the possible callees, refining the call
graph, performing indirect call promotion, etc.
Differential Revision: https://reviews.llvm.org/D37355
llvm-svn: 316576
Simon Dardis [Wed, 25 Oct 2017 13:35:53 +0000 (13:35 +0000)]
[mips] Clean up some whitespace (NFC).
Also test that my email address was updated.
llvm-svn: 316575
Daniil Fukalov [Wed, 25 Oct 2017 12:51:32 +0000 (12:51 +0000)]
[inlineasm] Fix crash when number of matched input constraint operands overflows signed char
In a case when number of output constraint operands that has matched input operands
doesn't fit to signed char, TargetLowering::ParseConstraints() can try to access
ConstraintOperands (that is std::vector) with negative index.
Reviewers: rampitec, arsenm
Differential Review: https://reviews.llvm.org/D39125
llvm-svn: 316574
Diana Picus [Wed, 25 Oct 2017 12:22:21 +0000 (12:22 +0000)]
[ARM GlobalISel] Remove redundant testcases. NFC
Remove the G_FADD testcases from arm-legalizer.mir, they are covered by
arm-legalizer-fp.mir (I probably forgot to delete them when I created
that test).
llvm-svn: 316573
Diana Picus [Wed, 25 Oct 2017 12:22:16 +0000 (12:22 +0000)]
[ARM GlobalISel] Update test after r316479. NFC
No need to check register classes in the register block anymore, since
we can now much more conveniently check them at their def.
llvm-svn: 316572
Haojian Wu [Wed, 25 Oct 2017 11:54:45 +0000 (11:54 +0000)]
[rename] support renaming class member.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D39178
llvm-svn: 316571
Diana Picus [Wed, 25 Oct 2017 11:42:40 +0000 (11:42 +0000)]
[ARM GlobalISel] Fix call opcodes
We were generating BLX for all the calls, which was incorrect in most
cases. Update ARMCallLowering to generate BL for direct calls, and BLX,
BX_CALL or BMOVPCRX_CALL for indirect calls.
llvm-svn: 316570
Diana Picus [Wed, 25 Oct 2017 11:21:15 +0000 (11:21 +0000)]
[ARM GlobalISel] Split test into 3. NFC
Separate the test cases that deal with calls from the rest of the IR
Translator tests.
We split into 2 different files, one for testing parameter and result
lowering, and one for testing the various different kinds of calls that
can occur (BL, BLX, BX_CALL etc).
llvm-svn: 316569
Max Kazantsev [Wed, 25 Oct 2017 11:07:43 +0000 (11:07 +0000)]
[SCEV] Enhance SCEVFindUnsafe for division
This patch allows SCEVFindUnsafe algorithm to tread division by any non-positive
value as safe. Previously, it could only recognize non-zero constants.
Differential Revision: https://reviews.llvm.org/D39228
llvm-svn: 316568
Clement Courbet [Wed, 25 Oct 2017 11:02:09 +0000 (11:02 +0000)]
Re-land "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"
Compute the actual decomposition only after deciding whether to expand
of not. Else, it's easy to make the compiler OOM with:
`memcpy(dst, src, 0xffffffffffffffff);`, which typically happens if
someone mistakenly passes a negative value. Add a test.
This reverts commit
f8fc02fbd4ab33383c010d33675acf9763d0bd44.
llvm-svn: 316567
George Rimar [Wed, 25 Oct 2017 10:23:49 +0000 (10:23 +0000)]
[llvm-dwarfdump] - Fix array out of bounds access crash.
This fixes possible out of bound access in
DWARFDie::getFirstChild()
which might happen when .debug_info section is corrupted,
like shown in testcase.
Differential revision: https://reviews.llvm.org/D39185
llvm-svn: 316566
Ilya Biryukov [Wed, 25 Oct 2017 09:35:10 +0000 (09:35 +0000)]
[clangd] Added a callback-based codeComplete in clangd.
Reviewers: klimek, bkramer, sammccall, krasimir
Reviewed By: sammccall
Subscribers: rwols, cfe-commits
Differential Revision: https://reviews.llvm.org/D38629
llvm-svn: 316565
Ilya Biryukov [Wed, 25 Oct 2017 08:45:41 +0000 (08:45 +0000)]
[clangd] Handle exit notification (proper shutdown)
Summary:
This changes the onShutdown handler to do essentially nothing (for now), and
instead exits the runloop when we receive the exit notification from the client.
Some clients may wait on the reply from the shutdown request before sending an
exit notification. If we exit the runloop already in the shutdown request, a
client might block forever.
This also gives us the opportunity to do any global cleanups and/or
serializations of PCH preambles to disk, but I've left that out for now.
See the LSP protocol documentation for details.
Reviewers: malaperle, krasimir, bkramer, sammccall, ilya-biryukov
Reviewed By: malaperle, sammccall, ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38939
llvm-svn: 316564
Sam Parker [Wed, 25 Oct 2017 08:37:33 +0000 (08:37 +0000)]
[ARM] OrCombineToBFI function
Extract the functionality to combine OR to BFI into its own function.
Differential Revision: https://reviews.llvm.org/D39001
llvm-svn: 316563
Sam Parker [Wed, 25 Oct 2017 08:33:06 +0000 (08:33 +0000)]
[ARM] Swap cmp operands for automatic shifts
Swap the compare operands if the lhs is a shift and the rhs isn't,
as in arm and T2 the shift can be performed by the compare for its
second operand.
Differential Revision: https://reviews.llvm.org/D39004
llvm-svn: 316562
Haojian Wu [Wed, 25 Oct 2017 08:25:25 +0000 (08:25 +0000)]
[clang-rename] Fix and enable the failing TemplatedClassFunction test.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D39241
llvm-svn: 316561
Jonas Paulsson [Wed, 25 Oct 2017 08:23:33 +0000 (08:23 +0000)]
[MachineScheduler] Minor refactoring.
Duplicated code found in three places put into a new static function:
/// Given a Count of resource usage and a Latency value, return true if a
/// SchedBoundary becomes resource limited.
static bool checkResourceLimit(unsigned LFactor, unsigned Count,
unsigned Latency) {
return (int)(Count - (Latency * LFactor)) > (int)LFactor;
}
Review: Florian Hahn, Matthias Braun
https://reviews.llvm.org/D39235
llvm-svn: 316560
Martin Storsjo [Wed, 25 Oct 2017 08:07:19 +0000 (08:07 +0000)]
Fix the context/cursor size for ARM with WMMX enabled
This was missed in SVN r274744 when the WMMX part was made optional;
when made optional, some struct fields were reordered, which caused
the total struct size to grow due to padding/alignment.
llvm-svn: 316559
Dmitry Vyukov [Wed, 25 Oct 2017 08:05:13 +0000 (08:05 +0000)]
[tsan] Fix warnings in tsan_interceptors.cc from expansion of variadic macros
C99 technically requires the rest arguments to be used in C variadic macros.
This presents a problem with the macro SCOPED_TSAN_INTERCEPTOR when func
takes no arguments. This happens with the function pause. Like other void
argument functions, we pass in a fake argument to avoid this warning.
Author: Alex Langford (xiaobai)
Reviewed in: https://reviews.llvm.org/D39151
llvm-svn: 316558
Martin Storsjo [Wed, 25 Oct 2017 07:25:18 +0000 (07:25 +0000)]
[AArch64] Add support for dllimport of values and functions
Previously, the dllimport attribute did the right thing in terms
of treating it as a pointer to a value, but this makes sure the
names get mangled properly, and calls to such functions load the
function from the __imp_ pointer.
This is based on SVN r212431 and r212430 where the same was
implemented for ARM.
Differential Revision: https://reviews.llvm.org/D38530
llvm-svn: 316555
Matt Arsenault [Wed, 25 Oct 2017 07:14:07 +0000 (07:14 +0000)]
DAG: Fix creating select with wrong condition type
This code added in r297930 assumed that it could create
a select with a condition type that is just an integer
bitcast of the selected type. For AMDGPU any vselect is
going to be scalarized (although the vector types are legal),
and all select conditions must be i1 (the same as getSetCCResultType).
This logic doesn't really make sense to me, but there's
never really been a consistent policy in what the select
condition mask type is supposed to be. Try to extend
the logic for skipping the transform for condition types
that aren't setccs. It doesn't seem quite right to me though,
but checking conditions that seem more sensible (like whether the
vselect is going to be expanded) doesn't work since this
seems to depend on that also.
llvm-svn: 316554
Matt Arsenault [Wed, 25 Oct 2017 07:00:51 +0000 (07:00 +0000)]
AMDGPU: Add max-mix-insts subtarget feature
llvm-svn: 316553
Max Kazantsev [Wed, 25 Oct 2017 06:47:39 +0000 (06:47 +0000)]
[IRCE] Fix intersection between signed and unsigned ranges
IRCE for unsigned latch conditions was temporarily disabled by rL314881. The motivating
example contained an unsigned latch condition and a signed range check. One of the safe
iteration ranges was `[1, SINT_MAX + 1]`. Its right border was incorrectly interpreted as a negative
value in `IntersectRange` function, this lead to a miscompile under which we deleted a range check
without inserting a postloop where it was needed.
This patch brings back IRCE for unsigned latch conditions. Now we treat range intersection more
carefully. If the latch condition was unsigned, we only try to consider a range check for deletion if:
1. The range check is also unsigned, or
2. Safe iteration range of the range check lies within `[0, SINT_MAX]`.
The same is done for signed latch.
Values from `[0, SINT_MAX]` are unambiguous, these values are non-negative under any interpretation,
and all values of a range intersected with such range are also non-negative.
We also use signed/unsigned min/max functions for range intersection depending on type of the
latch condition.
Differential Revision: https://reviews.llvm.org/D38581
llvm-svn: 316552
Mikael Holmen [Wed, 25 Oct 2017 06:15:32 +0000 (06:15 +0000)]
[MemDep] DBG intrinsics don't impact abort limit for call site dependence analysis
Summary:
Memory dependence analysis no longer counts DbgInfoIntrinsics towards the
limit where to abort the analysis. Before, a bunch of calls to dbg.value
could affect the generated code, meaning that with -g we could generate
different code than without.
Reviewers: chandlerc, Prazek, davide, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39181
llvm-svn: 316551
Max Kazantsev [Wed, 25 Oct 2017 06:10:02 +0000 (06:10 +0000)]
[IRCE] Smarter detection of empty ranges using SCEV
For a SCEV range, this patch replaces the naive emptiness check for SCEV ranges
which looks like `Begin == End` with a SCEV check. The range is guaranteed to be
empty of `Begin >= End`. We should filter such ranges out and do not try to perform
IRCE for them.
For example, we can get such range when intersecting range `[A, B)` and `[C, D)`
where `A < B < C < D`. The resulting range is `[max(A, C), min(B, D)) = [C, B)`.
This range is empty, but its `Begin` does not match with `End`.
Making IRCE for an empty range is basically safe but unprofitable because we
never actually get into the main loop where the range checks are supposed to
be eliminated. This patch uses SCEV mechanisms to treat loops with proved
`Begin >= End` as empty.
Differential Revision: https://reviews.llvm.org/D39082
llvm-svn: 316550
Peter Collingbourne [Wed, 25 Oct 2017 05:33:28 +0000 (05:33 +0000)]
Try to fix test on windows.
llvm-svn: 316549
Dean Michael Berris [Wed, 25 Oct 2017 05:19:20 +0000 (05:19 +0000)]
[XRay][compiler-rt][NFC] Clean up xray log files before running test
Improves the test behaviour in the face of failure. Without this change
the fdr-single-thread.cc test may leave around artefacts of a previous
failing run since the cleanup doesn't happen if any of the intermediary
steps fail.
Non-functional change.
Subscribers: llvm-commits
llvm-svn: 316548
Peter Collingbourne [Wed, 25 Oct 2017 05:00:54 +0000 (05:00 +0000)]
COFF: Don't add /manifest* flags to the response file.
If /manifest:embed is enabled we're already creating a resource file
out of these flags and adding it to the linkrepro, and it doesn't
seem worth being able to repro side-by-side manifests.
Includes a test that covers this commit as well as r315948.
Differential Revision: https://reviews.llvm.org/D38975
llvm-svn: 316547
Peter Collingbourne [Wed, 25 Oct 2017 04:24:20 +0000 (04:24 +0000)]
Assembly tests require x86 target.
llvm-svn: 316546
Saleem Abdulrasool [Wed, 25 Oct 2017 03:58:15 +0000 (03:58 +0000)]
CodeGen: fix a case of incorrect checks for ivars
Ensure that we check the ivar containing decl for the DLL storage
attribute rather than the ivar itself as the dll storage is associated
to the interface decl not the ivar decl.
llvm-svn: 316545
Teresa Johnson [Wed, 25 Oct 2017 03:41:31 +0000 (03:41 +0000)]
[ThinLTO] Make test for promoted names more specific
With r314527, promoted values get a suffix that is a decimal value of
the module hash instead of hex. Change the regex to match only decimal
suffix values.
llvm-svn: 316544
Peter Collingbourne [Wed, 25 Oct 2017 03:37:12 +0000 (03:37 +0000)]
llvm-readobj: Add support for reading relocations in the Android packed format.
This is in preparation for testing lld's upcoming relocation packing
feature (D39152). I have verified that this implementation correctly
unpacks the relocations from a Chromium DSO built with gold and the
Android relocation packer for ARM32 and ARM64.
Differential Revision: https://reviews.llvm.org/D39272
llvm-svn: 316543
Petr Hosek [Wed, 25 Oct 2017 02:35:22 +0000 (02:35 +0000)]
[CMake] Build host builtins in Fuchsia toolchain even on Darwin
This is nedeeded for the toolchain to be actually usable as a host
toolchain on Darwin.
Differential Revision: https://reviews.llvm.org/D39273
llvm-svn: 316542
Petr Hosek [Wed, 25 Oct 2017 02:31:38 +0000 (02:31 +0000)]
[CMake] Include clang-refactor in Fuchsia toolchain
This includes the clang-refactor in the toolchain distribution.
Differential Revision: https://reviews.llvm.org/D39270
llvm-svn: 316541
Petr Hosek [Wed, 25 Oct 2017 01:11:27 +0000 (01:11 +0000)]
[clang-refactor] Use add_clang_tool CMake template
This allows including clang-refactor in LLVM_DISTRIBUTION_COMPONENTS
to build clang-refactor as part of the toolchain distribution.
Differential Revision: https://reviews.llvm.org/D39266
llvm-svn: 316540
George Karpenkov [Wed, 25 Oct 2017 00:03:45 +0000 (00:03 +0000)]
[Analyzer] Remove spaces inside comments mentioning the parameter name,
to aid clang-tidy comprehension.
Requested by @alexfh in https://reviews.llvm.org/D39015
llvm-svn: 316539
George Karpenkov [Wed, 25 Oct 2017 00:03:45 +0000 (00:03 +0000)]
[Analyzer] Remove unnecessary semicolon in analyzer tests.
llvm-svn: 316538
Mitch Phillips [Tue, 24 Oct 2017 23:56:12 +0000 (23:56 +0000)]
Check special-case-list regex before insertion.
Summary:
Checks that the supplied regex to SpecialCaseList::Matcher::insert(..) is non-empty.
Reported by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3688
Verified that this fixes the provided assertion failure (built with {asan, fuzzer}):
```
mitchp@mitchp2:~/llvm-build/git-fuzz$ ninja llvm-special-case-list-fuzzer[12/12] Linking CXX executable bin/llvm-special-case-list-fuzzer
mitchp@mitchp2:~/llvm-build/git-fuzz$ bin/llvm-special-case-list-fuzzer ~/Downloads/clusterfuzz-testcase-
6748633157337088
INFO: Seed:
1697404507
INFO: Loaded 1 modules (18581 inline 8-bit counters): 18581 [0x9e9f60, 0x9ee7f5),
INFO: Loaded 1 PC tables (18581 PCs): 18581 [0x9ee7f8,0xa37148),
bin/llvm-special-case-list-fuzzer: Running 1 inputs 1 time(s) each.
Running: /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-
6748633157337088
Executed /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-
6748633157337088 in 0 ms
***
*** NOTE: fuzzing was not performed, you have only
*** executed the target code on a fixed set of inputs.
***
mitchp@mitchp2:~/llvm-build/git-fuzz$
```
Reviewers: kcc, vsk
Reviewed By: vsk
Subscribers: vsk, llvm-commits, vlad.tsyrklevich
Differential Revision: https://reviews.llvm.org/D39212
llvm-svn: 316537
George Karpenkov [Tue, 24 Oct 2017 23:53:19 +0000 (23:53 +0000)]
[Analyzer] Store BodyFarm in std::unique_ptr
Differential Revision: https://reviews.llvm.org/D39220
llvm-svn: 316536
George Karpenkov [Tue, 24 Oct 2017 23:52:48 +0000 (23:52 +0000)]
[Analyzer] [Tests] Minor refactor of testing infrastructure:
Move utilities functions into a separate file to make comprehension
easier.
llvm-svn: 316535
George Karpenkov [Tue, 24 Oct 2017 23:52:46 +0000 (23:52 +0000)]
[Analyzer] [Tests] Remove temporary fields from generated reference results.
Pointer to HTML diagnostics is removed (as it is not stored) as well as
the version (as it would be available from the commit message).
llvm-svn: 316534
Stephane Sezer [Tue, 24 Oct 2017 23:46:00 +0000 (23:46 +0000)]
Fix a compile warning on linux
Can't cast directly between a pointer to function and a pointer to
object.
llvm-svn: 316533
Stephane Sezer [Tue, 24 Oct 2017 23:40:59 +0000 (23:40 +0000)]
Allow ObjectFilePECOFF to initialize with ARM binaries.
Summary: This is required to start debugging WinPhone ARM targets.
Reviewers: compnerd, zturner, omjavaid
Reviewed By: compnerd
Subscribers: jasonmolenda, aemerson, rengolin, lldb-commits
Differential Revision: https://reviews.llvm.org/D19604
llvm-svn: 316532
Akira Hatanaka [Tue, 24 Oct 2017 23:38:14 +0000 (23:38 +0000)]
[Sema][ObjC] Look for either objc_bridge or objc_bridge_mutable when
determining whether a RecordDecl is CFError.
CFErrorRef used to be declared with "objc_bridge(NSError)" but is now
declared with "objc_bridge_mutable(NSError)". Look for either when
checking whether a RecordDecl is CFError.
rdar://problem/
35034779
llvm-svn: 316531
Davide Italiano [Tue, 24 Oct 2017 23:31:53 +0000 (23:31 +0000)]
[FreeBSD] Remove more dead code. NFCI.
llvm-svn: 316530
Davide Italiano [Tue, 24 Oct 2017 23:29:01 +0000 (23:29 +0000)]
[ExpressionParser] Garbage-collect dead code. NFCI.
llvm-svn: 316529
Erich Keane [Tue, 24 Oct 2017 23:12:01 +0000 (23:12 +0000)]
Correct behavior of fastcall when default CC is set.
Fastcall doesn't support variadic function calls, so
setting the default calling convention to Fastcall would
result in incorrect code being emitted for these conditions.
This patch adds a 'variadic' test to the default calling conv
test, as well as fixes the behavior of fastcall.
llvm-svn: 316528
Stephane Sezer [Tue, 24 Oct 2017 23:01:33 +0000 (23:01 +0000)]
Remove some unused function calls from ClangUserExpression.cpp
llvm-svn: 316527
Stephane Sezer [Tue, 24 Oct 2017 22:56:05 +0000 (22:56 +0000)]
Remove some dead code from ClangExpressionDeclMap.cpp
llvm-svn: 316526