Commit Graph

433345 Commits

Author SHA1 Message Date
Chris Bieneman 0ac597f3ca [NFC] Move DXC driver tests
The DXC driver tests don't really belong mixed in with the toolchain
tests. This pulls them out to their own file and moves the
SimpleDiagnosticConsumer into a header so it can be used by both DXC and
toolchain tests.

fast-forwarded.
2022-08-18 16:06:41 -05:00
Alex Brachet c175d80be2 [clang][test] Recognize leading unscore for macos
Additionally mark this test unsupported for ps5 in addition
to ps4, niether support -fuse-ld=
2022-08-18 21:03:28 +00:00
Krzysztof Parzyszek 252cea037b [Hexagon] Add defaulted operator= to classes with defaulted copy ctor
This avoids deprecation warning:
```
warning: definition of implicit copy assignment operator for 'AddrInfo'
is deprecated because it has a user-declared copy constructor
[-Wdeprecated-copy]
```

This fixes https://github.com/llvm/llvm-project/issues/57229
2022-08-18 14:00:41 -07:00
Louis Dionne b8cb1dc9ea [libc++] Make <ranges> non-experimental
When we ship LLVM 16, <ranges> won't be considered experimental anymore.
We might as well do this sooner rather than later.

Differential Revision: https://reviews.llvm.org/D132151
2022-08-18 16:59:58 -04:00
Peter Klausler f5884fd9de [flang][runtime] Improve error message for incompatible MATMUL arguments
Print the full shapes of both argument when the dimensions that must
match do not do so.

Differential Revision: https://reviews.llvm.org/D132153
2022-08-18 13:59:13 -07:00
Michael Maitland f29401fcdf [LoopVectorize][LoopAccessAnalysis] add newline to debug message
A debug message in `LoopAccessAnalysis` did not have a newline in it, causing printed debug messages to be formatted incorrectly.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D132172
2022-08-18 13:44:05 -07:00
Ellis Hoag 18f6b05e0a Revert "[compiler-rt] Fix check for cross-compiling"
This reverts commit ee80903a2c.

This seems to have broke builds

Differential Revision: https://reviews.llvm.org/D132174
2022-08-18 13:43:21 -07:00
Nikolas Klauser 8fc23c9b45 [libc++] Mark everything inside vector as _LIBCPP_HIDE_FROM_ABI
Reviewed By: ldionne, huixie90, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132016
2022-08-18 22:41:27 +02:00
Ellis Hoag ee80903a2c [compiler-rt] Fix check for cross-compiling
When checking if we are cross-compiling, use `CMAKE_HOST_SYSTEM_NAME`
rather than `CMAKE_HOST_SYSTEM` which seems to have the full version
number attached.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D132130
2022-08-18 13:30:46 -07:00
Jacques Pienaar 18e616c3f0 [mlir][shape] add value_of op
Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D131976
2022-08-18 13:27:04 -07:00
Alex Brachet 377dddf4a0 [clang][Driver] Pass correct reproduce flag to lld-link
Additionally, the explicit linux target has been removed from the test.

Differential Revision: https://reviews.llvm.org/D131214
2022-08-18 20:12:23 +00:00
Philip Reames 4d87591028 [RISCV] Use VScaleForTuning in costing of operations whose cost depends on VL
On known hardware, reductions, gather, and scatter operations have execution latencies which correlated with the vector length (VL) of the operation. Most other operations (e.g. simply arithmetic) don't correlated in this way, and instead essentially fixed cost as VL varies.

When I'd implemented initial scalable cost model support for reductions, gather, and scatter operations, I had used an upper bound on the statically unknown VL. The argument at the time was that this prevented falsely low costs, and biased the vectorizer away from generating bad (on some hardware) code. Unfortunately, practical experience shows we were a bit too effective at that goal, and the high costs defacto prevents vectorization using these constructs at all.

This patch reverses course, and ties the returned cost not to the maximum possible VL, but the VL which would correspond to VScaleForTuning. This parameter is the same one the vectorizer uses when normalizing loop costs, so the term effectively cancels out. The result is that the vectorizer now sees these constructs as comparable in cost to their fixed length variants.

This does introduce the possibility of the cost for these operations being a significant under estimate on platforms where actual VLEN is far from that implied by VScaleForTuning. On such platforms, we might make poor heuristic choices. Probably not in LV itself (due to the cancellation mentioned above), but possibly during e.g. lowering. I'm not currently aware of any concrete examples of this, but this patch does open a concern which did not previously exist.

Previously, we had the problem of overestimating costs causing the same problem on machines much closer to default values for vscale for tuning. With this patch, we still have that problem potentially if vscale for tuning is set high (manually), and then the code is run on a narrow VLEN machine.

Differential Revision: https://reviews.llvm.org/D131519
2022-08-18 13:10:03 -07:00
Nico Weber d3a1dbc490 [gn build] port f7a33090a9 2022-08-18 15:48:22 -04:00
Prabhdeep Singh Soni bce94ea551 [OMPIRBuilder] Add support for safelen clause
This patch adds OMPIRBuilder support for the safelen clause for the
simd directive.

Reviewed By: shraiysh, Meinersbur

Differential Revision: https://reviews.llvm.org/D131526
2022-08-18 15:43:08 -04:00
John Ericson f7a33090a9 [cmake] Use `CMAKE_INSTALL_LIBDIR` too
We held off on this before as `LLVM_LIBDIR_SUFFIX` conflicted with it.
Now we return this.

`LLVM_LIBDIR_SUFFIX` is kept as a deprecated way to set
`CMAKE_INSTALL_LIBDIR`. The other `*_LIBDIR_SUFFIX` are just removed
entirely.

I imagine this is too potentially-breaking to make LLVM 15. That's fine.
I have a more minimal version of this in the disto (NixOS) patches for
LLVM 15 (like previous versions). This more expansive version I will
test harder after the release is cut.

Reviewed By: sebastian-ne, ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D130586
2022-08-18 15:33:35 -04:00
Michele Scuttari 8a10ee7590
[MLIR] DynamicMemRefType: iteration and access by indices
The methods to perform such operations have been implemented for the DynamicMemRefType in a way that is similar to the implementation for StridedMemRefType. Up until here one could pass an unranked memref to the library, and thus obtain a “dynamic” memref descriptor, but then there would have been no possibility to operate on its content.
2022-08-18 21:30:20 +02:00
Emil Kieri 4b12b256d7 [flang][nfc] Update expected warning message in test
to match the emitted warning, which has changed. I push this without
review as it is a one-line NFC. I have discussed it in D130386, which
altered the warning in question.
2022-08-18 21:03:48 +02:00
Joseph Huber ca6d70b32e [LinkerWrapper][NFC] Clean-up error handling
Summary:
We should return and propagate these errors instead of reporting them
immediately. Also use llvm::copy instead.
2022-08-18 15:01:01 -04:00
Xiang Li 140b0bf899 [HLSL] Set main as default entry.
When there's no -E option, use main as entry function.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D124753
2022-08-18 11:57:36 -07:00
Wolfgang Pieb 8564e2fea5 [Inlining] Add a clang option to limit inlining of functions
Add the clang option -finline-max-stacksize=<N> to suppress inlining
of functions whose stack size exceeds the given value.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D131986
2022-08-18 11:56:24 -07:00
Jeff Niu a48ff68888 [mlir][LLVMIR] "Modernize" LLVM insert/extract element operations
This patch "modernizes" the implementation of these operations by
switching them to assembly formats and type inference traits.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D131971
2022-08-18 14:43:06 -04:00
Peiming Liu 788b8b6b4a [mlir][memref] Remove extra brackets in doc
There is an (probably) unintended bracket in the documentation for `memref.subview`. See https://mlir.llvm.org/docs/Dialects/MemRef/#memrefsubview-mlirmemrefsubviewop below Example 5.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D132150
2022-08-18 18:26:29 +00:00
Valentin Clement 4235bd603a
[flang] Make sure dynamic extents and length are rounded to 0 if negative
Function returning CHARACTER with adjustable length or dynamic arrays
can have negative length or extents passed to them. This patch makes sure
any negative inputs is rounded to 0.

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D132139
2022-08-18 20:23:20 +02:00
Valentin Clement b8535b5908
[flang] Set attribute at the correct position
The TargetRewrite pass can change the number of argument of a function.
An extra llvm.nest attribute is added and was not set at the correct position
if an extra argument was inserted before.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D132113
2022-08-18 20:21:41 +02:00
Florian Hahn b8709a9d03
[LV] Support fixed order recurrences.
If the incoming previous value of a fixed-order recurrence is a phi in
the header, go through incoming values from the latch until we find a
non-phi value. Use this as the new Previous, all uses in the header
will be dominated by the original phi, but need to be moved after
the non-phi previous value.

At the moment, fixed-order recurrences are modeled as a chain of
first-order recurrences.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D119661
2022-08-18 19:15:52 +01:00
Philip Reames 1436adae2c [LV-L] Add const and move method body out of line [nfc] 2022-08-18 11:10:19 -07:00
Nikolas Klauser 1db43b7ba9 [libc++] Replace _LIBCPP_INLINE_VISIBILITY and mark all functions _LIBCPP_HIDE_FROM_ABI in __split_buffer
Reviewed By: ldionne, huixie90, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132028
2022-08-18 19:50:57 +02:00
Philip Reames c064d3f139 [LV] Use early continue to simplify code [nfc] 2022-08-18 10:31:55 -07:00
Vitaly Buka 14b480b092 [test][mlir] Disable tests with HWASAN
Re-enable after fixing https://github.com/llvm/llvm-project/issues/57231
2022-08-18 10:19:18 -07:00
Vitaly Buka a0e402d41f [test] Disable DynamicLibrary with HWASAN
Re-enabled when https://github.com/llvm/llvm-project/issues/57206 fixed.
2022-08-18 10:19:18 -07:00
Vitaly Buka 4e5d64e83e [NFC][libc] Detect HWASAN support macro 2022-08-18 10:19:18 -07:00
Emil Kieri 93dca9fbee [flang][test] Fix semantics tests with respect to warnings
Make tests expect the (correctly) emitted warnings using the WARNING
directive. This directive is non-functional now, but will be recognised
by test_errors.py when D125804 is landed. This patch is a preparation
for D125804.

For most tests, we add missing WARNING directives for emitted warnings,
but there are exceptions:

 - for int-literals.f90 and resolve31.f90 we pass -pedantic to the
   frontend driver, so that the expected warnings are actually emitted.

 - for block-data01.f90 and resolve42.f90 we change the tests so that
   warnings, which appear unintentional, are not emitted. While testing
   the warning in question (padding added for alignment in common block)
   would be desired, that is beyond the scope of this patch. This
   warning is target-dependent.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D131987
2022-08-18 19:16:20 +02:00
Jeff Niu 491dd5a3b2 [mlir][LLVMIR] Fix syntax in integration tests (NFC) 2022-08-18 13:09:34 -04:00
Paul Walker 96c8d615d6 [SVE] Extend findMoreOptimalIndexType so BUILD_VECTORs do not force 64bit indices.
Extends findMoreOptimalIndexType to allow ISD::BUILD_VECTOR based
indices to be truncated when such truncation is lossless. This can
enable the use of 32bit gather/scatter indices thus making it less
likely to have to split a gather/scatter in two.

Depends on D125194

Differential Revision: https://reviews.llvm.org/D130533
2022-08-18 18:00:53 +01:00
Simon Pilgrim 2b3be87534 [CostModel][X86] Add explicit int/fp arithmetic test coverage for avx512/slm/glm targets 2022-08-18 17:46:57 +01:00
Jeff Niu b2ccfb4d95 [mlir][LLVMIR] Change ShuffleVectorOp to use assembly format
This patch moves `LLVM::ShuffleVectorOp` to assembly format and in the
process drops the extra type that can be inferred (both operand types
are required to be the same) and switches to a dense integer array.

The syntax change:

```
// Before
%0 = llvm.shufflevector %0, %1 [0 : i32, 0 : i32, 0 : i32, 0 : i32] : vector<4xf32>, vector<4xf32>
// After
%0 = llvm.shufflevector %0, %1 [0, 0, 0, 0] : vector<4xf32>
```

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D132038
2022-08-18 12:46:04 -04:00
Kadir Cetinkaya 7f2a079a12
[clangd] Fix a tsan failure in PreambleThrottle tests 2022-08-18 18:36:01 +02:00
Jim Ingham 33722848fc Use a SmallPtrSet rather than a SmallVector in ClusterManager.
The m_objects store in this class is only used to check whether
this ClusterManager already owns this pointer.  With a SmallVector
the is_contained call was non-linear in number of children, and for
instance printing all the elements of a 16M element std::vector
didn't complete in the time I was willing to wait for it (hours).

Since we are only doing insert & contains, some kind of set is a
better data structure.  In this patch I used SmallPtrSet.  With
that, the same array prints out in 30 seconds.  I also tried a
std::unordered_set but that was slightly slower and used a fair bit
more memory.

Other than performance, this is NFC.

Differential Revision: https://reviews.llvm.org/D131996
2022-08-18 09:34:28 -07:00
Argyrios Kyrtzidis dd8982d44a Revert "[FindGRPC.cmake] Use `llvm_add_library()` for the custom proto target instead of `add_llvm_library()`"
Breaks configuring `clangd` with `-DCLANGD_ENABLE_REMOTE=On` (https://github.com/llvm/llvm-project/issues/57213)

This reverts commit ba68802407.

Differential Revision: https://reviews.llvm.org/D132138
2022-08-18 09:20:20 -07:00
Simon Pilgrim 5c7b975326 [CostModel][X86] Add explicit cmp/select test coverage for slm/glm targets 2022-08-18 17:05:39 +01:00
Simon Pilgrim b864cad7b4 [CostModel][X86] Adjust SLM select costs to match poor throughput of pblendvb/blendvpd/blendvps 2022-08-18 17:05:38 +01:00
Joe Nash 063ee26ea3 [AMDGPU] Update comment on shrinking dpp. NFC 2022-08-18 11:29:32 -04:00
Slava Zakharin ee0166cfc5 [flang] Enable SimplifyIntrinsics pass in driver.
The pass is enabled for O1/O2/O3 optlevels now.

Differential Revision: https://reviews.llvm.org/D132069
2022-08-18 08:55:27 -07:00
Mark de Wever 750ee8d56d [NFC][libc++] Fixes a typo.
Discovered by phosek in D126971.
2022-08-18 17:27:43 +02:00
Denis Revunov d0e29e87cd [BOLT][AArch64] Ignore functions with islandsInfo during VeneerEliminarion and ICF
Differential Revision: https://reviews.llvm.org/D131881

Reviewed By: yota9
2022-08-18 11:08:47 -04:00
Danila Malyutin 4a9ff289fb [InstCombine] Fix freeze instruction getting inserted before landingpad
The code would use first non-phi instruction as an insertion point, however
this could lead to freeze getting inserted between phi and landingpad
causing a verifier assert.

Differential Revision: https://reviews.llvm.org/D132105
2022-08-18 17:43:42 +03:00
Kiran Chandramohan 495b8e104d [Flang][OpenMP] Provide an error when the minus operator is used in a reduction
OpenMP 5.2 standard has deprecated the usage of the minus operation in
reductions. The minus operation also is an unpleasant feature with
varied interpretations.

The patch also changes the usage of the minus operator in some existing testcases.

Discussed in https://discourse.llvm.org/t/openmp-runtime-problem-with-subtraction-reduction/64404

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D132060
2022-08-18 14:35:12 +00:00
Simon Pilgrim 23f60d43a2 [CostModel][X86] Add cost kinds test coverage for integer comparisons 2022-08-18 15:26:53 +01:00
Nikolas Klauser dea4386749 [libc++][NFC] Add a short description for __split_buffer
Reviewed By: Mordante, huixie90, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132032
2022-08-18 16:16:20 +02:00
Philip Reames 531dd3634d [LV] Restructure isPredicatedInst and isScalarWithPredication (w/a fix for uniform mem ops)
This change reorganizes the code and comments to make the expected semantics of these routines more clear. However, this is *not* an NFC change. The functional change is having isScalarWithPredication return false if the instruction does not need predicated. Specifically, for the case of a uniform memory operation we were previously considering it *not* to be a predicated instruction, but *were* considering it to be scalable with predication.

As can be seen with the test changes, this causes uniform memory ops which should have been lowered as uniform-per-parts values to instead be lowering via naive scalarization or if scalarization is infeasible (i.e. scalable vectors) aborted entirely. I also don't trust the code to bail out correctly 100% of the time, so it's possible we had a crash or miscompile from trying to scalarize something which isn't scalaralizable. I haven't found a concrete example here, but I am suspicious.

Differential Revision: https://reviews.llvm.org/D131093
2022-08-18 07:14:04 -07:00