Amara Emerson [Thu, 30 Nov 2017 20:06:02 +0000 (20:06 +0000)]
[GlobalISel][IRTranslator] Fix crash during translation of zero sized loads/stores/args/returns.
This fixes PR35358.
rdar://
35619533
Differential Revision: https://reviews.llvm.org/D40604
llvm-svn: 319465
Sterling Augustine [Thu, 30 Nov 2017 19:39:33 +0000 (19:39 +0000)]
Move x86-specific sources to x86-specific source lists.
llvm-svn: 319464
Xinliang David Li [Thu, 30 Nov 2017 19:37:56 +0000 (19:37 +0000)]
[PGO] Add a test case for infinite loops
Differential Revision: http://reviews.llvm.org/D40663
llvm-svn: 319463
Xinliang David Li [Thu, 30 Nov 2017 19:16:25 +0000 (19:16 +0000)]
[PGO] Skip counter promotion for infinite loops
Differential Revision: http://reviews.llvm.org/D40662
llvm-svn: 319462
Michal Gorny [Thu, 30 Nov 2017 19:09:22 +0000 (19:09 +0000)]
[cmake] Include project name in Sphinx doctree dir to fix race conditions
Modify add_sphinx_target() to include the project name alongside builder
in Sphinx doctree directory. This aims to avoid crashes due to race
conditions between multiple Sphinx instances running in parallel that
attempt to create or read that directory simultaneously.
This problem has originally been addressed in r283188. However, that
commit presumed that there will be only one target per builder being
run. However, r314863 introduced a second manpage target, reintroducing
the race condition.
Differential Revision: https://reviews.llvm.org/D40656
llvm-svn: 319461
Yan Zhang [Thu, 30 Nov 2017 19:05:09 +0000 (19:05 +0000)]
add new check to find NSError init invocation
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40528
llvm-svn: 319460
Yan Zhang [Thu, 30 Nov 2017 19:05:08 +0000 (19:05 +0000)]
add new check to find NSError init invocation
Summary:
This check will find out improper initialization of NSError objects.
According to Apple developer document, we should always use factory method errorWithDomain:code:userInfo: to create new NSError objects instead of [NSError alloc] init]. Otherwise it will lead to a warning message during runtime in Xcode.
The corresponding information about NSError creation: https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html
Reviewers: hokein, benhamilton
Reviewed By: benhamilton
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40528
llvm-svn: 319459
Kelvin Li [Thu, 30 Nov 2017 18:52:06 +0000 (18:52 +0000)]
[OpenMP] Diagnose undeclared variables on declare target clause
Clang asserts on undeclared variables on the to or link clause in the declare
target directive. The patch is to properly diagnose the error.
// foo1 and foo2 are not declared
#pragma omp declare target to(foo1)
#pragma omp declare target link(foo2)
Differential Revision: https://reviews.llvm.org/D40588
llvm-svn: 319458
Daniel Sanders [Thu, 30 Nov 2017 18:48:35 +0000 (18:48 +0000)]
[globalisel][tablegen] Add support for specific immediates in the match pattern
This enables a few rules such as ARM's uxtb instruction.
llvm-svn: 319457
Zachary Turner [Thu, 30 Nov 2017 18:39:50 +0000 (18:39 +0000)]
Split TypeTableBuilder into two classes.
llvm-svn: 319456
Alexander Richardson [Thu, 30 Nov 2017 18:37:04 +0000 (18:37 +0000)]
Fix the MIPS baremetal build
Summary:
Currently sys/cachectl.h is used unconditionally on MIPS although it is
only available on Linux and will fail the build when targeting baremetal
Reviewers: petarj
Reviewed By: petarj
Subscribers: sdardis, krytarowski
Differential Revision: https://reviews.llvm.org/D40659
llvm-svn: 319455
Jim Ingham [Thu, 30 Nov 2017 18:35:35 +0000 (18:35 +0000)]
Remove a long out-of-date comment.
llvm-svn: 319454
Zachary Turner [Thu, 30 Nov 2017 18:33:34 +0000 (18:33 +0000)]
[llvm-readobj] Fix mismatched line endings
llvm-svn: 319453
Dan Gohman [Thu, 30 Nov 2017 18:16:49 +0000 (18:16 +0000)]
[WebAssembly] Revert r319186 "Support bitcasted function addresses with varargs."
The patch broke Emscripten's EM_ASM macros, which utiltize unprototyped
functions.
See https://bugs.llvm.org/show_bug.cgi?id=35385 for details.
llvm-svn: 319452
Rafael Espindola [Thu, 30 Nov 2017 18:02:04 +0000 (18:02 +0000)]
Simplify. NFC.
This particular reportDuplicate is only used with Defined.
llvm-svn: 319451
Alexey Bataev [Thu, 30 Nov 2017 18:01:54 +0000 (18:01 +0000)]
[OPENMP] Fix possible assert for target regions with incorrect inner
teams region.
If the inner teams region is not correct, it may cause an assertion when
processing outer target region. Patch fixes this problem.
llvm-svn: 319450
Rafael Espindola [Thu, 30 Nov 2017 17:51:10 +0000 (17:51 +0000)]
Handle copy relocations in symbol assignments.
When a linker script has "foo = bar" and bar is the result of a copy
relocation foo should point to the same location in .bss.
This is part of a growing evidence that copy relocations should be
implemented by using replaceSymbol to replace the SharedSymbol with a
Defined.
llvm-svn: 319449
Jonas Hahnfeld [Thu, 30 Nov 2017 17:08:31 +0000 (17:08 +0000)]
[CMake] Detect information about test compiler
Perform a nested CMake invocation to avoid writing our own parser
for compiler versions when we are not testing the in-tree compiler.
Use the extracted information to mark a test as unsupported that
hangs with Clang prior to version 4.0.1 and restrict tests for
libomptarget to Clang version 6.0.0 and later.
Differential Revision: https://reviews.llvm.org/D40083
llvm-svn: 319448
Francis Visoiu Mistrih [Thu, 30 Nov 2017 16:48:53 +0000 (16:48 +0000)]
[MIR] Fix DebugInfo tests after r319445
llvm-svn: 319447
Erich Keane [Thu, 30 Nov 2017 16:37:02 +0000 (16:37 +0000)]
Fix __has_unique_object_representations implementation
As rsmith pointed out, the original implementation of this intrinsic
missed a number of important situations. This patch fixe a bunch of
shortcomings and implementation details to make it work correctly.
Differential Revision: https://reviews.llvm.org/D39347
llvm-svn: 319446
Francis Visoiu Mistrih [Thu, 30 Nov 2017 16:12:24 +0000 (16:12 +0000)]
[CodeGen] Always use `printReg` to print registers in both MIR and debug
output
As part of the unification of the debug format and the MIR format,
always use `printReg` to print all kinds of registers.
Updated the tests using '_' instead of '%noreg' until we decide which
one we want to be the default one.
Differential Revision: https://reviews.llvm.org/D40421
llvm-svn: 319445
Igor Laevsky [Thu, 30 Nov 2017 15:41:58 +0000 (15:41 +0000)]
[FuzzMutate] Bailout from injecting into empty basic blocks.
In rare cases we can receive request to inject into completelly empty basic block. In the normal case
all basic blocks contain at least terminator instruction, but it is possible that the only instruction is
catchpad instruction which is not part of the instruction iterator. This case seems rare enough to not care
about it.
Submiting without review, since it seems almost NFC. I couldn't come up with any reasonable way to test this.
llvm-svn: 319444
Pavel Labath [Thu, 30 Nov 2017 15:39:57 +0000 (15:39 +0000)]
Add a test case for open bug 35480
The test is about failing to hit breakpoints in global constructors in
shared libraries.
llvm-svn: 319443
Igor Laevsky [Thu, 30 Nov 2017 15:31:13 +0000 (15:31 +0000)]
[FuzzMutate] Correctly handle vector types in the insertvalue operation
Differential Revision: https://reviews.llvm.org/D40397
llvm-svn: 319442
Igor Laevsky [Thu, 30 Nov 2017 15:29:16 +0000 (15:29 +0000)]
[FuzzMutate] Don't use index operands as sinks
Differential Revision: https://reviews.llvm.org/D40396
llvm-svn: 319441
Igor Laevsky [Thu, 30 Nov 2017 15:26:48 +0000 (15:26 +0000)]
[FuzzMutate] Pick correct index for the insertvalue instruction
Differential Revision: https://reviews.llvm.org/D40395
llvm-svn: 319440
Igor Laevsky [Thu, 30 Nov 2017 15:24:41 +0000 (15:24 +0000)]
[FuzzMutate] Don't create load as a new source if it doesn't match with the descriptor
Differential Revision: https://reviews.llvm.org/D40394
llvm-svn: 319439
Igor Laevsky [Thu, 30 Nov 2017 15:07:38 +0000 (15:07 +0000)]
[FuzzMutate] Don't crash when we can't remove instruction from empty function
Differential Revision: https://reviews.llvm.org/D40393
llvm-svn: 319438
Sanjay Patel [Thu, 30 Nov 2017 14:59:03 +0000 (14:59 +0000)]
[LangRef] clarify semantics of the frem instruction
As noted in D40594, the frem instruction corresponds to fmod() except that it can't set errno.
I modified the text that we currently use for intrinsics that map to libm functions and applied
it to frem.
Differential Revision: https://reviews.llvm.org/D40629
llvm-svn: 319437
Alexey Bataev [Thu, 30 Nov 2017 14:33:58 +0000 (14:33 +0000)]
[InstCombine] Additional test for PR35354, NFC.
llvm-svn: 319436
George Rimar [Thu, 30 Nov 2017 14:01:06 +0000 (14:01 +0000)]
[ELF] - Handle EhInputSection Live bit in MarkLive.cpp
Since MarkLive.cpp is the place where we set Live flags for
other sections, it looks correct to do that there.
Benefit is that we stop spreading GC logic outsize of MarkLive.cpp.
Differential revision: https://reviews.llvm.org/D40454
llvm-svn: 319435
Nemanja Ivanovic [Thu, 30 Nov 2017 13:39:10 +0000 (13:39 +0000)]
[PowerPC] Recommit r314244 with refactoring and off by default
This re-commits everything that was pulled in r314244. The transformation
is off by default (patch to enable it to follow). The code is refactored
to have a single entry-point and provide fine-grained control over patterns
that it selects. This patch also fixes the bugs in the original code.
Everything that failed with the original patch has been re-tested with this
patch (with the transformation turned on). So the patch to turn this on is
soon to follow.
Differential Revision: https://reviews.llvm.org/D38575
llvm-svn: 319434
Simon Pilgrim [Thu, 30 Nov 2017 13:18:06 +0000 (13:18 +0000)]
[X86][AVX512] Tag fcmp/ptest/ternlog instructions scheduler classes
llvm-svn: 319433
Simon Pilgrim [Thu, 30 Nov 2017 13:09:21 +0000 (13:09 +0000)]
[X86][AVX512] Regenerate avx512 schedule tests
llvm-svn: 319432
Philip Pfaffe [Thu, 30 Nov 2017 13:06:10 +0000 (13:06 +0000)]
Handle Top-Level-Regions in polly::isHoistableLoad
Summary:
This can be seen as a follow-up on my previous differential [D33411](https://reviews.llvm.org/D33411).
We received a bug report where this error was triggered. I have tried my best to recreate the issue in a minimal lit testcase which is also part of this differential.
I only handle return instructions as predecessors to a virtual TLR-exit right now. From inspecting the codebase, it seems `unreachable` instructions may also be of interest here. If requested, I can extend my patches to consider them as well. I would also apply this on `ScopHelper.cpp::isErrorBlock` (see D33411), of course.
Reviewers: philip.pfaffe, bollu
Reviewed By: bollu
Subscribers: Meinersbur, pollydev, llvm-commits
Tags: #polly
Differential Revision: https://reviews.llvm.org/D40492
llvm-svn: 319431
Sean Eveson [Thu, 30 Nov 2017 13:05:14 +0000 (13:05 +0000)]
[MC] Function stack size section.
Re applying after fixing issues in the diff, sorry for any painful conflicts/merges!
Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html
This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128).
The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary.
There is a follow up change to add an option to clang.
Thanks.
Reviewers: hfinkel, MatzeB
Reviewed By: MatzeB
Subscribers: thegameg, asb, llvm-commits
Differential Revision: https://reviews.llvm.org/D39788
llvm-svn: 319430
Sean Eveson [Thu, 30 Nov 2017 12:43:25 +0000 (12:43 +0000)]
Revert r319423: [MC] Function stack size section.
I messed up the diff.
llvm-svn: 319429
Diana Picus [Thu, 30 Nov 2017 12:23:44 +0000 (12:23 +0000)]
[ARM GlobalISel] Bail out for byval
Fallback if we have a byval parameter or argument since we don't support
them yet.
llvm-svn: 319428
Francis Visoiu Mistrih [Thu, 30 Nov 2017 12:12:19 +0000 (12:12 +0000)]
[CodeGen] Print "%vreg0" as "%0" in both MIR and debug output
As part of the unification of the debug format and the MIR format, avoid
printing "vreg" for virtual registers (which is one of the current MIR
possibilities).
Basically:
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/%vreg([0-9]+)/%\1/g"
* grep -nr '%vreg' . and fix if needed
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/ vreg([0-9]+)/ %\1/g"
* grep -nr 'vreg[0-9]\+' . and fix if needed
Differential Revision: https://reviews.llvm.org/D40420
llvm-svn: 319427
Michael Kruse [Thu, 30 Nov 2017 12:05:48 +0000 (12:05 +0000)]
Update format after clang-format change. NFC.
In r319314 clang-format changed its reflowing logic.
llvm-svn: 319426
Keith Walker [Thu, 30 Nov 2017 12:05:18 +0000 (12:05 +0000)]
Revert [ARM] disable FPU features when using soft floating point.
This reverts r319420
It is failing the test Driver/arm-mfpu.c so reverting while I investigate the failure.
llvm-svn: 319425
Simon Pilgrim [Thu, 30 Nov 2017 12:01:52 +0000 (12:01 +0000)]
[X86][AVX512] Tag binop/rounding/sae instructions scheduler classes
llvm-svn: 319424
Sean Eveson [Thu, 30 Nov 2017 12:01:16 +0000 (12:01 +0000)]
[MC] Function stack size section.
Summary:
Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html
I wasn't sure who to put as reviewers, so please add/remove people as appropriate.
This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128).
The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary.
There is a follow up change to add an option to clang.
Thanks.
Reviewers: hfinkel, MatzeB
Reviewed By: MatzeB
Subscribers: thegameg, asb, llvm-commits
Differential Revision: https://reviews.llvm.org/D39788
llvm-svn: 319423
Andrey Churbanov [Thu, 30 Nov 2017 11:51:47 +0000 (11:51 +0000)]
Extension of HWLOC topology discovery with NUMA nodes and tiles
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D40309
llvm-svn: 319422
Sam Parker [Thu, 30 Nov 2017 11:49:11 +0000 (11:49 +0000)]
[DAGCombine] Refactor ReduceLoadWidth
visitAND attempts to narrow the width of extending loads that are
then masked off. ReduceLoadWidth already exists for a similar purpose
and handles shifts, so I've moved the code to handle AND nodes there.
Differential Revision: https://reviews.llvm.org/D39595
llvm-svn: 319421
Keith Walker [Thu, 30 Nov 2017 11:38:56 +0000 (11:38 +0000)]
[ARM] disable FPU features when using soft floating point.
To be compatible with GCC if soft floating point is in effect any FPU
specified is effectively ignored, eg,
-mfloat-abi=soft -fpu=neon
If any floating point features which require FPU hardware are enabled
they must be disable.
There was some support for doing this for NEON, but it did not handle
VFP, nor did it prevent the backend from emitting the build attribute
Tag_FP_arch describing the generated code as using the floating point
hardware if a FPU was specified (even though soft float does not use
the FPU).
Disabling the hardware floating point features for targets which are
compiling for soft float has meant that some tests which were incorrectly
checking for hardware support also needed to be updated. In such cases,
where appropriate the tests have been updated to check compiling for
soft float and a non-soft float variant (usually softfp). This was
usually because the target specified in the test defaulted to soft float.
Differential Revision: https://reviews.llvm.org/D40256
llvm-svn: 319420
Serge Guelton [Thu, 30 Nov 2017 11:06:22 +0000 (11:06 +0000)]
Support generic lowering of vector bswap
llvm-svn: 319419
Simon Pilgrim [Thu, 30 Nov 2017 10:48:47 +0000 (10:48 +0000)]
[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes
llvm-svn: 319418
Jonas Devlieghere [Thu, 30 Nov 2017 10:41:31 +0000 (10:41 +0000)]
[dsymutil] Exclude namespace from ifdef in CFBundle
Should fix build failure introduced by r319416 on non-darwin hosts.
llvm-svn: 319417
Jonas Devlieghere [Thu, 30 Nov 2017 10:25:28 +0000 (10:25 +0000)]
[dsymutil] Upstream getBundleInfo implementation
This patch implements `getBundleInfo`, which uses CoreFoundation to
obtain information about the CFBundle. This information is needed to
populate the Plist in the dSYM bundle.
This change only applies to darwin and is an NFC as far as other
platforms are concerned.
Differential revision: https://reviews.llvm.org/D40244
llvm-svn: 319416
Martin Probst [Thu, 30 Nov 2017 10:25:17 +0000 (10:25 +0000)]
clang-format: [JS] do not wrap after async/await.
Summary:
Otherwise automatic semicolon insertion can trigger, i.e. wrapping
produces invalid syntax.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D40642
llvm-svn: 319415
Pavel Labath [Thu, 30 Nov 2017 10:16:54 +0000 (10:16 +0000)]
Fix assertion in ClangASTContext
Summary:
llvm::APSInt(0) asserts because it creates an int with bit-width 0 and
not (as I thought) a value 0.
Theoretically it should be sufficient to change this to APSInt(1), as
the intention there was that the value of the first argument should be
ignored if the type is invalid, but that would look dodgy.
Instead, I use llvm::Optional to denote an invalid value and use a
special struct instead of a std::pair, to reduce typing and increase
clarity.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D40615
llvm-svn: 319414
Ivan A. Kosarev [Thu, 30 Nov 2017 09:26:39 +0000 (09:26 +0000)]
[CodeGen] Add initial support for union members in TBAA
The basic idea behind this patch is that since in strict aliasing
mode all accesses to union members require their outermost
enclosing union objects to be specified explicitly, then for a
couple given accesses to union members of the form
p->a.b.c...
q->x.y.z...
it is known they can only alias if both p and q point to the same
union type and offset ranges of members a.b.c... and x.y.z...
overlap. Note that the actual types of the members do not matter.
Specifically, in this patch we do the following:
* Make unions to be valid TBAA base access types. This enables
generation of TBAA type descriptors for unions.
* Encode union types as structures with a single member of a
special "union member" type. Currently we do not encode
information about sizes of types, but conceptually such union
members are considered to be of the size of the whole union.
* Encode accesses to direct and indirect union members, including
member arrays, as accesses to these special members. All
accesses to members of a union thus get the same offset, which
is the offset of the union they are part of. This means the
existing LLVM TBAA machinery is able to handle such accesses
with no changes.
While this is already an improvement comparing to the current
situation, that is, representing all union accesses as may-alias
ones, there are further changes planned to complete the support
for unions. One of them is storing information about access sizes
so we can distinct accesses to non-overlapping union members,
including accesses to different elements of member arrays.
Another change is encoding type sizes in order to make it
possible to compute offsets within constant-indexed array
elements. These enhancements will be addressed with separate
patches.
Differential Revision: https://reviews.llvm.org/D39455
llvm-svn: 319413
Stephan Bergmann [Thu, 30 Nov 2017 09:22:12 +0000 (09:22 +0000)]
Linux needs to include sys/uio.h for readv, preadv
...at least when building against glibc-2.26-16.fc27.x86_64
llvm-svn: 319412
Roman Lebedev [Thu, 30 Nov 2017 09:18:35 +0000 (09:18 +0000)]
[analyzer] Fix false negative on post-increment of uninitialized variable.
Summary:
Currently clang static analyzer does warn on:
```
int x;
x+=1;
x-=1;
x=x+1;
x=x-1;
```
But does warn on:
```
int x;
x++;
x--;
--x;
++x;
```
This differential should fix that.
Fixes https://bugs.llvm.org/show_bug.cgi?id=35419
Reviewers: dcoughlin, NoQ
Reviewed By: dcoughlin
Subscribers: NoQ, xazax.hun, szepet, cfe-commits, a.sidorin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D40463
llvm-svn: 319411
Hiroshi Inoue [Thu, 30 Nov 2017 08:29:51 +0000 (08:29 +0000)]
Revert rL319407: [SROA] enable splitting for non-whole-alloca loads and stores
This reverts commit rL319407 due to failures in some buildbot.
llvm-svn: 319410
Jonas Paulsson [Thu, 30 Nov 2017 08:18:50 +0000 (08:18 +0000)]
[SystemZ] Bugfix in adjustSubwordCmp.
Csmith generated a program where a store after load to the same address did
not get chained after the new load created during DAG legalizing, and so
performed an illegal overwrite of the expected value.
When the new zero-extending load is created, the chain users of the original
load must be updated, which was not done previously.
A similar case was also found and handled in lowerBITCAST.
Review: Ulrich Weigand
https://reviews.llvm.org/D40542
llvm-svn: 319409
Richard Smith [Thu, 30 Nov 2017 08:18:21 +0000 (08:18 +0000)]
Preserve the "last diagnostic was suppressed" flag across SFINAE checks.
Sometimes we check the validity of some construct between producing a
diagnostic and producing its notes. Ideally, we wouldn't do that, but in
practice running code that "cannot possibly produce a diagnostic" in such a
situation should be safe, and reasonable factoring of some code requires it
with our current diagnostics infrastruture. If this does happen, a diagnostic
that's suppressed due to SFINAE should not cause notes connected to the prior
diagnostic to be suppressed.
llvm-svn: 319408
Hiroshi Inoue [Thu, 30 Nov 2017 07:44:46 +0000 (07:44 +0000)]
[SROA] enable splitting for non-whole-alloca loads and stores
Currently, SROA splits loads and stores only when they are accessing the whole alloca.
This patch relaxes this limitation to allow splitting a load/store if all other loads and stores to the alloca are disjoint to or fully included in the current load/store. If there is no other load or store that crosses the boundary of the current load/store, the current splitting implementation works as is.
The whole-alloca loads and stores meet this new condition and so they are still splittable.
Here is a simplified motivating example.
struct record {
long long a;
int b;
int c;
};
int func(struct record r) {
for (int i = 0; i < r.c; i++)
r.b++;
return r.b;
}
When updating r.b (or r.c as well), LLVM generates redundant instructions on some platforms (such as x86_64, ppc64); here, r.b and r.c are packed into one 64-bit GPR when the struct is passed as a method argument.
With this patch, the above example is compiled into only few instructions without loop.
Without the patch, unnecessary loop-carried dependency is introduced by SROA and the loop cannot be eliminated by the later optimizers.
Differential Revision: https://reviews.llvm.org/D32998
llvm-svn: 319407
Craig Topper [Thu, 30 Nov 2017 07:01:40 +0000 (07:01 +0000)]
[X86] Optimize avx2 vgatherqps for v2f32 with v2i64 index type.
Normal type legalization will widen everything. This requires forcing 0s into the mask register. We can instead choose the form that only reads 2 elements without zeroing the mask.
llvm-svn: 319406
Craig Topper [Thu, 30 Nov 2017 06:31:31 +0000 (06:31 +0000)]
[X86] Make sure we don't remove sign extends of masks with AVX2 masked gathers.
We don't use k-registers and instead use the MSB so we need to make sure we sign extend the mask to the msb.
llvm-svn: 319405
Rafael Espindola [Thu, 30 Nov 2017 06:18:31 +0000 (06:18 +0000)]
Don't crash on invalid.
llvm-svn: 319404
Rafael Espindola [Thu, 30 Nov 2017 05:52:42 +0000 (05:52 +0000)]
Delete dead code.
llvm-svn: 319403
Jan Kratochvil [Thu, 30 Nov 2017 05:49:02 +0000 (05:49 +0000)]
refactor: Simplify loop with DWARFCompileUnit::Extract
Forgotten small simplification in D40212.
Differential revision: https://reviews.llvm.org/D40635
llvm-svn: 319402
Rafael Espindola [Thu, 30 Nov 2017 05:37:35 +0000 (05:37 +0000)]
Error instead of ignoring broken debug info.
Thanks to Davide for noticing.
llvm-svn: 319401
Dean Michael Berris [Thu, 30 Nov 2017 05:35:51 +0000 (05:35 +0000)]
[XRay][docs] Update documentation on new default for xray_naive_log=
We've recently changed the default for `xray_naive_log=` to be `false`
instead of `true` to make it more consistent with the FDR mode logging
implementation. This means we will now ask users to explicitly choose
which version of the XRay logging is being used.
llvm-svn: 319400
Graham Yiu [Thu, 30 Nov 2017 03:36:57 +0000 (03:36 +0000)]
- Removed unused lamba (IsReturnBlock) causing build bots to fail for r319398
- Added lit testcases that were supposed to be part of r319398
llvm-svn: 319399
Graham Yiu [Thu, 30 Nov 2017 02:41:36 +0000 (02:41 +0000)]
With PGO information, we can do more aggressive outlining of cold regions in the inline candidate function. This contrasts with the scheme of keeping only the 'early return' portion of the inline candidate and outlining the rest of the function as a single function call.
Support for outlining multiple regions of each function is added, as well as some basic heuristics to determine which regions are good to outline. Outline candidates limited to regions that are single-entry & single-exit. We also avoid outlining regions that produce live-exit variables, which may inhibit some forms of code motion (like commoning).
Fallback to the regular partial inlining scheme is retained when either i) no regions are identified for outlining in the function, or ii) the outlined function could not be inlined in any of its callers.
Differential Revision: https://reviews.llvm.org/D38190
llvm-svn: 319398
Kostya Serebryany [Thu, 30 Nov 2017 02:26:47 +0000 (02:26 +0000)]
[libFuzzer] mention one more trophie in the Linux Kernel
llvm-svn: 319397
Sam Clegg [Thu, 30 Nov 2017 01:40:08 +0000 (01:40 +0000)]
[WebAssembly] Allow function signature checking at link time
This change allows checking of function signatures but
does not yes enable it by default. In this mode, linking
two objects that were compiled with a different signatures
for the same function will produce a link error.
New options for enabling and disabling this feature have been
added: (--check-signatures/--no-check-signatures).
Differential Revision: https://reviews.llvm.org/D40371
llvm-svn: 319396
Rui Ueyama [Thu, 30 Nov 2017 01:08:09 +0000 (01:08 +0000)]
Remove unused condition.
Looks like all tests pass without this `isLocal()`.
Differential Revision: https://reviews.llvm.org/D39780
llvm-svn: 319395
Rui Ueyama [Thu, 30 Nov 2017 01:04:26 +0000 (01:04 +0000)]
Fix typo.
llvm-svn: 319394
Matt Arsenault [Thu, 30 Nov 2017 00:52:40 +0000 (00:52 +0000)]
AMDGPU: Allow negative MUBUF vaddr for gfx9
GFX9 does not enable bounds checking for the resource descriptors
used for private access, so it should be OK to use vaddr with
a potentially negative value.
llvm-svn: 319393
Rafael Espindola [Thu, 30 Nov 2017 00:44:22 +0000 (00:44 +0000)]
Check alignment in getSectionContentsAsArray.
While the ArrayRef can technically have unaligned data, it would be
extremely surprising if iterating over it caused undefined behavior
when a reference to the underlying type was bound.
llvm-svn: 319392
Vedant Kumar [Thu, 30 Nov 2017 00:28:23 +0000 (00:28 +0000)]
[Coverage] Use the most-recent completed region count (PR35437)
This is a fix for the coverage segment builder.
If multiple regions must be popped off the active stack at once, and
more than one of them end at the same location, emit a segment using the
count from the most-recent completed region.
Fixes PR35437, rdar://
35760630
Testing: invoked llvm-cov on a stage2 build of clang, additional unit
tests, check-profile
llvm-svn: 319391
Peter Collingbourne [Thu, 30 Nov 2017 00:27:08 +0000 (00:27 +0000)]
LowerTypeTests: Deduplicate code. NFC.
llvm-svn: 319390
Jim Ingham [Thu, 30 Nov 2017 00:23:42 +0000 (00:23 +0000)]
Fix the gtest target for the move of ArchSpecTest.cpp from Core to Utility.
<rdar://problem/
35562389>
llvm-svn: 319389
Dean Michael Berris [Thu, 30 Nov 2017 00:04:54 +0000 (00:04 +0000)]
[XRay][clang] Introduce -fxray-always-emit-customevents
Summary:
The -fxray-always-emit-customevents flag instructs clang to always emit
the LLVM IR for calls to the `__xray_customevent(...)` built-in
function. The default behaviour currently respects whether the function
has an `[[clang::xray_never_instrument]]` attribute, and thus not lower
the appropriate IR code for the custom event built-in.
This change allows users calling through to the
`__xray_customevent(...)` built-in to always see those calls lowered to
the corresponding LLVM IR to lay down instrumentation points for these
custom event calls.
Using this flag enables us to emit even just the user-provided custom
events even while never instrumenting the start/end of the function
where they appear. This is useful in cases where "phase markers" using
__xray_customevent(...) can have very few instructions, must never be
instrumented when entered/exited.
Reviewers: rnk, dblaikie, kpw
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D40601
llvm-svn: 319388
Peter Collingbourne [Thu, 30 Nov 2017 00:02:55 +0000 (00:02 +0000)]
LowerTypeTests: Remove unnecessary cast. NFC.
llvm-svn: 319387
Hans Wennborg [Wed, 29 Nov 2017 23:44:11 +0000 (23:44 +0000)]
MS ABI: Treat explicit instantiation definitions of dllimport function templates as explicit instantiation decls (PR35435)
This matches MSVC's behaviour, and we already do it for class templates
since r270897.
Differential revision: https://reviews.llvm.org/D40621
llvm-svn: 319386
Rafael Espindola [Wed, 29 Nov 2017 23:39:12 +0000 (23:39 +0000)]
Fix reloc section alignment in test.
This should fix the ubsan bot.
We still have to fix lld to produce a clean error on unaligned reloc
sections.
llvm-svn: 319385
Eugene Zelenko [Wed, 29 Nov 2017 23:27:36 +0000 (23:27 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 319384
Aaron Ballman [Wed, 29 Nov 2017 23:10:14 +0000 (23:10 +0000)]
Perform a bounds check on a function's argument list before accessing any index value specified by an 'argument_with_type_tag' attribute. Fixes PR28520.
Patch by Matt Davis.
llvm-svn: 319383
Craig Topper [Wed, 29 Nov 2017 23:08:25 +0000 (23:08 +0000)]
[X86] Remove some questionable looking code that seems to be looking through a VZEXT to create a larger VSEXT.
If the input the vzext was signed this would do the wrong thing.
Not sure how to test this.
llvm-svn: 319382
Joerg Sonnenberger [Wed, 29 Nov 2017 23:05:56 +0000 (23:05 +0000)]
First step towards more human-friendly PPC assembler output:
- add -ppc-reg-with-percent-prefix option to use %r3 etc as register
names
- split off logic for Darwinish verbose conditional codes into a helper
function
- be explicit about Darwin vs AIX vs GNUish assembler flavors
Based on the patch from Alexandre Yukio Yamashita
Differential Revision: https://reviews.llvm.org/D39016
llvm-svn: 319381
Sam Clegg [Wed, 29 Nov 2017 23:05:50 +0000 (23:05 +0000)]
[WebAssembly] Update test expectations for gcc torture tests
I believe these were recently fixed by:
https://reviews.llvm.org/rL319186
Differential Revision: https://reviews.llvm.org/D40619
llvm-svn: 319380
Jonathan Peyton [Wed, 29 Nov 2017 22:47:52 +0000 (22:47 +0000)]
Make kmp_r_sched_t into a union
This change makes kmp_r_sched_t type into a union for simpler
comparisons and assignments
Patch by Terry Wilmarth
Differential Revision: https://reviews.llvm.org/D40374
llvm-svn: 319379
Rafael Espindola [Wed, 29 Nov 2017 22:47:35 +0000 (22:47 +0000)]
Use Symbol::File directly.
We are already paying the cost of storing a InputFile in every
Symbol, so use it uniformly.
llvm-svn: 319378
Zachary Turner [Wed, 29 Nov 2017 22:41:56 +0000 (22:41 +0000)]
[CodeView] Factor some code out of TypeTableBuilder.
This class had some code that would automatically remap type
indices before hashing and serializing. The only caller of
this method was the TypeStreamMerger anyway, and the method
doesn't make general sense, and prevents making certain future
improvements to the class. So, factoring this up one level
into the TypeStreamMerger where it belongs.
llvm-svn: 319377
Eugene Zelenko [Wed, 29 Nov 2017 22:39:22 +0000 (22:39 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 319376
Jonathan Peyton [Wed, 29 Nov 2017 22:29:38 +0000 (22:29 +0000)]
Fix aligned memory allocation in the stub library
kmp_aligned_malloc() always returned NULL on Windows (stub library only)
that may cause Fortran application crash. With this change all memory
allocation functions were fixed to use aligned{m,re,rec}alloc() to
allocate/reallocate memory. To deallocate that memory _aligned_free() is
used in kmp_free().
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D40296
llvm-svn: 319375
Jonathan Peyton [Wed, 29 Nov 2017 22:27:18 +0000 (22:27 +0000)]
Warning is emitted when tiles are requested but cannot be used
Added two warnings:
1) Before building the topology map check if tiles are requested but the
topo method is not hwloc;
2) After building the topology map check if tiles are requested but not
detected by the library.
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D40340
llvm-svn: 319374
Vedant Kumar [Wed, 29 Nov 2017 22:25:14 +0000 (22:25 +0000)]
[Coverage] Emit gap areas in braces-optional statements (PR35387)
Emit a gap area starting after the r-paren location and ending at the
start of the body for the braces-optional statements (for, for-each,
while, etc). The count for the gap area equal to the body's count. This
extends the fix in r317758.
Fixes PR35387, rdar://
35570345
Testing: stage2 coverage-enabled build of clang, check-clang
llvm-svn: 319373
Jonathan Peyton [Wed, 29 Nov 2017 22:23:44 +0000 (22:23 +0000)]
Fix types of Fortran array elements
Fortran array elements made default integer in OMP_GET_PLACE_PROC_IDS and
OMP_GET_PARTITION_PLACE_NUMS subroutines, otherwise call to them produces
incorrect result.
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D40356
llvm-svn: 319372
Rui Ueyama [Wed, 29 Nov 2017 22:21:37 +0000 (22:21 +0000)]
Use llvm::StringSet instead of std::set.
std::set is pretty slow. We generally prefer llvm::StringSet if we don't
need an sorted set.
Differential Revision: https://reviews.llvm.org/D40579
llvm-svn: 319371
Rafael Espindola [Wed, 29 Nov 2017 22:20:03 +0000 (22:20 +0000)]
Simplify. NFC.
llvm-svn: 319370
Eugene Zelenko [Wed, 29 Nov 2017 22:17:39 +0000 (22:17 +0000)]
[Documentation] Sort Clang-tidy changes next way: new modules, new checks, renamed checks, extended checks, new check aliases.
Sort checks in each section alphabetically.
llvm-svn: 319369
Craig Topper [Wed, 29 Nov 2017 22:15:43 +0000 (22:15 +0000)]
[SelectionDAG][X86] Teach promotion legalization for fp_to_sint/fp_to_uint to insert an assertsext/assertzext based on the original type
If we put in an assertsext/zext here, we're able to generate better truncate code using pack on pre-avx512 targets.
Similar is already done during type legalization. This is the equivalent for op legalization
Differential Revision: https://reviews.llvm.org/D40591
llvm-svn: 319368
Rafael Espindola [Wed, 29 Nov 2017 22:09:16 +0000 (22:09 +0000)]
Don't crash on broken debug info.
llvm-svn: 319367
Dean Michael Berris [Wed, 29 Nov 2017 22:06:12 +0000 (22:06 +0000)]
[XRay][compiler-rt][Darwin] Use dynamic initialisation as an alternative
Summary:
In cases where we can't use the .preinit_array section (as in Darwin for
example) we instead use dynamic initialisation. We know that this
alternative approach will race with the initializers of other objects at
global scope, but this is strictly better than nothing.
Reviewers: kubamracek, nglevin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D40599
llvm-svn: 319366