Mikhail R. Gadelha [Tue, 17 Jul 2018 17:40:34 +0000 (17:40 +0000)]
[analyzer] Fix Z3 backend after D48205
Summary:
An assertion was added in D48205 to catch places where a `nonloc::SymbolVal` was wrapping a `loc` object.
This patch fixes that in the Z3 backend by making the `SValBuilder` object accessible from inherited instances of `SimpleConstraintManager` and calling `SVB.makeSymbolVal(foo)` instead of `nonloc::SymbolVal(foo)`.
Reviewers: NoQ, george.karpenkov
Reviewed By: NoQ
Subscribers: xazax.hun, szepet, a.sidorin
Differential Revision: https://reviews.llvm.org/D49430
llvm-svn: 337304
Florian Hahn [Tue, 17 Jul 2018 17:12:50 +0000 (17:12 +0000)]
Revert rL337292 due to another MSVC STL problem.
llvm-svn: 337303
Simon Pilgrim [Tue, 17 Jul 2018 17:10:47 +0000 (17:10 +0000)]
[llvm-mca][x86] Add BSWAP resource tests
llvm-svn: 337302
Sam Clegg [Tue, 17 Jul 2018 16:40:03 +0000 (16:40 +0000)]
[WebAssembly] Update WebAssemblyLowerEmscriptenEHSjLj to handle separate compilation
Previously we were assuming whole program compilation. Now that
separate compilation is a thing we need to update this pass.
Firstly, it can no longer assert on the existence of malloc and free.
This functions might not be in the current translation unit. If we
need them then we will generate not imports for them.
Secondly the global helper function we create should be marked as
weak since we will be generating a separate copy in each translation
unit.
Finally the names of the symbols used must be unique and fixed since
they need to agree across translation units.
Differential Revision: https://reviews.llvm.org/D49263
llvm-svn: 337301
Sam Clegg [Tue, 17 Jul 2018 16:34:48 +0000 (16:34 +0000)]
Add wasm-ld to help text Improve error text
Differential Revision: https://reviews.llvm.org/D48838
llvm-svn: 337300
Craig Topper [Tue, 17 Jul 2018 16:24:33 +0000 (16:24 +0000)]
[X86] Remove some standalone patterns in favor of the patterns in the MOVLPD instruction definitions.
Previously we passed 'null_frag' into the instruction definition. The multiclass is shared with MOVHPD which doesn't use null_frag. It turns out by passing X86Movsd it produces patterns equivalent to some standalone patterns.
llvm-svn: 337299
Simon Pilgrim [Tue, 17 Jul 2018 16:17:33 +0000 (16:17 +0000)]
[llvm-mca][x86] Add displacement-only and additional scale=1 LEA tests
llvm-svn: 337298
Simon Pilgrim [Tue, 17 Jul 2018 16:13:29 +0000 (16:13 +0000)]
[llvm-mca][x86] Add LEA resource tests (PR32326)
Add llvm-mca tests demonstrating how LEA instructions are currently modelled. Once this is working on btver2 I'll copy the test file to the other target directories.
llvm-svn: 337297
Matt Morehouse [Tue, 17 Jul 2018 16:12:00 +0000 (16:12 +0000)]
libFuzzer: prevent irrelevant strings from leaking into auto-dictionary
This is a fix for bug 37047.
https://bugs.llvm.org/show_bug.cgi?id=37047
Implemented by basically reversing the logic. Previously all strings
were considered, with some operations excluded. Now strings are excluded
by default, and only strings during the CB considered.
Patch By: pdknsk
Differential Revision: https://reviews.llvm.org/D48800
llvm-svn: 337296
Matt Davis [Tue, 17 Jul 2018 16:11:54 +0000 (16:11 +0000)]
[llvm-mca][docs] Revert mca internals docs.
We're going to work on this in a separate review focusing more on documenting
the View and probably removing some of the less-interesting/less-useful pieces.
This reverts r337219,337225
llvm-svn: 337295
Andrea Di Biagio [Tue, 17 Jul 2018 16:11:37 +0000 (16:11 +0000)]
[Tablegen][PredicateExpander] Fix a bug in `expandCheckImmOperand`.
Function `expandCheckImmOperand` should always check if the input machine
instruction is passed by reference before calling method `getOperand()` on it.
Found while working on a patch that relies on `expandCheckImmOperand` to expand
a scheduling predicate.
llvm-svn: 337294
Sander de Smalen [Tue, 17 Jul 2018 15:41:58 +0000 (15:41 +0000)]
[AArch64][SVE]: Integer multiply-add/subtract instructions.
This patch adds support for the following instructions:
MLA mul-add, writing addend (Zda = Zda + Zn * Zm)
MLS mul-sub, writing addend (Zda = Zda + -Zn * Zm)
MAD mul-add, writing multiplicant (Zdn = Za + Zdn * Zm)
MSB mul-sub, writing multiplicant (Zdn = Za + -Zdn * Zm)
llvm-svn: 337293
Florian Hahn [Tue, 17 Jul 2018 15:24:19 +0000 (15:24 +0000)]
Recommit r334887: [SmallSet] Add SmallSetIterator.
Spell out destructor, copy/move constructor and assignment operators for
MSVC STL, where set<T>::const_iterator is not trivially copy constructible.
llvm-svn: 337292
Jonas Devlieghere [Tue, 17 Jul 2018 15:11:15 +0000 (15:11 +0000)]
[CMake] Have check-lldb-unit use CMAKE_CURRENT_BINARY_DIR
llvm-lit uses `map_config` directives (generated at configuration-time) to
make it possible to pass a test path relative to the source instead of
the build folder (CMAKE_CURRENT_BINARY_DIR).
However, this doesn't work in the case of swift where the build
directory layout prevents llvm-lit from knowing about lldb and its test
paths. This caused check-lldb-unit to fail in this configuration, while
everything was working as expected upstream. This patch fixes the issue
by passing a path relative to the build directory. This was already the
case for check-lldb-lit.
llvm-svn: 337291
Nico Weber [Tue, 17 Jul 2018 15:07:40 +0000 (15:07 +0000)]
clang-cl: Postpone Wmsvc-not-found emission until link.exe gets used.
Wmsvc-not-found was added in r297851 to help diagnose why link.exe can't be
executed. However, it's emitted even when using -fuse-ld=lld, and in cross
builds there's no way to get rid of the warning other than disabling it.
Instead, emit it when we look up link.exe and it ends up not being executable.
That way, when passing -fuse-ld=lld it will never be printed.
It will also not be printed if we find link.exe on PATH.
(We might want to eventually default to lld one day, at least when running on a
non-Win host, but that's for another day.)
Fixes PR38016.
llvm-svn: 337290
Leonard Chan [Tue, 17 Jul 2018 14:58:49 +0000 (14:58 +0000)]
[Fixed Point Arithmetic] Fix for bug where integer literals could be treated as fixed point literals
This addresses a bug brought up in https://bugs.llvm.org/show_bug.cgi?id=38161 where integer literals could be treated as fixed point types and throw errors related to fixed point types when the 'k' or 'r' suffix used. The fix also addresses the second issue brought up with the assertion by not treating integers as fixed point types in the first place.
Integers that have suffixes 'k' and 'r' now throw the error `invalid suffix 'k/r' on integer constant`.
A few more tests were also added to ensure that fixed point types, and any errors/warnings related to them, are limited to C for now.
Prior discussion also at https://reviews.llvm.org/D46915.
Differential Revision: https://reviews.llvm.org/D49327
llvm-svn: 337289
Petar Jovanovic [Tue, 17 Jul 2018 14:57:46 +0000 (14:57 +0000)]
[Mips][FastISel] Fix handling of icmp with i1 type
The Mips FastISel back-end does not extend i1 values while lowering icmp.
Ensure that we bail into DAG ISel when handling this case.
Patch by Dragan Mladjenovic.
Differential Revision: https://reviews.llvm.org/D49290
llvm-svn: 337288
George Rimar [Tue, 17 Jul 2018 14:36:19 +0000 (14:36 +0000)]
[ELF] - Eliminate dead 'return' in EhFrameSection::finalizeContents(). NFC.
EhFrameSection::finalizeContents() is called from a single place:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1559
So code was dead.
llvm-svn: 337287
Idriss Riouak [Tue, 17 Jul 2018 14:35:15 +0000 (14:35 +0000)]
[clang-tidy: modernize] Fix modernize-use-equals-default with {} brackets list initialization: patch
Summary:
Hello, i would like to suggest a fix for one of the checks in clang-tidy.
The bug was reported in https://bugs.llvm.org/show_bug.cgi?id=38039 where you can find more information.
```
struct UOB{
UOB(const UOB &Other):j{Other.j}{}
int j;
};
```
In this case the check modernize-use-equals-default does not detect copy constructors that can be defaulted; that should be:
```
struct UOB{
UOB(const UOB &Other) = default;
int j;
};
```
Reviewers: aaron.ballman, hokein, alexfh
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49356
llvm-svn: 337286
Nico Weber [Tue, 17 Jul 2018 14:20:02 +0000 (14:20 +0000)]
Remove superfluous ; to fix -Wpedantic warning from gcc
llvm-svn: 337285
Simon Marchi [Tue, 17 Jul 2018 14:13:05 +0000 (14:13 +0000)]
[Tooling] Add operator== to CompileCommand
Summary:
It does the obvious thing of comparing all fields. This will be needed
for a clangd patch I have in the pipeline.
Subscribers: dblaikie, ilya-biryukov, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D49265
llvm-svn: 337284
Florian Hahn [Tue, 17 Jul 2018 14:04:59 +0000 (14:04 +0000)]
[IPSCCP] Run Solve each time we resolved an undef in a function.
Once we resolved an undef in a function we can run Solve, which could
lead to finding a constant return value for the function, which in turn
could turn undefs into constants in other functions that call it, before
resolving undefs there.
Computationally the amount of work we are doing stays the same, just the
order we process things is slightly different and potentially there are
a few less undefs to resolve.
We are still relying on the order of functions in the IR, which means
depending on the order, we are able to resolve the optimal undef first
or not. For example, if @test1 comes before @testf, we find the constant
return value of @testf too late and we cannot use it while solving
@test1.
This on its own does not lead to more constants removed in the
test-suite, probably because currently we have to be very lucky to visit
applicable functions in the right order.
Maybe we manage to come up with a better way of resolving undefs in more
'profitable' functions first.
Reviewers: efriedma, mssimpso, davide
Reviewed By: efriedma, davide
Differential Revision: https://reviews.llvm.org/D49385
llvm-svn: 337283
Sander de Smalen [Tue, 17 Jul 2018 13:58:46 +0000 (13:58 +0000)]
[AArch64][SVE] Asm: FP fused multiply-add/subtract instructions.
This patch adds support for the following instructions:
FMLA mul-add, writing addend (Zda = Zda + Zn * Zm)
FNMLA negated mul-add, writing addend (Zda = -Zda + -Zn * Zm)
FMLS mul-sub, writing addend (Zda = Zda + -Zn * Zm)
FNMLS negated mul-sub, writing addend (Zda = -Zda + Zn * Zm)
FMAD mul-add, writing multiplicant (Zdn = Za + Zdn * Zm)
FNMAD negated mul-add, writing multiplicant (Zdn = -Za + -Zdn * Zm)
FMSB mul-sub, writing multiplicant (Zdn = Za + -Zdn * Zm)
FNMSB negated mul-sub, writing multiplicant (Zdn = -Za + Zdn * Zm)
llvm-svn: 337282
George Rimar [Tue, 17 Jul 2018 13:56:23 +0000 (13:56 +0000)]
[ELF] - Remove dead code from EhFrameSection::addCie. NFC.
Code was dead because caller of the addCie() already
checks that ID is equal to 0:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L431
llvm-svn: 337281
Simon Pilgrim [Tue, 17 Jul 2018 13:43:33 +0000 (13:43 +0000)]
[SLPVectorizer] Don't attempt horizontal reduction on pointer types (PR38191)
TTI::getMinMaxReductionCost typically can't handle pointer types - until this is changed its better to limit horizontal reduction to integer/float vector types only.
llvm-svn: 337280
Benjamin Kramer [Tue, 17 Jul 2018 13:17:01 +0000 (13:17 +0000)]
Revert "[Sema] Reword warning for constant captures that are not required"
This reverts commit r337152. This applies to non-constants too. The real
explanation is that the capture is not ODR-used, but putting that into
the warning message seems ... worse.
llvm-svn: 337278
Joerg Sonnenberger [Tue, 17 Jul 2018 13:13:34 +0000 (13:13 +0000)]
Always use __mcount on NetBSD. Some platforms don't provide _mcount.
llvm-svn: 337277
George Rimar [Tue, 17 Jul 2018 13:13:08 +0000 (13:13 +0000)]
[ELF] - Eliminate dead code. NFC.
Code was dead because at the moment of BssSection creation
it can never have a parent. Also, code simply does not
make sence as alignment adjastment happens when
BssSection is added to its parent later.
llvm-svn: 337276
Gabor Marton [Tue, 17 Jul 2018 12:39:27 +0000 (12:39 +0000)]
[ASTImporter] Fix poisonous structural equivalence cache
Summary:
Implementation functions call into the member functions of
ASTStructuralEquivalence, thus they can falsely alter the DeclsToCheck state
(they add decls). This results that some leaf declarations can be stated as
inequivalent as a side effect of one inequivalent element in the DeclsToCheck
list. And since we store the non-equivalencies, any (otherwise independent)
decls will be rendered as non-equivalent. Solution: I tried to clearly
separate the implementation functions (the static ones) and the public
interface. From now on, the implementation functions do not call any public
member functions, only other implementation functions.
Reviewers: a.sidorin, a_sidorin, r.stahl
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D49300
llvm-svn: 337275
Joerg Sonnenberger [Tue, 17 Jul 2018 12:38:57 +0000 (12:38 +0000)]
For NetBSD, unwind data is emitted by default, so also enable frame
pointer optimisation by default when using optimisation.
llvm-svn: 337274
Tim Renouf [Tue, 17 Jul 2018 12:38:39 +0000 (12:38 +0000)]
More fixes for subreg join failure in RegCoalescer
Summary:
Part of the adjustCopiesBackFrom method wasn't correctly dealing with SubRange
intervals when updating.
2 changes. The first to ensure that bogus SubRange Segments aren't propagated when
encountering Segments of the form [1234r, 1234d:0) when preparing to merge value
numbers. These can be removed in this case.
The second forces a shrinkToUses call if SubRanges end on the copy index
(instead of just the parent register).
V2: Addressed review comments, plus MIR test instead of ll test
Subscribers: MatzeB, qcolombet, nhaehnle
Differential Revision: https://reviews.llvm.org/D40308
Change-Id: I1d2b2b4beea802fce11da01edf71feb2064aab05
llvm-svn: 337273
Sander de Smalen [Tue, 17 Jul 2018 12:36:08 +0000 (12:36 +0000)]
[AArch64][SVE] Asm: Support for predicated FP operations (FP immediate)
This patch completes support for the following floating point
instructions that take FP immediates:
FADD* (addition)
FSUB (subtract)
FSUBR (subtract reverse form)
FMUL* (multiplication)
FMAX* (maximum)
FMAXNM (maximum number)
FMIN (maximum)
FMINNM (maximum number)
All operations are predicated and take a FP immediate operand,
e.g.
fadd z0.h, p0/m, z0.h, #0.5
fmin z0.s, p0/m, z0.s, #1.0
^___________^ (tied)
* Instructions added in a previous patch.
llvm-svn: 337272
Joerg Sonnenberger [Tue, 17 Jul 2018 12:33:19 +0000 (12:33 +0000)]
By popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64
to long for consistency with other 64bit platforms.
llvm-svn: 337271
Chen Zheng [Tue, 17 Jul 2018 12:31:54 +0000 (12:31 +0000)]
[NFC][testcases] add testcases for folding srem whose operands are negatived.
Finish same optimization for add instruction in D49216 and sdiv instruction in
D49382. This patch is for srem instruction.
llvm-svn: 337270
Joerg Sonnenberger [Tue, 17 Jul 2018 12:30:34 +0000 (12:30 +0000)]
Don't assert that a size_t fits into 64bit.
Avoids tautological compare warnings on 32bit platforms.
llvm-svn: 337269
George Rimar [Tue, 17 Jul 2018 12:14:48 +0000 (12:14 +0000)]
[ELF] - Add test for checking unknown -color-diagnostics arguments.
This covers a following line with the test:
https://github.com/llvm-mirror/lld/blob/master/ELF/DriverUtils.cpp#L73
llvm-svn: 337268
Gabor Marton [Tue, 17 Jul 2018 12:06:36 +0000 (12:06 +0000)]
[ASTImporter] Fix import of unnamed structs
Summary:
D48773 simplified ASTImporter nicely, but it introduced a new error: Unnamed
structs are not imported correctly, if they appear in a recursive context.
This patch provides a fix for structural equivalency.
Reviewers: a.sidorin, a_sidorin, balazske, gerazo
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D49296
llvm-svn: 337267
George Rimar [Tue, 17 Jul 2018 12:04:23 +0000 (12:04 +0000)]
[ELF] - Add a test for --no-warn-symbol-ordering.
Mentioned flag was never tested together with
--call-graph-ordering-file. And the following line
was uncovered:
https://github.com/llvm-mirror/lld/blob/master/ELF/Symbols.cpp#L248
llvm-svn: 337266
George Rimar [Tue, 17 Jul 2018 11:35:28 +0000 (11:35 +0000)]
[ELF] - Simplify Symbol::getSize(). NFC.
There are following symbols currently available:
DefinedKind, SharedKind, UndefinedKind, LazyArchiveKind, LazyObjectKind.
Our code calls getSize() only for first two and there
seems to be no reason to return 0 for the rest.
llvm-svn: 337265
whitequark [Tue, 17 Jul 2018 11:13:58 +0000 (11:13 +0000)]
[LLVM-C] Fix name mangling on AggressiveInstCombine
Similarly to rL336736, at least one more C API function does not
properly get declared as extern "C" due to a missing header, causing
name mangling and linking errors.
This patch fixes calls to LLVMAddAggressiveInstCombinerPass().
Differential Revision: https://reviews.llvm.org/D49416
Reviewed By: whitequark
llvm-svn: 337264
whitequark [Tue, 17 Jul 2018 10:57:39 +0000 (10:57 +0000)]
[LLVM-C] Add target triple normalization to the C API.
rL333307 was introduced to remove automatic target triple
normalization when calling sys::getDefaultTargetTriple(), arguing
that users of the latter already called Triple::normalize()
if necessary. However, users of the C API currently have no way of
doing target triple normalization.
This patch introduces an LLVMNormalizeTargetTriple function to
the C API which wraps Triple::normalize() and can be used on
the result of LLVMGetDefaultTargetTriple to achieve the same effect.
Differential Revision: https://reviews.llvm.org/D49414
Reviewed By: whitequark
llvm-svn: 337263
Benjamin Kramer [Tue, 17 Jul 2018 10:30:56 +0000 (10:30 +0000)]
[llvm-objcopy] Run not with any python, but the python configured in lit.
llvm-svn: 337262
Jonas Devlieghere [Tue, 17 Jul 2018 10:04:19 +0000 (10:04 +0000)]
Move pretty stack trace printer into driver.
We used to have a pretty stack trace printer in SystemInitializerCommon.
This was disabled on Apple because we didn't want the library to be
setting signal handlers, as this was causing issues when loaded into
Xcode. However, I think it's useful to have this for the LLDB driver, so
I moved it up to use the PrettyStackTraceProgram in the driver's main.
Differential revision: https://reviews.llvm.org/D49377
llvm-svn: 337261
Balazs Keri [Tue, 17 Jul 2018 09:52:41 +0000 (09:52 +0000)]
[ASTImporter] Import described template (if any) of function.
Summary:
When a function is imported, check if it has a described template.
The name lookup is corrected to find the templated entity in this case.
The described template of the function is imported too.
Reviewers: a.sidorin, a_sidorin
Reviewed By: a_sidorin
Subscribers: a_sidorin, martong, cfe-commits
Differential Revision: https://reviews.llvm.org/D49235
llvm-svn: 337260
Sander de Smalen [Tue, 17 Jul 2018 09:48:57 +0000 (09:48 +0000)]
[AArch64][SVE] Asm: Support for predicated FP operations.
This patch adds support for the following floating point
instructions:
FABD (absolute difference)
FADD (addition)
FSUB (subtract)
FSUBR (subtract reverse form)
FDIV (divide)
FDIVR (divide reverse form)
FMAX (maximum)
FMAXNM (maximum number)
FMIN (minimum)
FMINNM (minimum number)
FSCALE (adjust exponent)
FMULX (multiply extended)
All operations are predicated and binary form, e.g.
fadd z0.h, p0/m, z0.h, z1.h
^___________^ (tied)
Supporting 16, 32 and 64-bit FP elements.
llvm-svn: 337259
Simon Pilgrim [Tue, 17 Jul 2018 09:45:35 +0000 (09:45 +0000)]
[DAGCombiner] Call SimplifyDemandedVectorElts from EXTRACT_VECTOR_ELT
If we are only extracting vector elements via EXTRACT_VECTOR_ELT(s) we may be able to use SimplifyDemandedVectorElts to avoid unnecessary vector ops.
Differential Revision: https://reviews.llvm.org/D49262
llvm-svn: 337258
Simon Pilgrim [Tue, 17 Jul 2018 09:39:55 +0000 (09:39 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
llvm-svn: 337257
George Rimar [Tue, 17 Jul 2018 09:37:53 +0000 (09:37 +0000)]
[ELF] - Check we able to report function symbols that encloses a location in error messages.
InputSectionBase::getLocation() have the following block of the code which
is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L238
Patch adds a test to trigger this branch.
llvm-svn: 337256
Florian Hahn [Tue, 17 Jul 2018 09:23:31 +0000 (09:23 +0000)]
Temporarily revert r337226 "Restructure checking for, and warning on, lifetime extension."
This change breaks on ARM because pointers to clang::InitializedEntity are only
4 byte aligned and do not have 3 bits to store values. A possible solution
would be to change the fields in clang::InitializedEntity to enforce a bigger
alignment requirement.
The error message is
llvm/include/llvm/ADT/PointerIntPair.h:132:3: error: static_assert failed "PointerIntPair with integer size too large for pointer"
static_assert(IntBits <= PtrTraits::NumLowBitsAvailable,
include/llvm/ADT/PointerIntPair.h:73:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> >' requested here
Value = Info::updateInt(Info::updatePointer(0, PtrVal),
llvm/include/llvm/ADT/PointerIntPair.h:51:5: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::setPointerAndInt' requested here
setPointerAndInt(PtrVal, IntVal);
^
llvm/tools/clang/lib/Sema/SemaInit.cpp:6237:12: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::PointerIntPair' requested here
return {Entity, LK_Extended};
Full log here:
http://lab.llvm.org:8011/builders/clang-cmake-armv7-global-isel/builds/1330
http://lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/1394
llvm-svn: 337255
George Rimar [Tue, 17 Jul 2018 09:10:16 +0000 (09:10 +0000)]
[ELF] - Fix BB. 'Filecheck' -> 'FileCheck'.
llvm-svn: 337254
Sander de Smalen [Tue, 17 Jul 2018 08:52:45 +0000 (08:52 +0000)]
[AArch64][SVE] Asm: Support for SPLICE instruction.
The SPLICE instruction splices two vectors into one vector using a
predicate. It copies the active elements from the first vector, and
then fills the remaining elements with the low-numbered elements from
the second vector.
The instruction has the following form, e.g.
splice z0.b, p0, z0.b, z1.b
for 8-bit elements. It also supports 16, 32 and
64-bit elements.
llvm-svn: 337253
George Rimar [Tue, 17 Jul 2018 08:42:42 +0000 (08:42 +0000)]
[ELF] - Check we are able to report zlib decompressor errors.
This test case adds a check for the following line of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L194
llvm-svn: 337252
Sander de Smalen [Tue, 17 Jul 2018 08:39:48 +0000 (08:39 +0000)]
[AArch64][SVE] Asm: Support for EXT instruction.
This patch adds an instruction that allows extracting
a vector from a pair of vectors, given an immediate index
that describes the element position to extract from.
The instruction has the following assembly:
ext z0.b, z0.b, z1.b, #imm
where #imm is an immediate between 0 and 255.
llvm-svn: 337251
George Rimar [Tue, 17 Jul 2018 08:04:27 +0000 (08:04 +0000)]
[ELF] - Check we are able to report errors when DW_AT_decl_file is invalid.
We did not try to support this intentionally but have
an error handling and reporting logic that can take care
of that and hence needs a test.
llvm-svn: 337250
Roman Lebedev [Tue, 17 Jul 2018 07:12:08 +0000 (07:12 +0000)]
Harden/relax clang/test/CodeGen/opt-record-MIR.c test
Summary:
If the build path is short, `Line` field can end up fitting on the same line as `File`,
but the `{{.*}}` would consume it. Keeping in mind rL293149, i think we can fix it,
while keeping it working when there are and there are not any quotations.
At least this fixes this test for me.
Reviewers: anemet, aaron.ballman, hfinkel
Reviewed By: anemet
Subscribers: cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D49348
llvm-svn: 337249
Tobias Grosser [Tue, 17 Jul 2018 07:08:06 +0000 (07:08 +0000)]
[DependenceInfo] Use isl++ to replace foreach_set with for loop
llvm-svn: 337248
Tobias Grosser [Tue, 17 Jul 2018 07:08:01 +0000 (07:08 +0000)]
[IslNodeBuilder] Use isl++ to replace foreach_set with for loop
llvm-svn: 337247
Tobias Grosser [Tue, 17 Jul 2018 06:41:20 +0000 (06:41 +0000)]
[ScopInfo] Replace isl foreach calls with for loops
llvm-svn: 337246
Tobias Grosser [Tue, 17 Jul 2018 06:33:41 +0000 (06:33 +0000)]
[ZoneAlgo] Replace isl foreach calls with for loops
llvm-svn: 337245
Tobias Grosser [Tue, 17 Jul 2018 06:33:37 +0000 (06:33 +0000)]
[FlattenSchedule] Replace isl foreach calls with for loops
llvm-svn: 337244
Tobias Grosser [Tue, 17 Jul 2018 06:33:34 +0000 (06:33 +0000)]
[MaximalStaticExpansion] Replace isl foreach calls with for loops
llvm-svn: 337243
Tobias Grosser [Tue, 17 Jul 2018 06:33:31 +0000 (06:33 +0000)]
[ForwardOpTree] Replace isl foreach calls with for loops
llvm-svn: 337242
Tobias Grosser [Tue, 17 Jul 2018 06:33:26 +0000 (06:33 +0000)]
[Simplify] Replace isl foreach calls with for loops
llvm-svn: 337241
Craig Topper [Tue, 17 Jul 2018 06:24:16 +0000 (06:24 +0000)]
[X86] Properly qualify some MOVSS/MOVSD patterns with OptSize.
These are integer versions of patterns that I already fixed for floating point.
llvm-svn: 337240
Tobias Grosser [Tue, 17 Jul 2018 06:16:58 +0000 (06:16 +0000)]
[FlattenAlgo] Replace more isl foreach calls with for loops
This time we replace for loops where the return isl::stat::error has
been used to carry status information.
There are still two uses of foreach remaining as we do not have a
corresponding for implementation for pw_aff functions.
llvm-svn: 337239
Tobias Grosser [Tue, 17 Jul 2018 06:11:53 +0000 (06:11 +0000)]
[FlattenAlgo] Replace some isl foreach calls with for loops
Replace foreach calls which only return 'ok' with for loops.
llvm-svn: 337238
Tobias Grosser [Tue, 17 Jul 2018 06:08:04 +0000 (06:08 +0000)]
[unittest/DeLICM] Replace isl foreach calls with for loops
llvm-svn: 337237
Daniel Cederman [Tue, 17 Jul 2018 05:49:33 +0000 (05:49 +0000)]
[Sparc] Do not depend on icc for ta 1
The ta instruction will always trap, regardless of the value
of the integer condition codes. TRAPri is marked as using icc,
so we cannot use a pattern for TRAPri to implement ta 1, as
verify-machineinstrs can complain that icc is not defined.
Instead we implement ta 1 the same way as ta 5.
llvm-svn: 337236
Eric Fiselier [Tue, 17 Jul 2018 05:48:48 +0000 (05:48 +0000)]
Address "always inline function is not always inlinable" warning with GCC.
When an always_inline function is used prior to the functions definition,
the compiler may not be able to inline it as requested by the attribute.
GCC flags the `basic_string(CharT const*)` function as one such example.
This patch supresses the warning, and the problem, by moving the
definition of the string constructor to the inline declaration.
This ensures the body is available when it is first ODR used.
llvm-svn: 337235
Craig Topper [Tue, 17 Jul 2018 05:48:48 +0000 (05:48 +0000)]
[X86] Add full set of patterns for turning ceil/floor/trunc/rint/nearbyint into rndscale with loads, broadcast, and masking.
This amounts to pretty ridiculous number of patterns. Ideally we'd canonicalize the X86ISD::VRNDSCALE earlier to reuse those patterns. I briefly looked into doing that, but some strict FP operations could still get converted to rint and nearbyint during isel. It's probably still worthwhile to look into. This patch is meant as a starting point to work from.
llvm-svn: 337234
Craig Topper [Tue, 17 Jul 2018 05:48:46 +0000 (05:48 +0000)]
[X86] Add test cases for selecting floor/ceil/trunc/rint/nearbyint to rndscale with masking, loading, and broadcasting.
llvm-svn: 337233
Jacob Bandes-Storch [Tue, 17 Jul 2018 04:56:22 +0000 (04:56 +0000)]
[Driver] Add -fno-digraphs
Summary: Add a flag `-fno-digraphs` to disable digraphs in the lexer, similar to `-fno-operator-names` which disables alternative names for C++ operators.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: rsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D48266
llvm-svn: 337232
Artem Dergachev [Tue, 17 Jul 2018 01:39:25 +0000 (01:39 +0000)]
[analyzer] Fix size_t in tests.
Should fix a buildbot. No functional change intended.
llvm-svn: 337231
Chen Zheng [Tue, 17 Jul 2018 01:04:41 +0000 (01:04 +0000)]
[testcases] move testcases to right place - NFC
Differential Revision: https://reviews.llvm.org/D49409
llvm-svn: 337230
Artem Dergachev [Tue, 17 Jul 2018 00:57:57 +0000 (00:57 +0000)]
[CFG] [analyzer] Allow elidable copies to have more than one arguments.
Copy-constructors and move-constructors may have default arguments. It is
incorrect to assert that they only have one argument, i.e. the reference to the
object being copied or moved. Remove the assertion.
Differential Revision: https://reviews.llvm.org/D49215
llvm-svn: 337229
Artem Dergachev [Tue, 17 Jul 2018 00:42:35 +0000 (00:42 +0000)]
[analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.
The canonical representation of pointer &SymRegion{$x} casted to boolean is
"$x != 0", not "$x". Assertion added in r337227 catches that.
Differential Revision: https://reviews.llvm.org/D48232
llvm-svn: 337228
Artem Dergachev [Tue, 17 Jul 2018 00:22:27 +0000 (00:22 +0000)]
[analyzer] Assert that nonloc::SymbolVal always wraps a non-Loc-type symbol.
In the current SVal hierarchy there are multiple ways of representing certain
values but few are actually used and expected to be seen by the code.
In particular, a value of a symbolic pointer is always represented by a
loc::MemRegionVal that wraps a SymbolicRegion that wraps the pointer symbol
and never by a nonloc::SymbolVal that wraps that symbol directly.
Assert the aforementioned fact. Fix one minor violation of it.
Differential Revision: https://reviews.llvm.org/D48205
llvm-svn: 337227
Richard Smith [Tue, 17 Jul 2018 00:11:41 +0000 (00:11 +0000)]
Restructure checking for, and warning on, lifetime extension.
This change implements C++ DR1696, which makes initialization of a
reference member of a class from a temporary object ill-formed. The
standard wording here is imprecise, but we interpret it as meaning that
any time a mem-initializer would result in lifetime extension, the
program is ill-formed.
llvm-svn: 337226
Matt Davis [Mon, 16 Jul 2018 23:50:53 +0000 (23:50 +0000)]
[llvm-mca][docs] Add notes about cycle and resource callbacks. NFC.
llvm-svn: 337225
Matt Morehouse [Mon, 16 Jul 2018 23:22:54 +0000 (23:22 +0000)]
[libFuzzer] Avoid STL in MSan test.
Summary:
STL can cause MSan false positives if lib[std]c++ isn't instrumented
with MSan.
Reviewers: kcc
Reviewed By: kcc
Subscribers: Dor1s, llvm-commits
Differential Revision: https://reviews.llvm.org/D49404
llvm-svn: 337224
Craig Topper [Mon, 16 Jul 2018 23:10:58 +0000 (23:10 +0000)]
[X86] Add a missing FMA3 scalar intrinsic pattern.
This allows us to use 231 form to fold an insertelement on the add input to the fma. There is technically no software intrinsic that can use this until AVX512F, but it can be manually built up from other intrinsics.
llvm-svn: 337223
Sam Clegg [Mon, 16 Jul 2018 23:09:29 +0000 (23:09 +0000)]
[WebAssembly] Remove ELF file support.
This support was partial and temporary. Now that we have
wasm object file support its no longer needed.
Differential Revision: https://reviews.llvm.org/D48744
llvm-svn: 337222
Sanjay Patel [Mon, 16 Jul 2018 22:59:31 +0000 (22:59 +0000)]
[Intrinsics] define funnel shift IR intrinsics + DAG builder support
As discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2018-May/123292.html
http://lists.llvm.org/pipermail/llvm-dev/2018-July/124400.html
We want to add rotate intrinsics because the IR expansion of that pattern is 4+ instructions,
and we can lose pieces of the pattern before it gets to the backend. Generalizing the operation
by allowing 2 different input values (plus the 3rd shift/rotate amount) gives us a "funnel shift"
operation which may also be a single hardware instruction.
Initially, I thought we needed to define new DAG nodes for these ops, and I spent time working
on that (much larger patch), but then I concluded that we don't need it. At least as a first
step, we have all of the backend support necessary to match these ops...because it was required.
And shepherding these through the IR optimizer is the primary concern, so the IR intrinsics are
likely all that we'll ever need.
There was also a question about converting the intrinsics to the existing ROTL/ROTR DAG nodes
(along with improving the oversized shift documentation). Again, I don't think that's strictly
necessary (as the test results here prove). That can be an efficiency improvement as a small
follow-up patch.
So all we're left with is documentation, definition of the IR intrinsics, and DAG builder support.
Differential Revision: https://reviews.llvm.org/D49242
llvm-svn: 337221
Puyan Lotfi [Mon, 16 Jul 2018 22:17:05 +0000 (22:17 +0000)]
[NFC][llvm-objcopy] Make helper functions static
Anywhere in tools/llvm-objcopy where functions or classes are not referenced
outside of a given file, we change things to make the function or class static
or put inside an anonymous namespace.
llvm-svn: 337220
Matt Davis [Mon, 16 Jul 2018 21:42:58 +0000 (21:42 +0000)]
[llvm-mca][docs] Initial description of mca internals. NFC
This patch introduces a brief description of the components of MCA. The main
focus is on Views. This is a work in progress, and more descriptions will be
introduced later. I want to flesh-out the Views section more and provide a
detailed description of eventing in MCA. Eventually a brief code example of a
View should accompany the description.
Also, we should consider moving the MCA internals guide elsewhere at some point.
llvm-svn: 337219
Zachary Turner [Mon, 16 Jul 2018 21:34:25 +0000 (21:34 +0000)]
Add missing includes.
llvm-svn: 337218
Zachary Turner [Mon, 16 Jul 2018 21:24:03 +0000 (21:24 +0000)]
[LLVMDemangle] Move some utility classes to header files.
In a followup I'm looking to add a Microsoft demangler. Doing
so needs a lot of the same utility classes and feature test
macros which are already implemented in ItaniumDemangle.cpp.
So move all of these things into header files so that they
can be re-used by a new demangler.
Differential Revision: https://reviews.llvm.org/D49399
llvm-svn: 337217
Reka Kovacs [Mon, 16 Jul 2018 20:47:45 +0000 (20:47 +0000)]
[analyzer] Make checkEndFunction() give access to the return statement.
Differential Revision: https://reviews.llvm.org/D49387
llvm-svn: 337215
George Karpenkov [Mon, 16 Jul 2018 20:42:37 +0000 (20:42 +0000)]
[ASTMatchers] Quickfix for tests.
llvm-svn: 337214
George Karpenkov [Mon, 16 Jul 2018 20:33:25 +0000 (20:33 +0000)]
[analyzer] Bugfix for an overly eager suppression for null pointer return from macros.
Only suppress those cases where the null which came from the macro is
relevant to the bug, and was not overwritten in between.
rdar://
41497323
Differential Revision: https://reviews.llvm.org/D48856
llvm-svn: 337213
George Karpenkov [Mon, 16 Jul 2018 20:32:57 +0000 (20:32 +0000)]
[analyzer] Fix GCDAntipatternChecker to only fire when the semaphore is initialized to zero
Initializing a semaphore with a different constant most likely signals a different intent
rdar://
41802552
Differential Revision: https://reviews.llvm.org/D48911
llvm-svn: 337212
George Karpenkov [Mon, 16 Jul 2018 20:32:32 +0000 (20:32 +0000)]
[analyzer] Provide a symmetric method for generating a PathDiagnosticLocation from Decl
Differential Revision: https://reviews.llvm.org/D49166
llvm-svn: 337211
Yunlian Jiang [Mon, 16 Jul 2018 20:28:48 +0000 (20:28 +0000)]
remove temporal file directory before testing in thinlto-debug-fission.ll
Summary:
This removes the %T/dwo directory before calling ld.lld in ELF/lto/thinlto-debug-fission.ll so that
files aren't left over from previous runs.
Reviewers: espindola, pcc
Reviewed By: pcc
Subscribers: inglorion, emaste, arichardson, eraman, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D49390
llvm-svn: 337210
George Karpenkov [Mon, 16 Jul 2018 20:22:12 +0000 (20:22 +0000)]
[ASTMatchers] Introduce Objective-C matchers `hasReceiver` and `isInstanceMessage` for ObjCMessageExpr
Differential Revision: https://reviews.llvm.org/D49333
llvm-svn: 337209
Roman Lebedev [Mon, 16 Jul 2018 20:10:46 +0000 (20:10 +0000)]
[NFC][InstCombine] Fine-tune 'check for [no] signed truncation' tests
We are using i8 for these tests, and shifting by 4,
which is exactly the half of i8.
But as it is seen from the proofs https://rise4fun.com/Alive/mgu
KeptBits = bitwidth(%x) - MaskedBits,
so with using shifts by 4, we are not really testing that
we actually properly handle the other cases with shifts not by half...
llvm-svn: 337208
Alexey Bataev [Mon, 16 Jul 2018 20:05:25 +0000 (20:05 +0000)]
[OPENMP] Fix checks for declare target link entries.
If the declare target link entries are created but not used, the
compiler will produce an error message. Patch improves handling of such
situations + improves checks for possibly lost declare target variables.
llvm-svn: 337207
Max Moroz [Mon, 16 Jul 2018 20:05:18 +0000 (20:05 +0000)]
Revert r337194 (https://reviews.llvm.org/D48891) due to compilation errors.
llvm-svn: 337206
Eric Fiselier [Mon, 16 Jul 2018 20:01:59 +0000 (20:01 +0000)]
Fix PR38160 - init_priority attribute not supported by GCC on Apple.
This patch guards the use of __attribute__((init_priority(101)))
within memory_resource.cpp when building with compilers that don't
support it. Specifically GCC on Apple platforms, and MSVC.
llvm-svn: 337205
Jake Ehrlich [Mon, 16 Jul 2018 19:48:52 +0000 (19:48 +0000)]
[llvm-objcopy] Add support for large indexes
This patch is an update of an older patch that never landed
(see here: https://reviews.llvm.org/D42516)
Recently various users have run into this issue and it just 100%
has to be solved at this point. The main difference in this patch
is that I use gunzip instead of unzip which should hopefully allow
tests to pass. Please review this as if it is a new patch however.
I found some issues along the way and made some minor modifications.
The binary used in this patch for testing (a zip file to make it small)
can be found here:
https://drive.google.com/file/d/1UjsnTO9edLttZibbr-2T1bJl92KEQFAO/view?usp=sharing
Differential Revision: https://reviews.llvm.org/D49206
llvm-svn: 337204
Alex Lorenz [Mon, 16 Jul 2018 19:41:49 +0000 (19:41 +0000)]
[cmake][libFuzzer] fixup r337193 to ensure msan/dfsan are not added
to test deps for libfuzzer when they're not supported by the platform
llvm-svn: 337203