Commit Graph

423511 Commits

Author SHA1 Message Date
Walter Erquinigo 7b73de9ec2 [trace][intelpt] Support system-wide tracing [3] - Refactor IntelPTThreadTrace
I'm refactoring IntelPTThreadTrace into IntelPTSingleBufferTrace so that it can
both single threads or single cores. In this diff I'm basically renaming the
class, moving it to its own file, and removing all the pieces that are not used
along with some basic cleanup.

Differential Revision: https://reviews.llvm.org/D124648
2022-05-09 16:05:26 -07:00
Walter Erquinigo b8d1776fc5 [trace][intelpt] Support system-wide tracing [2] - Add a dummy --per-core-tracing option
This updates the documentation of the gdb-remote protocol, as well as the help messages, to include the new --per-core-tracing option.

Differential Revision: https://reviews.llvm.org/D124640
2022-05-09 16:05:26 -07:00
Mathieu Fehr 67d0bc27c0 [mlir][doc] Move documentation of extensible dialects
Merge the documentation of the definition of extensible dialects
with the definition of dialects.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D125200
2022-05-09 16:01:12 -07:00
Peter Klausler be768164a7 [flang] Refine handling of short character actual arguments
Actual arguments whose lengths are less than the expected length
of their corresponding dummy argument are errors; but this needs
to be refined.  Short actual arguments that are variables remain
errors, but those that are expressions can be (again) extended on
the right with blanks.

Differential Revision: https://reviews.llvm.org/D125115
2022-05-09 15:39:48 -07:00
Nico Weber 42915e2be2 [gn build] (manually) port a2f2dfde48 (clang-fuzzer-dictionary) 2022-05-09 18:28:58 -04:00
River Riddle 867cd5007d [mlir-LSP] Ensure existing documents are process synchronously
This prevents races where we accidentally launched multiple servers.
2022-05-09 15:23:23 -07:00
Peter Klausler 85fdbc1569 [flang] Correct folding of SPREAD() for higher ranks
The construction of the dimension order vector used to populate the
result array was incorrect, leading to a scrambled-looking result
for rank-3 and higher results.  Fix, and extend tests.

Differential Revision: https://reviews.llvm.org/D125113
2022-05-09 15:09:39 -07:00
Hongtao Yu 9641b9be9d [Inliner] Preserve !prof metadata when converting call to invoke.
When a callee function is inlined via an invoke instruction, every function call inside the callee, if not an invoke,  will be converted to an invoke after cloned to the caller body. I found that during the conversion the !prof metadata was dropped. This in turned caused a cloned indirect call not properly promoted in subsequent passes.

The particular scenario I was investigating was with AutoFDO and thinLTO. In prelink, no ICP was triggered (neither by the sample loader nor PGO ICP), no indirect call was promoted. This is because 1) the particular indirect call did not have inlined samples;  and 2) PGO ICP was intentionally disabled.  After inlining, the prof metadata was dropped. Then in postlink, PGO ICP jumped in but didn't do anything. Thus the opportunity was missed.

I'm making a simple fix to preserve !prof metadata when converting call to invoke.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D125249
2022-05-09 15:08:09 -07:00
Peter Klausler 18dd123c56 [flang] Operands of SIGN() need not have same kind
The standard requires that the operands of the intrinsic function
SIGN() must have the same type (INTEGER or REAL), but they are not
required to have the same kind.

Differential Revision: https://reviews.llvm.org/D125105
2022-05-09 14:39:26 -07:00
Florian Mayer b77d16f7f3 [HWASan] deflake hwasan_symbolize test
Also enable on X86_64.

The directory would change during the test execution. This should not
necessarily prevent us from indexing a directory (a user might
potentially do that if they specify a parent directory of the actual
symbols directory, and change unrelated files).

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D125143
2022-05-09 14:11:52 -07:00
Michael Kruse e61baceedb [polly] Load NPM pass plugin for NPM test.
This fixes the polly-*-plugin buildbots.
2022-05-09 16:10:01 -05:00
Peter Klausler 1cff71b975 [flang] Fold intrinsic functions SPACING() and RRSPACING()
The related real number system inquiry functions SPACING()
and RRSPACING() can be folded for constant arguments.
See 16.9.164 & 16.9.180 in Fortran 2018.

Differential Revision: https://reviews.llvm.org/D125100
2022-05-09 14:09:29 -07:00
Alexey Bataev 4212ef8a0e Revert "[SLP]Further improvement of the cost model for scalars used in buildvectors."
This reverts commit 99f31acfce and several
others to fix detected crashes, reported in https://reviews.llvm.org/D115750
2022-05-09 13:46:06 -07:00
Peter Klausler 460fc79a08 [flang] Fold intrinsic inquiry functions SAME_TYPE_AS() and EXTENDS_TYPE_OF()
When the result can be known at compilation time, fold it.
Success depends on whether the operands are polymorphic.
When neither one is polymorphic, the result is known and can
be either .TRUE. or .FALSE.; when either one is polymorphic,
a .FALSE. result still can be discerned.

Differential Revision: https://reviews.llvm.org/D125062
2022-05-09 13:38:18 -07:00
Alexey Bataev cce80bd8b7 [SLP]Adjust assertion check for scalars in several insertelements.
If the same scalar is inserted several times into the same buildvector,
the mask index can be used already. In this case need to check, that
this scalar is already part of the vectorized buildvector.
2022-05-09 13:07:59 -07:00
Peter Klausler 72831a592e [flang][runtime] BACKSPACE after non-advancing I/O
A BACKSPACE statement on a unit after a READ or WRITE with ADVANCE="NO"
must reset the position to the beginning of the record, not to the
beginning of the previous one.

Differential Revision: https://reviews.llvm.org/D125057
2022-05-09 13:00:41 -07:00
Peter Klausler 28b5e99a4c [flang][runtime] (G0) for CHARACTER means (A), not (A0)
I'm emitting zero characters for (G0) formatting of CHARACTER values
instead of using their lengths to determine the output field width.

Differential Revision: https://reviews.llvm.org/D125056
2022-05-09 13:00:15 -07:00
Peter Klausler fb9ec95cf0 [flang][runtime] Enforce restrictions on unlimited format repetition
A repeated format item group with an unlimited ('*') repetition count
can appear only as the last item at the top level of a format; it can't
be nested in more parentheses and it can't be followed by anything
else.

Differential Revision: https://reviews.llvm.org/D125054
2022-05-09 12:48:23 -07:00
Peter Klausler cea8b8a72d [flang][runtime] Don't pad CHARACTER input at end of record unless PAD='YES'
When formatted CHARACTER input runs into the end of an input record,
the runtime usually fills the remainder of the variable with spaces,
but this should be conditional, and not done when PAD='NO'.

And while here, add some better comments to two members of connection.h
to make their non-obvious relationship more clear.

Differential Revision: https://reviews.llvm.org/D125053
2022-05-09 12:39:43 -07:00
Peter Klausler 2f31b4b10a [flang][runtime] Fix input of NAN(...) on non-fast path
The closing parenthesis needs to be consumed when a NaN
with parenthesized (ignored) information is read on the
real input path that preprocesses input characters before
passing them to the decimal-to-binary converter.

Differential Revision: https://reviews.llvm.org/D125048
2022-05-09 12:38:31 -07:00
Thomas Raoux 09fc685ce6 [mlir][nvvm] Add attribute to nvvm.cpAsyncOp to control l1 bypass
Add attribute to be able to generate the intrinsic version of async copy
generating a copy with l1 bypass. This correspond to
cp.async.cg.shared.global in ptx.

Differential Revision: https://reviews.llvm.org/D125241
2022-05-09 19:34:48 +00:00
Florian Hahn 266ea446ab
Revert "Recommit "[VPlan] Remove uneeded needsVectorIV check.""
This reverts commit 8b48223447.

This triggers an assertion on a test case mentioned in D123720.
Revert while I investigate.
2022-05-09 20:33:14 +01:00
Michael Kruse 588ffdaf37 [polly] Fix compiler warning. NFC.
Fix the warning

   warning: 'polly::ScopViewer' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]

and for several other classes by inserting virtual destructors.
2022-05-09 14:04:40 -05:00
Michael Kruse 6b3b87376b [polly] migrate -polly-show to the new pass manager
Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D123678
2022-05-09 14:04:29 -05:00
Michael Kruse a6b399ad79 [PassManager] Implement DOTGraphTraitsViewer under NPM
Rename the legacy `DOTGraphTraits{Module,}{Viewer,Printer}` to the corresponding `DOTGraphTraits...WrapperPass`, and implement a new `DOTGraphTraitsViewer` with new pass manager.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D123677
2022-05-09 14:04:28 -05:00
Chris Bieneman f5d054cdc1 Modify DXILPrepare to emit no-op bitcasts
In supporting opaque pointers we need to re-materialize typed pointers
in bitcode emission. Because of how the value-enumerator pre-allocates
types and instructions we need to insert some no-op bitcasts in the
places that we'll need bitcasts for the pointer types.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D122269
2022-05-09 13:40:47 -05:00
Clemens Wasser d08e5d4cc6 Make lsan TestCases more consistent
Inlining `LSAN_BASE` makes the lsan TestCases more consistent to the other sanitizer TestCases.
It is also needed on Windows: https://reviews.llvm.org/D115103

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D124322
2022-05-09 11:32:15 -07:00
Stella Stamenova 057863a9bc [mlir] Fix build & test of mlir python bindings on Windows
There are a couple of issues with the python bindings on Windows:
- `create_symlink` requires special permissions on Windows - using `copy_if_different` instead allows the build to complete and then be usable
- the path to the `python_executable` is likely to contain spaces if python is installed in Program Files. llvm's python substitution adds extra quotes in order to account for this case, but mlir's own python substitution does not
- the location of the shared libraries is different on windows
- if the type is not specified for numpy arrays, they appear to be treated as strings

I've implemented the smallest possible changes for each of these in the patch, but I would actually prefer a slightly more comprehensive fix for the python_executable and the shared libraries.

For the python substitution, I think it makes sense to leverage the existing %python instead of adding %PYTHON and instead add a new variable for the case when preloading is needed. This would also make it clearer which tests are which and should be skipped on platforms where the preloading won't work.

For the shared libraries, I think it would make sense to pass the correct path and extension (possibly even the names) to the python script since these are known by lit and don't have to be hardcoded in the test at all.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D125122
2022-05-09 11:10:20 -07:00
Pavel Labath a49d5e976e [lldb/test] Remove superfluous -std=c++11 from tests
We default to that anyway. It does not work on windows, and since
ac7747e, the flag actually takes effect.
2022-05-09 20:04:14 +02:00
Pavel Labath ac7747ef28 [lldb/test] Append CXXFLAGS_EXTRAS last in Makefile.rules
This matches what we do with CFLAGS, and it started to matter
8abfa5119a, which added some -std=-apending code.
2022-05-09 19:26:29 +02:00
Kazu Hirata 3f64f03289 [CodeGen] Clarify the semantics of ADDCARRY/SUBCARRY
This patch clarifies the semantics of ADDCARRY/SUBCARRY, specifically
stating that both the incoming and outgoing carries are active high.

Differential Revision: https://reviews.llvm.org/D125130
2022-05-09 10:17:00 -07:00
Kai Nacke b2206d1de3 [SystemZ] Fix argument type of tdc instruction.
The DAG node for the Test Data Class is defined using i64 as the second parameter.
However, the code to lower is_fpclass uses `i32` as type. This only works because no
type check is generated in the DAG matcher.
This PR changes the type of the mask constant to `i64`.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D125230
2022-05-09 13:12:37 -04:00
Arthur Eubanks 431b23d20d [opt] Error on `opt -O# --foo-pass`
Matches the error message we emit with `-opt -O# --passes=foo`.
Otherwise we crash later on.

Makes #55320 much less confusing.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125196
2022-05-09 09:53:24 -07:00
Alexey Bataev 9dc4ced204 [SLP]Try partial store vectorization if supported by target.
We can try to vectorize number of stores less than MinVecRegSize
/ scalar_value_size, if it is allowed by target. Gives an extra
opportunity for the vectorization.

Fixes PR54985.

Differential Revision: https://reviews.llvm.org/D124284
2022-05-09 09:48:15 -07:00
Anastasia Stulova cd99227c78 [Docs] Added my office hours. 2022-05-09 17:39:41 +01:00
Jakub Tucholski 167bbfcb9d [mlir] Refactoring dialect and test code to use parseCommaSeparatedList
Issue #55173

Reviewed By: lattner, rriddle

Differential Revision: https://reviews.llvm.org/D124791
2022-05-09 12:36:54 -04:00
Sam McCall a2f2dfde48 [clang-fuzzer] Add a tiny tool to generate a fuzzing dictionary for clang
It should be useful clang-fuzzer itself, though my own motivation is
to use this in fuzzing clang-pseudo. (clang-tools-extra/pseudo/fuzzer).

Differential Revision: https://reviews.llvm.org/D125166
2022-05-09 18:25:29 +02:00
Erich Keane 017abbb258 Revert ""Re-apply 4b6c2cd642 "Deferred Concept Instantiation Implementation"""""
This reverts commit a425cac31e.

There is another libc++ test, that this time causes us to hit an
assertion. Reverting, likely for a while this time.
2022-05-09 09:12:05 -07:00
Philip Reames 11728db9e6 [riscv] Add a few more vsetvli insertion tests
These are aimed at a possible miscompile spotted in the vmv.s.x/f mutation case, but it appears this is a latent bug.  Or at least, I haven't been able to construct a case with compatible policy flags via intrinsics.
2022-05-09 09:08:19 -07:00
Fraser Cormack 3b9a231d25 [RISCV] Remove two unmasked RVV patterns
These can be selected to unmasked from masked instructions by the
post-process DAG step.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125239
2022-05-09 16:54:24 +01:00
Jerry Wu ad7c49bef7 [mlir][linalg] Fix padding size calculation for Conv2d ops.
This patch fixed the padding size calculation for Conv2d ops when the stride > 1. It contains the changes below:

- Use addBound to add constraint for AffineApplyOp in getUpperBoundForIndex. So the result value can be mapped and retrieved later.

- Fixed the bound from AffineMinOp by adding as a closed bound. Originally the bound was added as an open upper bound, which results in the incorrect bounds when we multiply the values. For example:

```
%0 = affine.min affine_map<()[s0] -> (4, -s0 + 11)>()[iv0]
%1 = affine.apply affine_map<()[s0] -> (s0 * 2)>()[%0]

If we add the affine.min as an open bound, addBound will internally transform it into the close bound "%0 <= 3". The following sliceBounds will derive the bound of %1 as "%1 <= 6" and return the open bound "%1 < 7", while the correct bound should be "%1 <= 8".
```

- In addition to addBound, I also changed sliceBounds to support returning closed upper bound, since for the size computation, we usually care about the closed bounds.

- Change the getUpperBoundForIndex to favor constant bounds when required. The sliceBounds will return a tighter but non-constant bounds, which can't be used for padding. The constantRequired option requires getUpperBoundForIndex to get the constant bounds when possible.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D124821
2022-05-09 08:45:37 -07:00
Ashay Rane e287d647c6 [mlir] Add translation from tensor.reshape to memref.reshape
This patch augments the `tensor-bufferize` pass by adding a conversion
rule to translate ReshapeOp from the `tensor` dialect to the `memref`
dialect, in addition to adding a unit test to validate the translation.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D125031
2022-05-09 17:45:07 +02:00
Pavel Labath 8abfa5119a [lldb/test] Fix TestCppIncompleteTypeMembers.py
modify the Makefile.rules line which was interfering with the
target-specific variable values.
2022-05-09 17:11:57 +02:00
Zarko Todorovski d35bff8bc4 [LLVM][sancov] Inclusive language: Add -ignorelist option
Adding the `-ignorelist` option that may eventually replace `-blacklist`.
With this patch `sancov` accepts both options.

Reviewed By: quinnp

Differential Revision: https://reviews.llvm.org/D113514
2022-05-09 11:06:08 -04:00
Alex Richardson 7c20e7ca86 [ELF] Support -plugin-opt=stats-file=
This flag is added by clang::driver::tools::addLTOOptions() and was causing
errors for me when building the llvm-test-suite repository with LTO and
-DTEST_SUITE_COLLECT_STATS=ON. This replaces the --stats-file= option
added in 1c04b52b25 since the flag is only
used for LTO and should therefore be in the -plugin-opt= namespace.

Additionally, this commit fixes the `REQUIRES: asserts` that was added in
948d05324a150a5a24e93bad07c9090d5b8bd129: the feature was never defined in
the lld test suite so it effectively disabled the test.

Reviewed By: MaskRay, MTC

Differential Revision: https://reviews.llvm.org/D124105
2022-05-09 15:04:40 +00:00
Simon Pilgrim 01188f996d [X86] insertps-combine.ll - show address math in checks 2022-05-09 16:01:42 +01:00
Alexey Bataev 9c3a75eabf [SLP]Fix a crash when preparing a mask for external scalars.
Need to use actual index instead of the tree entry position, since the
insert index may be different than 0. It mean, that we vectorized part
of the buildvector starting from not initial insertelement instruction
beause of some reason.
2022-05-09 07:59:34 -07:00
Nikita Popov 68e1ba8188 [SCEV] Fold umin_seq using known predicate
Fold %x umin_seq %y to %x if %x ule %y. This also subsumes the
special handling for constant operands, as if %y is constant this
folds to umin via implied poison reasoning, and if %x is constant
then either %x is not zero and it folds to umin, or it is known
zero, in which case it is ule anything.
2022-05-09 16:35:08 +02:00
Nikita Popov 7dddf12f44 [SCEV] Add more tests for umin_seq with known predicate (NFC) 2022-05-09 16:18:09 +02:00
Micah Weston 882915df61 Enum conversion warning when one signed and other unsigned.
Ensures an -Wenum-conversion warning happens when one of the enums is
signed and the other is unsigned. Also adds a test file to verify these
warnings.

This warning would not happen since the -Wsign-conversion would make a
diagnostic then return, never allowing the -Wenum-conversion checks.

For example:

C
enum PE { P = -1 };
enum NE { N };
enum NE conv(enum PE E) { return E; }
Before this would only create a diagnostic with -Wsign-conversion and
never on -Wenum-conversion. Now it will create a diagnostic for both
-Wsign-conversion and -Wenum-conversion.

I could change it to just warn on -Wenum-conversion as that was what I
initially did. Seeing PR35200 (or GitHub Issue 316268), I let both
diagnostics check so that the sign conversion could generate a warning.
2022-05-09 10:16:19 -04:00