platform/upstream/llvm.git
2 years ago[mlir][ods] Save the Enum info in EnumAttr
Mogball [Fri, 4 Mar 2022 21:59:14 +0000 (21:59 +0000)]
[mlir][ods] Save the Enum info in EnumAttr

2 years ago[mlir] NFC fix missing dependency on Async
Mogball [Fri, 4 Mar 2022 21:58:17 +0000 (21:58 +0000)]
[mlir] NFC fix missing dependency on Async

2 years agoObjectFile: add a case for `EM_RISCV`
Saleem Abdulrasool [Fri, 4 Mar 2022 21:50:54 +0000 (21:50 +0000)]
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
~~~

2 years agoReapply "[cmake] Prefix gtest and gtest_main with "llvm_"."
Stella Laurenzo [Fri, 4 Mar 2022 20:08:04 +0000 (12:08 -0800)]
Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"."

This reverts commit 7cdda6b8ce49ae3c90c068cff4dc355bba5d77f2.

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

2 years agorevert "[lldb/Host] Fix crash in FileSystem::IsLocal"
Med Ismail Bennani [Fri, 4 Mar 2022 21:36:36 +0000 (13:36 -0800)]
revert "[lldb/Host] Fix crash in FileSystem::IsLocal"

This reverts commit 2dc6e906b09deb092c15a726c06d0ecbeec1eb18 following
changes introduced in 59eb70527741594fe3c92d0a1b6704ed45111437.

2 years ago[lldb/Plugins] Add ability to load modules to Scripted Processes
Med Ismail Bennani [Fri, 4 Mar 2022 19:22:32 +0000 (11:22 -0800)]
[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>
2 years ago[lldb/Plugin] Use static ScriptedInterface::ErrorWithMessage function (NFC)
Med Ismail Bennani [Tue, 1 Mar 2022 01:37:28 +0000 (17:37 -0800)]
[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>
2 years ago[lldb/test] Re-enable TestEvents.py on Darwin and fix crashes
Med Ismail Bennani [Sat, 26 Feb 2022 04:50:05 +0000 (20:50 -0800)]
[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>
2 years agoFix test failure in openmp-offload.c
Yaxun (Sam) Liu [Fri, 4 Mar 2022 21:27:53 +0000 (16:27 -0500)]
Fix test failure in openmp-offload.c

Update active offload kind of actions for OpenMP programs.

The change is expected as of e5eb365069cce7bb642421d53a1d3964f8d5bdb7.

2 years ago[llvm] add -r functionality to llvm-bitcode-strip
Richard Howell [Fri, 4 Mar 2022 21:24:37 +0000 (13:24 -0800)]
[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

2 years agoOpenMP: add allocsize(0) attribute to __kmpc_alloc_shared
Augie Fackler [Fri, 11 Feb 2022 20:07:48 +0000 (15:07 -0500)]
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

2 years agoReland [SROA] Maintain shadow/backing alloca when some slices are noncapturnig read...
Roman Lebedev [Thu, 24 Feb 2022 12:24:36 +0000 (15:24 +0300)]
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 703240c71fd640af7490069e8149d32d78d14da1,
that was reverted by commit 7405581f7ca3ba54be8a04c394a96fe6d980f073,
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

2 years ago[NFC][SROA] Add test w/ select and non-capturing call
Roman Lebedev [Fri, 4 Mar 2022 20:46:27 +0000 (23:46 +0300)]
[NFC][SROA] Add test w/ select and non-capturing call

2 years ago[LLDB] Flush stream at the end of PrintCommandOutput
Zequan Wu [Fri, 4 Mar 2022 03:22:30 +0000 (19:22 -0800)]
[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

2 years agogetAllocAlignment: respect allocalign attribute if present
Augie Fackler [Wed, 26 Jan 2022 04:50:22 +0000 (23:50 -0500)]
getAllocAlignment: respect allocalign attribute if present

As with allocsize(), we prefer the table data to attributes.

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

2 years agoBuildLibCalls: add allocalign attributes for memalign and aligned_alloc
Augie Fackler [Fri, 21 Jan 2022 17:07:53 +0000 (12:07 -0500)]
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

2 years agoAttributes: add a new allocalign attribute
Augie Fackler [Fri, 21 Jan 2022 16:22:09 +0000 (11:22 -0500)]
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

2 years ago[CUDA][HIP] Fix offloading kind for linking C++ programs
Yaxun (Sam) Liu [Thu, 3 Mar 2022 14:01:46 +0000 (09:01 -0500)]
[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

2 years ago[LLDB] Remove cases of using namespace std
Shafik Yaghmour [Fri, 4 Mar 2022 20:50:25 +0000 (12:50 -0800)]
[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

2 years ago[HIP] Fix job action offloading kind for mixed HIP/C++ compilation
Yaxun (Sam) Liu [Wed, 2 Mar 2022 14:09:16 +0000 (09:09 -0500)]
[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

2 years ago[mlir] Region/BranchOpInterface: Allow implicit type conversions along control-flow...
Mogball [Fri, 4 Mar 2022 20:23:24 +0000 (20:23 +0000)]
[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

2 years ago[RGT] DistroTest: Separate environment-specific test functions
Paul Robinson [Thu, 17 Feb 2022 18:36:17 +0000 (10:36 -0800)]
[RGT] DistroTest: Separate environment-specific test functions

This allows using GTEST_SKIP() to identify un-executed tests.

Found by the Rotten Green Tests project.

2 years ago[mlir][bufferize] Add BufferizationState initializers
Matthias Springer [Fri, 4 Mar 2022 20:11:21 +0000 (05:11 +0900)]
[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

2 years ago[libc] Fix small bugs in aarch64/FEnvImpl.h and simplify feclearexcept_test.
Tue Ly [Fri, 4 Mar 2022 15:00:10 +0000 (10:00 -0500)]
[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

2 years ago[tooling] Explain how to create a compilation database on Windows [NFC]
Richard [Thu, 3 Feb 2022 03:53:53 +0000 (20:53 -0700)]
[tooling] Explain how to create a compilation database on Windows [NFC]

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

2 years ago[mlir][sparse] Rename add{Pointer,Index} to append{Pointer,Index}
wren romano [Thu, 3 Mar 2022 19:41:23 +0000 (11:41 -0800)]
[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

2 years ago[lld-macho][nfc] Use %X in mapfile test
Jez Ng [Fri, 4 Mar 2022 19:20:53 +0000 (14:20 -0500)]
[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

2 years ago[lld-macho][nfc] Rename some tests for consistency
Jez Ng [Fri, 4 Mar 2022 19:20:49 +0000 (14:20 -0500)]
[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

2 years ago[bazel] Port 76ec69a911c6
Benjamin Kramer [Fri, 4 Mar 2022 19:18:00 +0000 (20:18 +0100)]
[bazel] Port 76ec69a911c6

2 years ago[memprof] Filter out callstack frames which cannot be symbolized.
Snehasish Kumar [Thu, 3 Mar 2022 01:28:09 +0000 (17:28 -0800)]
[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

2 years ago[libc] Remove the redundant header FPUtil/FEnvUtils.h
Tue Ly [Fri, 4 Mar 2022 03:58:51 +0000 (22:58 -0500)]
[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

2 years ago[NVPTX] Correctly set regs for neg, abs intrinsics
Jakub Chlanda [Fri, 4 Mar 2022 19:05:00 +0000 (11:05 -0800)]
[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

2 years ago[OpenMP][FIX] Ensure custom state machine works
Johannes Doerfert [Fri, 4 Mar 2022 18:16:29 +0000 (13:16 -0500)]
[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

2 years agoRevert "[SROA] Maintain shadow/backing alloca when some slices are noncapturnig read...
Roman Lebedev [Fri, 4 Mar 2022 18:47:54 +0000 (21:47 +0300)]
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 703240c71fd640af7490069e8149d32d78d14da1.

2 years ago[InstrProf][NFC] Fix warning by removing typecast
Ellis Hoag [Thu, 3 Mar 2022 22:59:51 +0000 (14:59 -0800)]
[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

2 years ago[libc][NFC] Add a platform independent thread support library.
Siva Chandra Reddy [Sat, 26 Feb 2022 01:18:19 +0000 (01:18 +0000)]
[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

2 years ago[libc++] Mark __wrap_iter's private constructors as explicit.
Arthur O'Dwyer [Thu, 3 Mar 2022 20:42:26 +0000 (15:42 -0500)]
[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

2 years ago[libc][Obvious] Add build folder to .gitignore.
Tue Ly [Fri, 4 Mar 2022 18:15:17 +0000 (13:15 -0500)]
[libc][Obvious] Add build folder to .gitignore.

2 years ago[Libomptarget] Work around bug in initialization of libomptarget
Joseph Huber [Fri, 4 Mar 2022 17:07:57 +0000 (12:07 -0500)]
[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

2 years ago[SROA] Maintain shadow/backing alloca when some slices are noncapturnig read-only...
Roman Lebedev [Thu, 24 Feb 2022 12:24:36 +0000 (15:24 +0300)]
[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

Reviewed By: djtodoro

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

2 years ago[clang] [concepts] Check constrained-auto return types for void-returning functions
Arthur O'Dwyer [Mon, 14 Feb 2022 21:03:01 +0000 (16:03 -0500)]
[clang] [concepts] Check constrained-auto return types for void-returning functions

Fixes #49188.

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

2 years ago[clang] [NFC] Add `const` to a parameter that's not modified.
Arthur O'Dwyer [Thu, 17 Feb 2022 16:59:00 +0000 (11:59 -0500)]
[clang] [NFC] Add `const` to a parameter that's not modified.

Reviewed as part of D119184.

2 years ago[X86] getTargetVShiftNode - peek through any zext node
Simon Pilgrim [Fri, 4 Mar 2022 17:41:28 +0000 (17:41 +0000)]
[X86] getTargetVShiftNode - peek through any zext node

If the shift amount has been zero-extended, peek through as this might help us further canonicalize the shift amount.

Fixes regression mentioned in rG147cfcbef1255ba2b4875b76708dab1a685085f5

2 years agoPass through more LIBCXX_* variables to libfuzzer's custom lib++
Colin Cross [Fri, 4 Mar 2022 06:17:15 +0000 (22:17 -0800)]
Pass through more LIBCXX_* variables  to libfuzzer's custom lib++

Pass LIBCXX_HAS_PTHREAD_LIB, LIBCXX_HAS_RT_LIB  and LIBCXXABI_HAS_PTHREAD_LIB
through to the custom lib++ builds so that libfuzzer  doesn't end up with a .deplibs section that
links against those libraries when the variables are set to false.

Reviewed By: phosek

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

2 years ago[libc] Make the errno macro resolve to the thread local variable directly.
Siva Chandra Reddy [Thu, 3 Mar 2022 10:25:35 +0000 (10:25 +0000)]
[libc] Make the errno macro resolve to the thread local variable directly.

With modern architectures having a thread pointer and language supporting
thread locals, there is no reason to use a function intermediary to access
the thread local errno value.

The entrypoint corresponding to errno has been replaced with an object
library as there is no formal entrypoint for errno anymore.

Reviewed By: jeffbailey, michaelrj

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

2 years ago[gn build] Port c88deef0a721
LLVM GN Syncbot [Fri, 4 Mar 2022 17:22:23 +0000 (17:22 +0000)]
[gn build] Port c88deef0a721

2 years ago[gn build] Port 7ee97c24efab
LLVM GN Syncbot [Fri, 4 Mar 2022 17:22:23 +0000 (17:22 +0000)]
[gn build] Port 7ee97c24efab

2 years ago[clang][dataflow] Add `MatchSwitch` utility library.
Yitzhak Mandelbaum [Thu, 3 Mar 2022 11:58:57 +0000 (11:58 +0000)]
[clang][dataflow] Add `MatchSwitch` utility library.

Adds `MatchSwitch`, a library for simplifying implementation of transfer
functions. `MatchSwitch` supports constructing a "switch" statement, where each
case of the switch is defined by an AST matcher. The cases are considered in
order, like pattern matching in functional languages.

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

2 years ago[MLIR][AMDGPU] Fix typo and add comment to SerializeToHsaco
Krzysztof Drewniak [Thu, 3 Mar 2022 22:52:27 +0000 (22:52 +0000)]
[MLIR][AMDGPU] Fix typo and add comment to SerializeToHsaco

Reviewed By: bondhugula

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

2 years ago[clang][dataflow] Add a lattice to track source locations.
Yitzhak Mandelbaum [Thu, 3 Mar 2022 03:34:44 +0000 (03:34 +0000)]
[clang][dataflow] Add a lattice to track source locations.

This patch adds a simpe lattice used to collect source loctions. An intended application is to track errors found in code during an analysis.

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

2 years ago[MLIR][SCF] Allow combining subsequent if statements that yield & negated condition
William S. Moses [Thu, 3 Mar 2022 19:04:14 +0000 (14:04 -0500)]
[MLIR][SCF] Allow combining subsequent if statements that yield & negated condition

This patch extends the existing if combining canonicalization to also handle the case where a value returned by the first if is used within the body of the second if.

This patch also extends if combining to support if's whose conditions are logical negations of each other.

Reviewed By: ftynse

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

2 years ago[DebugInfo][InstrRef] Accept register-reads after isel in any block
Jeremy Morse [Fri, 4 Mar 2022 16:39:22 +0000 (16:39 +0000)]
[DebugInfo][InstrRef] Accept register-reads after isel in any block

When lowering LLVM-IR to instruction referencing stuff, if a value is
defined by a COPY, we try and follow the register definitions back to where
the value was defined, and build an instruction reference to that
instruction. In a few scenarios (such as arguments), this isn't possible.
I added some assertions to catch cases that weren't explicitly whitelisted.

Over the course of a few months, several more scenarios have cropped up,
the lastest is the llvm.read_register intrinsic, which lets LLVM-IR read an
arbitary register at any point. In the face of this, there's little point
in validating whether debug-info reads a register in an expected scenario.
Thus: this patch just deletes those assertions, and adds a regression test
to check that something is done with the llvm.read_register intrinsic.

Fixes #54190

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

2 years ago[MLIR][MemRef] Ensure alloca_scope is inlined with no allocating ops
William S. Moses [Wed, 2 Mar 2022 20:13:07 +0000 (15:13 -0500)]
[MLIR][MemRef] Ensure alloca_scope is inlined with no allocating ops

Reviewed By: ftynse

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

2 years ago[X86] LowerShiftByScalarVariable - find splat patterns with getSplatSourceVector...
Simon Pilgrim [Fri, 4 Mar 2022 16:47:20 +0000 (16:47 +0000)]
[X86] LowerShiftByScalarVariable - find splat patterns with getSplatSourceVector instead of getSplatValue

This completes the removal of uses of SelectionDAG::getSplatValue started in D119090 - by avoiding extracting the splatted element we make it a lot easier to zero-extend the bottom 64-bits of the shift amount and fixes issues we had on 32-bit targets where i64 isn't legal.

I've removed the old version of getTargetVShiftNode that took the scalar shift amount argument and LowerRotate can finally efficiently handle vXi16 rotates-by-scalar (using the same code as general funnel-shifts).

The only regression we see is in the X86-AVX2 PR52719 test case in vector-shift-ashr-256.ll - this is now hitting the same problem as the X86-AVX1 case (failure to simplify a multi-use X86ISD::VBROADCAST_LOAD) which I intend to address in a follow up patch.

2 years agoRevert "[AArch64] Async unwind - function prologues"
Hans Wennborg [Fri, 4 Mar 2022 16:25:48 +0000 (17:25 +0100)]
Revert "[AArch64] Async unwind - function prologues"

It caused builds to assert with:

  (StackSize == 0 && "We already have the CFA offset!"),
  function generateCompactUnwindEncoding, file AArch64AsmBackend.cpp, line 624.

when targeting iOS. See comment on the code review for reproducer.

> This patch rearranges emission of CFI instructions, so the resulting
> DWARF and `.eh_frame` information is precise at every instruction.
>
> The current state is that the unwind info is emitted only after the
> function prologue. This is fine for synchronous (e.g. C++) exceptions,
> but the information is generally incorrect when the program counter is
> at an instruction in the prologue or the epilogue, for example:
>
> ```
> stp     x29, x30, [sp, #-16]!           // 16-byte Folded Spill
> mov     x29, sp
> .cfi_def_cfa w29, 16
> ...
> ```
>
> after the `stp` is executed the (initial) rule for the CFA still says
> the CFA is in the `sp`, even though it's already offset by 16 bytes
>
> A correct unwind info could look like:
> ```
> stp     x29, x30, [sp, #-16]!           // 16-byte Folded Spill
> .cfi_def_cfa_offset 16
> mov     x29, sp
> .cfi_def_cfa w29, 16
> ...
> ```
>
> Having this information precise up to an instruction is useful for
> sampling profilers that would like to get a stack backtrace. The end
> goal (towards this patch is just a step) is to have fully working
> `-fasynchronous-unwind-tables`.
>
> Reviewed By: danielkiss, MaskRay
>
> Differential Revision: https://reviews.llvm.org/D111411

This reverts commit 32e8b550e5439c7e4aafa73894faffd5f25d0d05.

2 years ago[AArch64] Use simd mov to materialize big fp constants
zhongyunde [Fri, 4 Mar 2022 14:44:14 +0000 (22:44 +0800)]
[AArch64] Use simd mov to materialize big fp constants

mov w8, #1325400064 + fmov s0, w8 ==> movi v0.2s, 0x4f, lsl 24
Fix https://github.com/llvm/llvm-project/issues/53651

Reviewed By: dmgreen, fhahn

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

2 years ago[llvm] fix bitcode-strip.test on windows
Richard Howell [Fri, 4 Mar 2022 16:30:32 +0000 (08:30 -0800)]
[llvm] fix bitcode-strip.test on windows

Remove the executable name from the test match as this will have
a `.exe` suffix on windows.

Reviewed By: drodriguez

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

2 years ago[MLIR][Presburger] skip IntegerPolyhedrons with LocalIds in coalesce
Michel Weber [Fri, 4 Mar 2022 15:04:37 +0000 (15:04 +0000)]
[MLIR][Presburger] skip IntegerPolyhedrons with LocalIds in coalesce

This patch makes coalesce skip the comparison of all pairs of IntegerPolyhedrons with LocalIds rather than crash. The heuristics to handle these cases will be upstreamed later on.

Reviewed By: arjunp

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

2 years ago[llvm] add -o flag to llvm-bitcode-strip
Richard Howell [Fri, 4 Mar 2022 16:00:21 +0000 (08:00 -0800)]
[llvm] add -o flag to llvm-bitcode-strip

Add the -o flag to specify an output path for llvm-bitcode-strip.
This matches the interface to the Xcode bitcode_strip tool.

Reviewed By: jhenderson

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

2 years ago[MLIR][LLVM] Fold extractvalue to ignore insertvalue at distinct index
William S. Moses [Thu, 3 Mar 2022 17:31:48 +0000 (12:31 -0500)]
[MLIR][LLVM] Fold extractvalue to ignore insertvalue at distinct index

We can simplify an extractvalue of an insertvalue to extract out of the base of the insertvalue, if the insert and extract are at distinct and non-prefix'd indices

Reviewed By: ftynse

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

2 years ago[runtimes] Trigger CI jobs when only the runtimes/ subdirectory is touched
Louis Dionne [Fri, 4 Mar 2022 15:59:03 +0000 (10:59 -0500)]
[runtimes] Trigger CI jobs when only the runtimes/ subdirectory is touched

2 years ago[clang-tidy][NFC] Document bugprone-narrowing-conversions check alias
Balazs Benics [Fri, 4 Mar 2022 15:45:20 +0000 (16:45 +0100)]
[clang-tidy][NFC] Document bugprone-narrowing-conversions check alias

2 years agoInstructionCombining: avoid eliding mismatched alloc/free pairs
Augie Fackler [Fri, 14 Jan 2022 19:38:44 +0000 (14:38 -0500)]
InstructionCombining: avoid eliding mismatched alloc/free pairs

Prior to this change LLVM would happily elide a call to any allocation
function and a call to any free function operating on the same unused
pointer. This can cause problems in some obscure cases, for example if
the body of operator::new can be inlined but the body of
operator::delete can't, as in this example from jyknight:

    #include <stdlib.h>
    #include <stdio.h>

    int allocs = 0;

    void *operator new(size_t n) {
        allocs++;
        void *mem = malloc(n);
        if (!mem) abort();
        return mem;
    }

    __attribute__((noinline)) void operator delete(void *mem) noexcept {
        allocs--;
        free(mem);
    }

    void deleteit(int*i) { delete i; }
    int main() {
        int*i = new int;
        deleteit(i);
        if (allocs != 0)
          printf("MEMORY LEAK! allocs: %d\n", allocs);
    }

This patch addresses the issue by introducing the concept of an
allocator function family and uses it to make sure that alloc/free
function pairs are only removed if they're in the same family.

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

2 years agoExtend `performANDCSELCombine` to `performANDORCSELCombine`
Karl Meakin [Wed, 16 Feb 2022 17:07:05 +0000 (17:07 +0000)]
Extend `performANDCSELCombine` to `performANDORCSELCombine`

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

2 years ago[CoroFrame] Remove unused insertSpills() return value (NFC)
Nikita Popov [Fri, 4 Mar 2022 14:10:51 +0000 (15:10 +0100)]
[CoroFrame] Remove unused insertSpills() return value (NFC)

2 years ago[X86] SimplifyDemandedVectorElts - adjust X86ISD::ANDNP demanded elts based off const...
Simon Pilgrim [Fri, 4 Mar 2022 13:14:24 +0000 (13:14 +0000)]
[X86] SimplifyDemandedVectorElts - adjust X86ISD::ANDNP demanded elts based off constant masks

Similar to what we already do in combineAndnp, if either operand is a constant then we can improve the demanded elts/bits.

2 years agoRevert "[WebAssembly] Update WebAssemblyAsmTypeCheck for table.get"
David Spickett [Fri, 4 Mar 2022 13:33:55 +0000 (13:33 +0000)]
Revert "[WebAssembly] Update WebAssemblyAsmTypeCheck for table.get"

This reverts commit 6b2482f6f4729a76776a48ac3b4a3fcd401a880e due to
test failures on AArch64 bots:
https://lab.llvm.org/buildbot/#/builders/183/builds/3684

2 years ago[flang] Fix standalone builds
Andrzej Warzynski [Fri, 4 Mar 2022 11:31:29 +0000 (11:31 +0000)]
[flang] Fix standalone builds

In dd875dd88bf7f39ad56d8402bdc49ffeb51b4ab8 I added a missing MLIR
dependency in Flang. However, that particular CMake target is not
exported as something available to standalone builds. In this patch is
switch to `MLIRIR` instead, which depends on
`MLIRBuiltinAttributeInterfacesIncGen` - the missing dependency added
previously.

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

2 years ago[AMDGPU] Extra test cases in hard-clauses.mir
Jay Foad [Fri, 4 Mar 2022 12:45:09 +0000 (12:45 +0000)]
[AMDGPU] Extra test cases in hard-clauses.mir

Add some cases where different kinds of instruction might be
combined in the same hard clause.

2 years ago[AMDGPU] Regenerate checks in hard-clauses.mir
Jay Foad [Fri, 4 Mar 2022 12:45:38 +0000 (12:45 +0000)]
[AMDGPU] Regenerate checks in hard-clauses.mir

2 years ago[demangler] Make OutputBuffer non-copyable
Nathan Sidwell [Thu, 3 Mar 2022 11:44:16 +0000 (03:44 -0800)]
[demangler] Make OutputBuffer non-copyable

In addressing the buffer ownership API, I discovered a rogue member
function that returned by value rather than by reference. It clearly
intended to return by reference, but because the copy ctor wasn't
deleted this wasn't caught.

It is not necessary to make this a move-only type, although that would
be an alternative.

Reviewed By: bruno

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

2 years agoRevert "[analyzer] Done some changes to detect Uninitialized read by the char array...
Aaron Ballman [Fri, 4 Mar 2022 12:21:04 +0000 (07:21 -0500)]
Revert "[analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions"

This reverts commit 9c300c18a4eaf79eb7044744bbdb705764579220.

This broke the sphinx bot and seems like an unintentional commit.

2 years ago[NFC] Divide tests into smaller files
4vtomat [Fri, 4 Mar 2022 04:09:00 +0000 (20:09 -0800)]
[NFC] Divide tests into smaller files

This commit divides the large test files(over 30k lines) under clang/test/CodeGen/RISCV including:
rvv-intrinsics/vloxseg.c
rvv-intrinsics/vluxseg.c
rvv-intrinsics-overloaded/vloxseg.c
rvv-intrinsics-overloaded/vluxseg.c
into "non-masked" version and "masked" version which can reduce the test cases by 50% in a single file.

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

2 years ago[AMDGPU] Tweak predicates for image_bvh_intersect_ray instructions
Jay Foad [Thu, 3 Mar 2022 15:35:40 +0000 (15:35 +0000)]
[AMDGPU] Tweak predicates for image_bvh_intersect_ray instructions

Don't override SubtargetPredicate since that is already set in the
base classes for the appropriate subtarget like MIMG_gfx10. Use
OtherPredicates instead for consistency with the way we handle
features like HasImageInsts and HasExtendedImageInsts. NFC.

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

2 years ago[WebAssembly] Update WebAssemblyAsmTypeCheck for table.get
nokotan [Fri, 4 Mar 2022 12:01:25 +0000 (13:01 +0100)]
[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

2 years ago[DAGCombine] Prevent illegal ISD::SPLAT_VECTOR operations post legalisation.
Paul Walker [Thu, 24 Feb 2022 18:40:23 +0000 (18:40 +0000)]
[DAGCombine] Prevent illegal ISD::SPLAT_VECTOR operations post legalisation.

When triggered during operation legalisation the affected combine
generates a splat_vector that when custom lowered for SVE fixed
length code generation, results in the original precombine sequence
and thus we enter a legalisation/combine hang.

NOTE: The patch contains no tests because I observed this issue
only when combined with other work that might never become public.
The current way AArch64 lowers ISD::SPLAT_VECTOR meant a specific
test was not possible so I'm hoping the DAGCombiner fix can be seen
as obvious. The AArch64ISelLowering change is requirted to maintain
existing code quality.

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

2 years ago[Driver] Split up huge arm-cortex-cpus.c test.
Florian Hahn [Fri, 4 Mar 2022 11:37:00 +0000 (11:37 +0000)]
[Driver] Split up huge arm-cortex-cpus.c test.

This test file has grown to the point where it takes a huge amount of
time to run. At the moment, this test seems to consistently time out
when running in the pre-commit checks in Phabricator with a 10 minute
timeout. For example see
https://reviews.llvm.org/harbormaster/unit/view/2832724/

While splitting up the test file is not ideal, it is even more
undesirable to have huge test files that time out in common settings.

This patch splits up the test file roughly in the middle.

Reviewed By: dmgreen

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

2 years ago[Driver] Split up huge aarch64-cpus.c test.
Florian Hahn [Fri, 4 Mar 2022 11:24:12 +0000 (11:24 +0000)]
[Driver] Split up huge aarch64-cpus.c test.

This test file has grown to the point where it takes a huge amount of
time to run. At the moment, this test seems to consistently time out
when running in the pre-commit checks in Phabricator with a 10 minute
timeout. For example see
https://reviews.llvm.org/harbormaster/unit/view/2832723/

While splitting up the test file is not ideal, it is even more
undesirable to have huge test files that time out in common settings.

This patch splits up the test file roughly in the middle.

Reviewed By: dmgreen

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

2 years ago[AArch64] Turn UZP1 with undef operand into truncate
David Green [Fri, 4 Mar 2022 11:12:26 +0000 (11:12 +0000)]
[AArch64] Turn UZP1 with undef operand into truncate

This turns upz1(x, undef) to concat(truncate(x), undef), as the truncate
is simpler and can often be optimized away, and it helps some of the
insert-subvector tests optimize more cleanly.

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

2 years ago[Attributor] Remove function pointer type check (NFCI)
Nikita Popov [Fri, 4 Mar 2022 11:08:41 +0000 (12:08 +0100)]
[Attributor] Remove function pointer type check (NFCI)

This check is not relevant for correctness, it can only avoid
walking some recursive uses if the cast is to a non-function
pointer type. As this distinction will no longer be possible
with opaque pointers and all users will have to be walked
anyway, I'm dropping the check in advance.

2 years ago[IVDescriptor] Use DT to check order of Previous, OtherPrev.
Florian Hahn [Fri, 4 Mar 2022 11:07:42 +0000 (11:07 +0000)]
[IVDescriptor] Use DT to check order of Previous, OtherPrev.

Previous and OhterPrev may not be in the same block. Use DT::dominates
instead of local comesBefore. DT::dominates is already used earlier to
check the order of Previous and SinkCandidate.

Fixes https://github.com/llvm/llvm-project/issues/54195

2 years agoReapply [MergeICmps] Don't require GEP
Nikita Popov [Fri, 25 Feb 2022 16:36:29 +0000 (17:36 +0100)]
Reapply [MergeICmps] Don't require GEP

Recommit without changes over 53abe3ff66a54117308352d379837c7d3229f8d6,
which addressed the cause of the reported crash.

-----

With opaque pointers, the zero-offset load will generally not use
a GEP. Allow a direct load without GEP, which is treated the same
way as a zero-offset GEP.

2 years ago[AArch64] Fix the TuneExynosM4 entry in lib/Target/AArch64/AArch64.td
David Sherwood [Mon, 28 Feb 2022 17:04:55 +0000 (17:04 +0000)]
[AArch64] Fix the TuneExynosM4 entry in lib/Target/AArch64/AArch64.td

A bug was introduced in 5ea35791e6642f6160819c930f79b0f57ad0e907 that
gave the wrong name and description for TuneExynosM4. This patch fixes
that and changes it back to m3.

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

2 years ago[MergeICmp] Make instruction move robust against empty block (NFCI)
Nikita Popov [Fri, 4 Mar 2022 10:13:40 +0000 (11:13 +0100)]
[MergeICmp] Make instruction move robust against empty block (NFCI)

Use the overload that support moving into an empty block. I don't
think that this situation can occur right now, but it can happen
with the change from e7fb1c15cb85d748c1c4fdd5a2eb5613ec7bef1d,
and the test is derived from the issue reported there.

2 years ago[AArch64] Improve access to fixed-width object when stack has SVE.
Sander de Smalen [Thu, 3 Mar 2022 14:09:26 +0000 (14:09 +0000)]
[AArch64] Improve access to fixed-width object when stack has SVE.

When the stack has SVE objects, fixed-width objects are often better accessed
from the SP, instead of the FP, because part/all of the fixed-width offset
can be folded into the (non-scalable) addressing mode, where otherwise an
ADDVL would be required.

Reviewed By: david-arm

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

2 years ago[AArch64] NFC: Add test for access to fixed-width stack object when stack has SVE.
Sander de Smalen [Tue, 1 Mar 2022 17:00:04 +0000 (17:00 +0000)]
[AArch64] NFC: Add test for access to fixed-width stack object when stack has SVE.

In this case, the access would benefit from being accessed from the SP, as that
would avoid the redundant ADDVL, since most of the offset can currently be
folded into the addressing mode.

2 years ago[Bitcode] Move x86_intrcc upgrade to bitcode reader
Nikita Popov [Fri, 4 Mar 2022 09:30:50 +0000 (10:30 +0100)]
[Bitcode] Move x86_intrcc upgrade to bitcode reader

This upgrade requires access the legacy pointer element type, so
it needs to happen inside the bitcode reader.

2 years ago[Bitcode] Fully support opaque pointer auto upgrade
Nikita Popov [Wed, 23 Feb 2022 15:56:41 +0000 (16:56 +0100)]
[Bitcode] Fully support opaque pointer auto upgrade

This completes the propagation of type IDs through bitcode reading,
and switches remaining uses of getPointerElementType() to use
contained type IDs.

The main new thing here is that sometimes we need to create a type
ID for a type that was not explicitly encoded in bitcode (or we
don't know its ID at the current point). For such types we create a
"virtual" type ID, which is cached based on the type and the
contained type IDs. Luckily, we generally only need zero or one
contained type IDs, and in the one case where we need two, we can
get away with not including it in the cache key.

With this change, we pass the entirety of llvm-test-suite at O3
with opaque pointers.

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

2 years ago[AArch64] Additional insert-subvector codegen tests. NFC
David Green [Fri, 4 Mar 2022 09:04:09 +0000 (09:04 +0000)]
[AArch64] Additional insert-subvector codegen tests. NFC

2 years ago[tests][Driver] Pass an empty sysroot for `DEFAULT_SYSROOT` builds
Tim Northover [Fri, 4 Mar 2022 07:59:16 +0000 (07:59 +0000)]
[tests][Driver] Pass an empty sysroot for `DEFAULT_SYSROOT` builds

The baremetal-sysroot test fails when the toolchain is configured with
DEFAULT_SYSROOT. So, to emulate not having passed one at all, let's
pass an empty sysroot instead.

https://reviews.llvm.org/D119144

Patch by Carlo Cabrera <carlo.antonio.cabrera@gmail.com>

2 years ago[libcxx] [test] Fix get_string_en_US, get_long_double_en_US for Windows
Martin Storsjö [Tue, 25 Jan 2022 11:19:18 +0000 (11:19 +0000)]
[libcxx] [test] Fix get_string_en_US, get_long_double_en_US for Windows

In the en_US locale on Windows, negative currency amounts is formatted
as "($0.01)" instead of "-$0.01".

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

2 years ago[libcxx] [test] Fix the get/put long_double_zh_CN tests on Windows
Martin Storsjö [Tue, 15 Feb 2022 13:49:40 +0000 (13:49 +0000)]
[libcxx] [test] Fix the get/put long_double_zh_CN tests on Windows

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

2 years ago[MLIR][Presburger] support a heuristic for the "cut case" in coalesce
Michel Weber [Thu, 3 Mar 2022 17:48:16 +0000 (23:18 +0530)]
[MLIR][Presburger] support a heuristic for the "cut case" in coalesce

This patch introduces the cut case. If one polytope has only cutting and
redundant inequalities for the other and the facet of the cutting
inequalities are contained within the other polytope, then the polytopes are
be combined into a polytope consisting only of their respective
redundant constraints.

Reviewed By: arjunp

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

2 years ago[analyzer] Done some changes to detect Uninitialized read by the char array manipulat...
phyBrackets [Fri, 4 Mar 2022 06:45:27 +0000 (12:15 +0530)]
[analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions

Few weeks back I was experimenting with reading the uninitialized values from src , which is actually a bug but the CSA seems to give up at that point . I was curious about that and I pinged @steakhal on the discord and according to him this seems to be a genuine issue and needs to be fix. So I goes with fixing this bug and thanks to @steakhal who help me creating this patch. This feature seems to break some tests but this was the genuine problem and the broken tests also needs to fix in certain manner. I add a test but yeah we need more tests,I'll try to add more tests.Thanks

Reviewed By: steakhal, NoQ

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

2 years ago[LoongArch] Delete unnecessary comments in LoongArchMCTargetDesc.cpp
Weining Lu [Fri, 4 Mar 2022 05:36:58 +0000 (13:36 +0800)]
[LoongArch] Delete unnecessary comments in LoongArchMCTargetDesc.cpp

2 years agoFix for D119899
David Blaikie [Fri, 4 Mar 2022 05:19:51 +0000 (05:19 +0000)]
Fix for D119899

2 years agoMore bazel fixes
David Blaikie [Fri, 4 Mar 2022 04:20:08 +0000 (04:20 +0000)]
More bazel fixes

2 years ago[PDLL] Attempt to fix shared libraries build
River Riddle [Fri, 4 Mar 2022 04:20:36 +0000 (20:20 -0800)]
[PDLL] Attempt to fix shared libraries build

PDLLParser now depends on TableGen, which disables LLVM_DYLIB

2 years agoMore bazel fixes
David Blaikie [Fri, 4 Mar 2022 04:15:38 +0000 (04:15 +0000)]
More bazel fixes

2 years ago[MLIR] Extend isLoopMemoryParallel to account for locally allocated memrefs
Uday Bondhugula [Thu, 3 Mar 2022 01:18:27 +0000 (06:48 +0530)]
[MLIR] Extend isLoopMemoryParallel to account for locally allocated memrefs

Extend isLoopMemoryParallel check to include locally allocated memrefs.
This strengthens and also speeds up the dependence check used by the
utility by excluding locally allocated memrefs where appropriate.

Additional memref dialect ops can be supported exhaustively via proper
interfaces.

Reviewed By: dcaballe

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