Commit Graph

425060 Commits

Author SHA1 Message Date
Alexander Batashev 0252357b3e [mlir][LLVM] Add support for Calling Convention in LLVMFuncOp
This patch adds support for Calling Convention attribute in LLVM
dialect, including enums, custom syntax and import from LLVM IR.
Additionally fix import of dso_local attribute.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D126161
2022-05-27 09:43:31 +03:00
Liqin.Weng a84026821b [RISCV] Add test for experimental.vector.reverse
```
void vector_reverse_i64(int *A, int *B, int n) {
  #pragma clang loop vectorize_width(4, scalable)
  for (int i = n-1; i >= 0; i--)
    A[i] = B[i] + 1;
}
```
When option: scalable-vectorization is on (or set #pragma clang loop vectorize_width(elements, scalable)), Reverse Iterators can't loop vectorization as <vscale x elements x elementType>

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125866
2022-05-27 06:30:07 +00:00
Pavel Samolysov e251fb4cde [libunwind][CMake] Fix name of LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG
The CMake variable LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG has been renamed
into C_SUPPORTS_NODEFAULTLIBS_FLAG because the last one is used in the
confix-ix.cmake file while the variable with the original name is not used
at al.

Differential Revision: https://reviews.llvm.org/D126466
2022-05-27 09:20:57 +03:00
Piggy NL 842e48bd65
[demangler][RISCV] Fix for long double
Summary:
The size of long double in RISCV (both RV32 and RV64) is 16 bytes, thus
the mangled_size shouble be 32.

This patch will fix test case
"_ZN5test01hIfEEvRAcvjplstT_Le4001a000000000000000E_c"
in test_demangle.pass.cpp, which is expected to be invalid but demangler
returned "void test0::h<float>(char (&) [(unsigned int)((sizeof (float))
+ (0x0.000000004001ap-16382L))])" in RISCV environment without this patch.

Reviewed By: urnathan

Differential Revision: https://reviews.llvm.org/D126480
2022-05-27 13:53:20 +08:00
Ping Deng 121689a62e [SelectionDAG][NFC] Simplify integer promotion in setcc/vp.setcc
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D126516
2022-05-27 05:50:19 +00:00
Siva Chandra Reddy 9b8ca3c1f1 [libc] Add global stdout and stderr objects.
They are added as entrypoint object targets. The header-gen
infrastructure has been extended to enable handling standard required
global objects. The libc-api-test has also been extended to verify the
global object declarations.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D126329
2022-05-27 05:43:49 +00:00
LLVM GN Syncbot 827fa2c419 [gn build] Port 08cc058518 2022-05-27 02:54:55 +00:00
Rahman Lavaee 08cc058518 Reland "[Propeller] Promote functions with propeller profiles to .text.hot."
This relands commit 4d8d2580c5.

The major change here is using 'addUsedIfAvailable<BasicBlockSectionsProfileReader>()` to make sure we don't change the pipeline tests.

Differential Revision: https://reviews.llvm.org/D126518
2022-05-26 19:53:14 -07:00
Chenbing Zheng b709f074d2 [InstCombine] [NFC] precommit tests for bitcast-extelt 2022-05-27 10:50:30 +08:00
Luo, Yuanke 535604e177 [X86][AMX] Update test case with automation tool. 2022-05-27 10:35:05 +08:00
Hanhan Wang 5aefdafccf [mlir][Linalg] Relax vectorization condition to allow transposed output.
Reviewed By: ThomasRaoux, dcaballe

Differential Revision: https://reviews.llvm.org/D126454
2022-05-26 19:20:36 -07:00
Enna1 52992f136b Add !nosanitize to FixedMetadataKinds
This patch adds !nosanitize metadata to FixedMetadataKinds.def, !nosanitize indicates that LLVM should not insert any sanitizer instrumentation.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D126294
2022-05-27 09:46:13 +08:00
Rahman Lavaee 3aa249329f Revert "[Propeller] Promote functions with propeller profiles to .text.hot."
This reverts commit 4d8d2580c5.
2022-05-26 18:45:40 -07:00
Fangrui Song cef377d75d [RISCV] Simplify code after D125905 2022-05-26 18:13:38 -07:00
wren romano 05c17bc4bb [mlir][sparse] Moving some functions around
This is a followup to D126105 to move functions in SparseTensorUtils.cpp to match their locations in SparseTensorUtils.h

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126106
2022-05-26 17:23:38 -07:00
wren romano 2046e11ac4 [mlir][sparse] Improving ExecutionEngine/SparseTensorUtils.h
This change makes the public API of SparseTensorUtils.cpp explicit, whereas before the publicity of these functions was only implicit.  Implicit publicity is sufficient for mlir-opt to generate calls to these functions, but it's not enough to enable C/C++ code to call them directly in the usual way (i.e., without going through codegen).  Thus, leaving the publicity implicit prevents development of other tools (e.g., microbenchmarks).

In addition this change also marks the functions MLIR_CRUNNERUTILS_EXPORT, which is required by the JIT under certain configurations (albeit not for anything in our test suite).

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126105
2022-05-26 17:22:08 -07:00
Argyrios Kyrtzidis edcd06ba8b [test/ClangScanDeps] Add a target triple for `macro-expansions.cpp`
This should fix the `clang-ppc64-aix` builder.
2022-05-26 17:18:32 -07:00
Chelsea Cassanova 5451c4b4fb
[lldb/fuzzer] Moving target fuzzer into separate subdirectory
Moving lldb-target-fuzzer into its own subdirectory for better
organization and modularity.

Differential revision: https://reviews.llvm.org/D126507
2022-05-26 17:05:14 -07:00
Damian Rouson d1440ccaa5 [flang] expand the this_image test coverage
Add a test with a range of this_image() intrinsic function
invocations, including a comprehensive set of standard-conforming
keyword and non-keyword arguments with and without optional
arguments present and with argument positions covering all
possible orderings.  Also test that several non-conforming
this_image() invocations generate the correct error messages.

Differential Revision: https://reviews.llvm.org/D123331
2022-05-26 16:36:20 -07:00
Rahman Lavaee 4d8d2580c5 [Propeller] Promote functions with propeller profiles to .text.hot.
Today, text section prefixes (none, .unlikely, .hot, and .unkown) are determined based on PGO profile. However, Propeller may deem a function hot when PGO doesn't. Besides, when `-Wl,-keep-text-section-prefix=true` Propeller cannot enforce a global section ordering as the linker can only reorder sections within each output section (.text, .text.hot, .text.unlikely).

This patch promotes all functions with Propeller profiles (functions listed in the basic-block-sections profile) to .text.hot. The feature is hidden behind the flag `--bbsections-guided-section-prefix` which defaults to `true`.

The new implementation refactors the parsing of basic block sections profile into a new `BasicBlockSectionsProfileReader` analysis pass. This allows us to use the information earlier in `CodeGenPrepare` in order to set the functions text prefix. `BasicBlockSectionsProfileReader` will be used both by `BasicBlockSections` pass and `CodeGenPrepare`.

Differential Revision: https://reviews.llvm.org/D122930
2022-05-26 16:23:21 -07:00
Arthur Eubanks 36096c2b38 [NFC][JumpThreading] Remove InsertFreezeWhenUnfoldingSelect pass parameter
All callers pass true.

select-unfold-freeze.ll is now a subset of select.ll so delete it.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D126501
2022-05-26 16:13:34 -07:00
Philip Reames 8a3b6ba756 [RISCV] Add a subtarget feature to enable unaligned scalar loads and stores
A RISCV implementation can choose to implement unaligned load/store support. We currently don't have a way for such a processor to indicate a preference for unaligned load/stores, so add a subtarget feature.

There doesn't appear to be a formal extension for unaligned support. The RISCV Profiles (https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#rva20u64-profile) docs use the name Zicclsm, but a) that doesn't appear to actually been standardized, and b) isn't quite what we want here anyway due to the perf comment.

Instead, we can follow precedent from other backends and have a feature flag for the existence of misaligned load/stores with sufficient performance that user code should actually use them.

Differential Revision: https://reviews.llvm.org/D126085
2022-05-26 15:25:47 -07:00
Rafael Auler c09cd64e5c [BOLT] Fix AND evaluation bug in shrink wrapping
Fix a bug where shrink-wrapping would use wrong stack offsets
because the stack was being aligned with an AND instruction, hence,
making its true offsets only available during runtime (we can't
statically determine where are the stack elements and we must give up
on this case).

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D126110
2022-05-26 14:59:28 -07:00
Sam Clegg 98ff205fd8 [lld][WebAssembly] Update test after 87628f5804 2022-05-26 14:57:17 -07:00
Jim Ingham 134d7f9a4b Store a by name list of signals with their actions in the Target
so that they can be used to prime new Process runs.  "process handle"
was also changed to populate the dummy target if there's no selected
target, so that the settings will get copied into new targets.

Differential Revision: https://reviews.llvm.org/D126259
2022-05-26 14:50:33 -07:00
Matthias Braun e267df8ce8 Use cmake Python3_EXECUTABLE variable instead of hardcoding 2022-05-26 14:48:45 -07:00
Sam Clegg 87628f5804 [lld][WebAssembly] Require double dash for modern linker flags
This matches the behaviour of the ELF backend (in fact this change
is mostly just copying directly from ELF/Options.td).

Differential Revision: https://reviews.llvm.org/D126500
2022-05-26 14:42:52 -07:00
Fangrui Song 056dec5dc8 [Driver][test] Change -target i386-unknown-linux-gnu to --target=i386 and remove unused -o %t.o
Use a generic ELF triple to demonstrate that these apply to all ELF OSes.
Also migrate away from the legacy `-target ` spelling.
2022-05-26 14:41:04 -07:00
Sebastian Peryt d1c5da34a7 [DOC] Improve LangRef description of declare
This patch fixes formatting inside Functions section of declare
by making it consistent with the way how define is written.

Fixes #39844

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D125581
2022-05-26 14:34:34 -07:00
Sebastian Peryt 0f64945352 [DOC] Refactor Functions section in LangRef
This change is a small refactor of Functions section
to update placement of define syntax.

Reviewed By: RKSimon

Differential revision: https://reviews.llvm.org/D125831
2022-05-26 14:34:34 -07:00
Mehdi Amini c067a9dee5 Apply clang-tidy fixes for llvm-else-after-return in OpenMPDialect.cpp (NFC) 2022-05-26 21:29:58 +00:00
Mehdi Amini da3b8200e5 Apply clang-tidy fixes for performance-unnecessary-value-param in Bufferize.cpp (NFC) 2022-05-26 21:29:58 +00:00
Michael Kruse cc871cf6b5 [Polly][Test] Fix race condition while printing dot files.
The tests dot-scops.ll and dot-scops-npm.ll both wrote to the same file
scops.func.dot. If they are executed in parallel they will race for
the file. Fix by renaming func to func_npm in dot-scops-npm.ll so this
test writes dot scops.func_npm.dot.

Long-term, we will probably pass a file name (prefix) to the
printer pass such that we can use the guaranteed-unique LIT %t
placeholder in tests.
2022-05-26 15:58:53 -05:00
owenca 5bf44aa434 [clang-format][NFC] Refactor UnwrappedLineParser::parseBlock()
Differential Revision: https://reviews.llvm.org/D126358
2022-05-26 13:56:47 -07:00
Louis Dionne eb1b1f2411 [libc++][NFC] Fix whitespace 2022-05-26 16:52:23 -04:00
Sam Clegg 198815e18d [lld][WebAssembly] Avoid importing/exporting hidden symbols in shared libraries
We have some special handling for weakly defined symbols where we both
import and export them, but this is not needed for hidden symbols which
should never be imported or exported.

See https://github.com/emscripten-core/emscripten/pull/16972

This should also help with:
https://github.com/emscripten-core/emscripten/issues/15487

Differential Revision: https://reviews.llvm.org/D126491
2022-05-26 13:43:25 -07:00
owenca 5221875a95 [clang-format] Fix an invalid code generation in RemoveBracesLLVM
Fixes #55706.

Differential Revision: https://reviews.llvm.org/D126438
2022-05-26 13:38:04 -07:00
Sam Clegg 966427b847 [lld][WebAssemlby] Check for command line flags with missing arguments
I'm really not sure how this was overlooked when we first ported lld
to Wasm.  The upstream code in the ELF backend has these two lines but
for some reason they never make it into the Wasm version.

Differential Revision: https://reviews.llvm.org/D126497
2022-05-26 13:35:27 -07:00
William Huang 35b0955aa5 [ValueTracking] Added support to deduce PHI Nodes values being a power of 2
Add Value Tracking support to deduce induction variable being a power of 2, allowing urem optimizations

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D126018
2022-05-26 20:30:31 +00:00
Sanjay Patel c4c750058f [InstCombine] fold mul of signbit directly to X < 0 ? Y : 0
This is effectively NFC (intentionally no test diffs)
because we already have the related fold that converts
the 'and' pattern to select. So this is just an efficiency
improvement.
2022-05-26 16:19:15 -04:00
Sanjay Patel 899af021f4 [InstCombine] add tests for mul with sign-splat operand; NFC 2022-05-26 16:19:15 -04:00
Sanjay Patel 49f8b05137 [InstCombine] fold icmp equality with sdiv and SMIN
This extends the fold from D126410 / 3952c905ef
to allow for the only case where it works with signed
division:
https://alive2.llvm.org/ce/z/k7_ypu

(X s/ Y) == SMIN --> (X == SMIN) && (Y == 1)
(X s/ Y) != SMIN --> (X != SMIN) || (Y != 1)

This is another improvement based on #55695.
2022-05-26 16:19:15 -04:00
Sanjay Patel ed5be1523f [InstCombine] reduce code duplication in icmp+div folds; NFC 2022-05-26 16:19:15 -04:00
Sanjay Patel 60682a0b85 [InstCombine] add tests for icmp with sdiv operand; NFC
Adapted from unsigned division tests from:
ea6171c108
2022-05-26 16:19:15 -04:00
Craig Topper 460781feef [LegalizeTypes] Fix bug in expensive checks verification
With a fix for an expensive checks build failure exposed by new RISC-V tests.
Something about expanding two rotates in type legalization caused a change
in the remapping tables that the expensive checks verifying wasn't expecting.
See comment in the code for how it was fixed.

Tests came from this commit that exposed the bug
[RISCV] Add test cases showing failure to remove mask on rotate amounts.

If the masking AND has multiple users we fail to remove it.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D126036
2022-05-26 13:13:32 -07:00
Craig Topper e9ac99b609 [RISCV] Simplfy creation of IndexVT in lowerMaskedGather/lowerMaskedScatter. NFC
The scalar element width is not a factor in how ContainerVT is
determined. We don't need to check the relative size of VT and
IndexVT.
2022-05-26 13:13:32 -07:00
LLVM GN Syncbot 75ac914b14 [gn build] Port b58a420ff4 2022-05-26 20:01:22 +00:00
Argyrios Kyrtzidis b4c83a13f6 [Tooling/DependencyScanning & Preprocessor] Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources
This is a commit with the following changes:

* Remove `ExcludedPreprocessorDirectiveSkipMapping` and related functionality

Removes `ExcludedPreprocessorDirectiveSkipMapping`; its intended benefit for fast skipping of excluded directived blocks
will be superseded by a follow-up patch in the series that will use dependency scanning lexing for the same purpose.

* Refactor dependency scanning to produce pre-lexed preprocessor directive tokens, instead of minimized sources

Replaces the "source minimization" mechanism with a mechanism that produces lexed dependency directives tokens.

* Make the special lexing for dependency scanning a first-class feature of the `Preprocessor` and `Lexer`

This is bringing the following benefits:

    * Full access to the preprocessor state during dependency scanning. E.g. a component can see what includes were taken and where they were located in the actual sources.
    * Improved performance for dependency scanning. Measurements with a release+thin-LTO build shows ~ -11% reduction in wall time.
    * Opportunity to use dependency scanning lexing to speed-up skipping of excluded conditional blocks during normal preprocessing (as follow-up, not part of this patch).

For normal preprocessing measurements show differences are below the noise level.

Since, after this change, we don't minimize sources and pass them in place of the real sources, `DependencyScanningFilesystem` is not technically necessary, but it has valuable performance benefits for caching file `stat`s along with the results of scanning the sources. So the setup of using the `DependencyScanningFilesystem` during a dependency scan remains.

Differential Revision: https://reviews.llvm.org/D125486
Differential Revision: https://reviews.llvm.org/D125487
Differential Revision: https://reviews.llvm.org/D125488
2022-05-26 12:50:06 -07:00
Argyrios Kyrtzidis b58a420ff4 [Tooling/DependencyScanning] Rename refactorings towards transitioning dependency scanning to use pre-lexed preprocessor directive tokens
This is first of a series of patches for making the special lexing for dependency scanning a first-class feature of the `Preprocessor` and `Lexer`.
This patch only includes NFC renaming changes to make reviewing of the functionality changing parts easier.

Differential Revision: https://reviews.llvm.org/D125484
2022-05-26 12:49:51 -07:00
python3kgae 628b2bfad8 [DirectX] Update test for dxil-dis.
Update metadata index which changed for dx.valver.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D126311
2022-05-26 12:32:52 -07:00