Jan Svoboda [Mon, 16 Nov 2020 11:17:29 +0000 (12:17 +0100)]
[clang][cli] Add ability to make fixups to CompilerInvocation after option parsing
Depends on D83211
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D83298
Martin Storsjö [Thu, 12 Nov 2020 08:57:03 +0000 (10:57 +0200)]
[libcxx] Add missing _LIBCPP_FUNC_VIS on a few win32 locale functions
These functions are called directly from the public installed
headers, and thus need to be exported in DLL builds, just like
some other functions in the same header (e.g. snprintf_l).
This fixes e.g. test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
in mingw configurations.
Differential Revision: https://reviews.llvm.org/D91328
Raphael Isemann [Wed, 18 Nov 2020 08:58:02 +0000 (09:58 +0100)]
[lldb] Python3 byte<->string issue in patch-crashlog.py
Georgii Rymar [Wed, 18 Nov 2020 08:55:03 +0000 (11:55 +0300)]
Revert "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types."
This reverts commit
65fd17c241e22e1671e81efdb683687369c2feb3.
It breaks LLD/MachO tests that seems use obj2yaml the check the output.
Piotr Sobczak [Tue, 17 Nov 2020 14:38:44 +0000 (15:38 +0100)]
SpeculativeExecution: Allow speculating more instruction types
Support more instructions in SpeculativeExecution pass:
- ExtractElement
- InsertElement
- ShuffleVector
Differential Revision: https://reviews.llvm.org/D91633
Nathan Ridge [Tue, 10 Nov 2020 05:20:38 +0000 (00:20 -0500)]
[clangd] Call hierarchy (Protocol layer)
The protocol is based on the spec found here:
https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#textDocument_prepareCallHierarchy
Differential Revision: https://reviews.llvm.org/D89296
Georgii Rymar [Fri, 6 Nov 2020 10:39:55 +0000 (13:39 +0300)]
[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types.
When we produce an YAML output, we also print leading zeroes currently.
An output might look like this:
```
- Name: .dynsym
Type: SHT_DYNSYM
Address: 0x0000000000001000
EntSize: 0x0000000000000018
```
There are probably no reason to print leading zeroes.
It just makes harder to read values. This patch stops printing them.
The output becomes like:
```
- Name: .dynsym
Type: SHT_DYNSYM
Address: 0x1000
EntSize: 0x18
```
This affects obj2yaml mostly, but also dsymutil and llvm-xray tools output.
Differential revision: https://reviews.llvm.org/D90930
Thorsten Schütt [Wed, 18 Nov 2020 08:20:37 +0000 (09:20 +0100)]
test commit
add whitespace
Vitaly Buka [Mon, 16 Nov 2020 13:16:45 +0000 (05:16 -0800)]
[NFC][tsan] Prepepare for more interceptors which use cond_wait()
Arthur Eubanks [Wed, 18 Nov 2020 07:53:21 +0000 (23:53 -0800)]
[test] Make scc-pass-printer.ll work with NPM
Pin some legacy PM specific RUN lines to legacy PM.
zhanghb97 [Sun, 8 Nov 2020 01:28:35 +0000 (09:28 +0800)]
[mlir] Get array from the dense elements attribute with buffer protocol.
- Add `mlirElementsAttrGetType` C API.
- Add `def_buffer` binding to PyDenseElementsAttribute.
- Implement the protocol to access the buffer.
Differential Revision: https://reviews.llvm.org/D91021
Craig Topper [Wed, 18 Nov 2020 05:34:34 +0000 (21:34 -0800)]
[X86] Use GF2P8AFFINEQB to implement vector bitreverse.
We can use GF2P8AFFINEQB to reverse bits in a byte. Shuffles are needed to reverse the bytes in elements larger than i8. LegalizeVectorOps takes care of inserting the shuffle for the larger element size.
We already have Custom lowering for v16i8 with SSSE3, v32i8 with AVX, and v64i8 with AVX512BW.
I think we might be able to use this for scalars too by moving into a vector and back. But I'll save that for a follow up as its a little more involved.
Reviewed By: RKSimon, pengfei
Differential Revision: https://reviews.llvm.org/D91515
Arthur Eubanks [Wed, 18 Nov 2020 07:47:49 +0000 (23:47 -0800)]
[test] Pin size-remarks.ll to legacy PM
This tests legacy PM specific stuff.
Arthur Eubanks [Wed, 18 Nov 2020 07:14:33 +0000 (23:14 -0800)]
[JumpThreading] Make -print-lvi-after-jump-threading work with NPM
Tei Jeong [Wed, 18 Nov 2020 06:14:02 +0000 (22:14 -0800)]
Add CalibratedQuantizedType to quant dialect
This type supports a calibrated type with min, max provided.
This will be used for importing calibration values of intermediate tensors (e.g. LSTM) which can't be imported with QuantStats op.
This type was initially suggested in the following RFC: https://llvm.discourse.group/t/rfc-a-proposal-for-implementing-quantization-transformations-in-mlir/655
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D91584
Utkarsh Saxena [Tue, 17 Nov 2020 11:15:31 +0000 (12:15 +0100)]
[clangd] Add OverridenBy Relation to index.
This was previously explored in reviews.llvm.org/D69094.
Differential Revision: https://reviews.llvm.org/D91610
Stella Laurenzo [Wed, 11 Nov 2020 18:21:53 +0000 (10:21 -0800)]
[mlir][Python] Make DenseElementsAttr loading be int size agnostic.
* I had missed the note about "Standard size" in the docs. On Windows, the 'l' types are 32bit.
* This fixes the only failing MLIR-Python test on Windows.
Differential Revision: https://reviews.llvm.org/D91283
Duncan P. N. Exon Smith [Wed, 18 Nov 2020 02:06:21 +0000 (18:06 -0800)]
ADT: Share an implementation for single-element insert in SmallVector, NFC
Factor out `SmallVectorImple::insert_one_impl`, a common implementation
for `insert(iterator, T&&)` and `insert(iterator, T const&)`. This is
just a clean up and has no functionality change.
Differential Revision: https://reviews.llvm.org/D91674
Arthur Eubanks [Sat, 14 Nov 2020 07:34:11 +0000 (23:34 -0800)]
[DCE] Always get TargetLibraryInfo
I don't see any reason not to unconditionally retrieve TLI, it's fairly
cheap.
Fixes calls-errno.ll under NPM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D91476
Eric Fiselier [Tue, 17 Nov 2020 22:34:23 +0000 (17:34 -0500)]
[libc++] Revert switch-based std::variant implementation again.
These changes cause substantial binary size increases for non-opt builds.
For example, the visit.pass.cpp test grows from 20k to 420k.
Further work will be done to re-land this patch without the size increases,
but that work is proving too tricky to fix forward.
This patch fully reverts:
*
35d226911165a9aae1f01f521a0019f1a9c0a25f
And it partially reverts:
*
bb43a0cd4adc4f1fa12e0d2fd1fe9aa6b5c00e34
The latter of which added XFAIL's to new variant tests
because the new implementation needlessly makes non-throwing code
paths in variant invoke throwing code.
This means the reverted change also breaks source backwards compat
with code compiled on OS X targeting older system dylibs. There is no
need for this to be the case. We should fix it before recommitting.
Reviewed as:
https://reviews.llvm.org/D91662
LLVM GN Syncbot [Wed, 18 Nov 2020 03:04:01 +0000 (03:04 +0000)]
[gn build] Port
6a89cb8136f
Yevgeny Rouban [Wed, 18 Nov 2020 02:44:16 +0000 (09:44 +0700)]
[NewPM] Disable PreservedCFGChecker and add regression unit tests
The design of the PreservedCFG Checker (landed with the commit
28012e00d80b9) has a fundamental flaw which makes it incorrect.
The checker is based on the PreservedAnalyses result returned
by functional passes: if CFGAnalyses is in the returned
PreservedAnalyses set, then the checker asserts that the CFG
snapshot saved before the pass is equal to the CFG snapshot
taken after the the pass. The problem is in passes that change
CFG and invalidate CFGAnalyses on their own. Such passes do not
return CFGanalyses in the returned PreservedAnalyses. So the
checker mistakenly expects CFG unchanged. As an example see the
class TestSimplifyCFGInvalidatingAnalysisPass in the new tests.
It is interesting that the bug was not found in LLVM. That is
because the CFG checker ran only if CFGAnalyses was checked
incorrectly:
if (!PassPA.allAnalysesInSetPreserved<CFGAnalyses>())
return;
but must be checked as follows:
auto PAC = PA.getChecker<PreservedCFGCheckerAnalysis>();
if (!(PAC.preserved() ||
PAC.preservedSet<AllAnalysesOn<Function>>() ||
PAC.preservedSet<CFGAnalyses>())
return;
A fully redesigned checker will be sent as a separate follow-up
patch.
Reviewed By: Serguei Katkov, Jakub Kuderski
Differential Revision: https://reviews.llvm.org/D91324
Artem Dergachev [Wed, 18 Nov 2020 02:59:01 +0000 (18:59 -0800)]
Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""
This reverts commit
41bcc05e2a4e3062eb12ac6e071bc835decc38f5.
LLVM GN Syncbot [Wed, 18 Nov 2020 02:45:24 +0000 (02:45 +0000)]
[gn build] Port
41bcc05e2a4
Artem Dergachev [Mon, 16 Nov 2020 01:26:22 +0000 (17:26 -0800)]
Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""
This reverts commit
77bb3ebebbca13f0648beb433fbd1b06ba95a19c.
Andrew Paverd [Wed, 18 Nov 2020 02:02:13 +0000 (18:02 -0800)]
[CFGuard] Add address-taken IAT tables and delay-load support
This patch adds support for creating Guard Address-Taken IAT Entry Tables (.giats$y sections) in object files, matching the behavior of MSVC. These contain lists of address-taken imported functions, which are used by the linker to create the final GIATS table.
Additionally, if any DLLs are delay-loaded, the linker must look through the .giats tables and add the respective load thunks of address-taken imports to the GFIDS table, as these are also valid call targets.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D87544
QingShan Zhang [Wed, 18 Nov 2020 02:12:01 +0000 (02:12 +0000)]
[NFC][Test] Add more tests for IEEE Longdouble for PowerPC
daquexian [Wed, 18 Nov 2020 01:29:43 +0000 (17:29 -0800)]
set the alignment of mlir::AttributeStorage to 64 bit explicitly to fix 32 bit platform
On some platform (like WebAssembly), alignof(mlir::AttributeStorage) is 4 instead of 8. As a result, it makes the program crashes since PointerLikeTypeTraits<mlir::Attribute>::NumLowBitsAvailable is 3.
So I explicitly set the alignment of mlir::AttributeStoarge to 64 bits, and set PointerLikeTypeTraits<mlir::Attribute>::NumLowBitsAvailable according to it.
I also fixed an another related error (alignof(NamedAttribute) -> alignof(DictionaryAttributeStorage)) based on reviewer's comments.
Reviewed By: dblaikie, rriddle
Differential Revision: https://reviews.llvm.org/D91062
Ben Barham [Wed, 18 Nov 2020 01:25:50 +0000 (17:25 -0800)]
[Frontend] Add flag to allow PCM generation despite compiler errors
As with precompiled headers, it's useful for indexers to be able to
continue through compiler errors in dependent modules.
Resolves rdar://
69816264
Reviewed By: akyrtzi
Differential Revision: https://reviews.llvm.org/D91580
Nick Desaulniers [Wed, 18 Nov 2020 01:17:44 +0000 (17:17 -0800)]
Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch"
This reverts commit
b7926ce6d7a83cdf70c68d82bc3389c04009b841.
Going with a simpler approach.
Nick Desaulniers [Wed, 18 Nov 2020 01:17:36 +0000 (17:17 -0800)]
Revert "[BitCode] decode nossp fn attr"
This reverts commit
0b11d018cc2f2c6bea5dac8dc72140cdb502ca02.
Going with a simpler approach.
Arthur Eubanks [Tue, 17 Nov 2020 17:24:38 +0000 (09:24 -0800)]
[CMake] Fix ExtensionDependencies.inc with multiple extensions
When polly is enabled and LLVM_BYE_LINK_INTO_TOOLS=ON is on, ExtensionDependencies.inc does not compile.
$ ninja tools/llvm-config/CMakeFiles/llvm-config.dir/llvm-config.cpp.o
tools/llvm-config/ExtensionDependencies.inc:8:1: error: excess elements in struct initializer
{{"Bye", {"Bye",nullptr}}},
ExtensionDependencies.inc pre-patch:
std::array<ExtensionDescriptor, 2> AvailableExtensions{
{{"Polly", {"support", "core", ...,nullptr}}},
{{"Bye", {"Bye",nullptr}}},
};
ExtensionDependencies.inc with this patch:
std::array<ExtensionDescriptor, 2> AvailableExtensions{
ExtensionDescriptor{"Polly", {"support", "core", ...,nullptr}},
ExtensionDescriptor{"Bye", {"Bye",nullptr}},
};
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D91641
Arthur Eubanks [Wed, 18 Nov 2020 01:09:45 +0000 (17:09 -0800)]
[gn build] Use forward slashes for goma directory
gn generates improper compile_commands.json files by not escaping
backslashes.
MaheshRavishankar [Wed, 18 Nov 2020 00:32:31 +0000 (16:32 -0800)]
[mlir][Linalg] Add dependence type to LinalgDependenceGraphElem.
Differential Revision: https://reviews.llvm.org/D91502
Sam Clegg [Fri, 1 May 2020 16:14:59 +0000 (09:14 -0700)]
[lld][WebAssembly] Implement --unresolved-symbols
This is a more full featured version of ``--allow-undefined``.
The semantics of the different methods are as follows:
report-all:
Report all unresolved symbols. This is the default. Normally the
linker will generate an error message for each reported unresolved
symbol but the option ``--warn-unresolved-symbols`` can change this
to a warning.
ignore-all:
Resolve all undefined symbols to zero. For data and function
addresses this is trivial. For direct function calls, the linker
will generate a trapping stub function in place of the undefined
function.
import-functions:
Generate WebAssembly imports for any undefined functions. Undefined
data symbols are resolved to zero as in `ignore-all`. This
corresponds to the legacy ``--allow-undefined`` flag.
The plan is to followup with a new mode called `import-dynamic` which
allows for statically linked binaries to refer to both data and
functions symbols from the embedder.
Differential Revision: https://reviews.llvm.org/D79248
LLVM GN Syncbot [Wed, 18 Nov 2020 00:02:29 +0000 (00:02 +0000)]
[gn build] Port
f8f6d6455f9
Artem Dergachev [Mon, 16 Nov 2020 00:06:32 +0000 (16:06 -0800)]
Revert "Revert "[analyzer] NFC: Move IssueHash to libAnalysis.""
This reverts commit
662ed9e67adace3d011f42478bc8bcb1773a2821.
Robert Underwood [Tue, 17 Nov 2020 23:44:00 +0000 (17:44 -0600)]
honor Python2_EXECUTABLE and Python3_EXECUTABLE when they are passed to cmake
CMake's find_package(Python3) and find_package(Python2) packages have a PYTHON_EXECUTABLE, Python2_EXECUTABLE, and Python3_EXECUTABLE cmake variables which control which version of python is built against. As far as I can tell, the rest of LLVM honors these variables. This can cause the build process to fail when if the automatically selected version of Python can't run due to modifications of LD_LIBRARY_PATH when using spack. The corresponding Spack issue is https://github.com/spack/spack/issues/19908. The corresponding LLVM issue is 48180
I believe an appropriate fix is to add the variables to the list of PASSTHROUGH_VARIABLES in cmake/Modules/AddCompilerRT.cmake, and this fixed compilation errors for me.
This bug affects distributions like Gentoo and package managers like Spack which allow for combinatorial versioning.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D91536
Siva Chandra Reddy [Thu, 5 Nov 2020 06:34:06 +0000 (22:34 -0800)]
[libc] Add implementations of ldexp[f|l].
The rounding behavior of NormalFloat to float format has been changed
to round to nearest. Also, a bug in NormalFloat to subnormal number
conversion has been fixed.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D91591
Richard Smith [Tue, 17 Nov 2020 21:59:07 +0000 (13:59 -0800)]
Fix assertions and bad warnings on extremely wide bit-fields.
We used to produce a bogus warning if the width couldn't be represented
in 32 bits, and assert if it couldn't be represented in 64 bits.
Erich Keane [Tue, 17 Nov 2020 22:28:52 +0000 (14:28 -0800)]
Fix a pair of tests that would fail on a win32 box
The tests don't specify a triple in some cases, since they shouldn't be
necessary, so I've updated the tests to detect via macro when they are
running on win32 to give the slightly altered diagnostic.
LLVM GN Syncbot [Tue, 17 Nov 2020 21:45:53 +0000 (21:45 +0000)]
[gn build] Port
8fb4417d82b
Michael Kruse [Tue, 17 Nov 2020 21:42:44 +0000 (15:42 -0600)]
[LLVMFronted][tests] Add basic OpenMP parsing tests.
As noticed in D91470, some of the functions of LLVMFrontend, are not tested within the library itself (but indirectly by its users clang and flang). In particular, the file OMP.cpp which is generated by tablegen was not tested at all.
Add tests for the parsing helpers in OMP.cpp. These are not meant to be exhaustive tests, just to ensure that we have some basic tests for all API functions.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D91643
Amy Huang [Tue, 15 Sep 2020 16:38:42 +0000 (09:38 -0700)]
[llvm-symbolizer] Add inline stack traces for Windows.
This adds inline stack frames for symbolizing on Windows.
Differential Revision: https://reviews.llvm.org/D88988
Aart Bik [Tue, 17 Nov 2020 20:13:18 +0000 (12:13 -0800)]
[mlir] [sparse] start of sparse tensor compiler support
As discussed in https://llvm.discourse.group/t/mlir-support-for-sparse-tensors/2020
this CL is the start of sparse tensor compiler support in MLIR. Starting with a
"dense" kernel expressed in the Linalg dialect together with per-dimension
sparsity annotations on the tensors, the compiler automatically lowers the
kernel to sparse code using the methods described in Fredrik Kjolstad's thesis.
Many details are still TBD. For example, the sparse "bufferization" is purely
done locally since we don't have a global solution for propagating sparsity
yet. Furthermore, code to input and output the sparse tensors is missing.
Nevertheless, with some hand modifications, the generated MLIR can be
easily converted into runnable code already.
Reviewed By: nicolasvasilache, ftynse
Differential Revision: https://reviews.llvm.org/D90994
Christopher Tetreault [Tue, 17 Nov 2020 20:25:21 +0000 (12:25 -0800)]
[SVE] Take constant fold fast path for splatted vscale vectors
This should be a perfectly reasonable operation for scalable vectors.
Currently, it only works for zeroinitializer values of
ScalableVectorType, but the fundamental operation is sound and it should
be possible to make it work for other splats
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D77442
Hansang Bae [Fri, 30 Oct 2020 20:32:55 +0000 (15:32 -0500)]
[OpenMP] Use explicit type casting in kmp_atomic.cpp
Differential Revision: https://reviews.llvm.org/D91105
Peter Steinfeld [Tue, 17 Nov 2020 19:55:29 +0000 (11:55 -0800)]
[flang] Fix FIR test failures
When doing out-of-tree builds, FIR tests were failing. I made a change
similar to the one by @jurahul to fix this.
Differential Revision: https://reviews.llvm.org/D91654
Fangrui Song [Tue, 17 Nov 2020 20:20:57 +0000 (12:20 -0800)]
[ELF] Fix interaction between --unresolved-symbols= and --[no-]allow-shlib-undefined
As mentioned in https://reviews.llvm.org/D67479#1667256 ,
* `--[no-]allow-shlib-undefined` control the diagnostic for an unresolved symbol in a shared object
* `-z defs/-z undefs` control the diagnostic for an unresolved symbol in a regular object file
* `--unresolved-symbols=` controls both bits.
In addition, make --warn-unresolved-symbols affect --no-allow-shlib-undefined.
This patch makes the behavior match GNU ld.
Reviewed By: psmith
Differential Revision: https://reviews.llvm.org/D91510
Sanjay Patel [Tue, 17 Nov 2020 20:09:06 +0000 (15:09 -0500)]
[SLP] avoid unreachable code crash/infloop
Example based on the post-commit comments for D88735.
Nawrin Sultana [Fri, 6 Nov 2020 21:36:19 +0000 (15:36 -0600)]
[OpenMP] Add omp_realloc implementation
This patch adds omp_realloc function implementation according to
OpenMP 5.1 specification.
Differential Revision: https://reviews.llvm.org/D90971
Jon Roelofs [Tue, 17 Nov 2020 18:54:41 +0000 (10:54 -0800)]
[MachineScheduler] Inform pass infra of post-ra scheduler's dependencies
Differential Revision: https://reviews.llvm.org/D91561
Michael Jones [Mon, 16 Nov 2020 22:20:14 +0000 (22:20 +0000)]
[libc] make part of libc's unit test framework independent of llvm
This is mostly changing stringref to std::string, outs() to cout,
and small supporting changes. This will make running unit tests possible
on systems that are only grabbing the libc part of llvm.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D91568
Sanjay Patel [Tue, 17 Nov 2020 18:24:47 +0000 (13:24 -0500)]
[InstCombine] allow vectors for masked-add -> xor fold
https://rise4fun.com/Alive/I4Ge
Name: add with pow2 mask
Pre: isPowerOf2(C2) && (C1 & C2) != 0 && (C1 & (C2-1)) == 0
%a = add i8 %x, C1
%r = and i8 %a, C2
=>
%n = and i8 %x, C2
%r = xor i8 %n, C2
Simon Pilgrim [Tue, 17 Nov 2020 18:26:32 +0000 (18:26 +0000)]
[X86] byval tests - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Simon Pilgrim [Tue, 17 Nov 2020 18:22:45 +0000 (18:22 +0000)]
[X86] emutls.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Simon Pilgrim [Tue, 17 Nov 2020 18:20:28 +0000 (18:20 +0000)]
[X86] emutls-pie.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Simon Pilgrim [Tue, 17 Nov 2020 18:14:36 +0000 (18:14 +0000)]
[X86] emutls-pic.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Alexey Bataev [Tue, 17 Nov 2020 13:33:25 +0000 (05:33 -0800)]
[OPENMP] Fix PR47999: correctly map implicit firstprivates in outer tasks.
If the variable is implicitly firstprivatized in the inner task-based
region, it also must be firstprivatized in outer task-based regions.
Previously firstprivates were captured in tasks but later it was
optimized to reduce the memory usage. But still need to mark such
variables as implicit firstprivate in outer tasks.
Differential Revision: https://reviews.llvm.org/D91627
Louis Dionne [Tue, 17 Nov 2020 18:17:40 +0000 (13:17 -0500)]
[libc++] Do not error out when we don't know the file format
Erroring out prevents the library from working with other file formats
(e.g. in embedded). Since that error does not guard us from doing something
incorrect, it seems fine to just remove it.
Stephen Kelly [Tue, 17 Nov 2020 18:13:35 +0000 (18:13 +0000)]
[Transformer] Split ForStmt test into two
It is apparently not possible to have two rewrites in one gtest function
because atomic changes in the test harness accumulate.
Louis Dionne [Tue, 17 Nov 2020 18:14:36 +0000 (13:14 -0500)]
[libc++] Only include_next <wctype.h> if it exists
This allows building on platforms that don't provide that header.
Joe Ellis [Tue, 17 Nov 2020 17:29:42 +0000 (17:29 +0000)]
[AArch64][SVE] Add tests for VLST -> VLAT lax conversions
These were previously missing from the SVE lax conversions tests
introduced in this commit:
23a96b84a8d985b686a4e06dec1f7aebc0cca6c6
(https://reviews.llvm.org/D91067)
Differential Revision: https://reviews.llvm.org/D91642
Simon Pilgrim [Tue, 17 Nov 2020 17:59:05 +0000 (17:59 +0000)]
[X86] segmented-stacks tests - replace X32 check prefix with X86 for non-gnux32 tests. NFC.
Only use X32 for the gnux32 triples in the tests
Simon Pilgrim [Tue, 17 Nov 2020 17:56:09 +0000 (17:56 +0000)]
[X86] select-of-fp-constants.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Simon Pilgrim [Tue, 17 Nov 2020 17:50:36 +0000 (17:50 +0000)]
[InstCombine] visitAnd - remove unnecessary Value *X, *Y shadow variables. NFCI.
Fixes a number of Wshadow warnings.
Nico Weber [Tue, 17 Nov 2020 17:15:42 +0000 (12:15 -0500)]
lld: Add --color-diagnostic to MachO port, harmonize others
This adds `--[no-]color-diagnostics[=auto,never,always]` to
the MachO port and harmonizes the flag in the other ports:
- Consistently use MetaVarName
- Consistently document the non-eq version as alias of the eq version
- Use B<> in the ports that have it (no-op, shorter)
- Fix oversight in COFF port that made the --no flag have the wrong
prefix
Differential Revision: https://reviews.llvm.org/D91640
Christian Sigg [Tue, 17 Nov 2020 17:00:55 +0000 (18:00 +0100)]
[mlir] Simplify std.alloc lowering to LLVM.
std.alloc only supports memrefs with identity layout, which means we can simplify the lowering to LLVM and compute strides only from (static and dynamic) sizes.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D91549
Stephen Kelly [Tue, 17 Nov 2020 17:48:14 +0000 (17:48 +0000)]
Comment out new test while I figure out what is wrong with it
Simon Pilgrim [Tue, 17 Nov 2020 17:22:36 +0000 (17:22 +0000)]
[InstCombine] visitAnd - use m_SpecificInt instead of m_APInt + comparison. NFCI.
m_SpecificInt has the same 'no undef element' behaviour as m_APInt so no change there, and anyway we have test coverage for undef elements in the fold.
Noticed while fixing a Wshadow warning about shadow Value *X, *Y variables.
Simon Pilgrim [Tue, 17 Nov 2020 16:51:24 +0000 (16:51 +0000)]
[X86] rot16.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Simon Pilgrim [Tue, 17 Nov 2020 16:50:08 +0000 (16:50 +0000)]
[X86] vec_fabs.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Wei Wang [Fri, 13 Nov 2020 19:17:47 +0000 (11:17 -0800)]
[BPI] Look through bitcasts in calcZeroHeuristic
Constant hoisting may hide the constant value behind bitcast for And's
operand. Track down the constant to make the BFI result consistent
regardless of hoisting.
Differential Revision: https://reviews.llvm.org/D91450
Alessandro Arzilli [Tue, 17 Nov 2020 17:26:20 +0000 (09:26 -0800)]
[debugserver] Add option to propagate SIGSEGV to target process
Adds a command line option that makes debugserver propagate the SIGSEGV
signal to the target process.
Motivation: I'm one of the maintainers of Delve [1] a debugger for Go.
We use debugserver as our backend on macOS and one of the most often
reported bugs is that, on macOS, we don't propagate SIGSEGV back to the
target process [2]. Sometimes some programs will actually cause a
SIGSEGV, by design, and then handle it. Those programs can not be
debugged at all.
Since catching signals isn't very important for a Go debugger I'd much
rather have a command line option in debugserver that causes it to let
SIGSEGV go directly to the target process.
[1] https://github.com/go-delve/delve/
[2] https://github.com/go-delve/delve/issues/852
Differential revision: https://reviews.llvm.org/D89315
Rahul Joshi [Tue, 17 Nov 2020 01:37:19 +0000 (17:37 -0800)]
[NFC] Add unit tests for printing/parsing of variadic operands and results.
Differential Revision: https://reviews.llvm.org/D91557
Sanjay Patel [Tue, 17 Nov 2020 17:03:55 +0000 (12:03 -0500)]
[InstCombine] remove scalar constraint for mask-of-add fold
https://rise4fun.com/Alive/V6fP
Name: add with low mask
Pre: (C1 & (-1 u>> countLeadingZeros(C2))) == 0
%a = add i8 %x, C1
%r = and i8 %a, C2
=>
%r = and i8 %x, C2
Sanjay Patel [Tue, 17 Nov 2020 17:02:27 +0000 (12:02 -0500)]
[InstCombine] add vector test for mask of add; NFC
Sanjay Patel [Tue, 17 Nov 2020 16:46:34 +0000 (11:46 -0500)]
[InstCombine] relax constraints on mask-of-add
There are 2 changes:
1. Remove the unnecessary one-use check.
2. Remove the unnecessary power-of-2 check.
https://rise4fun.com/Alive/V6fP
Name: add with low mask
Pre: (C1 & (-1 u>> countLeadingZeros(C2))) == 0
%a = add i8 %x, C1
%r = and i8 %a, C2
=>
%r = and i8 %x, C2
Sanjay Patel [Tue, 17 Nov 2020 16:28:33 +0000 (11:28 -0500)]
[InstCombine] add tests for masked add; NFC
ergawy [Tue, 17 Nov 2020 16:45:32 +0000 (11:45 -0500)]
[MLIR][SPIRV] Rename `spv._address_of` to `spv.mlir.addressof`
This commit does the renaming mentioned in the title in order to bring
`spv` dialect closer to the MLIR naming conventions.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D91609
Fangrui Song [Tue, 17 Nov 2020 17:11:19 +0000 (09:11 -0800)]
[ELF] --gc-sections: collect unused .gcc_except_table in section groups and associated text sections
`try ... catch` in an inline function produces `.gcc_except_table.*` in a COMDAT
group with GCC or newer Clang (since D83655). For --gc-sections, currently we
scan `.eh_frame` pieces and mark liveness of such a `.gcc_except_table.*` and
then the associated `.text.*` (if a member in a section group is retained, the
others should be retained as well).
Essentially all `.text.*` and `.gcc_except_table.*` compiled from inline
functions with `try ... catch` cannot be discarded by the imprecise
--gc-sections. Compared with the state before D83655, the output
`.gcc_except_table` is smaller (non-prevailing copies in COMDAT groups can now
be discarded) but `.text` may be larger, i.e. size regression.
This patch teaches the .eh_frame piece scanning code to not mark
`.gcc_except_table` in a section group, thus allow unused `.text.*` and
`.gcc_except_table.*` in a section group to be discarded.
Note, non-group `.gcc_except_table` can still not be discarded. That is the status quo.
Reviewed By: grimar, echristo
Differential Revision: https://reviews.llvm.org/D91579
Fangrui Song [Tue, 17 Nov 2020 17:07:38 +0000 (09:07 -0800)]
[ARC] Correct ARCInstPrinter::getMnemonic after D90039
Nikita Popov [Thu, 12 Nov 2020 20:51:32 +0000 (21:51 +0100)]
[BasicAA] Make alias GEP positive offset handling symmetric
aliasGEP() currently implements some special handling for the case
where all variable offsets are positive, in which case the constant
offset can be taken as the minimal offset. However, it does not
perform the same handling for the all-negative case. This means that
the alias-analysis result between two GEPs is asymmetric:
If GEP1 - GEP2 is all-positive, then GEP2 - GEP1 is all-negative,
and the first will result in NoAlias, while the second will result
in MayAlias.
Apart from producing sub-optimal results for one order, this also
violates our caching assumption. In particular, if BatchAA is used,
the cached result depends on the order of the GEPs in the first query.
This results in an inconsistency in BatchAA and AA results, which
is how I noticed this issue in the first place.
Differential Revision: https://reviews.llvm.org/D91383
Alex Zinenko [Tue, 17 Nov 2020 13:17:22 +0000 (14:17 +0100)]
[mlir] Add a _get_default_loc_context utility to Python bindings
This utility function is helpful for dialect-specific builders that need
to access the context through location, and the location itself may be
either provided as an argument or expected to be recovered from the
implicit location stack.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D91623
Stephen Kelly [Thu, 5 Nov 2020 18:42:21 +0000 (18:42 +0000)]
[AST] Update matchers to be traverse-aware
Don't match Stmt or Decl nodes not spelled in the source when using
TK_IgnoreUnlessSpelledInSource. This prevents accidental modification
of source code at incorrect locations.
Differential Revision: https://reviews.llvm.org/D90984
Stephen Kelly [Wed, 4 Nov 2020 22:57:42 +0000 (22:57 +0000)]
[AST] Ignore implicit nodes in IgnoreUnlessSpelledInSource mode
Update the ASTNodeTraverser to dump only nodes spelled in source. There
are only a few which need to be handled, but Decl nodes for which
isImplicit() is true are handled together.
Update the RAV instances used in ASTMatchFinder to ignore the nodes too.
As with handling of template instantiations, it is necessary to allow
the RAV to process the implicit nodes because they need to be visitable
before the first traverse() matcher is encountered. An exception to
this is in the MatchChildASTVisitor, because we sometimes wish to make a
node matchable but make its children not-matchable. This is the case
for defaulted CXXMethodDecls for example.
Extend TransformerTests to illustrate the kinds of problems that can
arise when performing source code rewriting due to matching implicit
nodes.
This change accounts for handling nodes not spelled in source when using
direct matching of nodes, and when using the has() and hasDescendant()
matchers. Other matchers such as
cxxRecordDecl(hasMethod(cxxMethodDecl())) still succeed for
compiler-generated methods for example after this change. Updating the
implementations of hasMethod() and other matchers is for a follow-up
patch.
Differential Revision: https://reviews.llvm.org/D90982
Stephen Kelly [Tue, 17 Nov 2020 15:52:46 +0000 (15:52 +0000)]
Move ASTMatchFinder definition so it can be accessed from other functions
Stephen Kelly [Tue, 17 Nov 2020 15:42:03 +0000 (15:42 +0000)]
Rename API to not be constrained to template instantiations
A follow-up commit will use this method to ignore implcit AST nodes.
Stephen Kelly [Tue, 17 Nov 2020 15:38:34 +0000 (15:38 +0000)]
Invert accessor for checking traversal mode
For now, there is a traversal mode which ignores implicit casts and
parenthesis. Invert the check in order to not obviously break that.
Simon Pilgrim [Tue, 17 Nov 2020 16:27:32 +0000 (16:27 +0000)]
[PPC] Fix dead store value clang static analyzer warning. NFCI.
Simplify the SplatBits 2-byte -> 4-byte 'splat'.
Christian Sigg [Tue, 17 Nov 2020 08:31:47 +0000 (09:31 +0100)]
[mlir] Remove unused ConvertToLLVMPattern::linearizeSubscripts().
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D91594
Florian Hahn [Tue, 17 Nov 2020 09:46:22 +0000 (09:46 +0000)]
[VPlan] Add VPDef class.
This patch introduces a new VPDef class, which can be used to
manage VPValues defined by recipes/VPInstructions.
The idea here is to mirror VPUser for values defined by a recipe. A
VPDef can produce either zero (e.g. a store recipe), one (most recipes)
or multiple (VPInterleaveRecipe) result VPValues.
To traverse the def-use chain from a VPDef to its users, one has to
traverse the users of all values defined by a VPDef.
VPValues now contain a pointer to their corresponding VPDef, if one
exists. To traverse the def-use chain upwards from a VPValue, we first
need to check if the VPValue is defined by a VPDef. If it does not have
a VPDef, this means we have a VPValue that is not directly defined
iniside the plan and we are done.
If we have a VPDef, it is defined inside the region by a recipe, which
is a VPUser, and the upwards def-use chain traversal continues by
traversing all its operands.
Note that we need to add an additional field to to VPVAlue to link them
to their defs. The space increase is going to be offset by being able to
remove the SubclassID field in future patches.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D90558
Simon Pilgrim [Tue, 17 Nov 2020 16:05:03 +0000 (16:05 +0000)]
[IR] ShuffleVectorInst::isIdentityWithPadding - bail on non-fixed-type vector shuffles.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27416
Simon Pilgrim [Tue, 17 Nov 2020 14:26:53 +0000 (14:26 +0000)]
[X86] nontemporal.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Simon Pilgrim [Tue, 17 Nov 2020 14:16:44 +0000 (14:16 +0000)]
[X86] subvector-broadcast.ll - replace X32 check prefix with X86. NFC.
We typically use X32 for gnux32 triples
Peyton, Jonathan L [Tue, 17 Nov 2020 16:14:36 +0000 (10:14 -0600)]
[OpenMP] NFC: remove tabs in message catalog file
Andy Wingo [Tue, 17 Nov 2020 16:03:50 +0000 (08:03 -0800)]
[WebAssembly] Fix parsing of linking section for named global imports
Differential Revision: https://reviews.llvm.org/D91635
Peyton, Jonathan L [Thu, 5 Nov 2020 18:34:39 +0000 (12:34 -0600)]
[OpenMP][stats] reset serial state when re-entering serial region
Differential Revision: https://reviews.llvm.org/D90867
Matt Arsenault [Tue, 17 Nov 2020 15:47:43 +0000 (10:47 -0500)]
Linker: Fix linking of byref types
This wasn't properly remapping the type like with the other
attributes, so this would end up hitting a verifier error after
linking different modules using byref.
Jay Foad [Mon, 16 Nov 2020 16:08:25 +0000 (16:08 +0000)]
[AMDGPU] Precommit more vccz workaround tests