platform/upstream/llvm.git
22 months ago[llvm] Use std::nullopt instead of None in comments (NFC)
Kazu Hirata [Fri, 9 Dec 2022 07:21:59 +0000 (23:21 -0800)]
[llvm] Use std::nullopt instead of None in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months agoMark test lld/test/MachO/fat-arch.s updated in e54cfa4 to require aarch64.
Douglas Yung [Fri, 9 Dec 2022 06:41:45 +0000 (22:41 -0800)]
Mark test lld/test/MachO/fat-arch.s updated in e54cfa4 to require aarch64.

22 months ago[clang] Use std::nullopt instead of None in comments (NFC)
Kazu Hirata [Fri, 9 Dec 2022 06:43:11 +0000 (22:43 -0800)]
[clang] Use std::nullopt instead of None in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months ago[AARCH64][CostModel] Modified the cost of mask vector load/store
liqinweng [Fri, 9 Dec 2022 04:45:42 +0000 (12:45 +0800)]
[AARCH64][CostModel] Modified the cost of mask vector load/store

Reviewed By: david-arm

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

22 months ago[mlir] Fix examples build
Jeff Niu [Fri, 9 Dec 2022 05:32:26 +0000 (21:32 -0800)]
[mlir] Fix examples build

Missing two extra parameters.

22 months ago[AAPointerInfo] rearrange code in preparation for further changes
Sameer Sahasrabuddhe [Fri, 9 Dec 2022 05:28:28 +0000 (10:58 +0530)]
[AAPointerInfo] rearrange code in preparation for further changes

AAPointerInfoFloating::updateImpl
  Move the member function definition out of its class before modifying it.

translateAndAddState
  Split the function definition into two along the FromCallee boolean argument.

handleAccess
  This should only be called when Size is not known. In other cases, replaced
  with a direct call to addAccess.

Reviewed By: jdoerfert

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

22 months ago[mlir][ods] Add I8 and I16 cases to BitEnumAttr
Jeff Niu [Thu, 8 Dec 2022 19:51:36 +0000 (11:51 -0800)]
[mlir][ods] Add I8 and I16 cases to BitEnumAttr

Reviewed By: rriddle

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

22 months agoRevert "Reland "[pgo] Avoid introducing relocations by using private alias""
Paul Kirth [Fri, 9 Dec 2022 04:28:43 +0000 (04:28 +0000)]
Revert "Reland "[pgo] Avoid introducing relocations by using private alias""

This reverts commit e89e8dcfad364d23515de25ac87d26dfe25badbb.

Some configurations still have references to discarded sections. I'm
reverting until these can be addressed.

22 months ago[libTooling] Add flag to getRangeForEdit to ignore macro expansions
Eric Li [Thu, 8 Dec 2022 22:01:53 +0000 (17:01 -0500)]
[libTooling] Add flag to getRangeForEdit to ignore macro expansions

This commit resolves the FIXME around the behavior of
`Lexer::makeFileCharRange` that `getRangeForEdit` inherits around
source locations in macro expansions.

We add a flag to `getRangeForEdit` that allows a caller to disable the
behavior, and instead uses the spelling location instead, with checks
to ensure that the source locations are not within a macro definition.

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

22 months ago[InstCombine] Add tests for udiv with shl-mul; NFC
Chenbing Zheng [Fri, 9 Dec 2022 03:18:31 +0000 (11:18 +0800)]
[InstCombine] Add tests for udiv with shl-mul; NFC

22 months ago[lld-macho] Fix bug in reading cpuSubType field.
Vy Nguyen [Wed, 7 Dec 2022 20:54:48 +0000 (15:54 -0500)]
[lld-macho] Fix bug in reading cpuSubType field.

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

22 months ago[Bazel] Set HAVE_DLADDR in config.h
NAKAMURA Takumi [Fri, 9 Dec 2022 02:41:14 +0000 (11:41 +0900)]
[Bazel] Set HAVE_DLADDR in config.h

Corresponding to CMake change in llvmorg-16-init-13673-g138d53895734

22 months agoImprove error handling for invalid breakpoint `-t` and `-x` options.
Jordan Rupprecht [Fri, 9 Dec 2022 01:53:54 +0000 (17:53 -0800)]
Improve error handling for invalid breakpoint `-t` and `-x` options.

Breakpoint option `-t` checks that `option_arg` is empty by checking `option_arg[0] == '\0'`. This is unnecessary: the next two checks for comparing against "current" and calling `getAsInteger` already gracefully handle an empty StringRef. If the `option_arg` string is empty, this crashes (or triggers an assertion failure with asserts enabled). Also, this sets the thread id to `LLDB_INVALID_THREAD_ID` if the thread id is invalid -- it should just not set the thread id.

Likewise of `-x` which checks `option_arg[0] == '\n'` unnecessarily.

I believe both of these bugs are unreachable via normal LLDB usage, and are only accessible via the fuzzer -- most likely some other CLI parsing is trimming whitespace and rejecting empty inputs. Still, it doesn't hurt to simplify this bit.

22 months agoReland "[pgo] Avoid introducing relocations by using private alias"
Paul Kirth [Fri, 9 Dec 2022 00:28:37 +0000 (00:28 +0000)]
Reland "[pgo] Avoid introducing relocations by using private alias"

In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.

This version makes the new runtime test a Linux only test.

Reviewed By: phosek

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

22 months ago[LoongArch] Remove GlobalISel from the LINK_COMPONENTS list. NFC
Weining Lu [Fri, 9 Dec 2022 01:11:10 +0000 (09:11 +0800)]
[LoongArch] Remove GlobalISel from the LINK_COMPONENTS list. NFC

LoongArch doesn't use GlobalISel for now.

22 months ago[NFC] Fix leak handling breakpoint names.
Jordan Rupprecht [Fri, 9 Dec 2022 01:14:38 +0000 (17:14 -0800)]
[NFC] Fix leak handling breakpoint names.

The breakpoint list is a list of raw pointers. When breakpoints are removed, the memory is not deleted. Switch to unique pointers. I did some minor cleanup while making this change.

Found by the LLDB command interpreter fuzzer. The input is `br m G`.

22 months ago[gn build] Port 3b7af2796b3d
LLVM GN Syncbot [Fri, 9 Dec 2022 01:06:43 +0000 (01:06 +0000)]
[gn build] Port 3b7af2796b3d

22 months agoRevert "Revert "[-Wunsafe-buffer-usage] Initial commit - Transition away from raw...
Artem Dergachev [Fri, 9 Dec 2022 00:40:33 +0000 (16:40 -0800)]
Revert "Revert "[-Wunsafe-buffer-usage] Initial commit - Transition away from raw buffers.""

This reverts commit bc0617795f8bdcd5deab3e48b120107cc2833cdc.

Be more careful with #includes to avoid linker errors on some buildbots.

22 months ago[NFC] Fix leak in command options configuration.
Jordan Rupprecht [Fri, 9 Dec 2022 00:37:43 +0000 (16:37 -0800)]
[NFC] Fix leak in command options configuration.

`m_options.Append(new OptionPermissions())` leaks because the pointer passed in is not owned. Use a class member to ensure lifetime, which is the common pattern used for this API.

Found by the LLDB command interpreter fuzzer. The fuzz input is running `ap $` twice.

22 months ago[ModuleUtils][KCFI] Set !kcfi_type metadata for sanitizer constructors
Sami Tolvanen [Fri, 9 Dec 2022 00:06:36 +0000 (00:06 +0000)]
[ModuleUtils][KCFI] Set !kcfi_type metadata for sanitizer constructors

Set KCFI type metadata for the sanitizer constructors to prevent
runtime failures when these functions are indirectly called in
instrumented code. This fixes a compatibility issue with KASAN and
-fsanitize=kcfi in the Linux kernel.

Link: https://github.com/ClangBuiltLinux/linux/issues/1742
Reviewed By: nickdesaulniers, MaskRay

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

22 months agoRevert "Reland "[pgo] Avoid introducing relocations by using private alias""
Paul Kirth [Fri, 9 Dec 2022 00:22:57 +0000 (00:22 +0000)]
Revert "Reland "[pgo] Avoid introducing relocations by using private alias""

This reverts commit 3cfaea2d499970c2fd14389ade59f792156be0f8.

The runtime test fails on Mac.

22 months ago[flang] Fix flang after MLIR update
Jeff Niu [Fri, 9 Dec 2022 00:22:06 +0000 (16:22 -0800)]
[flang] Fix flang after MLIR update

22 months ago[compiler-rt] Update build_symbolizer.sh to use -passes syntax
Roman Lebedev [Fri, 9 Dec 2022 00:07:36 +0000 (03:07 +0300)]
[compiler-rt] Update build_symbolizer.sh to use -passes syntax

22 months ago[CMake] Move dladdr check below _GNU_SOURCE check.
Daniel Thornburgh [Wed, 7 Dec 2022 00:22:24 +0000 (16:22 -0800)]
[CMake] Move dladdr check below _GNU_SOURCE check.

The presence of dladdr on Linux depends on whether or not _GNU_SOURCE is
set.

Reviewed By: phosek

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

22 months agoadd floor library function
Joshua Batista [Thu, 8 Dec 2022 21:03:47 +0000 (13:03 -0800)]
add floor library function

This change exposes the floor library function for HLSL,
excluding long, int, and long long doubles.
Floor is supported for all scalar, vector, and matrix types.

Long and long long double support is missing in this patch because those types
don't exist in HLSL. Int is missing because the floor function only works on floating type arguments.

The full documentation of the HLSL floor function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-floor

Reviewed By: beanz

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

22 months ago[mlir][sparse] reject kernels with non-sparsfiable reduction expression.
Peiming Liu [Thu, 8 Dec 2022 20:03:18 +0000 (20:03 +0000)]
[mlir][sparse] reject kernels with non-sparsfiable reduction expression.

To address https://github.com/llvm/llvm-project/issues/59394.

Reduction on negation of the output tensor is a non-sparsifiable kernel, it creates cyclic dependency.

This patch reject those cases instead of crashing.

Reviewed By: aartbik

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

22 months ago[ARM][AArch64] Some additional for bitcast splats. NFC
David Green [Thu, 8 Dec 2022 23:08:06 +0000 (23:08 +0000)]
[ARM][AArch64] Some additional for bitcast splats. NFC

22 months ago[NFC] Port one more codegen WinEH test to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:06:33 +0000 (02:06 +0300)]
[NFC] Port one more codegen WinEH test to `-passes=` syntax

22 months ago[NFC] Port last few Transforms tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:04:45 +0000 (02:04 +0300)]
[NFC] Port last few Transforms tests to `-passes=` syntax

22 months ago[NFC] Port last few Other tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:04:06 +0000 (02:04 +0300)]
[NFC] Port last few Other tests to `-passes=` syntax

22 months ago[NFC] Port all Verifier tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 23:03:37 +0000 (02:03 +0300)]
[NFC] Port all Verifier tests to `-passes=` syntax

22 months ago[NFC][asan] Guard implemetation with ASAN_INTERCEPT_SWAPCONTEXT
Vitaly Buka [Thu, 8 Dec 2022 22:52:00 +0000 (14:52 -0800)]
[NFC][asan] Guard implemetation with ASAN_INTERCEPT_SWAPCONTEXT

22 months agoRevert "[AMDGPU] Disable bool range metadata to workaround backend issue"
Yaxun (Sam) Liu [Thu, 8 Dec 2022 21:56:25 +0000 (16:56 -0500)]
Revert "[AMDGPU] Disable bool range metadata to workaround backend issue"

This reverts commit 107ee2613063183cb643cef97f0fad403508c9f0 to facilitate
investigating and fixing the root cause.

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

22 months ago[NFC] Port codegen X86 tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:41 +0000 (00:54 +0300)]
[NFC] Port codegen X86 tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen WinEH tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:41 +0000 (00:54 +0300)]
[NFC] Port codegen WinEH tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen Thumb2 tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:40 +0000 (00:54 +0300)]
[NFC] Port codegen Thumb2 tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen Thumb tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:40 +0000 (00:54 +0300)]
[NFC] Port codegen Thumb tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen SystemZ tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:40 +0000 (00:54 +0300)]
[NFC] Port codegen SystemZ tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen PowerPC tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:39 +0000 (00:54 +0300)]
[NFC] Port codegen PowerPC tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen NVPTX tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:39 +0000 (00:54 +0300)]
[NFC] Port codegen NVPTX tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen Generic tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:36 +0000 (00:54 +0300)]
[NFC] Port codegen Generic tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen ARM tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:35 +0000 (00:54 +0300)]
[NFC] Port codegen ARM tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen AMDGPU tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:35 +0000 (00:54 +0300)]
[NFC] Port codegen AMDGPU tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port codegen AArch64 tests that invoke opt to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:54:35 +0000 (00:54 +0300)]
[NFC] Port codegen AArch64 tests that invoke opt to `-passes=` syntax

22 months ago[NFC] Port all tools tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:52:21 +0000 (00:52 +0300)]
[NFC] Port all tools tests to `-passes=` syntax

22 months ago[NFC] Port all Verifier tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:52:21 +0000 (00:52 +0300)]
[NFC] Port all Verifier tests to `-passes=` syntax

22 months ago[NFC] Port all Other tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:45 +0000 (00:51 +0300)]
[NFC] Port all Other tests to `-passes=` syntax

22 months ago[NFC] Port all LTO tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:45 +0000 (00:51 +0300)]
[NFC] Port all LTO tests to `-passes=` syntax

22 months ago[NFC] Port all Feature tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:45 +0000 (00:51 +0300)]
[NFC] Port all Feature tests to `-passes=` syntax

22 months ago[NFC] Port all DebugInfo tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:51:01 +0000 (00:51 +0300)]
[NFC] Port all DebugInfo tests to `-passes=` syntax

22 months ago[NFC] Port all Bitcode tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:50:33 +0000 (00:50 +0300)]
[NFC] Port all Bitcode tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/ScalarEvolution tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:43 +0000 (00:49 +0300)]
[NFC] Port all Analysis/ScalarEvolution tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/MustExecute tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:42 +0000 (00:49 +0300)]
[NFC] Port all Analysis/MustExecute tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/MemorySSA tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:41 +0000 (00:49 +0300)]
[NFC] Port all Analysis/MemorySSA tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/LoopAccessAnalysis tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:40 +0000 (00:49 +0300)]
[NFC] Port all Analysis/LoopAccessAnalysis tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/LazyValueAnalysis tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:40 +0000 (00:49 +0300)]
[NFC] Port all Analysis/LazyValueAnalysis tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/GlobalsModRef tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:39 +0000 (00:49 +0300)]
[NFC] Port all Analysis/GlobalsModRef tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/Dominators tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:38 +0000 (00:49 +0300)]
[NFC] Port all Analysis/Dominators tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/CallGraph tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:36 +0000 (00:49 +0300)]
[NFC] Port all Analysis/CallGraph tests to `-passes=` syntax

22 months ago[NFC] Port all Analysis/AliasSet tests to `-passes=` syntax
Roman Lebedev [Thu, 8 Dec 2022 21:49:35 +0000 (00:49 +0300)]
[NFC] Port all Analysis/AliasSet tests to `-passes=` syntax

22 months ago[lld-macho] Update -adhoc_codesign default
Keith Smiley [Thu, 8 Dec 2022 20:33:41 +0000 (12:33 -0800)]
[lld-macho] Update -adhoc_codesign default

With newer versions of ld64 it generates an adhoc signature by default
for all arm64 simulator targets. This default is especially important
for unit test targets that rarely have custom codesigning requirements
but otherwise won't run on arm64 macs.

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

22 months ago[libc++][math.h] Add double overloads
Nikolas Klauser [Tue, 1 Nov 2022 21:29:57 +0000 (22:29 +0100)]
[libc++][math.h] Add double overloads

This allows libc++ to work with libcs that don't provide a proper math.h implementation.

Reviewed By: ldionne, #libc

Spies: aaron.ballman, fhahn, bcain, Izaron, libcxx-commits

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

22 months agoscudo-standalone: Add GetRSS method on Linux
Bastian Kersting [Thu, 8 Dec 2022 20:22:42 +0000 (12:22 -0800)]
scudo-standalone: Add GetRSS method on Linux

This change adds a GetRSS method on Linux that parses
the number from /proc/self/statm. This change is part
of splitting up https://reviews.llvm.org/D126752.

Reviewed By: vitalybuka, cryptoad

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

22 months ago[libc++] Move filter_view::iterator and sentinel out of filter_view
Nikolas Klauser [Sun, 4 Dec 2022 14:55:27 +0000 (15:55 +0100)]
[libc++] Move filter_view::iterator and sentinel out of filter_view

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

22 months ago[OPENMP51]Codegen for error directive.
Jennifer Yu [Thu, 1 Dec 2022 23:54:35 +0000 (15:54 -0800)]
[OPENMP51]Codegen for error directive.

Added codegen for `omp error` directive.
This is to generate IR to call:
void __kmpc_error(ident_t *loc, int severity, const char *message);

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

22 months agoReland "[pgo] Avoid introducing relocations by using private alias"
Paul Kirth [Thu, 8 Dec 2022 18:30:14 +0000 (18:30 +0000)]
Reland "[pgo] Avoid introducing relocations by using private alias"

In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.

This disables the failing runtime test on Windows, since the compiler
options (-fPIC) are unsupported on that platform.

Reviewed By: phosek

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

22 months agoutils/update_mir_test_checks.py: support UTC_ARGS
Gaëtan Bossu [Thu, 8 Dec 2022 20:50:02 +0000 (21:50 +0100)]
utils/update_mir_test_checks.py: support UTC_ARGS

As a reminder, UTC_ARGS is used by lit test cases to specify which
arguments need to be passed to update_XXXX_test_checks.py to be
auto-updated properly.

The support is achieved by relying on common.itertests, which is what
other test
updaters use to iterate over test files.

This commit also changes how the --llc-binary option is saved in args.
It used to be saved as "llc", but it is here changed to the standard
"llc_binary" to make use of an existing ignore mechanism for specific
arguments. Without that change, the option would not be ignored and
would appear in UTC_ARGS. This would be different from what e.g.
update_llc_test_checks does. As update_mir_test_checks.py now supports
UTC_ARGS, it became important to ensure the option is ignored.

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

22 months ago[opt] Disincentivize new tests from using old pass syntax
Roman Lebedev [Thu, 8 Dec 2022 20:35:26 +0000 (23:35 +0300)]
[opt] Disincentivize new tests from using old pass syntax

Over the past day or so, i've took a large swing at our tests,
and reduced the number of tests that were still using the old syntax
from ~1800 to just 200.

Left to handle: (as it is seen in this patch)
* Transforms/LSR
* Transforms/CGP
* Transforms/TypePromotion
* Transforms/HardwareLoops
* Analysis/*
* some misc.

I think this is the right point to start actively refusing
to honor the old syntax, except for the old tests,
to prevent the old syntax from creeping back in.

Thus, let's add temporary default-off flag,
and if it is not passed refuse to accept old syntax.
The tests that still need porting are annotated with this flag.

Reviewed By: aeubanks

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

22 months ago[openmp] Provide an assembly implementation of __kmp_invoke_microtask on ARM
Martin Storsjö [Fri, 25 Nov 2022 12:23:38 +0000 (14:23 +0200)]
[openmp] Provide an assembly implementation of __kmp_invoke_microtask on ARM

This fixes passing an arbitrarily large number of arguments to
microtasks, fixing the misc_bugs/many-microtask-args.c testcase on
ARM.

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

22 months ago[LLParser] Support symbolic address space numbers
Alex Richardson [Thu, 8 Dec 2022 20:31:44 +0000 (20:31 +0000)]
[LLParser] Support symbolic address space numbers

This allows the LLParser to also accept "A", "G", and "P" in `addrspace`
usages. "A" will be replaced by the alloca address space defined in the
globals, "G" by the default globals address space and "P" by the program
address space. This makes it easier to write tests that use different
address space and only only vary the RUN: lines. Currently, the only
alternative is to pre-process the sources with a tool such as `sed`

Importantly, these new string values are only accepted in .ll files and
not stored in the bitcode format, so it does not round-trip via llvm-as
and llvm-dis (see newly added test).

Reviewed By: nikic

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

22 months agoSimplify clang/test/CodeGen/annotations-global.c CHECK lines
Alex Richardson [Thu, 8 Dec 2022 10:47:22 +0000 (10:47 +0000)]
Simplify clang/test/CodeGen/annotations-global.c CHECK lines

There is no need to run FileCheck 5 times, we can use CHECK-DAG instead.

22 months agoFix annotations-field.c CHECK lines being ignored
Alex Richardson [Thu, 8 Dec 2022 10:38:53 +0000 (10:38 +0000)]
Fix annotations-field.c CHECK lines being ignored

Pointed out by @jrtc27 in https://reviews.llvm.org/D138722.

22 months ago[OpenMP] Clang Support for taskwait nowait clause
Sunil K [Thu, 8 Dec 2022 18:26:17 +0000 (10:26 -0800)]
[OpenMP] Clang Support for taskwait nowait clause

Support for taskwait nowait clause with placeholder for runtime changes.

Reviewed By: ABataev

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

22 months agoutils/update_mir_test_checks.py: allow checking fixedStack in .mir files
Gaëtan Bossu [Thu, 8 Dec 2022 19:49:04 +0000 (20:49 +0100)]
utils/update_mir_test_checks.py: allow checking fixedStack in .mir files

Generation of CHECK lines for fixedStack can be enabled with --print-fixed-stack.
This is particularly useful for tests which need to inspect how the
stack looks, e.g. for ABI tests.

See the other stacked revision building on top of this one which enables UTC_ARGS (in a similar fashion to other test updaters in utils/).

Reviewed By: arsenm

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

22 months ago[mlir][ods] BitEnumAttr: Actually use the 'str' for the all unset case
Jeff Niu [Thu, 8 Dec 2022 19:45:18 +0000 (11:45 -0800)]
[mlir][ods] BitEnumAttr: Actually use the 'str' for the all unset case

Reviewed By: rriddle

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

22 months ago[Attributor] Fix a break in relase build caused by
Haojian Wu [Thu, 8 Dec 2022 20:07:58 +0000 (21:07 +0100)]
[Attributor] Fix a break in relase build caused by
61318fa5c764d6af60baeb1c00d793f1bd95f5ea.

22 months ago[HWASAN] Removed right_aligned from HWASAN allocator Metadata.
Kirill Stoimenov [Thu, 8 Dec 2022 19:10:19 +0000 (19:10 +0000)]
[HWASAN] Removed right_aligned from HWASAN allocator Metadata.

This came up during review of D139464. Looks like this filed is always set to false to it is basically unused.

Reviewed By: vitalybuka

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

22 months agoScalarizer: fix an opaque pointer bug
Nicolai Hähnle [Mon, 5 Dec 2022 17:21:59 +0000 (18:21 +0100)]
Scalarizer: fix an opaque pointer bug

With opaque pointers, it's possible for the same pointer value to be
used to store different vector types (both number and type of elements),
so we need to take that into account when caching the scattering.

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

22 months agoScalarizer: explicitly exclude scalable vectors
Nicolai Hähnle [Fri, 2 Dec 2022 15:07:30 +0000 (16:07 +0100)]
Scalarizer: explicitly exclude scalable vectors

They are unsupported and would previously crash, now we just skip them.

Hypothetically, one could consider "scalarizing" a <vscale x n x T> into
n copies of <vscale x 1 x T>. But (1) it's unclear how to do that
because insertelement etc. don't work with scalable vectors in the
required way, and (2) there is no user of such functionality.

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

22 months ago[OpenMP] [OMPT] [3/8] Implemented callback registration in libomptarget
Dhruva Chakrabarti [Thu, 8 Dec 2022 18:57:11 +0000 (10:57 -0800)]
[OpenMP] [OMPT] [3/8] Implemented callback registration in libomptarget

The purpose of this patch is to have tool-provided callbacks registered
in libomptarget. The overall design document is in
https://rice.app.box.com/s/pf3gix2hs4d4o1aatwir1set05xmjljc

Defined a class OmptDeviceCallbacksTy that will be used by libomptarget
and a plugin for callbacks registered by a tool. Once the callbacks are
registered in libomp, a lookup function is passed to libomptarget that is
used to retrieve the callbacks and register them in libomptarget.

Patch from John Mellor-Crummey <johnmc@rice.edu>
(With contributions from Dhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>)

Reviewed By: jplehr, tianshilei1992

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

22 months agoupdate_mir_test_checks.py: match dead vreg definitions
Nicolai Hähnle [Tue, 6 Dec 2022 20:58:26 +0000 (21:58 +0100)]
update_mir_test_checks.py: match dead vreg definitions

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

22 months ago[tsan] re-exec when ASLR is enabled for x86_64 as well
zijunzhao [Thu, 8 Dec 2022 19:35:44 +0000 (19:35 +0000)]
[tsan] re-exec when ASLR is enabled for x86_64 as well

Reviewed By: vitalybuka

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

22 months agoWhen merging lambdas, keep track of the capture lists from each version.
Richard Smith [Wed, 7 Dec 2022 23:20:49 +0000 (15:20 -0800)]
When merging lambdas, keep track of the capture lists from each version.

Different versions of a lambda will in general refer to different
enclosing variable declarations, because we do not merge most
block-scope declarations, such as local variables. Keep track of all the
declarations that correspond to a lambda's capture fields so that we can
rewrite the name of any of those variables to the lambda capture,
regardless of which copy of the body of `operator()` we look at.

22 months ago[mlir] FunctionOpInterface: arg and result attrs dispatch to interface
Jeff Niu [Tue, 6 Dec 2022 20:55:43 +0000 (12:55 -0800)]
[mlir] FunctionOpInterface: arg and result attrs dispatch to interface

This patch removes the `arg_attrs` and `res_attrs` named attributes as a
requirement for FunctionOpInterface and replaces them with interface
methods for the getters, setters, and removers of the relevent
attributes. This allows operations to use their own storage for the
argument and result attributes.

Depends on D139471

Reviewed By: rriddle

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

22 months ago[mlir][ods] Generate remover methods with camelcase
Jeff Niu [Tue, 6 Dec 2022 21:09:24 +0000 (13:09 -0800)]
[mlir][ods] Generate remover methods with camelcase

The remove*Attr methods were not being generated with the correct
camelcase method.

Depends on D139470

Reviewed By: rriddle

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

22 months ago[mlir][ods] Make Operator.h comments triple forward slash (NFC)Depends on D139447
Jeff Niu [Tue, 6 Dec 2022 21:00:01 +0000 (13:00 -0800)]
[mlir][ods] Make Operator.h comments triple forward slash (NFC)Depends on D139447

Depends on D139447

Reviewed By: rriddle

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

22 months ago[mlir] FunctionOpInterface: make get/setFunctionType interface methods
Jeff Niu [Tue, 6 Dec 2022 19:28:47 +0000 (11:28 -0800)]
[mlir] FunctionOpInterface: make get/setFunctionType interface methods

This patch removes the concept of a `function_type`-named type attribute
as a requirement for implementors of FunctionOpInterface. Instead, this
type should be provided through two interface methods, `getFunctionType`
and `setFunctionTypeAttr` (*Attr because functions may use different
concrete function types), which should be automatically implemented by
ODS for ops that define a `$function_type` attribute.

This also allows FunctionOpInterface to materialize function types if
they don't carry them in an attribute, for example.

Importantly, all the function "helper" still accept an attribute name to
use in parsing and printing functions, for example.

Reviewed By: rriddle, lattner

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

22 months ago[compiler-rt] Add opt-in -ftrivial-auto-var-init flag for writing over uninitialized...
Leonard Chan [Thu, 8 Dec 2022 19:29:28 +0000 (19:29 +0000)]
[compiler-rt] Add opt-in -ftrivial-auto-var-init flag for writing over uninitialized stack variiables

This might allow lsan to find more leaks that would have gone
undetected. When lsan searches for leaked pointers on the stack, if a
leaked pointer that was pushed to the stack in a prior function call
would not be scrubbed on a future function call, then the scan will see
the pointer on the stack and not mark it as leaked. Such holes can exist
in the lsan runtime where there may be uninitialized data. Adding
auto-var-init can scrub some of that data and might be able to catch
more leaks that would've gone undetected this way.

See https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=111351 for more
details.

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

22 months ago[InstCombine] add tests for insertelts of truncs; NFC
Sanjay Patel [Thu, 8 Dec 2022 18:42:21 +0000 (13:42 -0500)]
[InstCombine] add tests for insertelts of truncs; NFC

22 months agoRevert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1 (2nd...
Sanjay Patel [Thu, 8 Dec 2022 15:47:53 +0000 (10:47 -0500)]
Revert "[InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 1 (2nd try)"

This reverts commit e71b81cab09bf33e3b08ed600418b72cc4117461.

As discussed in the planned follow-on to this patch (D138874),
this and the subsequent patches in this set can cause trouble for
the backend, and there's probably no quick fix. We may even
want to canonicalize in the opposite direction (towards insertelt).

22 months agoRevert "[InstCombine] improve efficiency of bool logic; NFC"
Sanjay Patel [Thu, 8 Dec 2022 15:46:49 +0000 (10:46 -0500)]
Revert "[InstCombine] improve efficiency of bool logic; NFC"

This reverts commit b7c7fe3d0779b6e332fe6db64e87561deba2e56a.

As discussed in the planned follow-on to this patch (D138874),
this and the previous patch in this set can cause trouble for
the backend, and there's probably no quick fix. We may even
want to canonicalize in the opposite direction (towards insertelt).

22 months agoRevert "Implement CWG2631"
Corentin Jabot [Thu, 8 Dec 2022 18:57:02 +0000 (19:57 +0100)]
Revert "Implement CWG2631"

This patch causes another link error,
reverting until I can investigate.

This reverts commit a96a6ed83230265f3eab09a94f0e9525d05f8a74.

22 months ago[clang] Add test for CWG418
Vlad Serebrennikov [Thu, 8 Dec 2022 18:03:42 +0000 (21:03 +0300)]
[clang] Add test for CWG418

P1787: //[[ https://cplusplus.github.io/CWG/issues/418.html | CWG418 ]] is resolved by trivial rephrasing along with that necessary for the new using-declaration interpretation.//
Wording: see changes to [dcl.fct.default]/9 and [over.match.best]/4.

[over.match.best]/4 includes [[ https://eel.is/c++draft/over.match.best#general-example-8 | an example ]] that is not properly diagnosed by Clang.

Reviewed By: #clang-language-wg, shafik

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

22 months ago[OpenMP][libomp] Fix version scripts after undefined version script changes
Joseph Huber [Thu, 8 Dec 2022 18:34:38 +0000 (13:34 -0500)]
[OpenMP][libomp] Fix version scripts after undefined version script changes

Summary:
Building with `lld` now errors on undefined symbols by default now. This
was causing `libomp` to think that the compiler didn't support version
scripts when checking linker features. This patch adds a new script that
exports all symbols to be used for testing. We also remove the old
workarounds for undefined versions now that it's no longer necessary.

22 months ago[MC][AArch64] Remove bogus whitespace of markup'd immediate.
Paul Walker [Thu, 8 Dec 2022 17:54:08 +0000 (17:54 +0000)]
[MC][AArch64] Remove bogus whitespace of markup'd immediate.

22 months agoUpdate the status of a few more C DRs
Aaron Ballman [Thu, 8 Dec 2022 18:16:29 +0000 (13:16 -0500)]
Update the status of a few more C DRs

This includes tests for DR085 and DR259.

22 months ago[mlir][linalg] Print broadcast, map, reduce, transpose ins/outs on one line.
Alexander Belyaev [Thu, 8 Dec 2022 18:06:19 +0000 (19:06 +0100)]
[mlir][linalg] Print broadcast, map, reduce, transpose ins/outs on one line.

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

22 months agoRevert "Reland "[pgo] Avoid introducing relocations by using private alias"""
Paul Kirth [Thu, 8 Dec 2022 18:14:48 +0000 (18:14 +0000)]
Revert "Reland "[pgo] Avoid introducing relocations by using private alias"""

This reverts commit 071c39df8632561b599f7b1debd81b3cf6b5b396.

One of the new runtimes tests causes a failure with MSVC, so I'm
reverting until the test can be fixed.

22 months ago[RISCV][InsertVSETVLI] vmv.s.x and fvmv.s.f do not depend on LMUL
Philip Reames [Thu, 8 Dec 2022 18:12:00 +0000 (10:12 -0800)]
[RISCV][InsertVSETVLI] vmv.s.x and fvmv.s.f do not depend on LMUL

We already have this rule encoded elsewhere in the file - which is why we don't see any test changes.  I'm adding it here for completionism.

This is not technically NFC since there could be a test case which isn't caught by the specific rules, but is handled by the generic logic.  I don't have such an example.

22 months ago[ADT] Use std::nullopt instead of llvm::None in OptionalTest.cpp
Kazu Hirata [Thu, 8 Dec 2022 18:07:43 +0000 (10:07 -0800)]
[ADT] Use std::nullopt instead of llvm::None in OptionalTest.cpp

This patch updates the test for the streaming operator for
llvm::Optional to use std::nullopt instead of llvm::None.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

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