platform/upstream/llvm.git
18 months ago[BOLT] Add bolt-runtime requirement to tests
Nathan Sidwell [Wed, 19 Apr 2023 19:53:17 +0000 (15:53 -0400)]
[BOLT] Add bolt-runtime requirement to tests

These tests rely on the X86 runtime, add the REQUIRES.

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

18 months ago[libc] Fix strtod hex exponent overflow bug
Michael Jones [Mon, 17 Apr 2023 17:30:28 +0000 (10:30 -0700)]
[libc] Fix strtod hex exponent overflow bug

Same issue as was fixed in commit 3d95323, but for hexadecimal floats.

Reviewed By: sivachandra

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

18 months ago[libc][math] Remove the unused dp_trig target and tests.
Siva Chandra Reddy [Wed, 19 Apr 2023 23:11:10 +0000 (23:11 +0000)]
[libc][math] Remove the unused dp_trig target and tests.

18 months agoRevert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffe...
MalavikaSamak [Wed, 19 Apr 2023 23:08:55 +0000 (16:08 -0700)]
Revert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages"

This reverts commit 777eb4bcfc3265359edb7c979d3e5ac699ad4641.

18 months ago[CMake] Don't set absolute paths as install runpaths on ELF platforms in llvm_setup_r...
Butta [Wed, 19 Apr 2023 22:55:05 +0000 (15:55 -0700)]
[CMake] Don't set absolute paths as install runpaths on ELF platforms in llvm_setup_rpath()

If any LLVM subprojects are built separately, the LLVM build directory
LLVM_LIBRARY_DIR is added to both the build and install runpaths in
llvm_setup_rpath(), which is incorrect when installed. Separate the
build and install runpaths on ELF platforms and finally remove the
incorrect call to this function for compiler-rt, as previously attempted
in 21c008d5a5b. That prior attempt was reverted in 959dbd1761c, where it
was said to break the build on macOS and Windows, so I made sure to keep
those platforms the same.

Two examples of incorrect runpaths that are currently added, one from
the latest LLVM 16 toolchain for linux x86_64:

  > readelf -d clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.*so | ag "File:|runpath"
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.dyndd.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan_aliases.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.memprof.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.scudo_standalone.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.tsan.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_minimal.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]

Another is in the Swift toolchain, which builds lldb separately:

  > readelf -d swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/{bin/lldb*,lib/liblldb.so}|ag "File:|runpath"
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/bin/lldb
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib]
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/bin/lldb-argdumper
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib]
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/bin/lldb-server
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib]
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/lib/liblldb.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib:/home/build-user/build/buildbot_linux/swift-linux-x86_64/lib/swift/linux:$ORIGIN/../lib/swift/linux]

This patch should fix this problem of absolute paths from the build host
leaking out into the toolchain's runpaths.

Differential revision: https://reviews.llvm.org/D146918

18 months ago[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages
MalavikaSamak [Wed, 19 Apr 2023 22:52:12 +0000 (15:52 -0700)]
[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages

This patch handles unevaluated contexts to ensure no warnings are produced by the machinery
for buffer access made within an unevaluated contexts. However, such accesses must be
considered by a FixableGadget and produce the necessary fixits.

Reviewed by: NoQ, ziqingluo-90, jkorous

Differential revision: https://reviews.llvm.org/D144905

18 months ago[flang][openacc] Add basic lowering to new data operations for acc.enter_data
Valentin Clement [Wed, 19 Apr 2023 22:52:24 +0000 (15:52 -0700)]
[flang][openacc] Add basic lowering to new data operations for acc.enter_data

This is an initial patch that lowers acc.enter_data copyin/create/attach
clauses to the newly added data operand operations. Follow up patches will
add support for array section and derived type and derived type component
as well as support in other data operation.

Reviewed By: razvanlupusoru

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

18 months ago[libc][Obvious] Remove an unused "using" declaration.
Siva Chandra Reddy [Wed, 19 Apr 2023 22:42:25 +0000 (22:42 +0000)]
[libc][Obvious] Remove an unused "using" declaration.

18 months ago[TableGen] Use heap allocated arrays instead of vectors for TreePatternNode::Types...
Craig Topper [Wed, 19 Apr 2023 22:22:42 +0000 (15:22 -0700)]
[TableGen] Use heap allocated arrays instead of vectors for TreePatternNode::Types and ResultPerm. NFC

These vectors are resized in the constructor and never change size.
We can manually allocate two arrays instead.

This reduces the size of TreePatternNode by removing the
unneeded capacity end pointer fields from the std::vector.

18 months agoRevert "[cmake] Explicitly disable download step"
Vitaly Buka [Wed, 19 Apr 2023 22:13:23 +0000 (15:13 -0700)]
Revert "[cmake] Explicitly disable download step"

This does not help. The build is broken because compiler-rt-clear
deletes cmake generated files in STAMP_DIR/

This reverts commit da89ed99a16920e5986b14853d297322ccf7109e.

18 months ago[mlir][openacc] Refine data operation data clause attribute
Razvan Lupusoru [Wed, 19 Apr 2023 17:59:41 +0000 (10:59 -0700)]
[mlir][openacc] Refine data operation data clause attribute

The data operations added in D148389 hold two data clause fields:
"dataClause" and "decomposedFrom". However, in most cases, dataClause
field holds a default value (except for acc_copyin_readonly,
acc_create_zero, and acc_copyout_zero).

The decomposedFrom field holds the original clause specified by user.
As work began on lowering to these new operations [1], it seems that
having both fields adds a bit of ambiguity. There is only one scenario
where we actually intended to use both:
acc data copyout(zero:)

The original intent was that this clause would be decomposed to
the following operations:
acc.create {dataClause = acc_create_zero, decomposedFrom =
acc_copyout_zero}
...
acc.copyout {dataClause = acc_copyout_zero}

However, we can encode the zero semantics like so without need of both:
acc.create {dataClause = acc_copyout_zero}
...
acc.copyout {dataClause = acc_copyout_zero}

Thus get rid of the decomposedFrom field and update verifier checks
to check for all data clauses that can be decomposed to the particular
operation.

So now the dataClause holds the original user's clause which simplifies
understanding of the operation.

[1] https://reviews.llvm.org/D148721

Reviewed By: clementval

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

18 months ago[lldb] Change setting descriptions to use StringRef instead of ConstString
Alex Langford [Wed, 19 Apr 2023 01:45:03 +0000 (18:45 -0700)]
[lldb] Change setting descriptions to use StringRef instead of ConstString

These probably do not need to be in the ConstString StringPool as they
don't really need any of the advantages that ConstStrings offer.
Lifetime for these things is always static and we never need to perform
comparisons for setting descriptions.

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

18 months ago[compiler-rt] [test] [profile] Avoid issues with an implicit .exe suffix
Martin Storsjö [Wed, 12 Apr 2023 11:17:48 +0000 (11:17 +0000)]
[compiler-rt] [test] [profile] Avoid issues with an implicit .exe suffix

Mingw toolchains implicitly add an .exe suffix if the output linked
file doesn't have a suffix. In many cases the extra suffix doesn't
cause any issues, but in some tests, this discrepancy between expected
output file name and actual output file does affect the tests.

In one test, a rm command fails to remove the executable since it
doesn't have the expected name. By failing to remove the executable, the
later llvm-profdata command tries to read the executable as if it was
a profile data file.

In another test, when the Python executor executes commands, it can
resolve executable names without the extra .exe suffix for absolute
paths (when most binaries are executed as e.g. "%t/foo"), but it fails
to resolve the executables for relative paths such as "./foo". Making
the paths absolute by using %t here shouldn't affect what the test tries
to validate.

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

18 months ago[SLP][NFC] Test showing a cost estimation issue caused by f82eb7e066f322a231627383fc8...
Vasileios Porpodas [Wed, 19 Apr 2023 00:47:18 +0000 (17:47 -0700)]
[SLP][NFC] Test showing a cost estimation issue caused by f82eb7e066f322a231627383fc80522d98ce6181

The buildvector cost for the case shown in the test should be 0 but it is -1, causing the code to get vectorized, whenit shouldn't.

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

18 months ago[libc++] Remove symbols for a std::allocator_arg & friends from the dylib
Louis Dionne [Mon, 6 Mar 2023 21:14:06 +0000 (16:14 -0500)]
[libc++] Remove symbols for a std::allocator_arg & friends from the dylib

This patch removes the symbols defined in the library for std::allocator_arg,
std::defer_lock, std::try_to_lock, std::adopt_lock, and std::piecewise_construct.
Those were defined in the library because we provided them in C++03 as an
extension, and in C++03 it was impossible to define them as `constexpr`
variables, like in the spec.

This is technically an ABI break since we are removing symbols from the
library. However, in practice, only programs compiled in C++03 mode who
take the address of those objects (or pass them as a reference) will have
an undefined ref to those symbols. In practice, this is expected to be
rare. First, those are C++11 features that we happen to provide in C++03,
and only the C++03 definition can potentially lead to code referencing
the dylib definition. So any code that is using these objects but compiling
in C++11 mode (as they should) is not at risk. Second, all uses of these
types in the library is done by passing those types by value to a function
that can get inlined. Since they are empty types, the compiler won't
generate an undefined reference if passed by value, since there's nothing
to pass anyway.

Long story short, the risk for code actually containing an undefined
reference to one of these types is rather small (but non-zero). I also
couldn't find any app on the App Store that referenced these symbols,
which supports my impression that this won't be an issue in practice.

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

18 months ago[lldb][NFCI] Stop creating additional temporary string in Log::VAPrintf
Alex Langford [Tue, 18 Apr 2023 23:46:12 +0000 (16:46 -0700)]
[lldb][NFCI] Stop creating additional temporary string in Log::VAPrintf

Instead of creating a std::string from the `SmallString`,
let's just use a std::string from the start. I initially tried to make
`SmallString` work but getting it right proved complicated because
`LogHandler::Emit` will take its `StringRef` parameter and touch the raw
`const char *` from it directly, which isn't guaranteed to be
null-terminated with a `SmallString`.

I changed `WriteMessage` to take a `StringRef` instead of a
`const std::string &` for flexibility.

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

18 months ago[MemProf] Fix bot failure about missing return value along all paths
Teresa Johnson [Wed, 19 Apr 2023 21:05:26 +0000 (14:05 -0700)]
[MemProf] Fix bot failure about missing return value along all paths

Fixes warning treated as error from
https://lab.llvm.org/buildbot/#/builders/13/builds/34440:
  'llvm::LibCallSimplifier::optimizeNew': not all control paths return a value
after a35206d78280e0ebcf48cd21bc5fff5c3b9c73fa.

Change assert in default case to a return nullptr, so we have a
reasonable fallback if invoked on a different library function, and no
longer get the above warning.

18 months ago[DebugInfo] printCompactDWARFExpr: don't assert on stack size
Scott Linder [Wed, 8 Feb 2023 20:01:42 +0000 (20:01 +0000)]
[DebugInfo] printCompactDWARFExpr: don't assert on stack size

Gracefully handle non-1 stack sizes in printCompactDWARFExpr rather than
assert. Add support for DW_OP_nop and test the zero-sized stack case.

This is intended to be nearly NFC.

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

18 months ago[HeterogeneousDWARF] Update encodings in AMDGPUDwarfExtensionsForHeterogeneousDebuggi...
Scott Linder [Thu, 23 Feb 2023 19:53:47 +0000 (19:53 +0000)]
[HeterogeneousDWARF] Update encodings in AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst

Repurpose the DW_OP_LLVM_aspace_implicit_pointer encoding (0xe9) as the
encoding for a new operation DW_OP_LLVM_user which prefixes all other
new operations.

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

18 months ago[MemProf] Optionally pass hot/cold hints to operator new
Teresa Johnson [Wed, 19 Apr 2023 15:21:52 +0000 (08:21 -0700)]
[MemProf] Optionally pass hot/cold hints to operator new

Optionally (off by default) replace operator new() calls marked with a
hot or cold memprof attribute with an operator new() call that takes a
hot_cold_t parameter.

Currently this is supported by the open source version of tcmalloc, see:
https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h

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

18 months ago[libc] Fix `nvptx_options` variable not being reset in CMake
Joseph Huber [Wed, 19 Apr 2023 20:27:33 +0000 (15:27 -0500)]
[libc] Fix `nvptx_options` variable not being reset in CMake

Summary:
This variable was not being reset, which caused the options to be
compounded when building multiple architectures. This was very
problematic as the architectures are not compatible.

18 months ago[libc++abi] Make the error message for recursive initialization of function-local...
Louis Dionne [Tue, 18 Apr 2023 12:46:49 +0000 (12:46 +0000)]
[libc++abi] Make the error message for recursive initialization of function-local statics more explicit

The new message is a bit verbose, but it makes it clearer that this isn't
a problem in libc++abi, but instead a problem in the user's code. Otherwise,
we get bugs sent down to libc++abi because people see this message in their
crash logs.

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

18 months ago[Driver] Make -fsanitize=kcfi,function incompatible
Fangrui Song [Wed, 19 Apr 2023 20:15:33 +0000 (13:15 -0700)]
[Driver] Make -fsanitize=kcfi,function incompatible

A -fsanitize=kcfi instrumented function has a special instruction/data
before the function entry at a fixed offset.
A -fsanitize=function instrumented function has special instruction/data
after the function entry at a fixed offset (may change to *before* in D148665).

The two instrumentations are not intended to be used together and will become
incompatible after D148665.

Reviewed By: samitolvanen

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

18 months ago[Driver] -fsanitize=kcfi doesn't need RequiresPIE
Fangrui Song [Wed, 19 Apr 2023 20:10:46 +0000 (13:10 -0700)]
[Driver] -fsanitize=kcfi doesn't need RequiresPIE

As mentioned on D148671: this is unneeded. This commit is a no-op for most Linux
builds since CLANG_DEFAULT_PIE_ON_LINUX defaults to 1.

18 months ago[libunwind] [SEH] Add debug logging in __libunwind_seh_personality
Martin Storsjö [Tue, 18 Apr 2023 12:04:57 +0000 (15:04 +0300)]
[libunwind] [SEH] Add debug logging in __libunwind_seh_personality

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

18 months ago[compiler-rt] [test] [ubsan] Mark failing tests as unsupported for mingw configs
Martin Storsjö [Wed, 12 Apr 2023 09:12:28 +0000 (09:12 +0000)]
[compiler-rt] [test] [ubsan] Mark failing tests as unsupported for mingw configs

All of these are already unsupported for MSVC style configs. For
some cases, simplify the regex to match any windows triple, while
for others, mention windows-msvc and windows-gnu specifically,
if they are separate cases that happen to fail for different reasons.

-fsanitize=function is unsupported both in mingw and MSVC modes.

The vptr tests expect to get demangled C++ type info names, but
Itanium C++ typenames don't get demangled by ubsan on Windows.

The test that tries to build a .so doesn't work as such on
Windows.

While mingw toolchains do support weak symbols, the relevant
sanitizer symbols aren't made weak on Windows.

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

18 months ago[OpenMP] Prefix outlined and reduction func names with original func's name
Itay Bookstein [Fri, 23 Dec 2022 09:35:47 +0000 (11:35 +0200)]
[OpenMP] Prefix outlined and reduction func names with original func's name

This patch prefixes omp outlined helpers and reduction funcs
with the original function's name.

Reviewed By: jdoerfert

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

18 months agoworkflows/release-binaries: Add missing output variable
Tom Stellard [Wed, 19 Apr 2023 19:58:59 +0000 (12:58 -0700)]
workflows/release-binaries: Add missing output variable

Reviewed By: thieta

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

18 months ago[cmake] Explicitly disable download step
Vitaly Buka [Wed, 19 Apr 2023 19:51:00 +0000 (12:51 -0700)]
[cmake] Explicitly disable download step

Fixes the following on cmake version 3.24.2:
'tools/clang/runtime/compiler-rt-stamps/compiler-rt-source_dirinfo.txt',
needed by 'tools/clang/runtime/compiler-rt-stamps/compiler-rt-download',
missing and no known rule to make it

Maybe related to https://cmake.org/cmake/help/latest/release/3.24.html#modules

18 months ago[BOLT][NFC] Move phdr typedef to cpp file
Nathan Sidwell [Tue, 18 Apr 2023 22:14:21 +0000 (18:14 -0400)]
[BOLT][NFC] Move phdr typedef to cpp file

This typedef is only used inside the RewriteInstance source file, let's not
expose it in the header file -- even if private.

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

18 months ago[BOLT] Adjust Shdr alignment
Nathan Sidwell [Tue, 18 Apr 2023 22:13:16 +0000 (18:13 -0400)]
[BOLT] Adjust Shdr alignment

Shdr's are not necesarily size 2^n, and there is no reason to align to
that boundary if they are.

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

18 months ago[libc++] Add helper script libcxx-lit for running tests
Louis Dionne [Tue, 18 Apr 2023 13:25:16 +0000 (13:25 +0000)]
[libc++] Add helper script libcxx-lit for running tests

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

18 months ago[InferAttrs] Mark frexp and modf as memory(argmem: write)
Daniel Woodworth [Wed, 19 Apr 2023 19:23:57 +0000 (15:23 -0400)]
[InferAttrs] Mark frexp and modf as memory(argmem: write)

These two math library functions can't write to errno, but they do
produce two results and store the second result to a pointer passed as
their second argument. Appropriately marking them as
memory(argmem: write) enables more optimizations on calls to them.

Reviewed By: xbolva00

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

18 months ago[CMake] Switch back to -fPIC for Fuchsia Toolchain
Daniel Thornburgh [Mon, 17 Apr 2023 22:54:11 +0000 (15:54 -0700)]
[CMake] Switch back to -fPIC for Fuchsia Toolchain

This reverts commit 1fab236e6e4575d5af4f4722216df4dd6a872795.

Shipping LLDB means distributing libLLDB.so, which will need to be built
with PIC. Disabling PIC also removes the libLTO target, which is a hard
dependency of the LLDB test suite.

Reviewed By: abrachet

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

18 months ago[MLIR][LLVM] Realign allocas to avoid dynamic realignment in inliner.
Johannes de Fine Licht [Tue, 18 Apr 2023 15:17:13 +0000 (15:17 +0000)]
[MLIR][LLVM] Realign allocas to avoid dynamic realignment in inliner.

When the natural stack alignment is not set or is larger than or equal
to the target alignment required by a read-only byval argument defined
by an alloca, avoid the copy by just realigning the alloca to the target
alignment.

The code to check existing alignment is reorganized a bit to avoid
redundant casts.

This also includes a bugfix for passing a null DataLayoutInterface to
the DataLayout constructor when no parent op defines
DataLayoutInterface, and will now pass ModuleOp instead in this case.

Reviewed By: gysit

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

18 months ago[pseudo] Use shared copy of bundle_resources.py
Sam McCall [Wed, 19 Apr 2023 18:38:15 +0000 (20:38 +0200)]
[pseudo] Use shared copy of bundle_resources.py

18 months agoRevert D146987 "[Assignment Tracking] Enable by default"
OCHyams [Wed, 19 Apr 2023 18:16:40 +0000 (19:16 +0100)]
Revert D146987 "[Assignment Tracking] Enable by default"

This reverts commit 89d27854ec7f5e8bd83e72fa574740bf3d06355b.

See https://reviews.llvm.org/D146987 for issues.

18 months ago[gn build] Port a443b3d18ef4 (HTMLLogger.inc)
Nico Weber [Wed, 19 Apr 2023 17:52:40 +0000 (13:52 -0400)]
[gn build] Port a443b3d18ef4 (HTMLLogger.inc)

Similar to 374db8fc2e49f.

18 months ago[mlir] Allow to specify target type in `convertType`
Jakub Kuderski [Wed, 19 Apr 2023 17:51:13 +0000 (13:51 -0400)]
[mlir] Allow to specify target type in `convertType`

Add a new helper function for the type converter that takes care of
casting to the target type.

This is to avoid bugs where an incorrect cast function is used after
type conversion, e.g., `dyn_cast` or `cast`. These are not guaranteed to
work when type conversion fails, or when type conversion succeeds but
the provided type converted returned a type that a conversion pattern
did not expect.

I saw this being an issue in some SPIR-V passes and in mlir-hlo.

Exercise the new function in a couple of passes. As a side-effect, this
also made the code more concise.

Reviewed By: rriddle, mehdi_amini

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

18 months agoRevert "[lldb] Fix bug to update process public run lock with process state"
Med Ismail Bennani [Wed, 19 Apr 2023 17:46:17 +0000 (10:46 -0700)]
Revert "[lldb] Fix bug to update process public run lock with process state"

This reverts commit 14f00213b202a82b895a6ab749262d4382435012.

18 months ago[mlir][openacc] Keep region when applying data operand conversion
Valentin Clement [Wed, 19 Apr 2023 17:27:15 +0000 (10:27 -0700)]
[mlir][openacc] Keep region when applying data operand conversion

Keep the region when the operation has one. The previous code
was throwing away the region when creating the new version
of the operation.

Reviewed By: razvanlupusoru

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

18 months ago[clang] makes `__is_trivially_equality_comparable` available as a struct
Christopher Di Bella [Wed, 19 Apr 2023 00:58:43 +0000 (00:58 +0000)]
[clang] makes `__is_trivially_equality_comparable` available as a struct

Since this was originally a name in library, it needs an escape hatch
for versions of Clang that are slightly out-of-sync with libc++.

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

18 months ago[docs] Remove a duplicate or unnecessary 'to' in a sentence.
Hiroshi Yamauchi [Tue, 18 Apr 2023 20:05:52 +0000 (13:05 -0700)]
[docs] Remove a duplicate or unnecessary 'to' in a sentence.

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

18 months ago[lldb] Fix bug to update process public run lock with process state
Med Ismail Bennani [Wed, 19 Apr 2023 06:35:45 +0000 (23:35 -0700)]
[lldb] Fix bug to update process public run lock with process state

This patch should address an issue that caused the process public run
lock to not be updated during a process launch/attach when the process
stops.

That caused the public run lock to report its state as running while the
process state is stopped. This prevents the users to interact with the
process (through the command line or via the SBAPI) since it's
considered still running.

To address that, this patch refactors the name of the internal hijack
listeners to a specific pattern `lldb.internal.<action>.hijack` that
are used to ensure that we've attached to or launched a process successfully.

Then, when updating the process public state, after updating the state
value, if the process is not hijacked externally, meaning if the process
doens't have a hijack listener that matches the internal hijack
listeners pattern, we can update the public run lock accordingly.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
18 months ago[Header][doc] Tweak wording for MWAIT[X] intrinsics
Paul Robinson [Wed, 19 Apr 2023 16:57:17 +0000 (09:57 -0700)]
[Header][doc] Tweak wording for MWAIT[X] intrinsics

18 months agoRevert "[OpenMP] Prefix outlined and reduction func names with original func's name"
Itay Bookstein [Wed, 19 Apr 2023 16:08:11 +0000 (19:08 +0300)]
Revert "[OpenMP] Prefix outlined and reduction func names with original func's name"

This reverts commit 029bfc311d4d7d3cd90be81bb08c046848796d02.

18 months ago[Headers][doc] Add/revise MONITOR/MWAIT descriptions
Paul Robinson [Tue, 18 Apr 2023 19:37:49 +0000 (12:37 -0700)]
[Headers][doc] Add/revise MONITOR/MWAIT descriptions

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

18 months ago[flang] Semantics for !DIR$ IGNORE_TKR
Peter Klausler [Mon, 10 Apr 2023 18:05:03 +0000 (11:05 -0700)]
[flang] Semantics for !DIR$ IGNORE_TKR

Implement semantics for the IGNORE_TKR directive as it is interpreted
by the PGI / NVFORTRAN compiler.

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

18 months ago[OpenMP] Prefix outlined and reduction func names with original func's name
Itay Bookstein [Fri, 23 Dec 2022 09:35:47 +0000 (11:35 +0200)]
[OpenMP] Prefix outlined and reduction func names with original func's name

This patch attempts to prefix omp outlined helpers and reduction funcs
with the original function's name.

Reviewed By: jdoerfert

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

18 months ago[compiler-rt] [test] [profile] Generalize existing MSVC XFAILs to cover mingw too
Martin Storsjö [Wed, 12 Apr 2023 11:45:41 +0000 (11:45 +0000)]
[compiler-rt] [test] [profile] Generalize existing MSVC XFAILs to cover mingw too

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

18 months ago[compiler-rt] [test] Don't override config.unsupported in TestCases/Windows
Martin Storsjö [Fri, 14 Apr 2023 20:58:34 +0000 (20:58 +0000)]
[compiler-rt] [test] Don't override config.unsupported in TestCases/Windows

This is a leftover from when these tests were added in
2bdca2006941a3a7de8e16ea9af9a758b367ee32 in 2014 (when the toplevel
asan/lit.cfg set "config.unsupported = True" on Windows). When the
common tests were included on Windows in
89d994367a597134fa7e1724314044e217718165 in 2015, that commit should
have removed the now unnecessary "config.unsupported = False" line here.

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

18 months ago[libcxx] [ci] Run the libcxxabi and libunwind tests in mingw configurations
Martin Storsjö [Wed, 5 Apr 2023 12:25:09 +0000 (15:25 +0300)]
[libcxx] [ci] Run the libcxxabi and libunwind tests in mingw configurations

The check-runtimes function runs check-cxx, check-cxxabi and check-unwind.

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

18 months ago[TTI][BPF] Ensure ArgumentPromotion Not Exceeding Target MaxArgs
Yonghong Song [Mon, 17 Apr 2023 18:11:59 +0000 (11:11 -0700)]
[TTI][BPF] Ensure ArgumentPromotion Not Exceeding Target MaxArgs

With LLVM patch https://reviews.llvm.org/D148269, we hit a linux kernel
bpf selftest compilation failure like below:
  ...
  progs/test_xdp_noinline.c:739:8: error: too many args to t8: i64 = GlobalAddress<ptr @encap_v4> 0, progs/test_xdp_noinline.c:739:8
              if (!encap_v4(xdp, cval, &pckt, dst, pkt_bytes))
                   ^
  ...
  progs/test_xdp_noinline.c:321:6: error: defined with too many args
  bool encap_v4(struct xdp_md *xdp, struct ctl_value *cval,
       ^
  ...

Note that bpf selftests are compiled with -O2 which is
the recommended flag for bpf community.

The bpf backend calling convention is only allowing 5
parameters in registers and does not allow pass arguments
through stacks. In the above case, ArgumentPromotionPass
replaced parameter '&pckt' as two parameters, so the total
number of arguments after ArgumentPromotion pass becomes 6
and this caused later compilation failure during instruction
selection phase.

This patch added a TargetTransformInfo hook getMaxNumArgs()
which returns 5 for BPF and UINT_MAX for other targets.

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

18 months ago[NFC][AArch64] Add cost model tests for extending loads
David Sherwood [Tue, 11 Apr 2023 12:10:33 +0000 (12:10 +0000)]
[NFC][AArch64] Add cost model tests for extending loads

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

18 months ago[libc++] Adds missing includes.
Mark de Wever [Tue, 18 Apr 2023 17:19:48 +0000 (19:19 +0200)]
[libc++] Adds missing includes.

This patch makes are code less dependant on transitive includes.

This was part of D145800. This patch will be abandoned, but these
changes are still useful. I manually verified declarations of the new
includes are used in these files.

Reviewed By: #libc, philnik

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

18 months ago[AMDGPU] NFC. Refactor GISel for cmp intrinsics
Joe Nash [Mon, 17 Apr 2023 21:22:43 +0000 (17:22 -0400)]
[AMDGPU] NFC. Refactor GISel for cmp intrinsics

Combine the logic for fcmp and icmp intrinsics and use operand presence
instead.

Reviewed By: kosarev, foad

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

18 months ago[AMDGPU] Fix some check prefixes
Jay Foad [Wed, 19 Apr 2023 14:26:32 +0000 (15:26 +0100)]
[AMDGPU] Fix some check prefixes

18 months ago[AMDGPU] Remove unused check lines from tests
Jay Foad [Wed, 19 Apr 2023 14:23:55 +0000 (15:23 +0100)]
[AMDGPU] Remove unused check lines from tests

18 months ago[MLIR] Fix missing ::mlir namespace
Arash Taheri-Dezfouli [Wed, 19 Apr 2023 15:09:29 +0000 (15:09 +0000)]
[MLIR] Fix missing ::mlir namespace

Add a missing ::mlir namespace for MixedContainerType
that only triggers if the user is not using namespace mlir.

Reviewed By: rriddle

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

18 months ago[dwarfdump][AMDGPU] Support EF_AMDGPU_MACH_NONE
Scott Linder [Wed, 19 Apr 2023 15:02:08 +0000 (15:02 +0000)]
[dwarfdump][AMDGPU] Support EF_AMDGPU_MACH_NONE

A quirk of the AMDGPU backend is EF_AMDGPU_MACH_NONE, which is not
specific to the r600 or amdgcn architecture, but can be combined with
either.

AMDGPU ELF code objects with this mach value cannot be mapped back to a
Triple architecture, as it could be either r600 or amdgcn. For
llvm-dwarfdump this means the normal method of inspecting
ObjectFile::getArch to determine how to handle relocations is
insufficient.

This patch adds an extra check for ELF code objects which would
otherwise be categorized as UnknownArch, making it possible to use
llvm-dwarfdump with them. For completeness it also adds support for
known r600 machines.

This also adds specific tests for llvm-dwarfdump for amdgcn and r600,
both with known and unknown mach values.

Reviewed By: jhenderson

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

18 months ago[flang][openacc] Add OpenACC pointer interface to FIR pointer types
Razvan Lupusoru [Tue, 18 Apr 2023 22:42:16 +0000 (15:42 -0700)]
[flang][openacc] Add OpenACC pointer interface to FIR pointer types

The OpenACC dialect data clauses require for variables appearing in data
operations to implement the `PointerLikeType` interface (similarly to
OpenMP dialect). Thus, this interface needs attached to FIR types.

Two of the FIR types, HeapType and LLVMPointerType, did not provide
getElementType - now they do by calling getEleTy. This cleans up the
interface attachment for both OpenACC and OpenMP dialects.

Reviewed By: clementval, jeanPerier

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

18 months ago[AArch64][CodeGen] Allow vectors larger than hardware support to use SVE's load zero...
Dinar Temirbulatov [Wed, 19 Apr 2023 14:17:32 +0000 (14:17 +0000)]
[AArch64][CodeGen] Allow vectors larger than hardware support to use SVE's load zero/sign-extend for fixed vectors.

Prefer to fold LOAD + SIGN/ZEROEXTEND to SVE load and sign extend instructions
for fixed-length-vectors even if a type is not representable on a hardware.

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

18 months agoRemove unused ValueTracking.h include from DebugInfo.cpp
OCHyams [Wed, 19 Apr 2023 14:14:18 +0000 (15:14 +0100)]
Remove unused ValueTracking.h include from DebugInfo.cpp

Buildbot: https://buildkite.com/llvm-project/upstream-bazel/builds/
                        59967#01879985-8d44-4041-9cd0-a1e41371208e

See https://reviews.llvm.org/D148536

18 months ago[AMDGPU] Remove unused check lines from GlobalISel IR tests
Jay Foad [Wed, 19 Apr 2023 14:12:50 +0000 (15:12 +0100)]
[AMDGPU] Remove unused check lines from GlobalISel IR tests

18 months ago[dataflow] add missing clangLex dep after a443b3d18ef4d01e7
Sam McCall [Wed, 19 Apr 2023 14:11:58 +0000 (16:11 +0200)]
[dataflow] add missing clangLex dep after a443b3d18ef4d01e7

18 months ago[SCF] Clean up ForOpTensorCastFolder and harden it against nop tensor casts
Benjamin Kramer [Wed, 19 Apr 2023 13:31:34 +0000 (15:31 +0200)]
[SCF] Clean up ForOpTensorCastFolder and harden it against nop tensor casts

The code was inserting a new cast, discarding it, then inserting it
again.

The self-cast issue is the root of #62135 because it would end up
dropping the loop and inserting an invalid cast to itself. As far as I
can tell tensor.cast with the same src and dst types is not invalid but
it can't really be tested in isolation as it's immediately folded.

Fixes #62135

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

18 months ago[AMDGPU] Remove unused check lines from GlobalISel MIR tests
Jay Foad [Wed, 19 Apr 2023 13:54:50 +0000 (14:54 +0100)]
[AMDGPU] Remove unused check lines from GlobalISel MIR tests

18 months ago[dataflow] add HTML logger: browse code/cfg/analysis timeline/state
Sam McCall [Wed, 8 Mar 2023 15:13:28 +0000 (16:13 +0100)]
[dataflow] add HTML logger: browse code/cfg/analysis timeline/state

With -dataflow-log=/dir we will write /dir/0.html etc for each
function analyzed.

These files show the function's code and CFG, and the path through
the CFG taken by the analysis. At each analysis point we can see the
lattice state.

Currently the lattice state dump is not terribly useful but we can
improve this: showing values associated with the current Expr,
simplifying flow condition, highlighting changes etc.

(Trying not to let this patch scope-creep too much, so I ripped out the
half-finished features)

Demo: https://htmlpreview.github.io/?https://gist.githubusercontent.com/sam-mccall/1746985bf13406bd19181af281aea9ff/raw/9718fdd48406dabccb3092acd983b4bd55da9dfa/analysis.html

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

18 months ago[OpenMP][MLIR] Add lowering of omp::FlagsAttr to LLVM-IR
Andrew Gozillon [Wed, 19 Apr 2023 13:21:24 +0000 (08:21 -0500)]
[OpenMP][MLIR] Add lowering of omp::FlagsAttr to LLVM-IR

The omp::FlagsAttr contains OpenMP RTL flags
given by a user to the compiler and a frontend
(flang currently) then populates the omp::FlagsAttr
which will then lower these to LLVM globals
which are utilised by the OpenMP runtime.

Reviewers: jdoerfert

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

18 months ago[AArch64] Remove dead tryMLAV64LaneV128 and tryMULLV64LaneV128 code.
David Green [Wed, 19 Apr 2023 13:26:27 +0000 (14:26 +0100)]
[AArch64] Remove dead tryMLAV64LaneV128 and tryMULLV64LaneV128 code.

As far as I can tell this code is never used, as the pattern recognised by
checkHighLaneIndex (an duplane with insert_subvec and extract_subvec) will not
be generated any more. There are no tests that change from removing it
(including the clang neon tests), and it didn't appear to come up in any
benchmarks I ran. There are already existing tablegen patterns for MLA with
index and s/umull with index.

Removing it also prevents it from causing problems for SVE, as in #62151.

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

18 months ago[DAGCombine][AArch64] Allow transformable to legal vectors to be used for MULH lowering.
Dinar Temirbulatov [Wed, 19 Apr 2023 13:24:58 +0000 (13:24 +0000)]
[DAGCombine][AArch64] Allow transformable to legal vectors to be used for MULH lowering.

It looks like it is still profitable to accept a transformable to a legal vector
type, not just a legal vector, as long as vector elements are the same between
two of those types.

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

18 months agoReapply D146987 "[Assignment Tracking] Enable by default"
OCHyams [Wed, 19 Apr 2023 12:59:08 +0000 (13:59 +0100)]
Reapply D146987 "[Assignment Tracking] Enable by default"

This reverts commit 7674ae7231c4e286b93eb399e475765630666f8b which
reverts D146987.

See https://reviews.llvm.org/D146987 for issues.

18 months ago[libc] Add the '--threads' and '--blocks' option to the GPU loaders
Joseph Huber [Mon, 17 Apr 2023 20:08:59 +0000 (15:08 -0500)]
[libc] Add the '--threads' and '--blocks' option to the GPU loaders

We will want to test the GPU `libc` with multiple threads in the future.
This patch adds the `--threads` and `--blocks` option to set the `x`
dimension of the kernel. Using CUDA terminology instead of OpenCL for
familiarity.

Depends on D148288 D148342

Reviewed By: jdoerfert, sivachandra, tra

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

18 months ago[libc] Add a support library for GPU utilities
Joseph Huber [Tue, 18 Apr 2023 14:44:27 +0000 (09:44 -0500)]
[libc] Add a support library for GPU utilities

The GPU has many features that can only be accessed through builtin or
intrinsic functions. Furthermore, these functions are unique for each
GPU target. This patch outlines an interface to create a common `libc`
interface to access these. Currently I only implement a function for the
CUDA equivalent of `blockIdx.x`. More will be added in the future.

Reviewed By: sivachandra

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

18 months ago[SLP]Fix cost estimation for buildvectors with extracts and/or constants.
Alexey Bataev [Fri, 14 Apr 2023 16:35:03 +0000 (09:35 -0700)]
[SLP]Fix cost estimation for buildvectors with extracts and/or constants.

If the partial matching is found and some other scalars must be
inserted, need to account the cost of the extractelements, transformed
to shuffles, and/or reused entries and calculate the cost of inserting
constants properly into the non-poison vectors.
Also, fixed the cost calculation for final gather/buildvector sequence.

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

18 months ago[SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute
Marco Elver [Wed, 19 Apr 2023 12:46:42 +0000 (14:46 +0200)]
[SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute

To avoid false positives, respect no_sanitize("thread") when atomics
metadata is enabled.

Reviewed By: dvyukov

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

18 months ago[gn build] Port bf47c1ed8556
LLVM GN Syncbot [Wed, 19 Apr 2023 12:38:32 +0000 (12:38 +0000)]
[gn build] Port bf47c1ed8556

18 months agoReapply "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"
OCHyams [Wed, 19 Apr 2023 12:11:22 +0000 (13:11 +0100)]
Reapply "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"

This reverts commit 6db6ab4815a44bfcaabfcdd84a0ff458394f6f52 which reverts
D148536.

Build issues addressed in D148698.

18 months ago[dataflow] Extract arena for Value/StorageLocation out of DataflowAnalysisContext
Sam McCall [Mon, 17 Apr 2023 18:35:20 +0000 (20:35 +0200)]
[dataflow] Extract arena for Value/StorageLocation out of DataflowAnalysisContext

DataflowAnalysisContext has a few too many responsibilities, this narrows them.

It also allows the Arena to be shared with analysis steps, which need to create
Values, without exposing the whole DACtx API (flow conditions etc).
This means Environment no longer needs to proxy all these methods.
(For now it still does, because there are many callsites to update, and maybe
if we separate bool formulas from values we can avoid churning them twice)

In future, if we untangle the concepts of Values from boolean formulas/atoms,
Arena would also be responsible for creating formulas and managing atom IDs.

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

18 months agoValueTracking: Handle shufflevector in computeKnownFPClass
Matt Arsenault [Thu, 13 Apr 2023 01:33:02 +0000 (21:33 -0400)]
ValueTracking: Handle shufflevector in computeKnownFPClass

18 months agoValueTracking: Add baseline tests for shufflevector computeKnownFPClass handling
Matt Arsenault [Tue, 18 Apr 2023 14:28:39 +0000 (10:28 -0400)]
ValueTracking: Add baseline tests for shufflevector computeKnownFPClass handling

18 months agoValueTracking: Handle insertelement in computeKnownFPClass
Matt Arsenault [Wed, 12 Apr 2023 23:21:49 +0000 (19:21 -0400)]
ValueTracking: Handle insertelement in computeKnownFPClass

18 months agoValueTracking: sitofp cannot return -0
Matt Arsenault [Thu, 13 Apr 2023 13:48:08 +0000 (09:48 -0400)]
ValueTracking: sitofp cannot return -0

18 months agoValueTracking: Add baseline test for computeKnownFPClass for minnum/maxnum
Matt Arsenault [Sat, 8 Apr 2023 23:29:53 +0000 (19:29 -0400)]
ValueTracking: Add baseline test for computeKnownFPClass for minnum/maxnum

18 months agoValueTracking: Add more fpext and fptrunc tests
Matt Arsenault [Mon, 17 Apr 2023 23:12:18 +0000 (19:12 -0400)]
ValueTracking: Add more fpext and fptrunc tests

18 months ago[lldb][RISCV] Add missing flags pointer to register infos
David Spickett [Wed, 19 Apr 2023 11:42:14 +0000 (11:42 +0000)]
[lldb][RISCV] Add missing flags pointer to register infos

 efd64c2f2506df3e2ed6d9da68e49f03fc31763c added these.

18 months ago[hwasan] provide a runtime flag for printing remaining threads in error report as...
Enna1 [Wed, 19 Apr 2023 11:27:26 +0000 (19:27 +0800)]
[hwasan] provide a runtime flag for printing remaining threads in error report as an extra information

This patch adds a runtime flag `print_live_threads_info`, which defaults to true, controls whether or not prints remaining threads in error report as an extra information.
We(ByteDance) are in the process of enabling hwasan for our server-side applications on AArch64/Linux, these server-side applications have thousands of threads, so it is nice to have this option.

Reviewed By: fmayer

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

18 months ago[NFC] Rename isPointerOffset to getPointerOffsetFrom and move to Value.h
OCHyams [Wed, 19 Apr 2023 10:59:37 +0000 (11:59 +0100)]
[NFC] Rename isPointerOffset to getPointerOffsetFrom and move to Value.h

Linking LLVMCore failed when building D148536 with shared libs enabled:
https://lab.llvm.org/buildbot/#/builders/121/builds/29766

Make isPointerOffset a Value method and rename it to getPointerOffsetFrom.

Reviewed By: jmorse

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

18 months ago[libcxxabi] [test] Fix the mingw test config
Martin Storsjö [Thu, 30 Mar 2023 11:40:17 +0000 (14:40 +0300)]
[libcxxabi] [test] Fix the mingw test config

Don't link libc++abi separately in addition to the main -lc++; in
mingw build configs, libc++abi is always bundled into libc++
(via LIBCXX_ENABLE_STATIC_ABI_LIBRARY).

In the case of a shared linked libc++, linking a separate static
libc++abi leads to linker errors.

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

18 months ago[libcxxabi] [test] Avoid mingw warnings about missing a return statement
Martin Storsjö [Sat, 1 Apr 2023 22:45:07 +0000 (01:45 +0300)]
[libcxxabi] [test] Avoid mingw warnings about missing a return statement

With current versions of mingw-w64 headers, code following
assert(false) isn't considered unreachable - thus add a dummy
"return nullptr;", to avoid warnings (treated as errors) for a
missing return statement.

The root cause does get fixed further upstream in mingw-w64 in
https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe
though.

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

18 months ago[libcxxabi] Omit dllimport in public headers in MinGW mode
Martin Storsjö [Sat, 15 Apr 2023 21:58:51 +0000 (21:58 +0000)]
[libcxxabi] Omit dllimport in public headers in MinGW mode

This matches the corresponding change to libcxx headers in
dfa88927ae1411ccc3b248b7e624f2acf623d947.

This avoids needing to define _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
when building libcxxabi tests, for two reasons:
- It defaults to normal linkage (as opposed to dllimport), fixing
  linking of a static library version of libcxx/libcxxabi
- It avoids issues with using dllimport declarations on symbols when
  including cxxabi implementations into the testcase itself

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

18 months ago[AArch64][CostModel]: Add costs for zero/sign extend.
Hassnaa Hamdi [Wed, 19 Apr 2023 09:23:13 +0000 (09:23 +0000)]
[AArch64][CostModel]: Add costs for zero/sign extend.

Add cost for extending to illegal scalable vector types.
Add testing file for the extend operations.

Reviewed By: sdesmalen

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

18 months agoMake use of '#pragma clang diagnostic' only with __clang__.
Martin Liska [Wed, 19 Apr 2023 09:47:43 +0000 (11:47 +0200)]
Make use of '#pragma clang diagnostic' only with __clang__.

Otherwise one gets the following warning with GCC:
warning: ignoring ‘#pragma clang diagnostic’ [-Wunknown-pragmas]

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

18 months ago[AMDGPU] Add more verbose logs to PromoteAlloca
pvanhout [Tue, 18 Apr 2023 12:22:45 +0000 (14:22 +0200)]
[AMDGPU] Add more verbose logs to PromoteAlloca

More specifically make it more talkative when it's looking at the users of
an alloca to promote it to a vector.

A common failure point of the pass is unknown or weird users of the alloca.
While debugging issues related to this pass one of the first thing I usually
did was to add logs to see how the users were being handled.
Having such logs in directly seems to be a nice addition.

Reviewed By: arsenm, rampitec

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

18 months ago[compiler-rt][ASAN] Replace find_executable with shtuil.which in script
David Spickett [Mon, 17 Apr 2023 13:36:03 +0000 (13:36 +0000)]
[compiler-rt][ASAN] Replace find_executable with shtuil.which in script

distutils is deprecated and shutil.which is the suggested
replacement for this function.

https://peps.python.org/pep-0632/#migration-advice
https://docs.python.org/3/library/shutil.html#shutil.which

which was added in 3.3 (https://docs.python.org/3/library/shutil.html#shutil.which)
and LLVM requires at least 3.6 (https://llvm.org/docs/GettingStarted.html#software).

Reviewed By: delcypher, vitalybuka

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

18 months agoRevert "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"
OCHyams [Wed, 19 Apr 2023 09:02:24 +0000 (10:02 +0100)]
Revert "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"

This reverts commit fca3e8e024f0015604d21e6f76f3e199345679c5.

Buildbot: https://lab.llvm.org/buildbot/#/builders/121/builds/29766

18 months agoRevert D146987 "[Assignment Tracking] Enable by default"
OCHyams [Wed, 19 Apr 2023 09:01:40 +0000 (10:01 +0100)]
Revert D146987 "[Assignment Tracking] Enable by default"

This reverts commit 107b307bd61e51aa66ea41f1a2c92c1459b39c7e due
to build errors in a parent commit fca3e8e024f0015604d21e6f76f3e199345679c5

18 months ago[AMDGPU] Don't transform illegal intrinsics to V_ILLEGAL
Jay Foad [Wed, 12 Apr 2023 13:22:40 +0000 (14:22 +0100)]
[AMDGPU] Don't transform illegal intrinsics to V_ILLEGAL

This reverts parts of D123693. The functionality of allowing unsupported
intrinsics to select has been superseded by D139000 "Remove function
with incompatible features".

Retain assembler/disassembler support for v_illegal on GFX10+ only,
where it is documented.

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

18 months ago[docs] Fix the CMAKE_BUILD_TYPE option in the cmake command in GettingStarted.rst
terrydang [Wed, 19 Apr 2023 08:45:05 +0000 (09:45 +0100)]
[docs] Fix the CMAKE_BUILD_TYPE option in the cmake command in GettingStarted.rst

The cmake command contained a duplicate CMAKE_BUILD_TYPE option in the
section "Compiling the LLVM Suite Source Code".

18 months ago[reland][libc] handle memset sequence as a separate struct
Guillaume Chatelet [Tue, 18 Apr 2023 15:16:20 +0000 (15:16 +0000)]
[reland][libc] handle memset sequence as a separate struct

These sequence of calls don't really make sense for head_tail and loop_and_tail.