Mikhail Maltsev [Fri, 19 Jun 2020 12:49:17 +0000 (12:49 +0000)]
[ARM][BFloat] Lowering of create/get/set/dup intrinsics
This patch adds codegen for the following BFloat
operations to the ARM backend:
* concatenation of bf16 vectors
* bf16 vector element extraction
* bf16 vector element insertion
* duplication of a bf16 value into each lane of a vector
* duplication of a bf16 vector lane into each lane
Differential Revision: https://reviews.llvm.org/D81411
Bruno Ricci [Fri, 19 Jun 2020 12:35:50 +0000 (13:35 +0100)]
[clang][test][NFC] Also test for serialization in AST dump tests, part 1/n.
The outputs between the direct ast-dump test and the ast-dump test after
deserialization should match modulo a few differences.
For hand-written tests, strip the "<undeserialized declarations>"s and
the "imported"s with sed.
For tests generated with "make-ast-dump-check.sh", regenerate the
output.
Part 1/n.
Bruno Ricci [Fri, 19 Jun 2020 12:31:38 +0000 (13:31 +0100)]
[clang][utils] Also match "col:" when looking for the end of builtins
Some AST dump tests have no "line:" at all. See "ast-dump-wchar.cpp" for
an example.
Xiangling Liao [Thu, 18 Jun 2020 23:52:34 +0000 (19:52 -0400)]
[AIX] Default AIX to using -fno-use-cxa-atexit
On AIX, we use __atexit to register dtor functions rather than __cxa_atexit.
So a driver change is needed to default AIX to using -fno-use-cxa-atexit.
Windows platform does not uses __cxa_atexit either. Following its precedent,
we remove the assertion for when -fuse-cxa-atexit is specified by the user,
do not produce a message and silently default to -fno-use-cxa-atexit behavior.
Differential Revision: https://reviews.llvm.org/D82136
Xiangling Liao [Wed, 27 May 2020 21:04:43 +0000 (17:04 -0400)]
[AIX][Frontend] Static init implementation for AIX considering no priority
1. Provides no piroirity supoort && disables three priority related
attributes: init_priority, ctor attr, dtor attr;
2. '-qunique' in XL compiler equivalent behavior of emitting sinit
and sterm functions name using getUniqueModuleId() util function
in LLVM (currently no support for InternalLinkage and WeakODRLinkage
symbols);
3. Add testcases to emit IR sample with __sinit80000000, __dtor, and
__sterm80000000;
4. Temporarily side-steps the need to implement the functionality of
llvm.global_ctors and llvm.global_dtors arrays. The uses of that
functionality in this patch (with respect to the name of the functions
involved) are not representative of how the functionality will be used
once implemented.
Differential Revision: https://reviews.llvm.org/D74166
Nathan James [Fri, 19 Jun 2020 12:22:39 +0000 (13:22 +0100)]
[NFC] Simplify IncludeInsertions appending to diagnostics
Kadir Cetinkaya [Fri, 19 Jun 2020 12:13:01 +0000 (14:13 +0200)]
[clangd] Use drop_front instead of consume_front to get rid of a redundant check
Alexander Belyaev [Fri, 19 Jun 2020 11:51:48 +0000 (13:51 +0200)]
[mlir][linalg] Add callback-based builders for `linalg.(indexed_)generic`.
Differential Revision: https://reviews.llvm.org/D82045
Sam McCall [Wed, 17 Jun 2020 13:56:01 +0000 (15:56 +0200)]
[clangd] Don't mangle workdir-relevant driver path in compile commands
Summary:
We can't resolve this (if it's a symlink) without further refactoring, but the
current behaviour is just incorrect.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82011
Georgii Rymar [Wed, 17 Jun 2020 10:47:37 +0000 (13:47 +0300)]
[llvm-readobj] - Add a validation of the GNU hash table to printGnuHashHistogram().
Similar to D81937, we might crash when printing a histogram for a GNU hash table
with a 'symndx' index that is larger than the number of dynamic symbols.
This patch adopts and reuses the `getGnuHashTableChains()` helper which performs
a validation of the table. As a side effect the warning reported for
the --gnu-hash-table was improved.
Also with this change we start to report a warning when the histogram is requested for
the GNU hash table, but the dynamic symbols table is empty (size == 0).
Differential revision: https://reviews.llvm.org/D82010
Florian Hahn [Fri, 19 Jun 2020 11:08:40 +0000 (12:08 +0100)]
[DSE,MSSA] Enable XFAIL'd merge-stores.ll test (NFC).
All cases in the test are supported now, it only still failed because an
over-eager regex match not accounting for `, align ` being added to each
load/store now.
Nathan James [Fri, 19 Jun 2020 11:02:08 +0000 (12:02 +0100)]
[clang-tidy] Extend InheritParentConfig to CommandLineConfig
Extend the `InheritParentConfig` support introduced in D75184 for the command line option `--config`.
The current behaviour of `--config` is to when set, disable looking for `.clang-tidy` configuration files.
This new behaviour lets you set `InheritParentConfig` to true in the command line to then look for `.clang-tidy` configuration files to be merged with what's been specified on the command line.
Reviewed By: DmitryPolukhin
Differential Revision: https://reviews.llvm.org/D81949
Joachim Protze [Fri, 19 Jun 2020 08:59:18 +0000 (10:59 +0200)]
[OpenMP][OMPT] Pass mutexinoutset to the tool
Adds OMPT support for the mutexinoutset dependency
Reviewed by: hbae
Differential Revision: https://reviews.llvm.org/D81890
Simon Pilgrim [Thu, 18 Jun 2020 16:41:15 +0000 (17:41 +0100)]
[X86][SSE] combineHorizontalPredicateResult - improve all_of(X == 0) for vXi64 on pre-SSE41 targets
Without SSE41 we don't have the PCMPEQQ instruction, making cmp-with-zero reductions more complicated than necessary. We can compare as vXi32 (PCMPEQD) and tweak the MOVMSK comparison to test upper/lower DWORD comparisons.
This pre-fixes something that occurs with null tests for vectors of (64-bit) pointers such as in PR35129.
Kadir Cetinkaya [Wed, 17 Jun 2020 16:09:54 +0000 (18:09 +0200)]
[clangd] Drop usage of PreambleStatCache in scanPreamble
Summary: It was used inside buildCompilerInvocation to speed up stats. But
preambleStatCache doesn't contain stat information performed while
building compiler invocation. So it was an unnecessary optimization.
Furthermore, buildCompilerInvocation in scanPreamble doesn't need to
find gcc installation, include paths and such, as it is only trying to
lex directives. Hence we are passing an empty FS to get rid of any
redundant IO.
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81719
LLVM GN Syncbot [Fri, 19 Jun 2020 10:15:53 +0000 (10:15 +0000)]
[gn build] Port
0628705efaf
Kadir Cetinkaya [Wed, 17 Jun 2020 16:09:54 +0000 (18:09 +0200)]
[clangd] Rename FSProvider to TFS in case of ThreadsafeFS
Summary: Depends on D81998
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82024
Kadir Cetinkaya [Wed, 17 Jun 2020 09:53:32 +0000 (11:53 +0200)]
[clangd][NFC] Rename FSProvider and getFileSystem
Summary:
Clangd uses FSProvider to get threadsafe views into file systems. This
patch changes naming to make that more explicit.
Depends on D81920
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81998
Kadir Cetinkaya [Tue, 16 Jun 2020 10:16:24 +0000 (12:16 +0200)]
[clangd] Change FSProvider::getFileSystem to take CurrentWorkingDirectory
Summary:
We've faced a couple of problems when the returned FS didn't have the
proper working directory. New signature makes the API safer against such
problems.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81920
Vitaly Buka [Fri, 19 Jun 2020 10:10:01 +0000 (03:10 -0700)]
[StackSafety,NFC] Fix comment
Tyker [Fri, 19 Jun 2020 10:01:59 +0000 (12:01 +0200)]
Simon Pilgrim [Fri, 19 Jun 2020 09:27:09 +0000 (10:27 +0100)]
[X86][SSE] combineSetCCMOVMSK - fold MOVMSK(SHUFFLE(X,u)) -> MOVMSK(X)
If we're permuting ALL the elements of a single vector, then for allof/anyof MOVMSK tests we can avoid the shuffle entirely.
David Sherwood [Tue, 9 Jun 2020 13:51:38 +0000 (14:51 +0100)]
[SVE] Fall back on DAG ISel at -O0 when encountering scalable types
At the moment we use Global ISel by default at -O0, however it is
currently not capable of dealing with scalable vectors for two
reasons:
1. The register banks know nothing about SVE registers.
2. The LLT (Low Level Type) class knows nothing about scalable
vectors.
For now, the easiest way to avoid users hitting issues when using
the SVE ACLE is to fall back on normal DAG ISel when encountering
instructions that operate on scalable vector types.
I've added a couple of RUN lines to existing SVE tests to ensure
we can compile at -O0. I've also added some new tests to
CodeGen/AArch64/GlobalISel/arm64-fallback.ll
that demonstrate we correctly fallback to DAG ISel at -O0 when
lowering formal arguments or translating instructions that involve
scalable vector types.
Differential Revision: https://reviews.llvm.org/D81557
Sander de Smalen [Fri, 19 Jun 2020 09:06:39 +0000 (10:06 +0100)]
[SveEmitter] Add builtins for struct loads/stores (ld2/ld3/etc)
The struct store intrinsics in LLVM IR take the individual parts
as arguments, so this patch uses the intrinsics used for `svget`
to break the tuples into individual parts.
Reviewers: c-rhodes, efriedma, ctetreau, david-arm
Reviewed By: efriedma
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81466
David Sherwood [Wed, 10 Jun 2020 13:37:25 +0000 (14:37 +0100)]
[CodeGen,AArch64] Fix up warnings in performExtendCombine
Try to avoid calling getVectorNumElements() or relying upon the
TypeSize conversion to uin64_t.
Differential Revision: https://reviews.llvm.org/D81573
Vitaly Buka [Fri, 12 Jun 2020 21:10:47 +0000 (14:10 -0700)]
[StackSafety] Add StackLifetime::isAliveAfter
This function is going to be added into StackSafety checks.
This patch uses function in ::print implementation to make sure
that it works as expected.
Vitaly Buka [Fri, 19 Jun 2020 07:49:23 +0000 (00:49 -0700)]
[SafeStack,NFC] Print liveness for all instrunctions
Vitaly Buka [Fri, 19 Jun 2020 01:17:59 +0000 (18:17 -0700)]
[StackSafety,NFC] Replace map with vector
We don't need to lookup InstructionNumbering by number, so
we can use vector with index as assigned number.
Vitaly Buka [Fri, 19 Jun 2020 01:08:37 +0000 (18:08 -0700)]
[StackSafety,NFC] Don't test terminators
Code does not track terminators and do not expose them through interface.
State there is just a state of the last instruction or entry.
So this information is just redundant and doesn't need to be tested.
Florian Hahn [Fri, 19 Jun 2020 08:27:52 +0000 (09:27 +0100)]
[SCCP] Turn sext into zext for non-negative ranges.
This patch updates SCCP/IPSCCP to use the computed range info to turn
sexts into zexts, if the value is known to be non-negative. We already
to a similar transform in CorrelatedValuePropagation, but it seems like
we can catch a lot of additional cases by doing it in SCCP/IPSCCP as
well.
The transform is limited to ranges that are known to not include undef.
Currently constant ranges from conditions are treated as potentially
containing undef, due to PR46144. Once we flip this, the transform will
be more effective in practice.
Reviewers: efriedma, davide
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D81756
Jay Foad [Thu, 18 Jun 2020 17:20:58 +0000 (18:20 +0100)]
[LiveIntervals] Fix early-clobber handling in handleMoveUp
Without this fix, handleMoveUp can create an invalid live range like
this:
[98904e,98908r:0)[98908e,227504r:1)
where the two segments overlap, but only because we have lost the "e"
(early-clobber) on the end point of the first segment.
Differential Revision: https://reviews.llvm.org/D82110
Raul Tambre [Fri, 19 Jun 2020 07:13:33 +0000 (12:43 +0530)]
[libc++] Implement <numbers>
Summary: Constants have 33 significant decimal digits for IEEE 754 128-bit floating-point numbers.
Reviewers: ldionne, #libc, EricWF, zoecarver, curdeius
Reviewed By: ldionne, #libc, curdeius
Differential Revision: https://reviews.llvm.org/D77505
Daniel Grumberg [Fri, 19 Jun 2020 08:07:42 +0000 (09:07 +0100)]
[NFC] Make AST_BLOCK_HASH test more robust with downstream changes
Tyker [Fri, 19 Jun 2020 08:32:09 +0000 (10:32 +0200)]
[AssumeBundles] add cannonicalisation to the assume builder
Summary:
this reduces significantly the number of assumes generated without aftecting too much
the information that is preserved. this improves the compile-time cost
of enable-knowledge-retention significantly.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, asbirlea, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79650
Alex Zinenko [Thu, 18 Jun 2020 20:55:53 +0000 (22:55 +0200)]
[mlir] Remove EDSC NestedBuilder
All class derived from `edsc::NestedBuilder` in core MLIR have been replaced
with alternatives based on OpBuilder+callbacks. The *Builder EDSC
infrastructure has been deprecated. Remove edsc::NestedBuilder.
This completes the "structured builders" refactoring.
Differential Revision: https://reviews.llvm.org/D82128
Alex Zinenko [Thu, 18 Jun 2020 20:55:46 +0000 (22:55 +0200)]
[mlir] Remove EDSC BlockBuilder, BlockHandle and related functionality
Callback-based constructions of blocks where the body is populated in the same
function as the block creation is a natural extension of callback-based loop
construction. They provide more concise and simple APIs than EDSC BlockBuilder
at less than 20% infrastructural code cost, and are compatible with
ScopedContext. BlockBuilder, Blockhandle and related functionality has been
deprecated, remove them.
Differential Revision: https://reviews.llvm.org/D82015
Alex Zinenko [Thu, 18 Jun 2020 20:55:40 +0000 (22:55 +0200)]
[mlir] Remove EDSC LoopBuilder, derived classes and related functionality
Callback-based loop construction, with loop bodies being constructed during the
construction of the parent op using a function, is now fully supported by the
core infrastructure. This provides almost the same level of brevity as EDSC
LoopBuilder at less than 30% infrastructural code cost. Functional equivalents
compatible with EDSC ScopedContext are implemented on top of the main builders.
LoopBuilder and related functionality has been deprecated, remove it.
Differential Revision: https://reviews.llvm.org/D81874
David Sherwood [Tue, 26 May 2020 06:46:01 +0000 (07:46 +0100)]
[CodeGen] Fix SimplifyDemandedBits for scalable vectors
For now I have changed SimplifyDemandedBits and it's various callers
to assume we know nothing for scalable vectors and to ignore the
demanded bits completely. I have also done something similar for
SimplifyDemandedVectorElts. These changes fix up lots of warnings
due to calls to EVT::getVectorNumElements() for types with scalable
vectors. These functions are all used for optimisations, rather than
functional requirements. In future we can revisit this code if
there is a need to improve code quality for SVE.
Differential Revision: https://reviews.llvm.org/D80537
David Sherwood [Wed, 3 Jun 2020 14:02:44 +0000 (15:02 +0100)]
[CodeGen] Fix ComputeNumSignBits for scalable vectors
When trying to calculate the number of sign bits for scalable vectors
we should just bail out for now and pretend we know nothing.
Differential Revision: https://reviews.llvm.org/D81093
Haojian Wu [Tue, 16 Jun 2020 07:08:02 +0000 (09:08 +0200)]
[AST] Dump containsErrors bit for the Type.
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81912
Mehdi Amini [Fri, 19 Jun 2020 03:21:36 +0000 (03:21 +0000)]
Fix `check-mlir` target when the host target isn't configured
This patch adds the `default_triple` feature to MLIR test suite.
This feature was added to LLVM in
d178f4fc8 in order to be able to
run the LLVM tests without having the host targets configured in.
With this change, `ninja check-mlir` passes without the host
target, i.e. this config:
cmake ../llvm -DLLVM_TARGETS_TO_BUILD="" -DLLVM_DEFAULT_TARGET_TRIPLE="" -DLLVM_ENABLE_PROJECTS=mlir -GNinja
Differential Revision: https://reviews.llvm.org/D82142
Mehdi Amini [Fri, 19 Jun 2020 04:41:24 +0000 (04:41 +0000)]
Mark some LLVM tests which require a default_triple (NFC)
These tests involve a JIT, and like other tests should have the
REQUIRE: default_triple present.
This allow to run `ninja check` without the host target configured
in.
Kristof Beyls [Mon, 25 May 2020 14:48:22 +0000 (15:48 +0100)]
[AArch64] Add clang command line support for -mharden-sls=
The accepted options to -mharden-sls= are:
* all: enable all mitigations against Straight Line Speculation that are
implemented.
* none: disable all mitigations against Straight Line Speculation.
* retbr: enable the mitigation against Straight Line Speculation for RET
and BR instructions.
* blr: enable the mitigation against Straight Line Speculation for BLR
instructions.
Differential Revision: https://reviews.llvm.org/D81404
Max Kazantsev [Fri, 19 Jun 2020 05:56:26 +0000 (12:56 +0700)]
[Test] Add more tests on select->phi transform
Dylan McKay [Fri, 19 Jun 2020 05:34:59 +0000 (17:34 +1200)]
[AVR] Remove duplicate specification of lib directory
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: Jim, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77334
This was originally committed in
03b0831144a9fe25aac81498b0a1dec82f4ec5df but I missed the commit
attribution.
Patch by Dennis van der Schagt.
Dylan McKay [Fri, 19 Jun 2020 05:35:43 +0000 (17:35 +1200)]
Revert "[AVR] Remove duplicate specification of lib directory"
This reverts commit
03b0831144a9fe25aac81498b0a1dec82f4ec5df.
I forgot to attribute the commit originally so I am recommitting in a
subsequent patch.
Dylan McKay [Fri, 19 Jun 2020 05:34:59 +0000 (17:34 +1200)]
[AVR] Remove duplicate specification of lib directory
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: Jim, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77334
Kristof Beyls [Fri, 22 May 2020 20:00:46 +0000 (21:00 +0100)]
[AArch64] Avoid incompatibility between SLSBLR mitigation and BTI codegen.
A "BTI c" instruction only allows jumping/calling to using a BLR* instruction.
However, the SLSBLR mitigation changes a BLR to a BR to implement the
function call. Therefore, a "BTI c" check that passed before could
trigger after the BLR->BL change done by the SLSBLR mitigation.
However, if the register used in BR is X16 or X17, this trigger will not
fire (see ArmARM for further details).
Therefore, this patch simply changes the function stubs for the SLSBLR
mitigation from
__llvm_slsblr_thunk_x<N>:
br x<N>
SpeculationBarrier
to
__llvm_slsblr_thunk_x<N>:
mov x16, x<N>
br x16
SpeculationBarrier
Differential Revision: https://reviews.llvm.org/D81405
Anthony Steinhauser [Fri, 19 Jun 2020 04:54:30 +0000 (21:54 -0700)]
[libc] Migrate the libc benchmark instruction to ninja.
Reviewers: sivachandra
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D82143
Ronak Chauhan [Wed, 17 Jun 2020 19:52:08 +0000 (01:22 +0530)]
[MC] Pass the symbol rather than its name to onSymbolStart()
Summary: This allows targets to also consider the symbol's type and/or address if needed.
Reviewers: scott.linder, jhenderson, MaskRay, aardappel
Reviewed By: scott.linder, MaskRay
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, aheejin, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82090
Francesco Petrogalli [Fri, 19 Jun 2020 03:31:01 +0000 (03:31 +0000)]
[llvm][SVE] Reg + reg addressing mode for LD1RO.
Reviewers: efriedma, sdesmalen
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80741
Nemanja Ivanovic [Fri, 19 Jun 2020 02:53:50 +0000 (21:53 -0500)]
[PowerPC] Canonicalize shuffles to match more single-instruction masks on LE
We currently miss a number of opportunities to emit single-instruction
VMRG[LH][BHW] instructions for shuffles on little endian subtargets. Although
this in itself is not a huge performance opportunity since loading the permute
vector for a VPERM can always be pulled out of loops, producing such merge
instructions is useful to downstream optimizations.
Since VPERM is essentially opaque to all subsequent optimizations, we want to
avoid it as much as possible. Other permute instructions have semantics that can
be reasoned about much more easily in later optimizations.
This patch does the following:
- Canonicalize shuffles so that the first element comes from the first vector
(since that's what most of the mask matching functions want)
- Switch the elements that come from splat vectors so that they match the
corresponding elements from the other vector (to allow for merges)
- Adds debugging messages for when a shuffle is matched to a VPERM so that
anyone interested in improving this further can get the info for their code
Differential revision: https://reviews.llvm.org/D77448
Carl Ritson [Fri, 19 Jun 2020 01:29:47 +0000 (10:29 +0900)]
AMDGPU/GlobalISel: Remove selection of MAD/MAC when not available
Add code to respect mad-mac-f32-insts target feature.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D81990
LLVM GN Syncbot [Fri, 19 Jun 2020 01:17:54 +0000 (01:17 +0000)]
[gn build] Port
9ca50e887db
Richard Smith [Fri, 19 Jun 2020 01:16:53 +0000 (18:16 -0700)]
Yitzhak Mandelbaum [Mon, 15 Jun 2020 19:23:57 +0000 (15:23 -0400)]
[libTooling] Add parser for string representation of `RangeSelector`.
This patch adds a parser for a `RangeSelector` written as a string. The format
is closely based on the way one would right the selector in C++. This should
enable use of `RangeSelector`s from tools like clang-query and web UIs.
Richard Smith [Fri, 19 Jun 2020 00:45:55 +0000 (17:45 -0700)]
The type of a reference to a non-type template parameter pack should
not be a pack expansion type.
Using a pack expansion type for a pack declaration makes sense, but
general expressions should never have pack expansion types. If we have a
pack `T *...V`, then the type of `V` is the type `T *`, which contains
an unexpanded pack, and is a pointer type.
This allows us to better diagnose issues where a template is invalid due
to some non-dependent portion of a dependent type of a non-type template
parameter pack.
Ties Stuij [Thu, 18 Jun 2020 22:57:32 +0000 (23:57 +0100)]
[BFloat] Move LLVMBFloatTypeKind to the end of the enum
Summary: so it doesn't change the C ABI
Reviewers: deadalnix
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82135
peter klausler [Thu, 18 Jun 2020 21:37:59 +0000 (14:37 -0700)]
[flang] DATA statement processing (part 2/4): Initial images
Summary:
Defines a representation for the initialized memory image of
a variable. This image is populated by DATA statement
processing as designator elements are put into correspondence
with values, then converted into an initializer in the symbol
table so that lowering can pass the initial image to the
code generator.
Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
Reviewed By: tskeith
Subscribers: mgorny, llvm-commits, flang-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D82131
Brad Smith [Fri, 19 Jun 2020 00:05:39 +0000 (20:05 -0400)]
Revert "Hook up OpenBSD 64-bit PowerPC support"
Derek Schuff [Thu, 18 Jun 2020 20:06:51 +0000 (13:06 -0700)]
Set appropriate host defines for building under emscripten
Emscripten has emulations for several headers found on Linux,
including spwan.h and endian.h
Differential Revision: https://reviews.llvm.org/D82121
Vitaly Buka [Thu, 18 Jun 2020 23:55:12 +0000 (16:55 -0700)]
[sanitizer] Update global_symbols.txt
Vitaly Buka [Thu, 18 Jun 2020 09:24:00 +0000 (02:24 -0700)]
[StackSafety] Add "Must Live" logic
Summary:
Extend StackLifetime with option to calculate liveliness
where alloca is only considered alive on basic block entry
if all non-dead predecessors had it alive at terminators.
Depends on D82043.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82124
Nathan James [Thu, 18 Jun 2020 23:40:00 +0000 (00:40 +0100)]
[NFC] Refactor Registry loops to range for
Vitaly Buka [Wed, 17 Jun 2020 11:09:58 +0000 (04:09 -0700)]
[StackSafety] Add pass for StackLifetime testing
Summary: lifetime.ll is a copy of SafeStack/X86/coloring2.ll
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: hiraditya, mgrang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82043
Brad Smith [Thu, 18 Jun 2020 23:19:45 +0000 (19:19 -0400)]
Hook up OpenBSD 64-bit PowerPC support
River Riddle [Thu, 18 Jun 2020 22:45:43 +0000 (15:45 -0700)]
[mlir][DialectConversion] Refactor how block argument types get converted
This revision removes the TypeConverter parameter passed to the apply* methods, and instead moves the responsibility of region type conversion to patterns. The types of a region can be converted using the 'convertRegionTypes' method, which acts similarly to the existing 'applySignatureConversion'. This method ensures that all blocks within, and including those moved into, a region will have the block argument types converted using the provided converter.
This has the benefit of making more of the legalization logic controlled by patterns, instead of being handled explicitly by the driver. It also opens up the possibility to support multiple type conversions at some point in the future.
This revision also adds a new utility class `FailureOr<T>` that provides a LogicalResult friendly facility for returning a failure or a valid result value.
Differential Revision: https://reviews.llvm.org/D81681
Xiangling Liao [Tue, 16 Jun 2020 20:27:04 +0000 (16:27 -0400)]
[NFC] Cleanup of EmitCXXGlobalInitFunc() and EmitCXXGlobalDtorFunc()
Tidy up some code of EmitCXXGlobalInitFunc() and EmitCXXGlobalDtorFunc() as the
pre-work of D74166 patch.
Differential Revision: https://reviews.llvm.org/D81972
peter klausler [Thu, 18 Jun 2020 20:28:43 +0000 (13:28 -0700)]
[flang] DATA stmt processing (part 1/4): designator folding
Summary:
Add code to resolve constant Designators at compilation time
into a base Symbol, byte offset, and field size. This is used in
later DATA statement processing to identify the static storage being
initialized by each object in a DATA statement. Also implement
the reverse mapping so that Designators can be reconstructed for
use in error messages about (e.g.) duplicate initializers.
Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
Reviewed By: PeteSteinfeld
Subscribers: mgorny, llvm-commits, flang-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D82125
Fangrui Song [Thu, 18 Jun 2020 21:52:39 +0000 (14:52 -0700)]
[docs] Regenerate clang/docs/ClangCommandLineReference.rst
Matt Arsenault [Thu, 18 Jun 2020 13:37:33 +0000 (09:37 -0400)]
ARC: Enforce function alignment at code emission time
Don't do this in the MachineFunctionInfo constructor. Also, ensure the
alignment rather than overwriting it outright. I vaguely remember
there was another place to enforce the target minimum alignment, but I
couldn't find it (it's there for instructions).
Matt Arsenault [Fri, 5 Jun 2020 19:29:18 +0000 (15:29 -0400)]
AMDGPU/GlobalISel: Implement computeKnownAlignForTargetInstr
We probably need to move where intrinsics are lowered to copies to
make this useful.
Matt Arsenault [Thu, 18 Jun 2020 21:24:12 +0000 (17:24 -0400)]
AMDGPU: Update private null pointer value in documentation
Private pointers used to workaround IR semantics by artifically
reserving an object at offset 0 so no user object would be allocated
there. Since alloca now uses a non-0 address space, that workaround is
unnecssary and 0 can be treated as a valid pointer.
Matt Arsenault [Thu, 11 Jun 2020 00:47:52 +0000 (20:47 -0400)]
BypassSlowDivision: Fix dropping debug info
I don't know anything about debug info, but this seems like more work
should be necessary. This constructs a new IRBuilder and reconstructs
the original divides rather than moving the original.
One problem this has is if a div/rem pair are handled, both end up
with the same debugloc. I'm not sure how to fix this, since this uses
a cache when it sees the same input operands again, which will have
the first instance's location attached.
peter klausler [Thu, 18 Jun 2020 19:19:49 +0000 (12:19 -0700)]
[flang] Roll up small fixes to runtime bugs found in testing
Summary:
Fix several bugs in the Fortran runtime found in initial
testing.
Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
Reviewed By: tskeith, PeteSteinfeld
Subscribers: llvm-commits, flang-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D82116
Amy Kwan [Thu, 18 Jun 2020 18:11:09 +0000 (13:11 -0500)]
[PowerPC][Power10] Implement Parallel Bits Deposit/Extract Builtins in LLVM/Clang
This patch implements builtins for the following prototypes:
vector unsigned long long vec_pdep(vector unsigned long long, vector unsigned long long);
vector unsigned long long vec_pext(vector unsigned long long, vector unsigned long long __b);
unsigned long long __builtin_pdepd (unsigned long long, unsigned long long);
unsigned long long __builtin_pextd (unsigned long long, unsigned long long);
Revision Depends on D80758
Differential Revision: https://reviews.llvm.org/D80935
Matt Arsenault [Tue, 16 Jun 2020 18:20:34 +0000 (14:20 -0400)]
GlobalISel: Fix some artifact combiner worklist inconsistencies
In one case, UpdateDefs was not getting set and a dead SmallVector
constructed. In another, it was adding new vreg defs to the updated
set which should be unnecessary. This also wasn't considering the
multiple defs of G_UNMERGE_VALUES.
Also increase the small vector sizes for merge/unmerge operands to the
usual semi-arbitrary 8. While debugging these, I'm usually seeing
merges and unmerges with at least 4 uses/defs.
I haven't run into an actual problem from any of these though.
Matt Arsenault [Tue, 9 Jun 2020 21:02:12 +0000 (17:02 -0400)]
GlobalISel: Pass LegalizerHelper to custom legalize callbacks
This was passing in all the parameters needed to construct a
LegalizerHelper in the custom legalization, when it's simpler to just
pass in the existing helper.
This is slightly more annoying to use in the common case where you
don't need the legalizer helper, but we could add back the common
parameters back in addition to the helper.
I didn't propagate this to all the internal target changes that this
logically implies, but did update a sample one for
legalizeMinNumMaxNum.
This is in preparation for moving AMDGPU load/store legalization
entirely into custom lowering. The current set of legalization actions
is really constraining and not really capable of expressing all the
actions needed to legalize loads/stores. In particular there's no way
to express when the memory access itself needs to change size vs. the
result type. There's also a lot of redundancy since the same
split/widen actions need to be applied in both vector and scalar
cases. All of the sub-cases logically belong as steps in the legalizer
helper, but it will be easier to consider everything at once in custom
lowering.
Vedant Kumar [Thu, 4 Jun 2020 21:33:17 +0000 (14:33 -0700)]
[docs] Specify rules for updating debug locations
Summary:
Restructure HowToUpdateDebugInfo.rst to specify rules for when
transformations should preserve, merge, or drop debug locations.
The goal is to have clear, well-justified rules that come with a few
examples and counter-examples, so that pass authors can pick the best
strategy for managing debug locations depending on the specific task at
hand.
I've tried to set down sensible rules here that mostly align with what
we already do in llvm today, and that take a diverse set of use cases
into account (interactive debugging, crash triage, SamplePGO).
Please *do* try to pick these rules apart and suggest clarifications or
improvements :).
Side note: Prior to
24660ea1, this document was structured as a long
list of very specific code transformations -- the idea being that we
would fill in what to do in each specific case. I chose to reorganize
the document as a list of actions to take because it drastically cuts
down on the amount of redundant exposition/explanation needed. I hope
that's fine...
Reviewers: jmorse, aprantl, dblaikie
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81198
Jonas Devlieghere [Thu, 18 Jun 2020 21:04:34 +0000 (14:04 -0700)]
[Sphinx] Adjust for source_parsers deprecation in Sphinx 3.0
Update the Sphinx configuration for the removal of source_parsers in
Sphinx 3.0. The variable has been deprecated since version 1.8.
> Version 1.8 deprecates and version 3.0 removes the source_parsers
> configuration variable that was used by older recommonmark versions.
https://www.sphinx-doc.org/en/master/usage/markdown.html
Differential revision: https://reviews.llvm.org/D75284
Alex Zinenko [Thu, 18 Jun 2020 15:53:59 +0000 (17:53 +0200)]
[mlir] Update Toy tutorial to use callback-based loop constructors
We recently introduced support for building loops or loop nests using callbacks
that populate the body. Use these in the tutorial instead of setInsertionPoint
manipulations.
Differential Revision: https://reviews.llvm.org/D82104
Alex Zinenko [Thu, 18 Jun 2020 15:53:50 +0000 (17:53 +0200)]
[mlir] Refactor affine loop nest builders
Existing implementation of affine loop nest builders relies on EDSC
ScopedContext, which is not used pervasively. Provide a common OpBuilder-based
helper function to construct a perfect nest of affine loops with the body of
the innermost loop populated by a callback. Use this function to implement the
EDSC version.
Affine "for" loops differ from SCF "for" loops by (1) not allowing to yield
values and (2) supporting short-hand form for constant bounds, which justifies
a separate implementation of the loop nest builder for the same of simplicity.
Differential Revision: https://reviews.llvm.org/D81955
River Riddle [Thu, 18 Jun 2020 20:58:25 +0000 (13:58 -0700)]
[mlir] Allow for patterns to match any root kind.
Traditionally patterns have always had the root operation kind hardcoded to a specific operation name. This has worked well for quite some time, but it has certain limitations that make it undesirable. For example, some lowering have the same implementation for many different operations types with a few lowering entire dialects using the same pattern implementation. This problem has led to several "solutions":
a) Provide a template implementation to the user so that they can instantiate it for each operation combination, generally requiring the inclusion of the auto-generated operation definition file.
b) Use a non-templated pattern that allows for providing the name of the operation to match
- No one ever does this, because enumerating operation names can be cumbersome and so this quickly devolves into solution a.
This revision removes the restriction that patterns have a hardcoded root type, and allows for a class patterns that could match "any" operation type. The major downside of root-agnostic patterns is that they make certain pattern analyses more difficult, so it is still very highly encouraged that an operation specific pattern be used whenever possible.
Differential Revision: https://reviews.llvm.org/D82066
River Riddle [Thu, 18 Jun 2020 20:58:17 +0000 (13:58 -0700)]
[mlir] Refactor RewritePatternMatcher into a new PatternApplicator class.
This class enables for abstracting more of the details for the rewrite process, and will allow for clients to apply specific cost models to the pattern list. This allows for DialectConversion and the GreedyPatternRewriter to share the same underlying matcher implementation. This also simplifies the plumbing necessary to support dynamic patterns.
Differential Revision: https://reviews.llvm.org/D81985
Shuhong Liu [Thu, 18 Jun 2020 20:51:53 +0000 (16:51 -0400)]
[AIX] Split lit test shtest-format into two separate tests and add AIX as UNSUPPORTED for shtest-format-argv0
Summary: lit test `shtest-format.py` fails on AIX because one of the subtest of shtest-format requires the tool `[` to be installed under the system PATH. For AIX, `[` is only available as a shell builtin and does not present as an executable file under PATH. Hence, split the original shtest-format into two separate test files and added AIX as UNSUPPORTED for the test using `[` .
Reviewers: daltenty, hubert.reinterpretcast
Reviewed By: hubert.reinterpretcast
Subscribers: delcypher, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82100
aartbik [Thu, 18 Jun 2020 19:55:54 +0000 (12:55 -0700)]
[mlir] [integration-test] [LLVMIR] Add reduction intrinsic tests
Reviewers: ftynse, nicolasvasilache, reidtatge
Reviewed By: nicolasvasilache
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82117
Christopher Tetreault [Thu, 18 Jun 2020 19:57:08 +0000 (12:57 -0700)]
[SVE] Remove calls to VectorType::getNumElements from Transforms/Utils
Reviewers: efriedma, c-rhodes, david-arm, Tyker, asbirlea
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82057
Yaxun (Sam) Liu [Tue, 16 Jun 2020 18:52:03 +0000 (14:52 -0400)]
[HIP] Enable -amdgpu-internalize-symbols
Enable -amdgpu-internalize-symbols to eliminate unused functions and global variables
for whole program to speed up compilation and improve performance.
For -fno-gpu-rdc, -amdgpu-internalize-symbols is passed to clang -cc1.
For -fgpu-rdc, -amdgpu-internalize-symbols is passed to lld.
Differential Revision: https://reviews.llvm.org/D81959
Thomas Raoux [Thu, 18 Jun 2020 20:24:51 +0000 (13:24 -0700)]
[mlir][vulkan-runner] add support for memref of i8, i16 types in vulkan runner
This extends the types supported as kernel arguments when using vulkan runner.
Differential Revision: https://reviews.llvm.org/D82068
Alexandre Ganea [Thu, 18 Jun 2020 20:17:05 +0000 (16:17 -0400)]
[CodeView] Revert
8374bf43634725dc02a262a77b5f940fca25938c and
403f9537924b8910ed4f741ed96c61f5e657915b
This reverts:
8374bf43634725dc02a262a77b5f940fca25938c [CodeView] Fix generated command-line expansion in LF_BUILDINFO. Fix the 'pdb' entry which was previously a null reference, now an empty string.
403f9537924b8910ed4f741ed96c61f5e657915b [CodeView] Add full repro to LF_BUILDINFO record
This is causing the lld/test/COFF/pdb-relative-source-lines.test to fail: http://lab.llvm.org:8011/builders/lld-x86_64-win/builds/1096/steps/test-check-all/logs/FAIL%3A%20lld%3A%3Apdb-relative-source-lines.test
And clang/test/CodeGen/debug-info-codeview-buildinfo.c fails as well: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/33346/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Adebug-info-codeview-buildinfo.c
Sam Clegg [Tue, 16 Jun 2020 19:23:25 +0000 (12:23 -0700)]
[lld][WebAssembly] Allow ctors functions that return values
Some projects use the constructor attribute on functions that also
return values. In this case we just ignore them.
The error was reported in the libgpg-error project that marks
gpg_err_init with the `__constructor__` attribute.
Differential Revision: https://reviews.llvm.org/D81962
Thomas Raoux [Thu, 18 Jun 2020 20:05:09 +0000 (13:05 -0700)]
[mlir][spirv] Allow mixed type cooperative matrix muladd
muladd can have differenti types for lhs/rhs and acc/destination. Change
verifier and update the test to use supported example.
Differential Revision: https://reviews.llvm.org/D82042
Jacques Pienaar [Thu, 18 Jun 2020 19:51:51 +0000 (12:51 -0700)]
[mlir][ods] Look through OpVariable for type constraint
If one uses an OpVariable (such as via Res) then the result type constraint
should be returned.
Differential Revision: https://reviews.llvm.org/D82119
Kirill Naumov [Sat, 6 Jun 2020 00:06:09 +0000 (00:06 +0000)]
[BasicBlock] Added AnnotationWriter functionality to BasicBlock class
This functionality is very similar to Function compatibility with
AnnotationWriter. This change allows us to use AnnotationWriter with
BasicBlock through BB.print() method.
Reviewed-By: apilipenko
Differntial Revision: https://reviews.llvm.org/D81321
Sanjay Patel [Thu, 18 Jun 2020 19:44:02 +0000 (15:44 -0400)]
[IRBuilder] add/use wrapper to create a generic compare based on predicate type; NFC
The predicate can always be used to distinguish between icmp and fcmp,
so we don't need to keep repeating this check in the callers.
Eric Christopher [Thu, 18 Jun 2020 19:36:34 +0000 (12:36 -0700)]
Add SveBFloat16 to type switch.
Matt Arsenault [Thu, 28 May 2020 15:33:15 +0000 (11:33 -0400)]
AMDGPU: Add IntrWillReturn to intrinsic definitions
This should probably be implied for all the speculatable ones. I think
the only ones where this plausibly doesn't apply is s_sendmsghalt and
maybe kill.
Davide Italiano [Thu, 18 Jun 2020 19:33:02 +0000 (12:33 -0700)]
[SimplifyCFG] Update debug location when folding branch to common destination
Sometimes a dead block gets folded and the debug information is still
retained. This manifests as jumpy stepping in lldb, see the bugzilla PR
for an end-to-end C testcase.
Fixes https://bugs.llvm.org/show_bug.cgi?id=46008
Differential Revision: https://reviews.llvm.org/D82062
Eduardo Caldas [Thu, 18 Jun 2020 18:41:43 +0000 (20:41 +0200)]
Add support for DeclRefExpr in SyntaxTree, by generating IdExpressions
Reviewers: gribozavr2
Reviewed By: gribozavr2
Subscribers: hlopko, gribozavr2, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81168
Christopher Ferris [Thu, 18 Jun 2020 18:18:16 +0000 (11:18 -0700)]
[scudo][standalone] Allow Primary allocations to fail up multiple times.
Summary:
When enabling some malloc debug features on Android, multiple 32 bit
regions become exhausted, and the allocations fail. Allow allocations
to keep trying each bigger class in the Primary until it finds a fit.
In addition, some Android tests running on 32 bit fail sometimes due
to a running out of space in two regions, and then fail the allocation.
Reviewers: cryptoad
Reviewed By: cryptoad
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D82070