Gabor Buella [Wed, 4 Jul 2018 11:21:44 +0000 (11:21 +0000)]
NFC - Fix typo in test/Layout/itanium-pack-and-align.cpp
llvm-svn: 336262
Eric Fiselier [Wed, 4 Jul 2018 11:14:18 +0000 (11:14 +0000)]
Add missing include for size_t
llvm-svn: 336261
Eric Liu [Wed, 4 Jul 2018 10:39:48 +0000 (10:39 +0000)]
[clangd] only ignore collected symbols if TU has uncompilable errors.
llvm-svn: 336260
George Rimar [Wed, 4 Jul 2018 10:38:12 +0000 (10:38 +0000)]
[ELF] - Add a test case for relocation pointing to deduplicated COMDAT.
ELF spec doesn't allow a relocation to point to a deduplicated
COMDAT section. Unfortunately this happens in practice (e.g. .eh_frame)
We have a code in MarkLive.cpp for that and it was uncovered by any test case:
https://github.com/llvm-mirror/lld/blob/master/ELF/MarkLive.cpp#L199
Patch adds a test.
llvm-svn: 336259
Max Kazantsev [Wed, 4 Jul 2018 10:32:02 +0000 (10:32 +0000)]
[NFC] Add test that shows that InstCombine can do better
llvm-svn: 336258
Kirill Bobyrev [Wed, 4 Jul 2018 10:18:03 +0000 (10:18 +0000)]
[clang-tools-extra] Cleanup documentation routine
The following issues are resolved:
* Doxygen didn't generate documentation for a bunch of existing tools
due to the absence of their directories in the doxygen configuration
file. This patch adds all relevant directories to the appropriate list.
* clang-tools-extra/docs/Doxyfile seems to be unused and irrelevant,
doxygen.cfg.in is passed to the CMake's Doxygen invocation, hence
Doxyfile is removed.
The validity of proposed changes was manually checked by building
doxygen-clang-tools and making sure that clangd and other tools are
present in Doxygen-generated docs of clang-tools-extra.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D47537
llvm-svn: 336257
Anastasis Grammenos [Wed, 4 Jul 2018 10:16:55 +0000 (10:16 +0000)]
[DebugInfo][LoopVectorize] Preserve DL in generated phi instruction
When creating `phi` instructions to resume at the scalar part of the loop,
copy the DebugLoc from the original phi over to the new one.
Differential Revision: https://reviews.llvm.org/D48769
llvm-svn: 336256
Eric Liu [Wed, 4 Jul 2018 10:01:18 +0000 (10:01 +0000)]
[SemaCodeComplete] Make sure visited contexts are passed to completion results handler.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48917
llvm-svn: 336255
Anastasis Grammenos [Wed, 4 Jul 2018 09:55:46 +0000 (09:55 +0000)]
[DebugInfo][InstCombine] Preserve DI after combining zext
When zext is EvaluatedInDifferentType, InstCombine
drops the dbg.value intrinsic. This patch tries to
preserve said DI, by inserting the zext's old DI in the
resulting instruction. (Only for integer type for now)
Differential Revision: https://reviews.llvm.org/D48331
llvm-svn: 336254
Eric Liu [Wed, 4 Jul 2018 09:54:23 +0000 (09:54 +0000)]
[clangd] Cleanup unittest: URIs. NFC.
llvm-svn: 336253
Eric Liu [Wed, 4 Jul 2018 09:43:35 +0000 (09:43 +0000)]
[clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.
Summary:
For example, template parameter might not be resolved in a broken TU,
which can result in wrong USR/SymbolID.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D48881
llvm-svn: 336252
Siddharth Bhat [Wed, 4 Jul 2018 09:40:55 +0000 (09:40 +0000)]
[Polly-ACC] Add isl_space.h to gpu_tree.c
Summary:
This patch adds <isl_space.h> to gpu_tree.c. This prevents a segfault
when allocating a new isl_space in the function create_sync_domain(), as
the compiler now knows that the return type is a pointer instead of
assuming the function returns an int.
This has been updated in upstream PPCG, so we should bump up our PPCG
version.
Initially discovered by Philip Pfaffe in Polly.
Reviewers: grosser, bollu, philip.pfaffe
Reviewed By: bollu
Subscribers: nemanjai, kbarton, llvm-commits
Differential Revision: https://reviews.llvm.org/D48883
Contributed-by: Alain Denzler <alaindenzler@gmail.com>
llvm-svn: 336251
Simon Pilgrim [Wed, 4 Jul 2018 09:12:48 +0000 (09:12 +0000)]
[X86][SSE] Blend any v8i16/v4i32 shift with 2 shift unique values (REAPPLIED)
We were only doing this for basic blends, despite shuffle lowering now being good enough to handle more complex blends. This means that the two v8i16 splat shifts are performed in parallel instead of serially as the general shift case.
Reapplied with a fixed (extra null tests) version of rL336113 after reversion in rL336189 - extra test case added at rL336247.
llvm-svn: 336250
Eric Liu [Wed, 4 Jul 2018 09:08:40 +0000 (09:08 +0000)]
Try to fix FileDistance test on windows.
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11510/steps/ninja%20check%201/logs/FAIL%3A%20Extra%20Tools%20Unit%20Tests%3A%3AFileDistanceTests.URI
llvm-svn: 336249
Sam McCall [Wed, 4 Jul 2018 09:01:04 +0000 (09:01 +0000)]
[clangd] FileDistance: temporarily disable in CodeComplete, it's behaving badly
llvm-svn: 336248
Simon Pilgrim [Wed, 4 Jul 2018 08:55:23 +0000 (08:55 +0000)]
[X86][SSE] Add reduced crash test case for r336113 - [X86][SSE] Blend any v8i16/v4i32 shift with 2 shift unique values
The patch was reverted at r336189 due to crashes
llvm-svn: 336247
Sam McCall [Wed, 4 Jul 2018 08:52:13 +0000 (08:52 +0000)]
[clangd] FileDistance: missing constexpr
llvm-svn: 336246
Sander de Smalen [Wed, 4 Jul 2018 08:50:49 +0000 (08:50 +0000)]
[AArch64][SVE] Asm: Support for SVE condition code aliases
SVE overloads the AArch64 PSTATE condition flags and introduces
a set of condition code aliases for the assembler. The
details are described in section 2.2 of the architecture
reference manual supplement for SVE.
In short:
SVE alias => AArch64 name
--------------------------
NONE => EQ
ANY => NE
NLAST => HS
LAST => LO
FIRST => MI
NFRST => PL
PMORE => HI
PLAST => LS
TCONT => GE
TSTOP => LT
Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D48869
llvm-svn: 336245
Ilya Biryukov [Wed, 4 Jul 2018 08:50:12 +0000 (08:50 +0000)]
[Sema] Fix crash in getConstructorName.
Summary:
Can happen when getConstructorName is called on invalid decls,
specifically the ones that do not have the injected class name.
Reviewers: bkramer, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48880
llvm-svn: 336244
Gabor Buella [Wed, 4 Jul 2018 08:32:02 +0000 (08:32 +0000)]
NFC - typo fix in test/CodeGen/avx512f-builtins.c
llvm-svn: 336243
Sam McCall [Wed, 4 Jul 2018 08:27:28 +0000 (08:27 +0000)]
[clangd] FileDistance: don't add duplicate edges
llvm-svn: 336242
Max Kazantsev [Wed, 4 Jul 2018 08:01:26 +0000 (08:01 +0000)]
[ImplicitNullChecks] Check for rewrite of register used in 'test' instruction
The following code pattern:
mov %rax, %rcx
test %rax, %rax
%rax = ....
je throw_npe
mov(%rcx), %r9
mov(%rax), %r10
gets transformed into the following incorrect code after implicit null check pass:
mov %rax, %rcx
%rax = ....
faulting_load_op("movl (%rax), %r10", throw_npe)
mov(%rcx), %r9
For implicit null check pass, if the register that is checked for null value (ie, the register used in the 'test' instruction) is written into before the condition jump, we should avoid doing the optimization.
Patch by Surya Kumari Jangala!
Differential Revision: https://reviews.llvm.org/D48627
Reviewed By: skatkov
llvm-svn: 336241
Richard Smith [Wed, 4 Jul 2018 02:25:38 +0000 (02:25 +0000)]
PR33924: merge local declarations that have linkage of some kind within
merged function definitions; also merge functions with deduced return
types.
This seems like two independent fixes, but unfortunately they are hard
to separate because it's challenging to reliably test either one of them
without also testing the other.
A complication arises with deduced return type support: we need the type
of the function in order to know how to merge it, but we can't load the
actual type of the function because it might reference an entity
declared within the function (and we need to have already merged the
function to correctly merge that entity, which we would need to do to
determine if the function types match). So we instead compare the
declared function type when merging functions, and defer loading the
actual type of a function with a deduced type until we've finished
loading and merging the function.
This reverts r336175, reinstating r336021, with one change (for PR38015):
we look at the TypeSourceInfo of the first-so-far declaration of each
function when considering whether to merge two functions. This works
around a problem where the calling convention in the TypeSourceInfo for
subsequent redeclarations may not match if it was implicitly adjusted.
llvm-svn: 336240
Michael Kruse [Wed, 4 Jul 2018 01:37:11 +0000 (01:37 +0000)]
[Sema] Consider all format_arg attributes.
If a function has multiple format_arg attributes, clang only considers
the first it finds (because AttributeLists are in reverse order, not
necessarily the textually first) and ignores all others.
Loop over all FormatArgAttr to print warnings for all declared
format_arg attributes.
For instance, libintl's ngettext (select plural or singular version of
format string) has two __format_arg__ attributes.
Differential Revision: https://reviews.llvm.org/D48734
llvm-svn: 336239
George Karpenkov [Wed, 4 Jul 2018 00:37:45 +0000 (00:37 +0000)]
[libFuzzer] [NFC] Inline static variable to avoid the linker warning.
Differential Revision: https://reviews.llvm.org/D48650
llvm-svn: 336238
Fangrui Song [Tue, 3 Jul 2018 23:31:19 +0000 (23:31 +0000)]
[Support] Remove SaveOr which is no longer used
llvm-svn: 336237
Jacques Pienaar [Tue, 3 Jul 2018 22:57:51 +0000 (22:57 +0000)]
[lanai] Handle atomic load of i8 like regular load.
Loads and stores less than 64-bits are already atomic, this adds support for a special case thereof. This needs to be expanded.
llvm-svn: 336236
Alexander Polyakov [Tue, 3 Jul 2018 22:51:01 +0000 (22:51 +0000)]
Ammend "Fix MSVC2015 compilation failure after r336206 patch".
llvm-svn: 336235
Kostya Serebryany [Tue, 3 Jul 2018 22:33:09 +0000 (22:33 +0000)]
[libFuzzer] add one more value profile metric, under a flag (experimental)
llvm-svn: 336234
Erik Pilkington [Tue, 3 Jul 2018 22:15:36 +0000 (22:15 +0000)]
[Sema] Discarded statment should be an evaluatable context.
The constexpr evaluator was erroring out because these templates weren't
defined. Despite being used in a discarded statement, we still need to constexpr
evaluate them, which means that we need to instantiate them. Fixes PR37585.
Differential revision: https://reviews.llvm.org/D48322
llvm-svn: 336233
Fangrui Song [Tue, 3 Jul 2018 21:40:03 +0000 (21:40 +0000)]
[X86][AsmParser] Fix inconsistent declaration parameter name in r336218
llvm-svn: 336232
Richard Smith [Tue, 3 Jul 2018 21:34:13 +0000 (21:34 +0000)]
Factor out Clang's desired 8MB stack size constant from the various
places we hardcode it.
llvm-svn: 336231
Kostya Serebryany [Tue, 3 Jul 2018 21:22:44 +0000 (21:22 +0000)]
[libFuzzer] remove stale code, as suggested in https://reviews.llvm.org/D48800
llvm-svn: 336230
Kostya Serebryany [Tue, 3 Jul 2018 21:17:55 +0000 (21:17 +0000)]
[libFuzzer] add a tiny and surprisingly hard puzzle
llvm-svn: 336229
Benjamin Kramer [Tue, 3 Jul 2018 20:59:33 +0000 (20:59 +0000)]
[clangd] Replace UniqueFunction with llvm::unique_function.
One implementation of this ought to be enough for everyone.
llvm-svn: 336228
Benjamin Kramer [Tue, 3 Jul 2018 20:40:04 +0000 (20:40 +0000)]
[NVPTX] Expand v2f16 INSERT_VECTOR_ELT
Vectorization can create them.
llvm-svn: 336227
Craig Topper [Tue, 3 Jul 2018 20:39:55 +0000 (20:39 +0000)]
[X86] Remove repeated 'the' from multiple comments that have been copy and pasted. NFC
llvm-svn: 336226
Erich Keane [Tue, 3 Jul 2018 20:30:34 +0000 (20:30 +0000)]
Fix allocation of Nullability attribute.
Existing code always allocates for on the declarator's attribute pool,
but sometimes adds it to the declspec. This patch ensures that the
correct pool is used.
Discovered while testing: https://reviews.llvm.org/D48788
llvm-svn: 336225
Roman Lebedev [Tue, 3 Jul 2018 19:12:37 +0000 (19:12 +0000)]
[X86] Add tests for low/high bit clearing with different attributes.
D48768 may turn some of these into shifts.
Reviewers: spatel
Reviewed By: spatel
Subscribers: spatel, RKSimon, llvm-commits, craig.topper
Differential Revision: https://reviews.llvm.org/D48767
llvm-svn: 336224
Fangrui Song [Tue, 3 Jul 2018 19:12:27 +0000 (19:12 +0000)]
[ARM] Fix inconsistent declaration parameter name in r336195
llvm-svn: 336223
Fangrui Song [Tue, 3 Jul 2018 19:07:53 +0000 (19:07 +0000)]
[AArch64] Make function parameter names in declarations match those of definitions
llvm-svn: 336222
Kostya Kortchinsky [Tue, 3 Jul 2018 19:03:46 +0000 (19:03 +0000)]
[scudo] Get rid of builtin-declaration-mismatch warnings
Summary:
The C interceptors were using `SIZE_T` defined in the interception library as
a `__sanitizer::uptr`. On some 32-bit platforms, this lead to the following
warning:
```
warning: declaration of ‘void* malloc(SIZE_T)’ conflicts with built-in declaration ‘void* malloc(unsigned int)’ [-Wbuiltin-declaration-mismatch]
INTERCEPTOR_ATTRIBUTE void *malloc(SIZE_T size) {
```
`__sanitizer::uptr` is indeed defined as an `unsigned long` on those.
So just include `stddef.h` and use `size_t` instead.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D48885
llvm-svn: 336221
Sanjay Patel [Tue, 3 Jul 2018 18:43:46 +0000 (18:43 +0000)]
[InstCombine] add tests for shuffle+binop with constant op1; NFC
This adds coverage for a planned enhancement for ConstantExpr::getBinOpIdentity() noted in D48830.
llvm-svn: 336220
Zachary Turner [Tue, 3 Jul 2018 18:12:39 +0000 (18:12 +0000)]
Fix crash in clang.
This happened during a recent refactor. toStringRefArray() returns
a vector<StringRef>, which was being implicitly converted to an
ArrayRef<StringRef>, and then the vector was immediately being
destroyed, so the ArrayRef<> was losing its backing storage.
Fix this by making sure the vector gets permanent storage.
llvm-svn: 336219
Craig Topper [Tue, 3 Jul 2018 18:07:30 +0000 (18:07 +0000)]
[X86][AsmParser] Rework the in/out (%dx) hack one more time.
This patch adds a new token type specifically for (%dx). We will now always create this token when we parse (%dx). After all operands have been parsed, if the mnemonic is in/out we'll morph this token to a regular register token. Otherwise we keep it as the special DX token which won't match any instructions.
This removes the need for passing Mnemonic through the parsing functions. It also seems closer to gas where when its used on the wrong instruction it just gets diagnosed as an invalid operand rather than a bad memory address.
llvm-svn: 336218
Craig Topper [Tue, 3 Jul 2018 17:40:51 +0000 (17:40 +0000)]
[X86][AsmParser] Don't consider %eip as a valid register outside of 32-bit mode.
This might make the error message added in r335668 unneeded, but I'm not sure yet.
The check for RIP is technically unnecessary since RIP is in GR64, but that fact is kind of surprising so be explicit.
llvm-svn: 336217
Vladimir Stefanovic [Tue, 3 Jul 2018 17:26:43 +0000 (17:26 +0000)]
Fix typo in lib/Support/Path.cpp to test commit access
llvm-svn: 336216
Sanjay Patel [Tue, 3 Jul 2018 17:12:59 +0000 (17:12 +0000)]
[Constants] add identity constants for fadd/fmul
As the test diffs show, the current users of getBinOpIdentity()
are InstCombine and Reassociate. SLP vectorizer is a candidate
for using this functionality too (D28907).
The InstCombine shuffle improvements are part of the planned
enhancements noted in D48830.
InstCombine actually has several other uses of getBinOpIdentity()
via SimplifyUsingDistributiveLaws(), but we don't call that for
any FP ops. Fixing that might be another part of removing the
custom reassociation in InstCombine that is only done for fadd+fmul.
llvm-svn: 336215
Sanjay Patel [Tue, 3 Jul 2018 16:44:18 +0000 (16:44 +0000)]
[Reassociate] add tests for binop with identity constant; NFC
llvm-svn: 336214
Kostya Kortchinsky [Tue, 3 Jul 2018 16:09:18 +0000 (16:09 +0000)]
[scudo] Enable Scudo on PPC64
Summary:
In conjunction with the clang side change D48833, this will enable Scudo on
PPC64. I tested `check-scudo` on a powerpc64le box and everything passes.
Reviewers: eugenis, alekseyshl
Reviewed By: alekseyshl
Subscribers: mgorny, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D48834
llvm-svn: 336213
Alexander Polyakov [Tue, 3 Jul 2018 16:07:30 +0000 (16:07 +0000)]
Fix MSVC2015 compilation failure after r336206 patch.
Added missing headers.
llvm-svn: 336212
Sanjay Patel [Tue, 3 Jul 2018 16:01:41 +0000 (16:01 +0000)]
[Reassociate] regenerate checks; NFC
llvm-svn: 336211
Sander de Smalen [Tue, 3 Jul 2018 16:01:27 +0000 (16:01 +0000)]
[AArch64][SVE] Asm: Support for FP Complex ADD/MLA.
The variants added in this patch are:
- Predicated Complex floating point ADD with rotate, e.g.
fcadd z0.h, p0/m, z0.h, z1.h, #90
- Predicated Complex floating point MLA with rotate, e.g.
fcmla z0.h, p0/m, z1.h, z2.h, #180
- Unpredicated Complex floating point MLA with rotate (indexed operand), e.g.
fcmla z0.h, p0/m, z1.h, z2.h[0], #180
Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D48824
llvm-svn: 336210
Amara Emerson [Tue, 3 Jul 2018 15:59:26 +0000 (15:59 +0000)]
[AArch64][GlobalISel] Fix fallbacks introduced in r336120 due to unselectable stores.
r336120 resulted in falling back to SelectionDAG more often due to the G_STORE
MMOs not matching the vreg size. This fixes that by explicitly any-extending the
value.
llvm-svn: 336209
Sanjay Patel [Tue, 3 Jul 2018 15:56:04 +0000 (15:56 +0000)]
[Reassociate] add test for missing FP constant analysis; NFC
llvm-svn: 336208
Teresa Johnson [Tue, 3 Jul 2018 15:52:57 +0000 (15:52 +0000)]
Rename lazy initialization functions to reflect behavior (NFC)
Suggested in review for D48698.
llvm-svn: 336207
Alexander Polyakov [Tue, 3 Jul 2018 15:40:20 +0000 (15:40 +0000)]
[lldb-mi] Re-implement symbol-list-lines command.
Summary: Now this command uses SB API instead of HandleCommand.
Reviewers: aprantl, clayborg
Reviewed By: aprantl, clayborg
Subscribers: ki.stfu, eraman, lldb-commits
Differential Revision: https://reviews.llvm.org/D48802
llvm-svn: 336206
Sander de Smalen [Tue, 3 Jul 2018 15:31:04 +0000 (15:31 +0000)]
[AArch64][SVE] Asm: Support for FMUL (indexed)
Unpredicated FP-multiply of SVE vector with a vector-element given by
vector[index], for example:
fmul z0.s, z1.s, z2.s[0]
which performs an unpredicated FP-multiply of all 32-bit elements in
'z1' with the first element from 'z2'.
This patch adds restricted register classes for SVE vectors:
ZPR_3b (only z0..z7 are allowed) - for indexed vector of 16/32-bit elements.
ZPR_4b (only z0..z15 are allowed) - for indexed vector of 64-bit elements.
Reviewers: rengolin, fhahn, SjoerdMeijer, samparker, javed.absar
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D48823
llvm-svn: 336205
Sander de Smalen [Tue, 3 Jul 2018 14:57:48 +0000 (14:57 +0000)]
[AArch64][SVE] Asm: Support for predicated unary operations.
The patch includes support for the following instructions:
ABS z0.h, p0/m, z0.h
NEG z0.h, p0/m, z0.h
(S|U)XTB z0.h, p0/m, z0.h
(S|U)XTB z0.s, p0/m, z0.s
(S|U)XTB z0.d, p0/m, z0.d
(S|U)XTH z0.s, p0/m, z0.s
(S|U)XTH z0.d, p0/m, z0.d
(S|U)XTW z0.d, p0/m, z0.d
llvm-svn: 336204
Eric Liu [Tue, 3 Jul 2018 14:51:23 +0000 (14:51 +0000)]
[clangd] Use default format style and fallback style. NFC
llvm-svn: 336203
Kostya Kortchinsky [Tue, 3 Jul 2018 14:39:29 +0000 (14:39 +0000)]
[Driver] Add PPC64 as supported for Scudo
Summary:
Scudo works on PPC64 as is, so mark the architecture as supported for it. This
will also require a change to config-ix.cmake on the compiler-rt side.
Update the tests accordingly.
Reviewers: eugenis, alekseyshl
Reviewed By: alekseyshl
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48833
llvm-svn: 336202
Simon Atanasyan [Tue, 3 Jul 2018 14:39:27 +0000 (14:39 +0000)]
[ELF][MIPS] Use llvm-mc to generate test case input file. NFC
llvm-svn: 336201
Alexander Polyakov [Tue, 3 Jul 2018 14:22:44 +0000 (14:22 +0000)]
Add new API to SBTarget and SBModule classes.
Summary: The new API allows to find a list of compile units related to target/module.
Reviewers: aprantl, clayborg
Reviewed By: aprantl
Subscribers: jingham, lldb-commits
Differential Revision: https://reviews.llvm.org/D48801
llvm-svn: 336200
George Rimar [Tue, 3 Jul 2018 14:16:19 +0000 (14:16 +0000)]
[ELF] - Add a comment. NFC.
Minor follow up for r336197
"[ELF] - Add support for '||' and '&&' in linker scripts."
llvm-svn: 336199
Simon Pilgrim [Tue, 3 Jul 2018 14:11:32 +0000 (14:11 +0000)]
[DAGCombiner] visitSDIV - Permit MIN_SIGNED_VALUE in pow2 vector codegen
Now that D45806 has landed, we can re-enable support for MIN_SIGNED_VALUE in the sdiv by pow2-constant code
llvm-svn: 336198
George Rimar [Tue, 3 Jul 2018 14:02:52 +0000 (14:02 +0000)]
[ELF] - Add support for '||' and '&&' in linker scripts.
This is https://bugs.llvm.org//show_bug.cgi?id=37976,
we had no support, but seems someone faced it.
llvm-svn: 336197
Sanjay Patel [Tue, 3 Jul 2018 13:44:22 +0000 (13:44 +0000)]
[InstCombine] fold shuffle-with-binop and common value
This is the last significant change suggested in PR37806:
https://bugs.llvm.org/show_bug.cgi?id=37806#c5
...though there are several follow-ups noted in the code comments
in this patch to complete this transform.
It's possible that a binop feeding a select-shuffle has been eliminated
by earlier transforms (or the code was just written like this in the 1st
place), so we'll fail to match the patterns that have 2 binops from:
D48401,
D48678,
D48662,
D48485.
In that case, we can try to materialize identity constants for the remaining
binop to fill in the "ghost" lanes of the vector (where we just want to pass
through the original values of the source operand).
I added comments to ConstantExpr::getBinOpIdentity() to show planned follow-ups.
For now, we only handle the 5 commutative integer binops (add/mul/and/or/xor).
Differential Revision: https://reviews.llvm.org/D48830
llvm-svn: 336196
Sam Parker [Tue, 3 Jul 2018 12:44:16 +0000 (12:44 +0000)]
[ARM][NFC] Refactor sequential access for DSP
With a view to support parallel operations that have their results
stored to memory, refactor the consecutive access helper out so it
could support stores instructions.
Differential Revision: https://reviews.llvm.org/D48872
llvm-svn: 336195
Bjorn Pettersson [Tue, 3 Jul 2018 12:39:52 +0000 (12:39 +0000)]
[IR] Strip trailing whitespace. NFC
llvm-svn: 336194
Sjoerd Meijer [Tue, 3 Jul 2018 12:09:20 +0000 (12:09 +0000)]
[AArch64] Armv8.4-A: system registers
This adds the following system registers:
- RAS registers,
- MPAM registers,
- Activitiy monitor registers,
- Trace Extension registers,
- Timing insensitivity of data processing instructions,
- Enhanced Support for Nested Virtualization.
Differential Revision: https://reviews.llvm.org/D48871
llvm-svn: 336193
Hans Wennborg [Tue, 3 Jul 2018 11:30:01 +0000 (11:30 +0000)]
build_llvm_package.bat: Re-try the build steps
The build on Windows has been extra flaky recently; retrying helps.
llvm-svn: 336192
Bjorn Pettersson [Tue, 3 Jul 2018 11:29:00 +0000 (11:29 +0000)]
[DebugInfo] Corrections for salvageDebugInfo
Summary:
When salvaging a dbg.declare/dbg.addr we should not add
DW_OP_stack_value to the DIExpression
(see test/Transforms/InstCombine/salvage-dbg-declare.ll).
Consider this example
%vla = alloca i32, i64 2
call void @llvm.dbg.declare(metadata i32* %vla, metadata !1, metadata !DIExpression())
Instcombine will turn it into
%vla1 = alloca [2 x i32]
%vla1.sub = getelementptr inbounds [2 x i32], [2 x i32]* %vla, i64 0, i64 0
call void @llvm.dbg.declare(metadata [2 x i32]* %vla1.sub, metadata !19, metadata !DIExpression())
If the GEP can be eliminated, then the dbg.declare will be salvaged
and we should get
%vla1 = alloca [2 x i32]
call void @llvm.dbg.declare(metadata [2 x i32]* %vla1, metadata !19, metadata !DIExpression())
The problem was that salvageDebugInfo did not recognize dbg.declare
as being indirect (%vla1 points to the value, it does not hold the
value), so we incorrectly got
call void @llvm.dbg.declare(metadata [2 x i32]* %vla1, metadata !19, metadata !DIExpression(DW_OP_stack_value))
I also made sure that llvm::salvageDebugInfo and
DIExpression::prependOpcodes do not add DW_OP_stack_value to
the DIExpression in case no new operands are added to the
DIExpression. That way we avoid to, unneccessarily, turn a
register location expression into an implicit location expression
in some situations (see test11 in test/Transforms/LICM/sinking.ll).
Reviewers: aprantl, vsk
Reviewed By: aprantl, vsk
Subscribers: JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D48837
llvm-svn: 336191
Benjamin Kramer [Tue, 3 Jul 2018 11:15:17 +0000 (11:15 +0000)]
Revert "[X86][SSE] Blend any v8i16/v4i32 shift with 2 shift unique values"
This reverts commit r336113. It causes crashes.
llvm-svn: 336189
John Brawn [Tue, 3 Jul 2018 10:52:20 +0000 (10:52 +0000)]
[llvm-exegesis] Adjust AArch64 unit test
The signature of setRegToConstant changed in r336171, so adjust the AArch64
unit test in a similar way to how the X86 unit test was changed in that commit.
llvm-svn: 336188
John Brawn [Tue, 3 Jul 2018 10:10:29 +0000 (10:10 +0000)]
[llvm-exegesis] Add an AArch64 target
The target does just enough to be able to run llvm-exegesis in latency mode for
at least some opcodes.
Differential Revision: https://reviews.llvm.org/D48780
llvm-svn: 336187
Sander de Smalen [Tue, 3 Jul 2018 09:48:22 +0000 (09:48 +0000)]
[AArch64][SVE] Asm: Support for saturing ADD/SUB instructions.
The variants added are:
signed Saturating ADD/SUB (immediate) e.g. sqadd z0.h, z0.h, #42
unsigned Saturating ADD/SUB (immediate) e.g. uqadd z0.h, z0.h, #42
signed Saturating ADD/SUB (vectors) e.g. sqadd z0.h, z0.h, z1.h
unsigned Saturating ADD/SUB (vectors) e.g. uqadd z0.h, z0.h, z1.h
llvm-svn: 336186
Petar Jovanovic [Tue, 3 Jul 2018 09:31:48 +0000 (09:31 +0000)]
[MIPS GlobalISel] Lower arguments using stack
Lower more than 4 arguments using stack. This patch targets MIPS32.
It supports only functions with arguments of type i32.
Patch by Petar Avramovic.
Differential Revision: https://reviews.llvm.org/D47934
llvm-svn: 336185
James Henderson [Tue, 3 Jul 2018 09:23:25 +0000 (09:23 +0000)]
[ELF] Don't create empty output section for unreferenced PROVIDEs
LLD removes empty output sections otherwise specified in the linker
script. Prior to this change however, if section descriptions included
ANY kind of symbol assignment, then the consequent output section would
not be removed, even if the assignment was marked with PROVIDE and not
actually triggered (i.e. the symbol was never referenced). This change
modifies the isDiscarable function to ignore such directives when
determining whether a section should be discarded, in keeping with
bfd's behaviour. Symbol assignments that do result in a symbol
definition will continue to result in a kept section (this is not
actually the same as bfd's behaviour, but it is simpler, and probably
makes more sense).
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D48771
llvm-svn: 336184
Chandler Carruth [Tue, 3 Jul 2018 09:13:27 +0000 (09:13 +0000)]
[PM/LoopUnswitch] Fix PR37651 by correctly invalidating SCEV when
unswitching loops.
Original patch trying to address this was sent in D47624, but that
didn't quite handle things correctly. There are two key principles used
to select whether and how to invalidate SCEV-cached information about
loops:
1) We must invalidate any info SCEV has cached before unswitching as we
may change (or destroy) the loop structure by the act of unswitching,
and make it hard to recover everything we want to invalidate within
SCEV.
2) We need to invalidate all of the loops whose CFGs are mutated by the
unswitching. Notably, this isn't the *entire* loop nest, this is
every loop contained by the outermost loop reached by an exit block
relevant to the unswitch.
And we need to do this even when doing trivial unswitching.
I've added more focused tests that directly check that SCEV starts off
with imprecise information and after unswitching (and simplifying
instructions) re-querying SCEV will produce precise information. These
tests also specifically work to check that an *outer* loop's information
becomes precise.
However, the testing here is still a bit imperfect. Crafting test cases
that reliably fail to be analyzed by SCEV before unswitching and succeed
afterward proved ... very, very hard. It took me several hours and
careful work to build these, and I'm not optimistic about necessarily
coming up with more to cover more elaborate possibilities. Fortunately,
the code pattern we are testing here in the pass is really
straightforward and reliable.
Thanks to Max Kazantsev for the initial work on this as well as the
review, and to Hal Finkel for helping me talk through approaches to test
this stuff even if it didn't come to much.
Differential Revision: https://reviews.llvm.org/D47624
llvm-svn: 336183
Sander de Smalen [Tue, 3 Jul 2018 09:07:23 +0000 (09:07 +0000)]
[AArch64][SVE] Asm: Support for vector element FP compare.
Contains the following variants:
- Compare with (elements from) other vector
instructions: fcmeq, fcmgt, fcmge, fcmne, fcmuo.
aliases: fcmle, fcmlt.
e.g. fcmle p0.h, p0/z, z0.h, z1.h => fcmge p0.h, p0/z, z1.h, z0.h
- Compare absolute values with (absolute values from) other vector.
instructions: facge, facgt.
aliases: facle, faclt.
e.g. facle p0.h, p0/z, z0.h, z1.h => facge p0.h, p0/z, z1.h, z0.h
- Compare vector elements with #0.0
instructions: fcmeq, fcmgt, fcmge, fcmle, fcmlt, fcmne.
e.g. fcmle p0.h, p0/z, z0.h, #0.0
llvm-svn: 336182
Peter Smith [Tue, 3 Jul 2018 08:53:41 +0000 (08:53 +0000)]
[ELF][AArch64] Add test case for load/store exclusive instructions [NFC]
The AArch64 -fix-cortex-a53-843419 is missing a test case for the load and
store exclusive instructions. This was leading to a function not being
covered in the codebase. This change adds two new instruction sequences to
be recognised as an instance of the erratum, one with a load exclusive the
other with a store exclusive.
Differential Revision: https://reviews.llvm.org/D48840
llvm-svn: 336181
George Rimar [Tue, 3 Jul 2018 08:34:55 +0000 (08:34 +0000)]
[ELF] - Revert mips-tls-64-pic-local-variable.s changed in r336129.
This restores the original comment in the test case.
llvm-svn: 336180
George Rimar [Tue, 3 Jul 2018 08:30:55 +0000 (08:30 +0000)]
[ELF] - Revert huge-temporary-file.s changed in r336129
Comment in the test case says that:
## This inputs previously created a 4gb temporarily file under 32 bit
## configuration. Issue was fixed. There is no clean way to check that from here.
## This testcase added for documentation purposes.
The intention of the test was to create such huge file
in case if our code will be broken again.
And currently it documents we do not create huge outputs.
r336129 changed -o to /dev/null and broke the intentions of the test case.
llvm-svn: 336179
Chandler Carruth [Tue, 3 Jul 2018 08:19:10 +0000 (08:19 +0000)]
[ADT] Disable the single callback optimization on Windows.
It appears that the function pointer we use there isn't reliably 4-byte
aligned. I have no idea why or how we could correct this, so for now we
just regress the Windows performance some.
Someone with access to Windows could try working on a fix. At the very
least we could use a double indirection rather than a table, but maybe
there is some way to fully restore this optimization. I don't want to
play too much with this when I don't have access to the platform and
this at least should restore the last bots.
llvm-svn: 336178
Sam McCall [Tue, 3 Jul 2018 08:09:29 +0000 (08:09 +0000)]
[clangd] Incorporate transitive #includes into code complete proximity scoring.
Summary:
We now compute a distance from the main file to the symbol header, which
is a weighted count of:
- some number of #include traversals from source file --> included file
- some number of FS traversals from file --> parent directory
- some number of FS traversals from parent directory --> child file/dir
This calculation is performed in the appropriate URI scheme.
This means we'll get some proximity boost from header files in main-file
contexts, even when these are in different directory trees.
This extended file proximity model is not yet incorporated in the index
interface/implementation.
Reviewers: ioeric
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, cfe-commits
Differential Revision: https://reviews.llvm.org/D48441
llvm-svn: 336177
Shiva Chen [Tue, 3 Jul 2018 07:56:04 +0000 (07:56 +0000)]
[DebugInfo] Fix PR37395.
DbgLabelInst has no address as its operands.
Differential Revision: https://reviews.llvm.org/D46738
Patch by Hsiangkai Wang.
llvm-svn: 336176
Hans Wennborg [Tue, 3 Jul 2018 07:51:41 +0000 (07:51 +0000)]
Revert r336021 "PR33924: merge local declarations that have linkage of some kind within"
This caused test failures in 32-bit builds (PR38015).
> merged function definitions; also merge functions with deduced return
> types.
>
> This seems like two independent fixes, but unfortunately they are hard
> to separate because it's challenging to reliably test either one of them
> without also testing the other.
>
> A complication arises with deduced return type support: we need the type
> of the function in order to know how to merge it, but we can't load the
> actual type of the function because it might reference an entity
> declared within the function (and we need to have already merged the
> function to correctly merge that entity, which we would need to do to
> determine if the function types match). So we instead compare the
> declared function type when merging functions, and defer loading the
> actual type of a function with a deduced type until we've finished
> loading and merging the function.
llvm-svn: 336175
Chandler Carruth [Tue, 3 Jul 2018 07:51:01 +0000 (07:51 +0000)]
[Support] This sanity check in the test only works with certain versions
of libstdc++, not just certain versions of GCC. The original macros
broke when using Clang + libstdc++4.9 sadly.
Sadly, testing for versions of libstdc++ has been extremely problematic
in the past, so I'm just narrowing this down to Windows and when using
libc++ as that seems at least very unlikely to keep build bots broken.
llvm-svn: 336174
Sam McCall [Tue, 3 Jul 2018 07:21:15 +0000 (07:21 +0000)]
[clangd] Remove CompletionItem::SymbolScope extension.
This was never serialized, and embedders now have access to the
CodeCompletion API, which includes this information.
llvm-svn: 336173
Max Kazantsev [Tue, 3 Jul 2018 06:23:57 +0000 (06:23 +0000)]
[InstCombine] Delay foldICmpUsingKnownBits until simple transforms are done
This patch changes order of transform in InstCombineCompares to avoid
performing transforms based on ranges which produce complex bit arithmetics
before more simple things (like folding with constants) are done. See PR37636
for the motivating example.
Differential Revision: https://reviews.llvm.org/D48584
Reviewed By: spatel, lebedev.ri
llvm-svn: 336172
Clement Courbet [Tue, 3 Jul 2018 06:17:05 +0000 (06:17 +0000)]
[llvm-exegesis] ExegisX86Target::setRegToConstant() should depend on the subtarget features.
Summary: This fixes PR38008.
Reviewers: gchatelet, RKSimon
Subscribers: tschuett, craig.topper, llvm-commits
Differential Revision: https://reviews.llvm.org/D48820
llvm-svn: 336171
Chandler Carruth [Tue, 3 Jul 2018 05:46:20 +0000 (05:46 +0000)]
[ADT] Try to work around a crash in MSVC.
Putting `sizeof(T) <= 16` into the parameter of a `std::conditional`
causes every version of MSVC I've tried to crash:
https://godbolt.org/g/eqVULL
Really frustrating, but an extra layer of indirection through an
instantiated type gives a working way to access this computed constant.
llvm-svn: 336170
Craig Topper [Tue, 3 Jul 2018 04:43:49 +0000 (04:43 +0000)]
[X86] Add avx512vl command line to break-false-dep.ll
llvm-svn: 336169
Steven Wu [Tue, 3 Jul 2018 04:15:49 +0000 (04:15 +0000)]
[Driver][Darwin] Use Host Triple to infer target os version
Summary:
When clang required to infer target os version from --target option and
the os version is not specified in targets, check the host triple. If the
host and target are both macOS, use host triple to infer target os
version.
rdar://problem/
41651999
Reviewers: arphaman, dexonsmith
Reviewed By: arphaman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48849
llvm-svn: 336168
Chandler Carruth [Tue, 3 Jul 2018 04:07:26 +0000 (04:07 +0000)]
[ADT] Switch another place to `llvm::is_trivially_move_constructible`.
I missed this the first time around, sorry.
llvm-svn: 336166
Zhihao Yuan [Tue, 3 Jul 2018 04:01:44 +0000 (04:01 +0000)]
[libc++] Install the missing header __errc
Summary: Omitted from D41347.
Reviewers: EricWF
Subscribers: mgorny, christof, ldionne, cfe-commits
Differential Revision: https://reviews.llvm.org/D48864
llvm-svn: 336165
Zhihao Yuan [Tue, 3 Jul 2018 03:25:10 +0000 (03:25 +0000)]
[libc++] Lift std::errc into a separated header
Summary: This is needed to implement `<charconv>`, otherwise `<charconv>` would need to include `<system_error>`, which pulls in `<string>` -- a header which the `<charconv>` proposal intends to keep away from.
Reviewers: mclow.lists, EricWF
Reviewed By: mclow.lists
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D41347
llvm-svn: 336164
Jakub Kuderski [Tue, 3 Jul 2018 02:06:23 +0000 (02:06 +0000)]
Reappl "[Dominators] Add the DomTreeUpdater class"
Summary:
This patch is the first in a series of patches related to the [[ http://lists.llvm.org/pipermail/llvm-dev/2018-June/123883.html | RFC - A new dominator tree updater for LLVM ]].
This patch introduces the DomTreeUpdater class, which provides a cleaner API to perform updates on available dominator trees (none, only DomTree, only PostDomTree, both) using different update strategies (eagerly or lazily) to simplify the updating process.
—Prior to the patch—
- Directly calling update functions of DominatorTree updates the data structure eagerly while DeferredDominance does updates lazily.
- DeferredDominance class cannot be used when a PostDominatorTree also needs to be updated.
- Functions receiving DT/DDT need to branch a lot which is currently necessary.
- Functions using both DomTree and PostDomTree need to call the update function separately on both trees.
- People need to construct an additional DeferredDominance class to use functions only receiving DDT.
—After the patch—
Patch by Chijun Sima <simachijun@gmail.com>.
Reviewers: kuhar, brzycki, dmgreen, grosser, davide
Reviewed By: kuhar, brzycki
Author: NutshellySima
Subscribers: vsk, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D48383
llvm-svn: 336163
Erik Pilkington [Tue, 3 Jul 2018 01:30:53 +0000 (01:30 +0000)]
Revert r336159, r336157. Some bots failed on qualified std::max_align_t, and other on unqualified max_align_t.
I'll take another stab at this tomorrow. Any ideas for fixing this would be appreciated!
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/23071/steps/build_Lld/logs/stdio
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/11185/steps/build-stage1-compiler/logs/stdio
llvm-svn: 336162
Chandler Carruth [Tue, 3 Jul 2018 01:18:21 +0000 (01:18 +0000)]
[Support] Fix llvm::unique_function when building with GCC 4.9 by
introducing llvm::trivially_{copy,move}_constructible type traits.
This uses a completely portable implementation of these traits provided
by Richard Smith. You can see it on compiler explorer in all its glory:
https://godbolt.org/g/QEDZjW
I have transcribed it, clang-formatted it, added some comments, and made
the tests fit into a unittest file.
I have also switched llvm::unique_function over to use these new, much
more portable traits. =D
Hopefully this will fix the build bot breakage from my prior commit.
llvm-svn: 336161