Commit Graph

411147 Commits

Author SHA1 Message Date
Aart Bik e52f530c36 [mlir][sparse] fix two typos
(1) copy-and-past error in encoding alias name:
    this is an annotation for a tensor (3-d) not a matrix (2-d).

(2) typo in "initialization"

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D117255
2022-01-13 15:11:55 -08:00
Peter Klausler 63a2987d51 [flang] Allow initialization in blank COMMON
This is nonconformant usage, but widely accepted as an extension.
Downgrade the error message to a warning.

Differential Revision: https://reviews.llvm.org/D117152
2022-01-13 15:07:37 -08:00
Lang Hames bfd0cbd4eb Reapply 253ce92844 "[JITLink][AArch64] Add support for splitting.." with fixes.
This reapplies 253ce92844, which was reverted in
66b2ed477f due to bot failures.

I have added the `-phony-externals` option added, which should fix the
unresolved symbol errors.
2022-01-14 10:00:20 +11:00
Bixia Zheng 778a264da9 Upstream MLIR PyTACO implementation.
Add TACO tests to test/Integration/Dialect/SparseTensor/taco. Add the MLIR
PyTACO implementation as tools under the directory.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D117126
2022-01-13 14:50:28 -08:00
Arthur Eubanks 9a0fe1b0fc [Inline] Attempt to delete any discardable if unused functions
Previously we limited ourselves to only internal/private functions. We
can also delete linkonce_odr functions.

Minor compile time wins:
https://llvm-compile-time-tracker.com/compare.php?from=d51e3474e060cb0e90dc2e2487f778b0d3e6a8de&to=bccffe3f8d5dd4dda884c9ac1f93e51772519cad&stat=instructions

Major memory wins on tramp3d:
https://llvm-compile-time-tracker.com/compare.php?from=d51e3474e060cb0e90dc2e2487f778b0d3e6a8de&to=bccffe3f8d5dd4dda884c9ac1f93e51772519cad&stat=max-rss

Relanding with fix for compile times D117236.

Reviewed By: nikic, mtrofin

Differential Revision: https://reviews.llvm.org/D115545
2022-01-13 14:48:38 -08:00
Jon Chesterfield d53b979596 [openmp][devicertl] Handle missing clang_tool
Fixes github issues/52910

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D117230
2022-01-13 22:43:26 +00:00
Arthur Eubanks 757e044dce [Inliner] Don't removeDeadConstantUsers() when checking if a function is dead
If a function has many uses, this can take a good chunk of compile times.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D117236
2022-01-13 14:29:45 -08:00
Peter Klausler 00e0de0572 [flang] Extension: initialization of LOGICAL with INTEGER & vice versa
We already accept assignments of INTEGER to LOGICAL (& vice versa)
as an extension, but not initialization.  Extend initialization
to cover those cases.

(Also fix misspelling in nearby comment as suggested by code reviewer.)

Decouple an inadvertent dependence cycle by moving two
one-line function definitions into a header file.

Differential Revision: https://reviews.llvm.org/D117159
2022-01-13 14:22:45 -08:00
Whitney Tsang cb6b9d3ae2 [LoopNest] Add new utilites
getLoopIndex() is added to get the loop index of a given loop.
getLoopsAtDepth() is added to get the loops in the nest at a given
depth.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D115590
2022-01-13 17:19:19 -05:00
Roman Lebedev 2c0c619541
[NFC][SCEV] Add test where it's the innermost umin_seq that has a duplicate operand 2022-01-14 01:15:45 +03:00
Zequan Wu f00cd23cae Revert "Revert "[LLDB][NativePDB] Add support for inlined functions""
This reland 945aa520ef with fixes.

This reverts commit 10bc3362a1.
2022-01-13 14:00:24 -08:00
Congzhe Cao 37e34b74e9 [LoopInterchange] Enable interchange with multiple outer loop indvars
This patch enables loop interchange with multiple outer loop
induction variables, and hence removes the limitation that only
a single outer loop induction variable is supported. In fact, it
turns out that the current pass already trivially supports multiple
outer indvars, which is the result of a previous patch
`https://reviews.llvm.org/D102743`. Therefore, this patch removed that
limitation and provides test cases for multiple outer indvars.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D114916
2022-01-13 16:51:32 -05:00
Philip Reames 213193c184 [test] precommit coverage for D117249 2022-01-13 13:42:39 -08:00
Venkata Ramanaiah Nalamothu 0bcd9f60cd [AMDGPU] Ensure return address is save/restored around the call with IPRA enabled/disabled
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D117243
2022-01-14 03:09:03 +05:30
Jack Kirk bef3eb8344 [Clang][NVPTX]Add NVPTX intrinsics and builtins for CUDA PTX cvt sm80 instructions
Adds NVPTX intrinsics and builtins for CUDA PTX cvt instructions for sm80
architectures and above. Requires ptx 7.0.

PTX ISA description of cvt instructions :
https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cvt

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>

Differential Revision: https://reviews.llvm.org/D116673
2022-01-13 13:29:48 -08:00
Sam McCall 07f9fb8b51 [clangd] Elide even more checks in SelectionTree.
During pop() we convert nodes into spans of expanded syntax::Tokens.
If we precompute a range of plausible (expanded) tokens, then we can do an
extremely cheap approximate hit-test against it, because syntax::Tokens are
ordered by pointer.

This would seem not to buy anything (we don't enter nodes unless they overlap
the selection), but in fact the spans we have are for *newly* claimed ranges
(i.e. those unclaimed by any child node).

So if you have:
   { { [[2+2]]; } }
then all of the CompoundStmts pass the hit test and are pushed, but we skip
full hit-testing of the brackets during pop() as they lie outside the range.

This is ~10x average speedup for selectiontree on a bad case I've seen
(large gtest file).

Differential Revision: https://reviews.llvm.org/D117107
2022-01-13 22:27:51 +01:00
Sam McCall 004acbb47d [clangd] Suppress warning about system_header pragma when editing headers
Not sure it's OK to suppress this in clang itself - if we're building a PCH
or module, maybe it matters?

Differential Revision: https://reviews.llvm.org/D116925
2022-01-13 22:24:05 +01:00
Peter Klausler c14cf92b5a [flang] Implement semantics for DEC STRUCTURE/RECORD
Implements part of the legacy "DEC structures" feature from
VMS Fortran.  STRUCTUREs are processed as if they were derived
types with SEQUENCE.  DATA-like object entity initialization
is supported as well (e.g., INTEGER FOO/666/) since it was used
for default component initialization in structures.  Anonymous
components (named %FILL) are also supported.

These features, and UNION/MAP, were already being parsed.
An omission in the collection of structure field names in the
case of nested structures with entity declarations was fixed
in the parser.

Structures are supported in modules, but this is mostly for
testing purposes.  The names of fields in structures accessed
via USE association cannot appear with dot notation in client
code (at least not yet).  DEC structures antedate Fortran 90,
so their actual use in applications should not involve modules.

This patch does not implement UNION/MAP, since that feature
would impose difficulties later in lowering them to MLIR types.
In the meantime, if they appear, semantics will issue a
"not yet implemented" error message.

Differential Revision: https://reviews.llvm.org/D117151
2022-01-13 13:17:13 -08:00
Sam McCall 71a082f726 [clangd] Implement textDocument/typeDefinition
This reuses the type=>decl mapping from go-to-definition on auto.
(Which could stand some improvement, but that can happen later).

Fixes https://github.com/clangd/clangd/issues/367

Differential Revision: https://reviews.llvm.org/D116443
2022-01-13 22:15:10 +01:00
Roman Lebedev 993792bd1a
[SCEV] Don't consider umin_seq scev expr to be more complex that ptrtoint scev expr
Let's consider sequential min/max expression family
to be more complex than their non-sequential counterparts,
preserving internal ordering within them.
2022-01-13 23:59:47 +03:00
Roman Lebedev f14b575194
[NFC][SCEV] Add test for umin_seq complexity ordering 2022-01-13 23:59:47 +03:00
Philip Reames cd36b29ec7 [MemoryBuiltins] (Slightly) clean up abuse of MallocLike bitmask [NFC] 2022-01-13 12:39:22 -08:00
Roman Lebedev 82c8aca934
[SimplifyCFG] Be more aggressive when sinking into block followed by unreachable
I strongly believe we need some variant of this.

The main problem is e.g. that the glibc's assert has 4 parameters,
but the profitability check is only okay with one extra phi node,
so D116692 doesn't even trigger on most of the expected cases.

While that restriction probably makes sense in normal code, if we
are about to run off of a cliff (into an `unreachable`), this
successor block is unlikely so the cost to setup these PHI nodes
should not be on the hotpath, and shouldn't matter performance-wise.

Likewise, we don't sink if there are unconditional predecessors
UNLESS we'd sink at least one non-speculatable instruction,
which is a performance workaround, but if we are about to run into
`unreachable`, it shouldn't matter.

Note that we only allow the case where there are at
most unconditiona branches on the way to the unreachable block.

Differential Revision: https://reviews.llvm.org/D117045
2022-01-13 23:30:31 +03:00
Louis Dionne 3d40508169 [libc++][NFC] Fix placement of some XFAILs 2022-01-13 15:28:41 -05:00
Craig Topper 0fac3891ec [X86] Fix mistake in comment on LowerFROUND. NFC
The code uses floor not trunc.
2022-01-13 12:22:04 -08:00
Tue Ly 355e56f5b2 [libc][trivial] Make LlvmLibcExhaustiveTest::check method purely virtual. 2022-01-13 14:35:11 -05:00
Louis Dionne e7b07a6538 [libc++][NFC] Add missing 'return 0' in main() functions 2022-01-13 14:32:41 -05:00
Fangrui Song 64da6eb065 [Driver][Gnu] -r: imply -nostdlib like GCC
See `gcc -dumpspecs` that -r essentially implies -nostdlib and suppresses
default -l* and crt*.o. The behavior makes sense because otherwise there will be
assuredly conflicting definitions when the relocatable output is linked into the
final executable/shared object.

Reviewed By: thesamesam, phosek

Differential Revision: https://reviews.llvm.org/D116843
2022-01-13 11:25:23 -08:00
Christian Sigg ffee3b2f7a [NVPTX] Add version test for sm_75, sm_80, sm_86.
Combine the sm-version tests into a single file.

Reviewed By: bkramer, tra

Differential Revision: https://reviews.llvm.org/D117198
2022-01-13 20:24:09 +01:00
Julian Lettner 0f6f6284d7 [lit] Make sure our test temp directory is actually used by tests
All credit to Martin Storsjö (mstorsjo) who describes the issue here:
https://github.com/llvm/llvm-project/issues/53167

Differential Revision: https://reviews.llvm.org/D117179
2022-01-13 11:23:32 -08:00
Christian Sigg efb8d4cff3 [NVPTX] Add fmin/fmax.NaN lowering for sm_80+.
Reviewed By: bkramer, tra

Differential Revision: https://reviews.llvm.org/D117204
2022-01-13 20:22:41 +01:00
Dave Lee cb5ea132d2 [lldb] Add long help to `crashlog`
Convert the `crashlog` command to be implemented as a class. The `Symbolicate`
function is switched to a class, to implement `get_long_help`. The text for the
long help comes from the help output generated by `OptionParser`. That is, the
output of `help crashlog` is the same as `crashlog --help`.

Differential Revision: https://reviews.llvm.org/D117165
2022-01-13 11:09:40 -08:00
Louis Dionne b476039e8b [libc++] Refactor the tests for ranges::{advance,next,prev}
This makes all the tests consistent and improves code coverage. This also
uncovers a bug with negative indices in advance() (which also impacts
prev()) -- I'll fix that in a subsequent patch.

I chose to only count operations in the tests for ranges::advance because
doing so in prev() and next() too was reaching diminishing returns, and
didn't meaningfully improve our test coverage.
2022-01-13 13:57:55 -05:00
Markus Böck 52b8fe9b6e [mlir] Fix attaching side effects on `FlatSymbolRefAttr`
The names of the generated attribute getters for ops changed some time ago. The method created from the attribute name returns the return type and an additional method of the same name with Attr as suffix is generated which returns the actual attribute as its storage type.

The code generating effects however was using the methods without the Attr suffix, which is a problem in the case of FlatSymbolRefAttr as it has a return type of llvm::StringRef. This would lead to compilation errors as the constructor of SideEffects::EffectInstance expects a SymbolRefAttr in this case.

This patch simply fixes the generated effects code to use the Attr suffixed getter to get the actual storage type of the attribute.

Differential Revision: https://reviews.llvm.org/D117194
2022-01-13 19:57:01 +01:00
Duncan P. N. Exon Smith bc9c1ae1c5 ADT: Make SmallVector::set_size() private
Stop allowing use of `SmallVectorBase::set_size()` outside of the
SmallVector implementation, which sets the size without calling
constructors or destructors.

Most callers should probably just use `resize()`. Or, if the new size is
guaranteed to be `<= size()`, then the new-ish `truncate()` works too
(and optimizes better).

Some callers want to avoid initializing memory before overwriting, but
need a pointer to the memory and so cannot use `push_back()`,
`emplace_back()`, or `append()`. Before this commit, this depended on
`reserve()` and `set_size()`:

```
V.reserve(V.size() + NumNew);      // Reserve expected size.
NumNew = initialize(V.end(), ...); // Get number added.
V.set_size(V.size() + NumNew);     // Set size to match.
```

Such code should be updated to use `resize_for_overwrite()` and
`truncate()`:

```
auto Size = V.size();                        // Save initial size.
V.resize_for_overwrite(Size + NumNew);       // Resize to expected size.
NumNew = initialize(V.begin() + Size, ...)); // Get number added.
V.truncate(Size + NumNew);                   // Truncate to match.
```

The new pattern is safe even for non-trivial types, since
`resize_for_overwrite()` calls constructors and `truncate()` calls
destructors. For trivial types, it should optimize the same way as the
old pattern.

Downstream code adapt to the disappearance of `set_size()` using this
new pattern should carefully audit uses of `V` between the resize and
the truncate:

- Change `V.size()` => `Size`.
- Change `V.capacity()` => `V.size()` (mostly).
- Change `V.end()` => `V.begin() + Size`.
- If `V` is an out-parameter, early returns need a `V.truncate()` or
  `V.clear()`. A scope exit is recommended.

Differential Revision: https://reviews.llvm.org/D115380
2022-01-13 10:50:06 -08:00
Tue Ly 8cd81274ff [libc] Add multithreading support for exhaustive testing and MPFRUtils.
Add threading support for exhaustive testing and MPFRUtils.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D117028
2022-01-13 13:46:14 -05:00
Mehdi Amini f7c589d3e7 Clarify that fold() can't "erase" an operation in the MLIR Canonicalization doc (NFC) 2022-01-13 18:43:18 +00:00
Peter Klausler bb59b38e87 [flang] Any type can appear in a structure constructor for an unlimited polymorphic allocatable component
A bogus error message is appearing for structure constructors containing
values that correspond to unlimited polymorphic allocatable components.
A value of any type can actually be used.

Differential Revision: https://reviews.llvm.org/D117154
2022-01-13 10:37:42 -08:00
Duncan P. N. Exon Smith 9b85d7e166 MC: Use SmallVector::clear() instead of set_size(0) 2022-01-13 10:34:14 -08:00
Emily Shi 53cb3a7bb4 Revert "[compiler-rt][darwin] check for strcmp to test interceptors instead of pthread_create"
This reverts commit 1e36bd8516.
2022-01-13 10:31:52 -08:00
Tue Ly cce6507767 [libc] Add rounding mode support for MPFR testing macros.
Add an extra argument for rounding mode to EXPECT_MPFR_MATCH and ASSERT_MPFR_MATCH macros.

Reviewed By: sivachandra, michaelrj

Differential Revision: https://reviews.llvm.org/D116777
2022-01-13 13:28:50 -05:00
Craig Topper 7690c2c76c [RISCV] Add tests for fixed vector mul reduction intrinsics. NFC
CodeGen for this can be improved.
2022-01-13 10:24:01 -08:00
Rob Suderman 173fce4205 [mlir][tosa] Update default tosa-to-linalg passes
Adding the optional decompositions have been verified to improve memory
usage on common models. Added the decomposition to the default tosa to linalg
passes.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D117175
2022-01-13 10:17:44 -08:00
Duncan P. N. Exon Smith b77d4d54f9 mlir: Avoid SmallVector::set_size in SerializeToHsacoPass::loadLibraries
Spotted this in a final grep of projects I don't usually build before
pushing https://reviews.llvm.org/D115380, which makes
`SmallVector::set_size()` private.

Update to `truncate()`, a new-ish variant of `resize()` that asserts the
new size is not bigger and that avoids pulling in the allocation and
initialization code for growing. Doesn't really look like the perf
impact of that would matter here, but since `dirLength` is known to be a
smaller size then we might as well.

Differential Revision: https://reviews.llvm.org/D117073
2022-01-13 10:17:00 -08:00
Andrew Browne 529f098789 [NFC][DFSan] Update DataFlowSanitizer user docs for -dfsan-conditional-callbacks, added in https://reviews.llvm.org/D116207
Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D117177
2022-01-13 10:05:45 -08:00
Louis Dionne c0671e2c9b [libc++] Move assignable_sentinel to a common header where it can be reused 2022-01-13 12:59:16 -05:00
Benoit Jacob 499703e9c0 Enable ReassociatingReshapeOpConversion with "non-identity" layouts.
Enable ReassociatingReshapeOpConversion with "non-identity" layouts.

This removes an early-return in this function, which seems unnecessary and is
preventing some memref.collapse_shape from converting to LLVM (see included lit test).

It seems unnecessary because the return message says "only empty layout map is supported"
but there actually is code in this function to deal with non-empty layout maps. Maybe
it refers to an earlier state of implementation and is just out of date?

Though, there is another concern about this early return: the condition that it actually
checks, `{src,dst}MemrefType.getLayout().isIdentity()`, is not quite the same as what the
return message says, "only empty layout map is supported". Stepping through this
`getLayout().isIdentity()` code in GDB, I found that it evaluates to `.getAffineMap().isIdentity()`
which does (AffineMap.cpp:271):

```
  if (getNumDims() != getNumResults())
    return false;
```

This seems that it would always return false for memrefs of rank greater than 1 ?

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114808
2022-01-13 17:46:20 +00:00
Simon Pilgrim fced2744d3 Fix MSVC "not all control paths return a value" warnings. NFC. 2022-01-13 17:44:10 +00:00
Simon Pilgrim 08212dbc44 [X86] Add xop/avx2 shifts to X86TargetLowering::isBinOp
Allows shuffle combining through per-element shift nodes

This exposed a number of issues with shuffle combining with target intrinsics that are lowered to nodes later during legalization - in particular shuffle combining and SimplifyDemandedVectorElts were being called after canonicalizeShuffleWithBinOps, meaning that shuffles didn't have a chance to be combined away before the shuffle(binop(x,y)) -> binop(shuffle(x),shuffle(y)) fold.
2022-01-13 17:44:10 +00:00
LLVM GN Syncbot e2c78f99c4 [gn build] Port 67151d029b 2022-01-13 17:34:38 +00:00