Commit Graph

416964 Commits

Author SHA1 Message Date
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
Med Ismail Bennani 2a29c3f72e [lldb/test] Re-enable TestEvents.py on Darwin and fix crashes
This patch re-enables TestEvents.py on Darwin and fixes some crashes
that were happening due to an undefined method.

I ran it 100 times locally with the following command and it passed
every the time:

```
for i in {1..100}; do print $i/100; ./bin/lldb-dotest -p TestEvents.py 2>&1 | rg PASSED; if [ "$?" -eq "1" ]; then break; fi; done
```

Let's see if it still fails non-deterministically on the bots and
eventually also re-enable it on linux.

rdar://37037235

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 13:35:07 -08:00
Yaxun (Sam) Liu 22b6e8173c Fix test failure in openmp-offload.c
Update active offload kind of actions for OpenMP programs.

The change is expected as of e5eb365069.
2022-03-04 16:32:30 -05:00
Richard Howell 94fba14f97 [llvm] add -r functionality to llvm-bitcode-strip
This diff adds functionality to the llvm-bitcode-strip tool for
stripping of LLVM bitcode sections.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D120669
2022-03-04 13:28:28 -08:00
Augie Fackler e1895a46dc OpenMP: add allocsize(0) attribute to __kmpc_alloc_shared
This is the second step in obviating two columns about allocation
functions in MemoryBuiltins.cpp.

Differential Revision: https://reviews.llvm.org/D119583
2022-03-04 16:26:03 -05:00
Roman Lebedev adc0984d81
Reland [SROA] Maintain shadow/backing alloca when some slices are noncapturnig read-only calls to allow alloca partitioning/promotion
This is inspired by the original variant of D109749 by Graham Hunter,
but is a more general version.

Roughly, instead of promoting the alloca, we call it
a shadow/backing alloca, go through all it's slices,
clone(!) instructions that operated on it,
but make them operate on the cloned alloca,
and promote cloned alloca instead.

This keeps the shadow/backing alloca, and all the original instructions
around, which results in said shadow/backing alloca being
a perfect mirror/representation of the promoted alloca's content,
so calls that take the alloca as arguments (non-capturingly!)
can be supported.

For now, we require that the calls also don't modify the alloca's content,
but that is only to simplify the initial implementation,
and that will be supported in a follow-up.

Overall, this leads to *smaller* codesize:
https://llvm-compile-time-tracker.com/compare.php?from=a8b4f5bbab62091835205f3d648902432a4a5b58&to=aeae054055b125b011c1122f82c86457e159436f&stat=size-total
and is roughly neutral compile-time wise:
https://llvm-compile-time-tracker.com/compare.php?from=a8b4f5bbab62091835205f3d648902432a4a5b58&to=aeae054055b125b011c1122f82c86457e159436f&stat=instructions

This relands commit 703240c71f,
that was reverted by commit 7405581f7c,
because the assertion `isa<LoadInst>(OrigInstr)` didn't hold in practice,
as the newly added test `@select_of_ptrs` shows:
If the pointers into alloca are used by select's/PHI's, then even if
we manage to fracture the alloca, some sub-alloca's will likely remain.
And if there are any non-capturing calls, then we will also decide to
keep the original backing alloca around, and we suddenly ~doubled
the alloca size, and the amount of memory traffic.
I'm not sure if this is a problem or we could live with it,
but let's leave that for later...

Reviewed By: djtodoro

Differential Revision: https://reviews.llvm.org/D113520
2022-03-05 00:14:12 +03:00
Roman Lebedev 168fc01997
[NFC][SROA] Add test w/ select and non-capturing call 2022-03-05 00:14:12 +03:00
Zequan Wu b31a1b4746 [LLDB] Flush stream at the end of PrintCommandOutput
On Windows, lldb doesn't print any error message until exit. This fixes it.

Differential Revision: https://reviews.llvm.org/D120961
2022-03-04 13:06:15 -08:00
Augie Fackler dba73135c8 getAllocAlignment: respect allocalign attribute if present
As with allocsize(), we prefer the table data to attributes.

Differential Revision: https://reviews.llvm.org/D118263
2022-03-04 15:57:54 -05:00
Augie Fackler b32735d599 BuildLibCalls: add allocalign attributes for memalign and aligned_alloc
This gets us close to being able to remove a column from the table in
MemoryBuiltins.cpp.

Differential Revision: https://reviews.llvm.org/D117923
2022-03-04 15:57:53 -05:00
Augie Fackler d664c4b73c Attributes: add a new allocalign attribute
This will let us start moving away from hard-coded attributes in
MemoryBuiltins.cpp and put the knowledge about various attribute
functions in the compilers that emit those calls where it probably
belongs.

Differential Revision: https://reviews.llvm.org/D117921
2022-03-04 15:57:53 -05:00
Yaxun (Sam) Liu e5eb365069 [CUDA][HIP] Fix offloading kind for linking C++ programs
When both CUDA or HIP programs and C++ programs are passed
to clang driver without -c, C++ programs are treated as CUDA
or HIP program, which is incorrect.

This is because action builder sets the offloading kind of input
job actions to the linking action to be the union of offloading
kind of the input job actions, i.e. if there is one HIP or CUDA
input to the linker, then all the input to the linker is marked
as HIP or CUDA.

To fix this issue, the offload action builder tracks the originating
input argument of each host action, which allows it to determine
the active offload kind of each host action. Then the offload
kind of each input action to the linker can be determined
individually.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D120911
2022-03-04 15:56:54 -05:00
Shafik Yaghmour 9bd72b5c25 [LLDB] Remove cases of using namespace std
We had using namespace std; sprinkled around several source files and tests.

Differential Revision: https://reviews.llvm.org/D120966
2022-03-04 12:50:25 -08:00
Yaxun (Sam) Liu bde13a8102 [HIP] Fix job action offloading kind for mixed HIP/C++ compilation
When both HIP and C++ programs are input files to clang
with -c, clang treats C++ programs as HIP programs,
which is incorrect.

This is due to action builder does not set correct
offloading kind for job actions for C++ programs.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D120910
2022-03-04 15:34:02 -05:00
Mogball e7c7b16a84 [mlir] Region/BranchOpInterface: Allow implicit type conversions along control-flow edges
RegionBranchOpInterface and BranchOpInterface are allowed to make implicit type conversions along control-flow edges. In effect, this adds an interface method, `areTypesCompatible`, to both interfaces, which should return whether the types of corresponding successor operands and block arguments are compatible. Users of the interfaces, here on forth, must be aware that types may mismatch, although current users (in MLIR core), are not affected by this change. By default, type equality is used.

`async.execute` already has unequal types along control-flow edges (`!async.value<f32>` vs. `f32`), but it opted out of calling `RegionBranchOpInterface::verifyTypes` in its verifier. That method has now been removed and `RegionBranchOpInterface` will verify types along control edges by default in its verifier.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D120790
2022-03-04 20:33:14 +00:00
Paul Robinson e22e2774d9 [RGT] DistroTest: Separate environment-specific test functions
This allows using GTEST_SKIP() to identify un-executed tests.

Found by the Rotten Green Tests project.
2022-03-04 12:28:38 -08:00
Matthias Springer 6fc11d4d3e [mlir][bufferize] Add BufferizationState initializers
Such initializer functions can be enqueued in `BufferizationOptions`. They can be used to set up dialect-specific bufferization state.

Differential Revision: https://reviews.llvm.org/D120985
2022-03-05 05:20:11 +09:00
Tue Ly db46c7770f [libc] Fix small bugs in aarch64/FEnvImpl.h and simplify feclearexcept_test.
Fix small bugs in aarch64/EFnvImpl.h and simplify feclearexcept_test.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D120997
2022-03-04 15:18:03 -05:00
Richard d5d03135a7 [tooling] Explain how to create a compilation database on Windows [NFC]
Differential Revision: https://reviews.llvm.org/D120947
2022-03-04 13:06:08 -07:00
wren romano 289f84a4a2 [mlir][sparse] Rename add{Pointer,Index} to append{Pointer,Index}
This clarifies that these methods only work in append mode, not for general insertions.  This is a prospective change towards https://github.com/llvm/llvm-project/issues/51652 which also performs random-access insertions, so we want to avoid confusion.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D120929
2022-03-04 12:03:24 -08:00
Jez Ng 72c5b26f3d [lld-macho][nfc] Use %X in mapfile test
LLD (and ld64) emits uppercase hex addresses in the mapfile. The
map-file.s test passes right now because the addresses we emit happen
not to include any alphabets, but that can easily change.

I noticed this while dealing with
https://github.com/llvm/llvm-project/issues/54184.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D120941
2022-03-04 14:21:17 -05:00
Jez Ng 984197612c [lld-macho][nfc] Rename some tests for consistency
Now all the tests that cover symbol resolution / precedence have
"resolution" in their filename.

I also added a couple of extra comments.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D120938
2022-03-04 14:21:16 -05:00
Benjamin Kramer 317e6a8077 [bazel] Port 76ec69a911 2022-03-04 20:18:00 +01:00
Snehasish Kumar 11314f4059 [memprof] Filter out callstack frames which cannot be symbolized.
This patch filters out callstack frames which can't be symbolized or if
the frames belong to the runtime. Symbolization may not be possible if
debug information is unavailable or if the addresses are from a shared
library. For now we only support optimization of the main binary which
is statically linked to the compiler runtime.

Differential Revision: https://reviews.llvm.org/D120860
2022-03-04 11:10:08 -08:00
Tue Ly 76ec69a911 [libc] Remove the redundant header FPUtil/FEnvUtils.h
Remove the redundant header FPUtil/FEnvUtils.h, use FPUtil/FEnvImpl.h header instead.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D120965
2022-03-04 14:09:47 -05:00
Jakub Chlanda dce6aa237a [NVPTX] Correctly set regs for neg, abs intrinsics
This patch fixes a bug introduced in D117887.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D120991
2022-03-04 11:06:07 -08:00
Johannes Doerfert f9c2d6005e [OpenMP][FIX] Ensure custom state machine works
The custom state machine had a check for surplus threads that filtered
the main thread if the kernel was executed by a single warp only. We
now first check for the main thread, then for surplus threads, avoiding
to filter the former out.

Fixes #54214.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D121011
2022-03-04 13:51:19 -05:00
Roman Lebedev 7405581f7c
Revert "[SROA] Maintain shadow/backing alloca when some slices are noncapturnig read-only calls to allow alloca partitioning/promotion"
Bots are reporting that the assertion about only expecting loads is wrong.

This reverts commit 703240c71f.
2022-03-04 21:49:30 +03:00
Ellis Hoag 9c35303981 [InstrProf][NFC] Fix warning by removing typecast
This fixes a warning about comparing mismatched types. Since `mmap()` already returns a `void *` use that as the pointer type for comparison.

Reviewed By: kyulee, zequanwu

Differential Revision: https://reviews.llvm.org/D120945
2022-03-04 10:48:25 -08:00
Siva Chandra Reddy a5ee8183c0 [libc][NFC] Add a platform independent thread support library.
The idea is that, other parts of the libc which require thread/lock
support will be able to use this platform independent setup.

With this change, only the linux implementation of a mutex type has been
moved to the new library. Because of this, there is some duplication
between the new library and src/threads/linux. A follow up change will
move all of src/threads/linux to the new library. The duplication should
be eliminated with that move.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D120795
2022-03-04 18:33:46 +00:00
Arthur O'Dwyer 7e1355eb13 [libc++] Mark __wrap_iter's private constructors as explicit.
This is slightly more user-visible than D119894, because the user is
expected to touch `__wrap_iter` directly. But the affected ctors are
non-public, so the user was never expected to be actually calling them.
And I didn't intentionally omit this from D119894; I just didn't
think of it.

Differential Revision: https://reviews.llvm.org/D120937
2022-03-04 13:24:38 -05:00
Tue Ly bccc88b384 [libc][Obvious] Add build folder to .gitignore. 2022-03-04 13:16:55 -05:00
Joseph Huber e2dcc2218c [Libomptarget] Work around bug in initialization of libomptarget
Libomptarget uses some shared variables to track certain internal stated
in the runtime. This causes problems when we have code that contains no
OpenMP kernels. These variables are normally initialized upon kernel
entry, but if there are no kernels we will see no initialization.
Currently we load the runtime into each source file when not running in
LTO mode, so these variables will be erroneously considered undefined or
dead and removed, causing miscompiles. This patch temporarily works
around the most obvious case, but others still exhibit this problem. We
will need to fix this more soundly later.

Fixes #54208.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D121007
2022-03-04 13:13:31 -05:00