Commit Graph

429177 Commits

Author SHA1 Message Date
Abinav Puthan Purayil c42fe5bd7a [GlobalISel][SelectionDAG] Implement the HasNoUse builtin predicate
This change introduces the HasNoUse builtin predicate in PatFrags that
checks for the absence of use of the first result operand.
GlobalISelEmitter will allow source PatFrags with this predicate to be
matched with destination instructions with empty outs. This predicate is
required for selecting the no-return variant of atomic instructions in
AMDGPU.

Differential Revision: https://reviews.llvm.org/D125212
2022-07-08 09:47:33 +05:30
Abinav Puthan Purayil 7504c7a877 [AMDGPU] Use AddedComplexity for ret and noret atomic ops selection
This patch removes the predicate for return atomic ops and uses
AddedComplexity to distinguish its selection from its no return variant.
This will produce better matchers that doesn't unnecessarily check for
the negated predicate if the initial predicate failed. Also, it
simplifies the enabling of no return atomic ops selection in GlobalISel.

Differential Revision: https://reviews.llvm.org/D128241
2022-07-08 09:47:33 +05:30
Mogball c20a581a8d [mlir] Delete ForwardDataFlowAnalysis
With SCCP and integer range analysis ported to the new framework, this old framework is redundant. Delete it.

Depends on D128866

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D128867
2022-07-07 21:08:27 -07:00
Chuanqi Xu 1934b3ae59 [docs] Add document "Debugging C++ Coroutines"
Previously in D99179, I tried to construct debug information for
coroutine frames in the middle end to enhance the debugability for
coroutines. But I forget to add ReleaseNotes to hint people and
documents to help people to use. My bad. @probinson revealed this in
https://github.com/llvm/llvm-project/issues/55916.

So I try to add the use document now.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D127626
2022-07-08 11:29:00 +08:00
Mogball ab701975e7 [mlir] Swap integer range inference to the new framework
Integer range inference has been swapped to the new framework. The integer value range lattices automatically updates the corresponding constant value on update.

Depends on D127173

Reviewed By: krzysz00, rriddle

Differential Revision: https://reviews.llvm.org/D128866
2022-07-07 20:28:13 -07:00
Chuanqi Xu 354a597b9f [C++20] [Modules] Don't complain about duplicated default template argument across modules
See https://github.com/cplusplus/draft/pull/5204 for a detailed
 background.

 Simply, the test redundant-template-default-arg.cpp attached to this
 patch should be accepted instead of being complained about the
 redefinition.

 Reviewed By: urnathan, rsmith, ChuanqiXu

 Differential Revision: https://reviews.llvm.org/D118034
2022-07-08 11:10:51 +08:00
lewuathe f27deeee79 [mlir][complex] Lower complex.angle to libm
complex.angle corresponds to arg function in libm. We can lower complex.angle to arg and argf.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D129341
2022-07-08 04:39:23 +02:00
Haohai Wen 18a1085e02 [X86] Fix collectLeaves for adds used by phi that forms loop
When add has additional users, we should indentify whether add's
user is phi that forms loop rather than root's.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D129169
2022-07-08 10:39:02 +08:00
Lian Wang 99da3115d1 [RISCV] Recommit test for D128717
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D128778
2022-07-08 02:21:33 +00:00
Phoebe Wang 6c535f9f1b [X86][FP16] Fix crash when lowering copysign for f16
This is to address the assertion fail reported in https://reviews.llvm.org/D107082#3635612
Not sure if it is a problem of promoting FCOPYSIGN + libcall FP_ROUND.
The promoting will set the rounding mode to 1 a442c62888/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (L4810-L4814)
While libcall cannot handle the rounding mode equals to 1 a442c62888/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (L4324-L4328)
So changing the action to Expand to workaround the problem.

Reviewed By: clementval, MaskRay

Differential Revision: https://reviews.llvm.org/D129294
2022-07-07 19:17:26 -07:00
Lian Wang ab9e8a3a6f Revert "[RISCV] Precommit test for D128717"
This reverts commit b3b37f3ecf.
2022-07-08 01:56:29 +00:00
Lian Wang b3b37f3ecf [RISCV] Precommit test for D128717
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D128778
2022-07-08 01:47:01 +00:00
Eric Astor 33f2a00023 [ms] [llvm-ml] Add support for the remaining binary named operators
Finish adding support for the remaining binary named operators in expression context: XOR, SHL, and SHR.

Differential Revision: https://reviews.llvm.org/D129299
2022-07-07 21:45:23 -04:00
Jun Zhang eee6a12227
[clang-repl][NFC] Split weak symbol test to a new test
Windows has some issues when we try to use `__attribute__((weak))` in
JIT, so we disabled that. But it's not worth to disable the whole test
just for this single feature. This patch split that part from the
original test so we can keep testing stuff that normally working in
Windows.

Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D129250
2022-07-08 09:17:11 +08:00
lewuathe eaba6e0b5c [mlir][complex] Convert complex.abs to libm
Convert complex.abs to libm library

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D127476
2022-07-08 09:55:51 +09:00
Joseph Huber 85768677f8 [llvm-objdump][Docs] Document new flag 2022-07-07 20:41:53 -04:00
Jacques Pienaar e60cc52b79 [mlir][bzl] Update for 1a92dbcfa8 and cab44c515c 2022-07-07 17:36:28 -07:00
Julian Lettner 7789c9afc1 Revert "[Sanitizer][Darwin] Cleanup MaybeReexec() function and usage"
Many tests for the `UBSan-Standalone-iossim-x86_64` fail with this.
Reverting so I can investigate.

This reverts commit 0a9667b0f5.
2022-07-07 17:27:10 -07:00
David Blaikie 72d9390778 Add a little extra test coverage for simple template names
This would fail with an overly naive approach to simple template
name (clang's -gsimple-template-names) since the names wouldn't be
unique per specialization, creating ambiguity/chance that a query for
one specialization would find another.
2022-07-08 00:12:29 +00:00
Aart Bik d926b3307e [mlir] add complex type to getZeroAttr
Fixes issue encountered with <sparse> complex constant
https://github.com/llvm/llvm-project/issues/56428

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129325
2022-07-07 16:58:59 -07:00
Florian Hahn afdedd405e
[AArch64] Try to re-use extended operand for SETCC with vector ops.
Try to re-use an already extended operand for SetCC with vector operands
feeding an extended select. Doing so avoids requiring another full
extension of the SET_CC result when lowering the select.

This improves lowering for certain extend/cmp/select patterns operating.
For example with  v16i8, this replaces 6 instructions for the extra extension
with 4 separate selects.

This improves the generated code for loops like the one below in
combination with D96522.

    int foo(uint8_t *p, int N) {
      unsigned long long sum = 0;
      for (int i = 0; i < N ; i++, p++) {
        unsigned int v = *p;
        sum += (v < 127) ? v : 256 - v;
      }
      return sum;
    }

https://clang.godbolt.org/z/Wco866MjY

On the AArch64 cores I have access to, the patch improves performance of
the vector loop by ~10%.

This could be generalized per follow-ups, but the initial version
targets one of the more important cases in combination with D96522.

Alive2 modeling:
* sext EQ https://alive2.llvm.org/ce/z/5upBvb
* sext NE https://alive2.llvm.org/ce/z/zbEcJp
* zext EQ https://alive2.llvm.org/ce/z/_xMwof
* zext NE https://alive2.llvm.org/ce/z/5FwKfc
* zext unsigned predicate: https://alive2.llvm.org/ce/z/iEwLU3
* sext signed predicate: https://alive2.llvm.org/ce/z/aMBega

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D120481
2022-07-07 16:50:00 -07:00
Julian Lettner 0a9667b0f5 [Sanitizer][Darwin] Cleanup MaybeReexec() function and usage
While investigating another issue, I noticed that `MaybeReexec()` never
actually "re-executes via `execv()`" anymore.  `DyldNeedsEnvVariable()`
only returned true on macOS 10.10 and below.

Usually, I try to avoid "unnecessary" cleanups (it's hard to be certain
that there truly is no fallout), but I decided to do this one because:

* I initially tricked myself into thinking that `MaybeReexec()` was
  relevant to my original investigation (instead of being dead code).
* The deleted code itself is quite complicated.
* Over time a few other things were mushed into `MaybeReexec()`:
  initializing `MonotonicNanoTime()`, verifying interceptors are
  working, and stripping the `DYLD_INSERT_LIBRARIES` env var to avoid
  problems when forking.
* This platform-specific thing leaked into `sanitizer_common.h`.
* The `ReexecDisabled()` config nob relies on the "strong overrides weak
  pattern", which is now problematic and can be completely removed.
* `ReexecDisabled()` actually hid another issue with interceptors not
  working in unit tests.  I added an explicit `verify_interceptors`
  (defaults to `true`) option instead.

Differential Revision: https://reviews.llvm.org/D129157
2022-07-07 16:39:27 -07:00
Jonas Devlieghere e4c5bca597
Revert "[LLDB][NFC] Decouple dwarf location table from DWARFExpression."
This reverts commit 227dffd0b6 and its
follow up 562c3467a6 because it breaks a
bunch of tests on GreenDragon:

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/45155/
2022-07-07 16:36:10 -07:00
Hui Xie a81cc1fc07 [libcxx][ranges] Create a test tool `ProxyIterator` that customises `iter_move` and `iter_swap`
It is meant to be used in ranges algorithm tests.
It is much simplified version of C++23's tuple + zip_view.
Using std::swap would cause compilation failure and using `std::move` would not create the correct rvalue proxy which would result in copies.

Differential Revision: https://reviews.llvm.org/D129099
2022-07-08 00:00:21 +01:00
Diego Caballero bf1758c3dc Revert "[RISCV] Optimize 2x SELECT for floating-point types"
This reverts commit 1178992c72.
2022-07-07 22:54:00 +00:00
owenca c84d29acbf [clang-format][NFC] Clean up IndentForLevel in LevelIndentTracker
Differential Revision: https://reviews.llvm.org/D129105
2022-07-07 15:33:09 -07:00
Mogball d80c271c8a [mlir] An implementation of dense data-flow analysis
This patch introduces an implementation of dense data-flow analysis. Dense
data-flow analysis attaches a lattice before and after the execution of every
operation. The lattice state is propagated across operations by a user-defined
transfer function. The state is joined across control-flow and callgraph edges.

Thge patch provides an example pass that uses both a dense and a sparse analysis
together.

Depends on D127139

Reviewed By: rriddle, phisiart

Differential Revision: https://reviews.llvm.org/D127173
2022-07-07 15:12:46 -07:00
Zequan Wu 562c3467a6 [LLDB] Fix aggregate-indirect-arg.cpp failure introduced by 227dffd0b6 2022-07-07 15:01:07 -07:00
Nico Weber b2998143a7 [gn build/mac] Use -mmacos-version-min instead of -mmacosx-version-min
The two flags do the same thing, but the OS is called macOS these days.

(The new flag is 5 years old: https://reviews.llvm.org/D32796)

No behavior change.
2022-07-07 23:56:37 +02:00
River Riddle d81edc7d9d [vscode-mlir] Bump to version 0.0.10
Since version 0.9 we've:

* Bumped the language-client to `8.0.2-next.5` to fix various bugs/stability issues
* Fixed an issue with starting a language server for non-workspace files
2022-07-07 14:55:57 -07:00
Johannes Doerfert cb26b01d57 [Attributor] Make heap2stack record alloca placement
We recently learned to place the alloca during the heap2stack
transformation in the entry block but we did not account for other
concurrent modifications. We need to record our decision rather than
checking (then outdated) passes during the manifest stage. This will
also allow us to use a custom (=optimistic) "loop info" in the future.
2022-07-07 16:49:22 -05:00
Johannes Doerfert efe8c581ff [Attributor][NFC] Improve heap2stack result readability and code style 2022-07-07 16:49:22 -05:00
Johannes Doerfert c771eaf07e [OpenMP] Ensure to not use SPMD mode in the absence of parallel regions 2022-07-07 16:49:22 -05:00
Vitaly Buka d1b7d57cab [sanitizer] Deduplicate dn_expand test
Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D129246
2022-07-07 14:47:35 -07:00
Leonard Chan 0f589826a3 [hwasan] Refactor frame record info into function
This way it can be reused easily in D128387.

Note this changes the IR slightly. Before The steps for calculating and storing the frame record info were:

1. getPC
2. getSP
3. inttoptr
4. or SP, PC
5. store

Now the steps are:

1. getPC
2. getSP
3. or SP, PC
4. inttoptr
5. store

Differential Revision: https://reviews.llvm.org/D129315
2022-07-07 14:44:39 -07:00
Leonard Chan c211041802 [hwasan][fuchsia] Fix features bitmask checking
Update the address tagging bitmask check to just see if
ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI is enabled rather than checking
if it's the only thing that's enabled.

Differential Revision: https://reviews.llvm.org/D129318
2022-07-07 14:43:00 -07:00
Mark Harmstone 8e218026f8 [clang] [MinGW] Fix paths on Gentoo
There's code in clang/lib/Driver/ToolChains/Gnu.cpp for Clang to use Gentoo's include and lib paths, but this is missing for mingw, meaning that any C++ programs using the STL will fail to compile.

See https://bugs.gentoo.org/788430

Differential Revision: https://reviews.llvm.org/D111081
2022-07-08 00:37:08 +03:00
Nico Weber 5812f9f10a [gn build] (manually) port 36f01909a0 (llvm-debuginfod)
LLVM_ENABLE_HTTPLIB is always off in the GN build. This means the
test for this won't run, so it's not really necessary to add the
llvm-debuginfod binary (and the binary might not even be that
interesting with LLVM_ENABLE_HTTPLIB off). But maybe we want
to add support for LLVM_ENABLE_HTTPLIB at some point, so let's
add the binary too. (Usually we wouldn't, since it's not needed
to get tests to pass.)
2022-07-07 23:31:33 +02:00
Krzysztof Drewniak db590549a9 [mlir][AMDGPU] Use the correct values for OOB_SELECT on gfx10
Differential Revision: https://reviews.llvm.org/D129320
2022-07-07 21:23:38 +00:00
Martin Sebor 516915beb5 [InstCombine] Fold memchr and strchr equality with first argument
Enhance memchr and strchr handling to simplify calls to the functions
used in equality expressions with the first argument to at most two
integer comparisons:

- memchr(A, C, N) == A to N && *A == C for either a dereferenceable
  A or a nonzero N,
- strchr(S, C) == S to *S == C for any S and C, and
- strchr(S, '\0') == 0 to true for any S

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128939
2022-07-07 15:14:23 -06:00
Peter Steinfeld e3611f82fc [flang] Fix typo in runtime message
The title says it.

Differential Revision: https://reviews.llvm.org/D129329
2022-07-07 14:10:25 -07:00
Florian Hahn bbf2725cf6
[AArch64] Add vector select tests with odd element types.
Additional tests for D120481.
2022-07-07 14:07:25 -07:00
Nikolas Klauser 4098e2085d [libc++] Add test for algorithm result type alias declarations
Reviewed By: var-const, #libc

Spies: libcxx-commits, jeroen.dobbelaere

Differential Revision: https://reviews.llvm.org/D129189
2022-07-07 23:05:05 +02:00
Xiang Li a9c875b19a [NFC] [DirectX] Cleanup test for comput_ids.
Cleanup test for review in https://reviews.llvm.org/D127990
2022-07-07 14:02:32 -07:00
David Blaikie b92c33495a Remove dead code: TypeMap::RemoveMismatchedTypes(TypeClass type_class) 2022-07-07 20:46:14 +00:00
River Riddle ed2fb1736a [mlir:LSP] Add support for MLIR code completions
This commit adds code completion results to the MLIR LSP using
a new code completion context in the MLIR parser. This commit
adds initial completion for dialect, operation, SSA value, and
block names.

Differential Revision: https://reviews.llvm.org/D129183
2022-07-07 13:35:54 -07:00
River Riddle 7e08885582 [mlir-vscode] Bump the language client version
This includes a fix for a code completion/document update bug where
code completion results were being requested before the document actually
updated.

Differential Revision: https://reviews.llvm.org/D129182
2022-07-07 13:35:53 -07:00
River Riddle 0c442776a9 [mlir-vscode] Explicitly set the return type for didOpen
In the newer versions of the language client, this explicitly expects a
Promise<void> return type, otherwise it errors out.

Fixes #56297

Differential Revision: https://reviews.llvm.org/D129181
2022-07-07 13:35:53 -07:00
Martin Storsjö 5b32e47559 [libcxx] [ci] Don't disable libc++experimental in mingw builds
Since dfa88927ae, the static
libc++experimental should work in mingw dll builds. (It probably worked
all along in static mingw builds.)

Differential Revision: https://reviews.llvm.org/D129270
2022-07-07 23:30:53 +03:00
Philip Reames 439783da01 [RISCV] Adjust fixed vector coverage for get.active.lane.mask
Make sure we include at least one case where the vsadd/vmsltu lowering
requires only LMUL1.  We should be able to generate all of the fixed
vector variants from scalar to vector idioms, but this is probably not
very important right now given the fixed length variants we'd actually
use when vectorizing with LMUL=1 are reasonable.
2022-07-07 13:28:29 -07:00