Commit graph

420312 commits

Author SHA1 Message Date
Nikita Popov 674ee4d353 [LoopSink] Use MemorySSA with legacy pass manager
LoopSink with the legacy pass manager still uses AST, because we
can't compute MemorySSA conditionally. I think now that the legacy
pass manager will be removed soon(TM) we don't need to care about
compile-time impact here anymore. Additionally, since MemorySSA is
no longer eagerly optimized, the impact is actually not that high
anymore (~0.2% geomean regression on CTMark).

This just makes legacy PM and new PM behavior line up -- as a
followup I'll drop these options entirely and make MemorySSA use
mandatory.

Differential Revision: https://reviews.llvm.org/D123216
2022-04-07 09:40:29 +02:00
Balázs Kéri cc7ed0caac [clang-tidy] bugprone-signal-handler: Message improvement and code refactoring.
Another change of the code design.
Code simplified again, now there is a single place to check
a handler function and less functions for bug report emitting.
More details are added to the bug report messages.

Reviewed By: whisperity

Differential Revision: https://reviews.llvm.org/D118370
2022-04-07 09:38:58 +02:00
Tobias Hieta 0dfa8a019d [LLD][COFF] Fix TypeServerSource matcher with more than one collision
Follow-up from 98bc304e9f - while that
commit fixed when you had two PDBs colliding on the same Guid it didn't
fix the case where you had more than two PDBs using the same Guid.

This commit fixes that and also tests much more carefully that all
the types are correct no matter the order.

Reviewed By: aganea, saudi

Differential Revision: https://reviews.llvm.org/D123185
2022-04-07 09:33:46 +02:00
Stanislav Mekhanoshin 78cb11c8e4 [AMDGPU] Fix test difference in debug and release. NFC.
Added -disable-gisel-legality-check to couple GlobalISel tests
which have not legal instructions to avoid difference in
debug and release builds.
2022-04-06 23:58:21 -07:00
Jason Molenda 4d3cc27831 Correct debugserver to write xmm/ymm/zmm reg values
debugserver does not call thread_set_state when changing xmm/ymm/zmm
register values, so the register contents are never updated.  Fix
that.  Mark the shell tests which xfail'ed these tests on darwin systems
to xfail them when the system debugserver, they will pass when using
the in-tree debugserver.  When this makes it into the installed
system debugservers, we'll remove the xfails.

Differential Revision: https://reviews.llvm.org/D123269
rdar://91258333
rdar://31294382
2022-04-06 23:36:52 -07:00
Liqin Weng f891123556 [RISCV] Add CMOV isel pattern for (select (setgt X, Imm), Y, Z)
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D122644
2022-04-07 05:55:53 +00:00
Petr Hosek ff78d25b8e [CMake][Fuchsia] Include bolt
We would like to use bolt with Fuchsia toolchain.

Differential Revision: https://reviews.llvm.org/D123280
2022-04-06 22:48:17 -07:00
Fangrui Song c29c19cb53 [ELF] Ignore --no-add-needed
It is used by a few projects like keepassxc and mumble.
Also see https://bugzilla.redhat.com/show_bug.cgi?id=2070813 that Fedora gcc has
an (unneeded) gcc12-no-add-needed.patch which adds --no-add-needed, although
--[no-]add-needed has been deprecated in GNU ld since 2009. Adding this has low
costs and makes several folks happy.

This basically restores 8f13bef575.

Fixes https://github.com/llvm/llvm-project/issues/54756
2022-04-06 22:41:27 -07:00
Fangrui Song 6c9b363cf6 [Driver][test] Fix csky-toolchain.c to be CLANG_DEFAULT_PIE_ON_LINUX agnostic 2022-04-06 21:14:24 -07:00
Jez Ng e4b286211c [lld-macho][nfc] Rearrange order of statements to clarify data dependencies 2022-04-07 00:00:41 -04:00
Fangrui Song e3dcef355f [Driver][test] Fix csky-toolchain.c to be CLANG_DEFAULT_PIE_ON_LINUX agnostic 2022-04-06 20:41:39 -07:00
Fangrui Song 2aca33baf1 Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON""
(The upgrade of the ppc64le bot and D121257 have fixed compiler-rt failures. Tested by nemanjai.)

Default the option introduced in D113372 to ON to match all(?) major Linux
distros. This matches GCC and improves consistency with Android and linux-musl
which always default to PIE.
Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future.

Differential Revision: https://reviews.llvm.org/D120305
2022-04-06 20:19:07 -07:00
Fangrui Song ef437a7d3f [CSKY] Fix some Clang warnings. NFC
Reviewed By: zixuan-wu

Differential Revision: https://reviews.llvm.org/D122872
2022-04-06 20:09:32 -07:00
Jun Zhang f2796a5d44
Link aganist clangSema to fix broken build.
Signed-off-by: Jun Zhang <jun@junz.org>
2022-04-07 10:50:50 +08:00
Matt Arsenault e6012c8e0f AMDGPU: Handle private atomics
Use new NotAtomic expansion to turn these into the equivalent
non-atomic operations. Independent lanes cannot access the private
memory of other lanes, so there's no possibility for synchronization.

These don't really appear directly in user code, but
InferAddressSpaces can make these appear after optimizations.

Fixes issues 54693 and 54274.
2022-04-06 22:47:19 -04:00
Matt Arsenault 7f14a1d46b AtomicExpand: Add NotAtomic lowering strategy
Currently LowerAtomics exists as a separate pass which blindly
replaces all atomics. Add a new lowering strategy option to eliminate
the atomics which the target can control on a per-instruction level.
2022-04-06 22:34:35 -04:00
Matt Arsenault c4ea925f50 AtomicExpand: Change return type for shouldExpandAtomicStoreInIR
Use the same enum as the other atomic instructions for consistency, in
preparation for addition of another strategy.

Introduce a new "Expand" option, since the store expansion does not
use cmpxchg. Alternatively, the existing CmpXChg strategy could be
renamed to Expand.
2022-04-06 22:34:04 -04:00
Lian Wang 1b547799c5 [RISCV] Supplement patterns for vnsrl.wx/vnsra.wx when splat shift is sext or zext
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D122786
2022-04-07 02:21:41 +00:00
Krystian Kuzniarek 1cd4346409 [clang-format][docs] Fix incorrect 'clang-format 11' option markers
Differential Revision: https://reviews.llvm.org/D122064
2022-04-06 18:38:30 -07:00
River Riddle 5520e07f46 [mlir:Parser][NFC] Replace SSAUseInfo with OpAsmParser::UnresolvedOperand
These are functionally identical, and merging the two removes the number of
redundant conversions within the parser.
2022-04-06 18:25:08 -07:00
Stanislav Mekhanoshin a41a676e8a [AMDGPU] Check SI LDS offset bug in the allowsMisalignedMemoryAccesses
Differential Revision: https://reviews.llvm.org/D123268
2022-04-06 18:05:02 -07:00
Michael Kruse 7fa7b0cbd8 [libomptarget] Add device RTL to regression test dependencies.
In a clean build directory, `check-openmp` or `check-libomptarget` will fail because of missing device RTL .bc files. Ensure that the new targets new custom targets `omptarget.devicertl.nvptx` and `omptarget.devicertl.amdgpu` (corresponding to the plugin rtl targets `omptarget.rtl.cuda`, respectively `omptarget.rlt.amdgpu` ) are dependencies of the regression tests.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D123177
2022-04-06 20:01:47 -05:00
LLVM GN Syncbot 7ac2e30fe1 [gn build] Port 39f1568633 2022-04-07 00:55:44 +00:00
Matt Arsenault 39f1568633 Transforms: Split LowerAtomics into separate Utils and pass
This will allow code sharing from AtomicExpandPass. Not entirely sure
why these exist as separate passes though.
2022-04-06 20:54:45 -04:00
River Riddle ea64828a10 [mlir:PDL] Expand how native constraint/rewrite functions can be defined
This commit refactors the expected form of native constraint and rewrite
functions, and greatly reduces the necessary user complexity required when
defining a native function. Namely, this commit adds in automatic processing
of the necessary PDLValue glue code, and allows for users to define
constraint/rewrite functions using the C++ types that they actually want to
use.

As an example, lets see a simple example rewrite defined today:

```
static void rewriteFn(PatternRewriter &rewriter, PDLResultList &results,
                      ArrayRef<PDLValue> args) {
  ValueRange operandValues = args[0].cast<ValueRange>();
  TypeRange typeValues = args[1].cast<TypeRange>();
  ...
  // Create an operation at some point and pass it back to PDL.
  Operation *op = rewriter.create<SomeOp>(...);
  results.push_back(op);
}
```

After this commit, that same rewrite could be defined as:

```
static Operation *rewriteFn(PatternRewriter &rewriter ValueRange operandValues,
                            TypeRange typeValues) {
  ...
  // Create an operation at some point and pass it back to PDL.
  return rewriter.create<SomeOp>(...);
}
```

Differential Revision: https://reviews.llvm.org/D122086
2022-04-06 17:41:59 -07:00
Petr Hosek f5e48a2ad3 [CMake][compiler-rt] Include the missing variables
This includes the missing variables as pointed out in
https://reviews.llvm.org/rGb0e2ffe151c3
2022-04-06 17:40:29 -07:00
Aart Bik 0b55f94d2b [mlir][sparse] replace stack-based access pattern with dyn-alloc
Rationale:
Allocating the temporary buffers for access pattern expansion on the stack
(using alloca) is a bit too agressive, since it easily runs out of stack space
for large enveloping tensor dimensions. This revision changes the dynamic
allocation of these buffers with explicit alloc/dealloc pairs.

Reviewed By: bixia, wrengr

Differential Revision: https://reviews.llvm.org/D123253
2022-04-06 17:10:43 -07:00
Simon Dardis 303c180199 [MIPS] Initial support for MIPS-I load delay slots
LLVM so far has only supported the MIPS-II and above architectures. MIPS-II is pretty close to MIPS-I, the major difference
being that "load" instructions always take one extra instruction slot to propogate to registers. This patch adds support for
MIPS-I by adding hazard handling for load delay slots, alongside MIPSR6 forbidden slots and FPU slots, inserting a NOP
instruction between a load and any instruction immediately following that reads the load's destination register. I also
included a simple regression test. Since no existing tests target MIPS-I, those all still pass.

Issue ref: https://github.com/simias/psx-sdk-rs/issues/1

I also tested by building a simple demo app with Clang and running it in an emulator.

Patch by: @impiaaa

Differential Revision: https://reviews.llvm.org/D122427
2022-04-07 01:02:29 +01:00
Stanislav Mekhanoshin 09c2b7c35a [AMDGPU] Regenerate global isel lds ops test checks. NFC. 2022-04-06 16:15:59 -07:00
Louis Dionne dd8269c54e [libc++abi] Remove XFAIL on arm64
The underlying TLS destruction order bug has been fixed in the OS. This
would technically still fail when running on top of macOS < 12, however
we don't have a good way of encoding that using Lit features. Indeed,
the existing target=<FOO> Lit feature encodes the deployment target,
not the actual runtime system that the tests are being run on.

If this test starts failing on your machine after this patch, upgrading
to macOS 12 should solve the problem.
2022-04-06 19:08:01 -04:00
Alina Sbirlea 50d41f3e0d [MSSA] Print memory phis when inspecting walker.
This makes the MemorySSA and MemorySSA Walker printers consistent.
Invokation `-print<memoryssa-walker>` should also have the MemoryPhis.
2022-04-06 16:06:14 -07:00
Alina Sbirlea 08075a7ee8 Revert f7381a795a
Roll-forward 29fada4a3d.
Issue triggered was due to UB.

Differential Revision: https://reviews.llvm.org/D121987
2022-04-06 16:06:14 -07:00
Simon Dardis 8e1d9f0032 [mips] Remove stale comment (NFC)
Test commit for my current email address.
2022-04-07 00:00:29 +01:00
Blue Gaston fc4c872d8f [Darwin][ASan] Fix "interceptor working?" check for DriverKit platform
The previous check for interceptors used `pthread_create()` which is not
available on DriverKit.  We need an intercepted symbol that satisfies
the following constraints:

- Symbol is available in DriverKit
- Symbol is provided by simulator runtime dylibs (`dlsym()` fails to
  look up host-provided symbols)

`puts()` satisfies all of the above constraints.

rdar://87895539

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D123245
2022-04-06 15:49:22 -07:00
Peter Collingbourne 38f9200945 gn build: Fix some tests for host_os to instead check current_os.
Should fix Windows build:
http://45.33.8.238/win/55809/step_4.txt
2022-04-06 15:45:51 -07:00
Sam McCall 5749a261c5 [pseudo] Include missing count in test deps.
We don't use this for testing, but one of the lit python modules requires it :-\

After this, check-clang-pseudo passes with a clean build tree.
2022-04-07 00:15:18 +02:00
Craig Topper 1235aaefbd [AArch64][AMDGPU][WebAssembly] Use static_cast instead of a reinterpret_cast to downcast in parseMachineFunctionInfo. NFC
static_cast is a little safer here since the compiler will
ensure we're casting to a class derived from
yaml::MachineFunctionInfo.

I believe this first appeared on AMDGPU and was copied to the
other two targets.

Spotted when it was being copied to RISCV in D123178.

Differential Revision: https://reviews.llvm.org/D123260
2022-04-06 15:09:18 -07:00
Jonas Devlieghere 815fa5bf44
[lldb] Remove duplicate "warning:"
Remove "warning:" from the warning message itself. The default event
handler is already emitting the appropriate prefix.
2022-04-06 15:05:27 -07:00
Sam McCall 69f7210657 Remove unused FileEntry::operator<. NFC 2022-04-06 23:39:17 +02:00
Nathan Sidwell 4a4d0985d4 [demangler] Node precision dumper
Add contents to the demangler node dumper's print(Prec) functions.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D122740
2022-04-06 14:04:15 -07:00
Peter Collingbourne 02a7b1754f Reland "gn build: Fix support for building the builtins for baremetal."
Our support for building for baremetal was conditional on a default
off arg and would have failed to build if you had somehow arranged
to pass the correct --target flag; presumably nobody noticed because
nobody was turning it on. A better approach is to model baremetal
as a separate "OS" called "baremetal" and build it in the same way
as we cross-compile for other targets. That's what this patch does.
I only hooked up the arm64 target but others can be added.

Relanding after fixing Mac build breakage in D123244.

Differential Revision: https://reviews.llvm.org/D122862
2022-04-06 13:45:40 -07:00
Peter Collingbourne 096477e25e gn build: Use target OS to control whether to use/depend on llvm-ar.
When cross-compiling from Mac to non-Mac, we need to use the just-built
llvm-ar instead of libtool. We're currently doing the right thing
when determining which archiver command to use, but the path to ar
and the toolchain dependencies were being set based on the host OS
(current_os evaluated in host OS toolchain), instead of the target
OS. Fix the problem by looking up current_os inside toolchain_args.

Differential Revision: https://reviews.llvm.org/D123244
2022-04-06 13:45:40 -07:00
Walter Erquinigo 6795f37c14 [NFC][trace][intelpt] Remove unneeded import
Remove an unnecessary import to silence a compiler warning.
2022-04-06 13:34:11 -07:00
John Demme 8d8738f6fe [MLIR] Add block detach func to CAPI and use it in Python bindings
Adds `mlirBlockDetach` to the CAPI to remove a block from its parent
region. Use it in the Python bindings to implement
`Block.append_to(region)`.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D123165
2022-04-06 13:11:56 -07:00
Nathan Sidwell 51f6caf2fb [demangler][NFC] Rename SwapAndRestore to ScopedOverride
The demangler has a utility class 'SwapAndRestore'. That name is
confusing. It's not swapping anything, and the restore part happens at
the object's destruction. What it's actually doing is allowing a
override of some value that is dynamically accessible within the
lifetime of a lexical scope. Thus rename it to ScopedOverride, and
tweak it's member variable names.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D122606
2022-04-06 12:55:35 -07:00
Martin Storsjö 7594e23679 [libcxx] [test] Stop defining LIBCXX-WINDOWS-FIXME
There are no such markings left - all of them have been fixed or
analyzed.

This closes llvm.org/PR32730 (github issue #32077).

Differential Revision: https://reviews.llvm.org/D123145
2022-04-06 22:54:39 +03:00
Martin Storsjö 9edee89b91 [Support] [BLAKE3] Fix building for Cygwin
Use the windows-gnu assembly files on x86_64 Cygwin too.

This fixes https://github.com/llvm/llvm-project/issues/54685.

Differential Revision: https://reviews.llvm.org/D123187
2022-04-06 22:54:26 +03:00
Martin Storsjö 8d7a17b7c8 [AArch64] Fix the upper limit for folded address offsets for COFF
In COFF, the immediates in IMAGE_REL_ARM64_PAGEBASE_REL21 relocations
are limited to 21 bit signed, i.e. the offset has to be less than
(1 << 20). The previous limit did intend to cover for this case, but
had missed that the 21 bit field was signed.

This fixes issue https://github.com/llvm/llvm-project/issues/54753.

Differential Revision: https://reviews.llvm.org/D123160
2022-04-06 22:54:13 +03:00
Martin Storsjö 6e38824221 [lldb] Silence GCC/glibc warnings about ignoring the return value of write(). NFC.
This matches how another similar warning is silenced in
Host/posix/ProcessLauncherPosixFork.cpp.

Differential Revision: https://reviews.llvm.org/D123205
2022-04-06 22:50:07 +03:00
Martin Storsjö ae2aa2d21b [lldb] Silence GCC warnings about missing returns after fully covered switches. NFC.
This silences warnings like this:

lldb/source/Core/DebuggerEvents.cpp: In member function ‘llvm::StringRef lldb_private::DiagnosticEventData::GetPrefix() const’:
lldb/source/Core/DebuggerEvents.cpp:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }

Differential Revision: https://reviews.llvm.org/D123203
2022-04-06 22:50:07 +03:00