Commit Graph

420328 Commits

Author SHA1 Message Date
Nikolas Klauser cd7b444078 [libc++][ranges] Add implicit conversion to bool test for ranges::find{, if, if_not}
Reviewed By: ldionne, var-const, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D122011
2022-04-07 12:03:43 +02:00
Mehdi Chinoune 3031fa88f0 [lldb] Fix building standalone LLDB on Windows.
It was broken since https://reviews.llvm.org/D110172

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D122523
2022-04-07 12:30:33 +03:00
Lorenzo Chelini 573e48765d [MLIR] Standalone: Fix copy-and-paste typo (NFC)
Remove duplicate statements.
2022-04-07 11:22:21 +02:00
Martin Storsjö 5560b9e884 [lldb] [CMake] Disable GCC's -Wstringop-truncation warning. NFC.
This warning gives false positives about lldb's correct use of
strncpy to fill fixed length fields that don't need null termination,
in lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp, like this:

    In file included from /usr/include/string.h:495,
                     from /usr/include/c++/9/cstring:42,
                     from ../include/llvm/ADT/StringRef.h:19,
                     from ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:10:
    In function ‘char* strncpy(char*, const char*, size_t)’,
        inlined from ‘lldb::offset_t CreateAllImageInfosPayload(const ProcessSP&, lldb::offset_t, lldb_private::StreamString&, lldb::SaveCoreStyle)’ at ../tools/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:6341:16:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 16 equals destination size [-Wstringop-truncation]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

The warning could be squelched locally with

    #pragma GCC diagnostic ignored "-Wstringop-truncation"

too, but Clang also interprets those GCC pragmas, and produces
a -Wunknown-warning-option warning instead. That could be remedied
by wrapping the pragma in an "#ifndef __clang__" - but that makes
things even more messy. Instead, just silence this warning entirely.

Differential Revision: https://reviews.llvm.org/D123254
2022-04-07 12:09:01 +03:00
Balázs Kéri 5479174071 [clang][ASTImporter] Not using consumeError at failed import of in-class initializer.
The error can be returned from the function, the problem written in comment before
does not exist. The same is done already in ASTImporter at various import failures.

After a declaration is created in an `ASTNodeImporter` import function
with `GetImportedOrCreateDecl`, that function registers it with
`MapImported`. At many places import errors can happen after this
and the error is returned. The same can be done in the place where
the in-class initializer is imported.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D122528
2022-04-07 11:07:15 +02:00
Benjamin Kramer 817df7999a [clang-tidy] Silence unused variable warning in release builds. NFCI. 2022-04-07 11:00:28 +02:00
Weining Lu 5b32102c87 [LoongArch] Improve td files indentation a little bit. NFC 2022-04-07 16:42:37 +08:00
Fraser Cormack 8ebc9b1560 [RISCV] Select unmasked integer setcc insts via ISel post-process
This patch has no effect on the generated code, whilst mitigating the
increase in ISel table size caused by the recent addition of masked
patterns.

I aim to do the same for floating-point patterns once D123051 lands,
giving us a reason to use masked floating-point patterns.

Reviewed By: arcbbb

Differential Revision: https://reviews.llvm.org/D123217
2022-04-07 09:30:19 +01:00
Benjamin Kramer b8acaaa0c7 [bazel] Port 5390606aa9 2022-04-07 10:40:55 +02:00
Benjamin Kramer ff485d727f Transforms: Remove unused include
Utils can't depend on Scalar transforms.
2022-04-07 10:40:28 +02:00
Florian Hahn 4388c979da
[VPlan] Use vector.body as header name in VPlan native path.
This brings the VPlan block naming in line with the naming of the
generated basic blocks.
2022-04-07 10:31:12 +02:00
Fraser Cormack 8216255c9f [RISCV][VP] Add basic RVV codegen for vp.fcmp
This patch adds the necessary infrastructure to lower vp.fcmp via
ISD::VP_SETCC to RVV instructions.

Most notably this patch adds cond-code legalization for VP_SETCC,
reusing the existing TargetLowering::LegalizeSetCCCondCode by passing in
additional SDValue parameters for the Mask and EVL. This method then
uses VP operations to legalize the condcode.

There is still a general lack of canonicalization on VP_SETCC as opposed
to SETCC which results in worse code than is theoretically possible.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D123051
2022-04-07 09:16:07 +01:00
Nikita Popov b8f50abd04 [lld] Remove support for legacy pass manager
This removes options for performing LTO with the legacy pass
manager in LLD. Options that explicitly enable the new pass manager
are retained as no-ops.

Differential Revision: https://reviews.llvm.org/D123219
2022-04-07 10:17:31 +02:00
Nikita Popov 5390606aa9 [OpaquePtr][Clang] Add CLANG_ENABLE_OPAQUE_POINTERS cmake option
This option controls whether -opaque-pointers or -no-opaque-pointers
is the default. Once opaque pointers are enabled by default, this
will provide a simple way to temporarily opt-out of the change.

Differential Revision: https://reviews.llvm.org/D123122
2022-04-07 10:14:56 +02:00
Valentin Clement 02da964350
[mlir][CSE] Remove duplicated operations with MemRead side-effect
This patch enhances the CSE pass to deal with simple cases of duplicated
operations with MemoryEffects.

It allows the CSE pass to remove safely duplicate operations with the
MemoryEffects::Read that have no other side-effecting operations in
between. Other MemoryEffects::Read operation are allowed.

The use case is pretty simple so far so we can build on top of it to add
more features.

This patch is also meant to avoid a dedicated CSE pass in FIR and was
brought together afetr discussion on https://reviews.llvm.org/D112711.
It does not currently cover the full range of use cases described in
https://reviews.llvm.org/D112711 but the idea is to gradually enhance
the MLIR CSE pass to handle common use cases that can be used by
other dialects.

This patch takes advantage of the new CSE capabilities in Fir.

Reviewed By: mehdi_amini, rriddle, schweitz

Differential Revision: https://reviews.llvm.org/D122801
2022-04-07 10:08:55 +02:00
Wei Xiao 842d0bf931 [x86] Improve select lowering for smin(x, 0) & smax(x, 0)
smin(x, 0):
  (select (x < 0), x, 0) -> ((x >> (size_in_bits(x)-1))) & x

smax(x, 0):
  (select (x > 0), x, 0) -> (~(x >> (size_in_bits(x)-1))) & x
  The comparison is testing for a positive value, we have to invert the sign
  bit mask, so only do that transform if the target has a bitwise 'and not'
  instruction (the invert is free).

The transform is performed only when CMP has a single user to avoid
increasing total instruction number.

https://alive2.llvm.org/ce/z/euUnNm
https://alive2.llvm.org/ce/z/37339J

Differential Revision: https://reviews.llvm.org/D123109
2022-04-07 15:53:24 +08:00
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