Commit graph

416996 commits

Author SHA1 Message Date
Benjamin Kramer f5d578847d Drop iostream include, which is forbidden in LLVM 2022-03-05 19:32:05 +01:00
Nikolas Klauser 52915d78f4 [libc++] Granularize <utility> includes
Reviewed By: ldionne, #libc

Spies: EricWF, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D120466
2022-03-05 19:31:46 +01:00
Benjamin Kramer 14af99d375 [OpenCL] Turn global vector into static array. NFCI. 2022-03-05 19:16:28 +01:00
mydeveloperday 28bb040ded [clang-format] QualifierOrder does not reorder template arguments
https://github.com/llvm/llvm-project/issues/53981

Reorder the qualifiers inside the template argument. This should handle the simple cases of

```
<const T>
<T const>
```

But only by relaxing that single letter capital variables are not possible macros

Fixes: #53981

Reviewed By: HazardyKnusperkeks, curdeius

Differential Revision: https://reviews.llvm.org/D120710
2022-03-05 18:08:25 +00:00
Nikolas Klauser 9b03c08e85 [libc++] Don't warn that coroutines aren't supported when including <experimental/coroutine>
This change makes the behavior of `<experimental/coroutine>` consistent with other headers that only work conditionally.

Reviewed By: ldionne, #libc

Spies: Mordante, ChuanqiXu, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D119964
2022-03-05 19:01:49 +01:00
Karl Meakin 1d8093fe1e [AArch64] fix i128-math.ll 2022-03-05 17:51:58 +00:00
Karl Meakin f3e254b3f3 [AArch64] Add test for i128 overflow/saturation ops (NFC)
This test exposes opportunities for future optimization work

Differential Revision: https://reviews.llvm.org/D121013
2022-03-05 17:25:04 +00:00
Benjamin Kramer a887b95edf [clang-format] Turn global COperatorsFollowingVar vector into a switch
LLVM optimizes this into a bit test. NFCI.
2022-03-05 18:00:16 +01:00
Sanjay Patel f4b53972ce [SDAG] fold bitwise logic with shifted operands
This extends acb96ffd14 to 'and' and 'xor' opcodes.

Copying from that message:

LOGIC (LOGIC (SH X0, Y), Z), (SH X1, Y) --> LOGIC (SH (LOGIC X0, X1), Y), Z

https://alive2.llvm.org/ce/z/QmR9rR

This is a reassociation + factoring fold. The common shift operation is moved
after a bitwise logic op on 2 input operands.
We get simpler cases of these patterns in IR, but I suspect we would miss all
of these exact tests in IR too. We also handle the simpler form of this plus
several other folds in DAGCombiner::hoistLogicOpWithSameOpcodeHands().
2022-03-05 11:14:45 -05:00
Sanjay Patel 90c2330c15 [AArch64][x86] add tests for bitwise logic + shifts; NFC
Copy tests from ecf606cb43 and replace 'or' with 'xor' / 'and'.
This provides coverage for an enhancement of D120516 / acb96ffd14
2022-03-05 11:14:45 -05:00
kamenokonokotan 219a2eb4d4 [WebAssembly] Update WebAssemblyAsmTypeCheck for table.get
This patch is aimed to resolve [[ https://github.com/llvm/llvm-project/issues/53789 | GitHub Issue #53789 ]].

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D120229
2022-03-05 16:57:29 +01:00
Zakk Chen 33b61c5678 [RISCV] Fix incorrect codegen introduced by D119688.
We should not emit a tail agnostic vlse for a tail undisturbed vmv.s.x

In D119688:
-    if (IsScalarMove && !Node->getOperand(0).isUndef())
+    bool HasPassthruOperand = Node->getOpcode() != ISD::SPLAT_VECTOR;
+    if (HasPassthruOperand && !IsScalarMove &&
!Node->getOperand(0).isUndef())
       break;

The IsScalarMove check in the if statement had been changed.

Differential Revision: https://reviews.llvm.org/D120963
2022-03-05 06:10:26 -08:00
Zakk Chen 3de970718c [RISCV][NFC] Precommit test cases for D120963. 2022-03-05 06:10:25 -08:00
Corentin Jabot fda7d029e5 [NFC][Clang] Fix a couple of typos 2022-03-05 09:45:04 +01:00
Craig Topper 1e569e3b7b [RISCV] Add CMOV isel pattern for (select (setgt X, -1), Y, Z)
setgt X, -1 is the canonical form of setge X, 0. We can swap the
select operands and use setlt X, X0 when selecting CMOV. This
avoid materializing the -1 in a register.
2022-03-04 22:35:13 -08:00
Shoaib Meenai 8c5aead28d [cmake] Pass /winsysroot explicitly
We were relying on HandleLLVMOptions adding this flag, but that's not
included in compiler-rt. Add the flag explicitly ourselves to ensure
it's present; the duplication of the flag in the parts of the build
which do include HandleLLVMOptions doesn't cause any issues.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D121033
2022-03-04 22:27:59 -08:00
Petr Hosek b5f1a8cfc3 [llvm-cov] New parameters to set coverage coverage_watermark
Add a pairs of parameters to set coverage watermark for llvm-cov, and
user can change the percentage thresholds marked with different colors
in the report.

Patch By: tanjinhua

Differential Revision: https://reviews.llvm.org/D116876
2022-03-04 22:21:40 -08:00
Shao-Ce SUN fa9c8bab0c [RISCV] Support k-ext clang intrinsics
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D112774
2022-03-05 13:57:18 +08:00
Arthur Eubanks 30f1cef86b Revert "[polly] Fix regression test after D110620."
This reverts commit 2aa624a94f.

D110620 was reverted.
2022-03-04 20:37:15 -08:00
Arthur O'Dwyer 988dae653f [libc++] Add _LIBCPP_HIDE_FROM_ABI to __quoted_proxy ctors.
ldionne says this looks right to him, too.

Reviewed as part of D120135.
2022-03-04 23:06:28 -05:00
Arthur O'Dwyer 9d93b97222 [libc++] [NFC] Formatting preliminary to D120135 (std::quoted)
This just gets some of the non-functional formatting out of the way
before the meat of D120135.
2022-03-04 23:06:28 -05:00
Arthur O'Dwyer 564c7fa1b7 [libc++] ADL-proof calls to __quoted and noskipws.
Reviewed as part of D120135.
2022-03-04 23:06:28 -05:00
Arthur Eubanks f909aed671 Revert "[SCEV] Infer ranges for SCC consisting of cycled Phis"
This reverts commit fc539b0004.

Causes miscompiles, see D110620.
2022-03-04 19:52:44 -08:00
Fangrui Song a815424cc5 Reland D119909 [ELF] Parallelize initializeLocalSymbols
ObjFile::parse combines symbol initialization and resolution. Many tasks
unrelated to symbol resolution can be postponed and parallelized. This patch
extracts local symbol initialization and parallelizes it.

Technically the new function initializeLocalSymbols can be merged into
ObjFile::postParse, but functions like getSrcMsg may access the
uninitialized (all nullptr) local part of InputFile::symbols.

Linking chrome: 1.02x as fast with glibc malloc, 1.04x as fast with mimalloc

Depends on f456c3ae3f and D119908

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D119909
2022-03-04 19:00:10 -08:00
Fangrui Song f456c3ae3f [ELF] Move addWrappedSymbols before postParseObjectFile
addWrappedSymbols may trigger archive extraction: split stack implementation
uses --wrap=pthread_create, which extracts libgcc.a(generic-morestack-thread.o).

This fixes the regression caused by 09602d3b47 by
making the invariant satisfied: no more non-compileBitcodeFiles object file is
produced at postParseObjectFile.
2022-03-04 18:56:37 -08:00
Thomas Lively c01ec30830 [WebAssembly] Update Preprocessor/init.c test after 3be9e0ba97 2022-03-04 18:40:10 -08:00
Craig Topper 232f57319d [RISCV] Move vslide1up/down intrinsics into lowerVectorIntrinsicSplats. NFC
Rename to lowerVectorIntrinsicScalars.

This allows us to share the code that checks if the scalar needs
to be type legalized.
2022-03-04 18:21:53 -08:00
Vladimir Vereschaka d860ac5da6 [CMake] Replace TARGET_TRIPLE with TOOLCHAIN_TARGET_TRIPLE for Win-to-Arm cross toolchain cache file. NFC.
Avoid using TARGET_TRIPLE argument for the cross toolchain cmake cache file and replace it
with TOOLCHAIN_TARGET_TRIPLE.

Reference: https://reviews.llvm.org/D119918

Differential Revision: https://reviews.llvm.org/D121029
2022-03-04 16:39:28 -08:00
Craig Topper 0b75b39a70 [RISCV] Merge more rv32/rv64 vector intrinsic tests that contain the same content.
Use sed to convert iXLen to i32/i64 before running the test.
2022-03-04 16:34:59 -08:00
Med Ismail Bennani 999e75476e
[lldb/Test] Fix test_launch_scripted_process_stack_frames failure
This should fix the test_launch_scripted_process_stack_frames GreenDragon
test failure : https://green.lab.llvm.org/green/job/lldb-cmake/41901

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 16:22:53 -08:00
Thomas Lively 3be9e0ba97 [WebAssembly] Check bulk-memory when adjusting lang opts
We previously had logic to disable pthreads, set the ThreadModel to Single, and
disable thread-safe statics when the atomics target features is disabled, since
that means that the resulting program will not be used in a threaded context.
Similarly check for the presence of the bulk-memory feature, since that is also
necessary to produce multithreaded programs.

Differential Revision: https://reviews.llvm.org/D121014
2022-03-04 16:07:16 -08:00
Zequan Wu be5705767a [clang-format] fix namepsace format when the name is macro expansion
Originally filed at crbug.com/1184570.
When the name of a namespace is a macro that takes arguments,
- It fixed the indentation.
- It fixed the namepsace end comments.

Differential Revision: https://reviews.llvm.org/D120931
2022-03-04 16:01:17 -08:00
Andrew Browne 9129743dde [Docs] List __has_feature(dataflow_sanitizer) in LanguageExtensions docs. 2022-03-04 15:48:07 -08:00
Kevin Athey 7fbc1f7ebe [MSAN] extend ioctl interceptor to support BLKSSZGET
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D120693
2022-03-04 15:39:30 -08:00
River Riddle 9c9a431735 [mlir][Pass] Add support for an InterfacePass and pass filtering based on OperationName
This commit adds a new hook Pass `bool canScheduleOn(RegisteredOperationName)` that
indicates if the given pass can be scheduled on operations of the given type. This makes it
easier to define constraints on generic passes without a) adding conditional checks to
the beginning of the `runOnOperation`, or b) defining a new pass type that forwards
from `runOnOperation` (after checking the invariants) to a new hook. This new hook is
used to implement an `InterfacePass` pass class, that represents a  generic pass that
runs on operations of the given interface type.

The PassManager will also verify that passes added to a pass manager can actually be
scheduled on that pass manager, meaning that we will properly error when an Interface
is scheduled on an operation that doesn't actually implement that interface.

Differential Revision: https://reviews.llvm.org/D120791
2022-03-04 15:14:04 -08:00
Jorge Gorbe Moya 449b649fec Revert "[ELF] Parallelize initializeLocalSymbols"
This reverts commit 09602d3b47.
2022-03-04 15:01:17 -08:00
Med Ismail Bennani 86e6030ee8 [lldb/Test] Disable test_scripted_process_and_scripted_thread on Windows
This disables TestScriptedProcess.test_scripted_process_and_scripted_thread
on Windows since the inferior binary a linked to a dylib that doesn't
build on Windows.

This should fix https://lab.llvm.org/buildbot/#/builders/83/builds/16100

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 14:56:20 -08:00
Martin Storsjö 45415ef91b [libcxx] Fix the ctype is (pointer version) function for Windows
Previously, this test snippet would report incorrect information:

    F::mask m;
    std::wstring in(L"\u00DA"); // LATIN CAPITAL LETTER U WITH ACUTE
    f.is(in.data(), in.data() + 1, &m);
    // m & F::lower would be set

The single-character version of the `is` function wasn't
affected by this issue though.

Define `_LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA` for Windows,
as the `alpha` / `_ALPHA` constant is a mask consisting of
multiple bits set, which avoids setting `alpha` whenver any
of the bits is set, in the `do_is` implementation.

On Windows, with the "C" locale, wchars are classified according
to their Unicode interpretation, just as in the en_US.UTF-8 locale on
all platforms.

Due to the differing classification of some characters, the
`scan_is` and `scan_not` tests are quite annoying to fix, thus just
ifdef out some of the tests for the "C" locale there - the code gets
tested with the more standard en_US.UTF-8 locale anyway.

Differential Revision: https://reviews.llvm.org/D120796
2022-03-05 00:47:19 +02:00
Arthur O'Dwyer 3347e7d40f [libc++] [LWG3656] Update the return type of std::bit_width.
Fixes LWG3656, "Inconsistent bit operations returning a count".
https://cplusplus.github.io/LWG/issue3656

The fix has been approved for C++23 and left to vendors' discretion
in C++20 (but it sounds like everyone's on the same page that
of course it should be DR'ed back to C++20 too).

Differential Revision: https://reviews.llvm.org/D120444
2022-03-04 17:31:09 -05:00
Aart Bik 988d4b0d62 [mlir][sparse] fix mlir-window build breakage
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D121022
2022-03-04 14:29:07 -08:00
Tanya Lattner ca8432f1ee Update references to the mailing list to reference Discourse. Also update references to LLVM Bugzilla as we have moved to GitHub issues.
Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D120833
2022-03-04 14:27:50 -08:00
Mogball 210bdc651b [mlir] RegionBranchOpInterface should be verifyWithRegions 2022-03-04 22:25:25 +00:00
Roman Lebedev e47257e251
Revert "Reland [SROA] Maintain shadow/backing alloca when some slices are noncapturnig read-only calls to allow alloca partitioning/promotion"
There seems to be one more uncaught problem, SROA may now end up trying
to re-re-repromote the just-promoted shadow alloca, and do that endlessly.

This reverts commit adc0984d81.
2022-03-05 01:09:51 +03:00
Mogball acf603b947 [mlir][ods] Save the Enum info in EnumAttr 2022-03-04 21:59:14 +00:00
Mogball 9d6c2ffcaa [mlir] NFC fix missing dependency on Async 2022-03-04 21:58:39 +00:00
Saleem Abdulrasool b5491dd307 ObjectFile: add a case for EM_RISCV
This adds the jump slot mapping for RISCV.  This enables lldb to attach to a
remote debug server.  Although this doesn't enable debugging RISCV targets, it
is sufficient to attach, which is a slight improvement.

Tested with DebugServer2:
~~~
(lldb) gdb-remote localhost:1234
(lldb) Process 71438 stopped
* thread #1, name = 'reduced', stop reason = signal SIGTRAP
    frame #0: 0x0000003ff7fe1b20

error: Process 71438 is currently being debugged, kill the process before connecting.
(lldb) register read
general:
        x0 = 0x0000003ff7fe1b20
        x1 = 0x0000002ae00d3a50
        x2 = 0x0000003ffffff3e0
        x3 = 0x0000002ae01566e0
        x4 = 0x0000003fe567c7b0
        x5 = 0x0000000000001000
        x6 = 0x0000002ae00604ec
        x7 = 0x00000000000003ff
        x8 = 0x0000003fffc22db0
        x9 = 0x0000000000000000
       x10 = 0x0000000000000000
       x11 = 0x0000002ae603b1c0
       x12 = 0x0000002ae6039350
       x13 = 0x0000000000000000
       x14 = 0x0000002ae6039350
       x15 = 0x0000002ae6039350
       x16 = 0x73642f74756f3d5f
       x17 = 0x00000000000000dd
       x18 = 0x0000002ae6038f08
       x19 = 0x0000002ae603b1c0
       x20 = 0x0000002b0f3d3f40
       x21 = 0x0000003ff0b212d0
       x22 = 0x0000002b0f3a2740
       x23 = 0x0000002b0f3de3a0
       x24 = 0x0000002b0f3d3f40
       x25 = 0x0000002ad6929850
       x26 = 0x0000000000000000
       x27 = 0x0000002ad69297c0
       x28 = 0x0000003fe578b364
       x29 = 0x000000000000002f
       x30 = 0x0000000000000000
       x31 = 0x0000002ae602401a
        pc = 0x0000003ff7fe1b20
       ft0 = 0
       ft1 = 0
       ft2 = 0
       ft3 = 0
       ft4 = 0
       ft5 = 0
       ft6 = 0
       ft7 = 0
       fs0 = 0
       fs1 = 0
       fa0 = 0
       fa1 = 0
       fa2 = 0
       fa3 = 0
       fa4 = 0
       fa5 = 0
       fa6 = 0
       fa7 = 9.10304232197721e-313
       fs2 = 0
       fs3 = 1.35805727667792e-312
       fs4 = 1.35589259164679e-312
       fs5 = 1.35805727659887e-312
       fs6 = 9.10304232355822e-313
       fs7 = 0
       fs8 = 9.10304233027751e-313
       fs9 = 0
      fs10 = 9.10304232948701e-313
      fs11 = 1.35588724164707e-312
       ft8 = 0
       ft9 = 9.1372158616833e-313
      ft10 = 9.13720376537528e-313
      ft11 = 1.356808717416e-312
3 registers were unavailable.

(lldb) disassemble
error: Failed to disassemble memory at 0x3ff7fe1b2
~~~
2022-03-04 21:54:20 +00:00
Stella Laurenzo 38151a08c2 Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"."
This reverts commit 7cdda6b8ce.

Differential Revision: https://reviews.llvm.org/D121020
2022-03-04 13:45:43 -08:00
Med Ismail Bennani b934ed7dd6 revert "[lldb/Host] Fix crash in FileSystem::IsLocal"
This reverts commit 2dc6e906b0 following
changes introduced in 59eb705277.
2022-03-04 13:36:36 -08:00
Med Ismail Bennani 680ca7f21a [lldb/Plugins] Add ability to load modules to Scripted Processes
This patch introduces a new way to load modules programatically with
Scripted Processes. To do so, the scripted process blueprint holds a
list of dictionary describing the modules to load, which their path or
uuid, load address and eventually a slide offset.

LLDB will fetch that list after launching the ScriptedProcess, and
iterate over each entry to create the module that will be loaded in the
Scripted Process' target.

The patch also refactors the StackCoreScriptedProcess test to stop
inside the `libbaz` module and make sure it's loaded correctly and that
we can fetch some variables from it.

rdar://74520238

Differential Revision: https://reviews.llvm.org/D120969

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 13:35:28 -08:00
Med Ismail Bennani 6eddd987c9 [lldb/Plugin] Use static ScriptedInterface::ErrorWithMessage function (NFC)
This patch replaces the calls to ErrorWithMessage using the GetInterface
message by a call to the static method directly.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 13:35:19 -08:00