platform/upstream/llvm.git
19 months ago[Hexagon] Further improve code generation for shuffles
Krzysztof Parzyszek [Thu, 24 Nov 2022 15:05:10 +0000 (07:05 -0800)]
[Hexagon] Further improve code generation for shuffles

* Concatenate partial shuffles into longer ones whenever possible:
In selection DAG, shuffle's operands and return type must all agree. This
is not the case in LLVM IR, and non-conforming IR-level shuffles will be
rewritten to match DAG's requirements. This can also make a shuffle that
can be matched to a single HVX instruction become shuffles that require
more complex handling. Example: anything that takes two single vectors
and returns a pair (e.g. V6_vshuffvdd).
This is avoided by concatenating such shuffles into ones that take a vector
pair, and an undef pair, and produce a vector pair.

* Recognize perfect shuffles when masks contain `undef` values.

* Use funnel shifts for contracting shuffles.

* Recognize rotations as a separate step.

These changes go into a single commit, because each one on their own
introduced some regressions.

19 months ago[AIX][LTO] Properly respect LDR_CNTRL and set MAXDATA32 to 0xA0000000@DSA.
Wael Yehia [Tue, 29 Nov 2022 20:43:04 +0000 (20:43 +0000)]
[AIX][LTO] Properly respect LDR_CNTRL and set MAXDATA32 to 0xA0000000@DSA.

Reviewed By: rzurob

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

19 months agoupdate_test_checks: fix typos
Nicolai Hähnle [Tue, 29 Nov 2022 22:08:47 +0000 (23:08 +0100)]
update_test_checks: fix typos

Found by our downstream CI.

19 months ago[libc++] Add a missing include to `swap_allocator.h`.
Konstantin Varlamov [Tue, 29 Nov 2022 21:54:20 +0000 (13:54 -0800)]
[libc++] Add a missing include to `swap_allocator.h`.

Also add tests for the file.

Reviewed By: #libc, ldionne

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

19 months ago[InstCombine] Revert D125845
William Huang [Tue, 29 Nov 2022 21:49:44 +0000 (21:49 +0000)]
[InstCombine] Revert D125845

Reverting D125845 `[InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back` because multiple users reported performance regression

Reviewed By: davidxl

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

19 months ago[clang] [test] Fix recently pushed mingw tests in some environments
Martin Storsjö [Tue, 29 Nov 2022 21:56:50 +0000 (23:56 +0200)]
[clang] [test] Fix recently pushed mingw tests in some environments

Account for backslashes in paths in mingw.cpp.

Testing clang with the <triple>-clang form seems to require the
x86 target to be enabled, when the triple is an x86 triple. Just
skip that aspect of the test, since the "clang --target=<triple>"
form should give enough test coverage here.

19 months agoAMDGPU: Remove unused variables. NFC
Benjamin Kramer [Tue, 29 Nov 2022 21:57:00 +0000 (22:57 +0100)]
AMDGPU: Remove unused variables. NFC

19 months ago[PowerPC] Fix vperm codegen
Maryam Moghadas [Fri, 25 Nov 2022 21:58:00 +0000 (15:58 -0600)]
[PowerPC] Fix vperm codegen

Commit rG934d5fa2b8672695c335deed0e19d0e777c98403 changed the vperm codegen
for cases that vperm is not replaced by xxperm, this patch is to revert that.

Reviewed By: stefanp

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

19 months agoRevert "enable code-object-version=5"
Ron Lieberman [Tue, 29 Nov 2022 21:21:09 +0000 (15:21 -0600)]
Revert "enable code-object-version=5"

very sorry wrong repo.

This reverts commit d882ba7aeac4b496dccd1b10cb58bd691786b691.

19 months agoRevert "Add mean_anyway to hpc config"
Ron Lieberman [Tue, 29 Nov 2022 21:19:44 +0000 (15:19 -0600)]
Revert "Add mean_anyway to hpc config"

my bad, wrong repo ,so sorry.

This reverts commit 0b9350f3da7daf1d740bbbfab79d01613fcd29f4.

19 months ago[clang][driver][darwin] Enforce consistent major version limit for any Darwin OS
Alex Lorenz [Tue, 29 Nov 2022 21:12:22 +0000 (13:12 -0800)]
[clang][driver][darwin] Enforce consistent major version limit for any Darwin OS

Limit can also be bumped up to 999 to allow OS versions over 100

19 months ago[openmp] [test] Use stdint.h instead of manual code defining kmp_int*. NFC.
Martin Storsjö [Mon, 28 Nov 2022 15:08:05 +0000 (17:08 +0200)]
[openmp] [test] Use stdint.h instead of manual code defining kmp_int*. NFC.

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

19 months agoReapply [openmp] [test] XFAIL many-microtask-args.c on ARM
Martin Storsjö [Fri, 25 Nov 2022 14:26:50 +0000 (16:26 +0200)]
Reapply [openmp] [test] XFAIL many-microtask-args.c on ARM

On ARM, a C fallback version of __kmp_invoke_microtask is used,
which only handles up to a fixed number of arguments - while
many-microtask-args.c tests that the function can handle an
arbitrarily large number of arguments (the testcase produces 17
arguments).

On the CMake level, we can't add ${LIBOMP_ARCH} directly to
OPENMP_TEST_COMPILER_FEATURES in OpenMPTesting.cmake, since
that file is parsed before LIBOMP_ARCH is set. Instead
convert the feature list into a proper CMake list, and append
${LIBOMP_ARCH} into it before serializing it to an Python array.

Reapply: Make sure OPENMP_TEST_COMPILER_FEATURES is defined
properly in all other test subdirectories other than
runtime/test too.

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

19 months ago[clang] [MinGW] Improve detection of libstdc++ headers on Fedora
Martin Storsjö [Tue, 22 Nov 2022 12:39:39 +0000 (14:39 +0200)]
[clang] [MinGW] Improve detection of libstdc++ headers on Fedora

There's some variation in where different toolchain distributions
(and linux distributions) package the mingw sysroots - this is
so far handled by adding specific known subdirectory paths
to the include and lib directory lists.

There are multiple degrees of combinatorics involved here though;
the distros may use different locations such as
/usr/x86_64-w64-mingw32/include or
/usr/x86_64-w64-mingw32/sys-root/mingw/include.

So far, this setup has been treated as base=/usr, subdir=x86_64-w64-mingw32,
and the driver tries to add further subdirectories such as
<base>/<subdir>/include, <base>/<subdir>/sys-root/mingw/include.

When it comes to libstdc++ (and libc++), each of these come with
a large number of potential subdirectories. Instead of further
exploding the combinatorics another step by adding all combinations
of all paths, check whether <base>/<subdir>/sys-root/mingw/include
exists, and if it does, append that subpath into the subdir variable.

This allows finding libstdc++ headers in e.g.
/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/x86_64-w64-mingw32
on Fedora.

The same logic (where everything belonging to this target fits
under one expanded <subdir> path, with just /include and /lib
under it) doesn't seem to apply on Gentoo, where the includes
are found in <base>/<subdir>/usr/include while the libraries
are in <base>/<subdir>/mingw/lib (see
8e218026f8d5eabfdef9141ae5e26aa91d1933e6). But apparently
the libstdc++ headers aren't installed under
<base>/<subdir>/usr/include, so that path hierarchy quirk doesn't
need to be taken into account in AddClangCXXStdlibIncludeArgs.

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

19 months ago[clang] [MinGW] Improve/extend the gcc/sysroot detection logic
Martin Storsjö [Tue, 22 Nov 2022 12:38:54 +0000 (14:38 +0200)]
[clang] [MinGW] Improve/extend the gcc/sysroot detection logic

There are three functions that try to detect the right implicit
sysroot and libgcc directory setup to use
- One which looks for mingw sysroots located in
  <clangbin>/../<sysrootname>
- One which looks for a mingw-targeting gcc executables in the PATH
- One which looks in the <gccroot>/lib/gcc directory to find the
  right one to use, and the right specific triple used for arch
  specific directories in the gcc/libstdc++ install

These have mostly tried to look for executables named
"<arch>-w64-mingw32-gcc" or "mingw32-gcc" or subdirectories
named "<arch>-w64-mingw32" or "mingw32".

In the case of findClangRelativeSysroot, it also has looked
for directories with the name of the actual triple. This
was added in deff7536278d355977171726124f83aa4bb95419,
with the intent of looking for a directory matching exactly
the user provided literal triple - however the triple here
is the normalized one, not the one provided by the user on
the command line.

Improve and unify this logic somewhat:
- Always first look for things based on the literal triple
  provided by the user.
- Secondly look for things based on the normalized triple
  (which usually ends up as e.g. x86_64-w64-windows-gnu),
  accessed via the Triple which is passed to the constructor
- Then look for the common triple form <arch>-w64-mingw32

The literal triple provided by the user is available via
Driver::getTargetTriple(), but computeTargetTriple() may
change e.g. the architecture of it, so we need to
reapply the effective architecture on the literal triple
spelling from Driver::getTargetTriple().

Do this consistently for all of findGcc, findClangRelativeSysroot
and findGccLibDir (while keeping the existing plain "mingw32"
cases in findGcc and findGccLibDir too).

Fedora 37 started shipping mingw sysroots targeting UCRT,
in addition to the traditional msvcrt.dll, and these use
triples in the form <arch>-w64-mingw32ucrt - see
https://fedoraproject.org/wiki/Changes/F37MingwUCRT.

Thus, in addition to the existing default tested triples,
try looking for triples in the form <arch>-w64-mingw32ucrt,
to automatically find the UCRT sysroots on Fedora 37.
By explicitly setting a specific target on the Clang command
line, the user can be more explicit with which flavour is
to be preferred.

This should fix the main issue in
https://github.com/llvm/llvm-project/issues/59001.

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

19 months agoAMDGPU: Remove BufferPseudoSourceValue
Nicolai Hähnle [Fri, 25 Nov 2022 06:21:54 +0000 (07:21 +0100)]
AMDGPU: Remove BufferPseudoSourceValue

The use of a PSV for buffer intrinsics is misleading because it may be
misinterpreted as all buffer intrinsics accessing the same address in
memory, which is clearly not true.

Instead, build MachineMemOperands without a pointer value but with an
address space, so that address space-based alias analysis can still
work.

There is a lot of test churn because previously address space 4
(constant address space) was used as an address space for buffer
intrinsics. This doesn't make much sense and seems to have been an
accident -- see the change in
AMDGPUTargetMachine::getAddressSpaceForPseudoSourceKind.

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

19 months agoAdd mean_anyway to hpc config
Ron Lieberman [Tue, 29 Nov 2022 21:11:48 +0000 (15:11 -0600)]
Add mean_anyway to hpc config

19 months agoenable code-object-version=5
Ron Lieberman [Tue, 29 Nov 2022 20:12:05 +0000 (14:12 -0600)]
enable code-object-version=5

19 months ago[FuzzMutate] Fix a bug in `connectToSink` which might invalidate the whole module.
Peter Rong [Tue, 29 Nov 2022 03:50:59 +0000 (19:50 -0800)]
[FuzzMutate] Fix a bug in `connectToSink` which might invalidate the whole module.

`connectToSink` uses a value by putting it in a future instruction.
It will replace the operand of a future instruction with the current value.

However, if current value is an `Instruction` and put into a switch case, the module is invalid.
We fix that by only connecting to Br/Switch's condition, and don't touch other operands.

Will have other strategies to mutate other Br/Switch operands to be patched once this patch is passed

Reviewed By: arsenm

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

19 months ago[libc] Fix test not including 'free'
Joseph Huber [Tue, 29 Nov 2022 21:03:00 +0000 (15:03 -0600)]
[libc] Fix test not including 'free'

Summary:
A previous change removed a transient inclusion of `stdlib.h` from the
`string_utils.h` file which this test depended on. Include it directly
here.

19 months ago[msan] Increase size of app/shadow/origin mappings on aarch64
Thurston Dang [Tue, 8 Nov 2022 20:53:20 +0000 (20:53 +0000)]
[msan] Increase size of app/shadow/origin mappings on aarch64

msan's app memory mappings for aarch64 are constrained by
the MEM_TO_SHADOW constant to 64GB or less, and some app
memory mappings (in kMemoryLayout) are even smaller in
practice. This will lead to a crash with the error message
"MemorySanitizer can not mmap the shadow memory" if the
executable's memory mappings (e.g., libraries) extend
beyond msan's app memory mappings.

This patch makes the app/shadow/origin memory mappings
considerably larger, along with corresponding changes to
the MEM_TO_SHADOW and SHADOW_TO_ORIGIN constants.

Note that this deprecates compatibility with 39- and 42-bit
VMAs.

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

19 months ago[libc][docs] Add documentation for the new GPU mode
Joseph Huber [Mon, 28 Nov 2022 20:54:30 +0000 (14:54 -0600)]
[libc][docs] Add documentation for the new GPU mode

This patch introduces documentation for the new GPU mode added in
D138608. The documentation includes instructions for building and using
the library, along with a description of the supported functions and
headers.

Reviewed By: sivachandra, lntue, michaelrj

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

19 months ago[libc] Add initial support for a libc implementation for the GPU
Joseph Huber [Tue, 22 Nov 2022 20:45:38 +0000 (14:45 -0600)]
[libc] Add initial support for a libc implementation for the GPU

This patch contains the initial support for building LLVM's libc as a
target for the GPU. Currently this only supports a handful of very basic
functions that can be implemented without an operating system. The GPU
code is build using the existing OpenMP toolchain. This allows us to
minimally change the existing codebase and get a functioning static
library. This patch allows users to create a static library called
`libcgpu.a` that contains fat binaries containing device IR.

Current limitations are the lack of test support and the fact that only
one target OS can be built at a time. That is, the user cannot get a
`libc` for Linux and one for the GPU simultaneously.

This introduces two new CMake variables to control the behavior
`LLVM_LIBC_TARET_OS` is exported so the user can now specify it to equal
`"gpu"`. `LLVM_LIBC_GPU_ARCHITECTURES` is also used to configure how
many targets to build for at once.

Depends on D138607

Reviewed By: sivachandra

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

19 months ago[libc] Move strdup implementation to a new header
Joseph Huber [Tue, 22 Nov 2022 20:59:13 +0000 (14:59 -0600)]
[libc] Move strdup implementation to a new header

The `strdup` family of functions rely on `malloc` to be implemented.
Its presence in the `string_utils.h` header meant that compiling many of
the string functions relied on `malloc` being implementated as well.
This patch simply moves the implementation into a new file to avoid
including `stdlib.h` from the other string functions. This was a barrier
for compiling string functions for the GPU where there is no malloc
currently.

Reviewed By: sivachandra

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

19 months ago[gn build] Port 185d4964a158
LLVM GN Syncbot [Tue, 29 Nov 2022 20:47:01 +0000 (20:47 +0000)]
[gn build] Port 185d4964a158

19 months ago[lldb] Introduce dwim-print command
Dave Lee [Fri, 18 Nov 2022 01:11:30 +0000 (17:11 -0800)]
[lldb] Introduce dwim-print command

Implements `dwim-print`, a printing command that chooses the most direct,
efficient, and resilient means of printing a given expression.

DWIM is an acronym for Do What I Mean. From Wikipedia, DWIM is described as:

  > attempt to anticipate what users intend to do, correcting trivial errors
  > automatically rather than blindly executing users' explicit but
  > potentially incorrect input

The `dwim-print` command serves as a single print command for users who don't
yet know, or prefer not to know, the various lldb commands that can be used to
print, and when to use them.

This initial implementation is the base foundation for `dwim-print`. It accepts
no flags, only an expression. If the expression is the name of a variable in
the frame, then effectively `frame variable` is used to get, and print, its
value. Otherwise, printing falls back to using `expression` evaluation. In this
initial version, frame variable paths will be handled with `expression`.

Following this, there are a number of improvements that can be made. Some
improvements include supporting `frame variable` expressions or registers.

To provide transparency, especially as the `dwim-print` command evolves, a new
setting is also introduced: `dwim-print-verbosity`. This setting instructs
`dwim-print` to optionally print a message showing the effective command being
run. For example `dwim-print var.meth()` can print a message such as: "note:
ran `expression var.meth()`".

See https://discourse.llvm.org/t/dwim-print-command/66078 for the proposal and
discussion.

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

19 months ago[mlir][sparse] Improve concatenate operator rewrite for annotated all dense dimension...
bixia1 [Tue, 29 Nov 2022 17:19:24 +0000 (09:19 -0800)]
[mlir][sparse] Improve concatenate operator rewrite for annotated all dense dimensions results.

Reviewed By: aartbik

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

19 months ago[Windows] Convert llvm/test/ExecutionEngine/MCJIT/remote tests to check 'target=...
Paul Robinson [Tue, 29 Nov 2022 20:18:38 +0000 (12:18 -0800)]
[Windows] Convert llvm/test/ExecutionEngine/MCJIT/remote tests to check 'target=<triple>'

Part of the project to eliminate special handling for triples in lit
expressions.

19 months ago[Hexagon] Simplify logic for generating code for contracting shuffles
Krzysztof Parzyszek [Tue, 29 Nov 2022 16:32:03 +0000 (08:32 -0800)]
[Hexagon] Simplify logic for generating code for contracting shuffles

Add functions that generate masks for the HVX instructions we were
targeting. This is both simpler than analyzing the masks, and these
functions may also be used in other places.

19 months ago[Windows] Convert clang/test/Modules tests to check 'target=<triple>'
Paul Robinson [Tue, 29 Nov 2022 20:14:10 +0000 (12:14 -0800)]
[Windows] Convert clang/test/Modules tests to check 'target=<triple>'

Part of the project to eliminate special handling for triples in lit
expressions.

19 months agoRevert "[SystemZ] change test to mir to better isolate miscompile; NFC"
Sanjay Patel [Tue, 29 Nov 2022 20:05:46 +0000 (15:05 -0500)]
Revert "[SystemZ] change test to mir to better isolate miscompile; NFC"

This reverts commit 8076c70d6a2a21d18713458996732f5231d61f43.
After discussion in D137791, a test that shows a miscompile
is better than the more isolated test for a transform (that
may not be wrong in all cases).

19 months ago[RISCV] Add test coverage for vector constant materialization costs on arithmetic...
Philip Reames [Tue, 29 Nov 2022 19:54:09 +0000 (11:54 -0800)]
[RISCV] Add test coverage for vector constant materialization costs on arithmetic instructions

19 months ago[clang] Fix buildbot failure in delayed-template-with-pragma.cpp
Mike Rice [Tue, 29 Nov 2022 19:41:09 +0000 (11:41 -0800)]
[clang] Fix buildbot failure in delayed-template-with-pragma.cpp

Use captured values to match loop metadata.

19 months ago[RISCV] Add cost model coverage for vector arithmetic
Philip Reames [Tue, 29 Nov 2022 19:46:06 +0000 (11:46 -0800)]
[RISCV] Add cost model coverage for vector arithmetic

19 months ago[flang] Use BaseBoxType in component by component assignment
Valentin Clement [Tue, 29 Nov 2022 19:44:42 +0000 (20:44 +0100)]
[flang] Use BaseBoxType in component by component assignment

Use BaseBoxType in `genComponentByComponentAssignment`
so the component by component assignment involving polymorphic entities
does not fall back to scalar assignment.

Reviewed By: PeteSteinfeld

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

19 months agoAdd test coverage for more C DRs
Aaron Ballman [Tue, 29 Nov 2022 19:43:45 +0000 (14:43 -0500)]
Add test coverage for more C DRs

This completes the initial pass over all of the C DRs.

19 months ago[AMDGPU] Unify uniform return and divergent unreachable blocks
Brendon Cahoon [Thu, 27 Oct 2022 21:27:50 +0000 (16:27 -0500)]
[AMDGPU] Unify uniform return and divergent unreachable blocks

This patch fixes a "failed to annotate CFG" error in
SIAnnotateControlFlow. The problem occurs when there are
divergent and uniform unreachable/return blocks in the same
region. In this case, AMDGPUUnifyDivergentExitNodes does not
create a unified block so the region contains multiple exits.

StructurizeCFG does not work properly when there are multiple
exits, so the neccessary CFG transformations do not occur along
divergent control flow. Subsequently, SIAnnotateControlFlow
processes the path to the divergent exit block, but may only
partially process blocks along a unform control flow path to
another exit block.

This patch fixes the bug by creating a single exit block when
there is a divergent exit block in the function.

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

19 months ago[OpenMP][OMPIRBuilder] Migrate target outlined function registration to OMPIRBuilder...
Jan Sjodin [Mon, 7 Nov 2022 20:27:50 +0000 (15:27 -0500)]
[OpenMP][OMPIRBuilder] Migrate target outlined function registration to OMPIRBuilder from clang

This patch moves the outlined function registration, function attribute
configuration and function ID creation to the OpenMPIRBuilder. This will later
be used by flag as well.

Reviewed By: jdoerfert

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

19 months ago[lld-macho] Reject -no_pie for unsupported archs
Keith Smiley [Tue, 29 Nov 2022 01:44:53 +0000 (17:44 -0800)]
[lld-macho] Reject -no_pie for unsupported archs

ld64 rejects `-no_pie` when targeting arm64, this mirrors that behavior.
Newer versions of ld64 also reject it based on minimum OS versions, but
that logic isn't in an open source dump yet so it isn't implemented
here.

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

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

19 months ago[flang][doc] Remove DCMPLX intrinsic from the Intrinsic Procedures Lacking Support...
Kelvin Li [Mon, 28 Nov 2022 19:45:10 +0000 (14:45 -0500)]
[flang][doc] Remove DCMPLX intrinsic from the Intrinsic Procedures Lacking Support list

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

19 months ago[WebAssembly] Move debug tests into DebugInfo
Heejin Ahn [Mon, 28 Nov 2022 23:28:14 +0000 (15:28 -0800)]
[WebAssembly] Move debug tests into DebugInfo

This moves debug info tests in `test/CodeGen/WebAssembly` into
`test/DebugInfo/WebAssembly`, to gather all wasm debug info related
tests there.

Reviewed By: dschuff

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

19 months ago[BOLT] Fix unused function warnings
Kazu Hirata [Tue, 29 Nov 2022 19:13:14 +0000 (11:13 -0800)]
[BOLT] Fix unused function warnings

This patch fixes:

  bolt/lib/Passes/CallGraph.cpp:27:15: error: unused function
  'hash_int64_fallback' [-Werror,-Wunused-function]

  bolt/lib/Passes/CallGraph.cpp:40:15: error: unused function
  'hash_int64' [-Werror,-Wunused-function]

19 months ago[libc++abi][LIT][AIX] Use Vector instructions available on Power7 in vec_reg_restore...
Xing Xue [Tue, 29 Nov 2022 19:08:03 +0000 (14:08 -0500)]
[libc++abi][LIT][AIX] Use Vector instructions available on Power7 in vec_reg_restore.pass.cpp

Summary:
libc++abi LIT test case vec_reg_restore.pass.cpp for AIX uses instructions mtvsrd and mfvsrd that are only available on Power8 CPU and higher, and therefore, fails on Power7 which is supported by the current AIX Clang. This patch replaces mtvsrd/mfvsrd with vector instructions available on Power7.

Reviewed by: nemanjai

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

19 months ago[RISCV] Separate out helper for checking if vector splat supported for operand [nfc]
Philip Reames [Tue, 29 Nov 2022 19:05:04 +0000 (11:05 -0800)]
[RISCV] Separate out helper for checking if vector splat supported for operand [nfc]

19 months ago[flang] Add support for LSHIFT and RSHIFT intrinsics
Kelvin Li [Mon, 28 Nov 2022 19:02:16 +0000 (14:02 -0500)]
[flang] Add support for LSHIFT and RSHIFT intrinsics

The functionality of LSHIFT and RSHIFT intrinsics is the same as the
standard SHIFTL and SHIFTA intrinsics respectively. The patch is to
alias the two intrinsics to the standardized ones.

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

19 months ago[NFC][asan] Simplify parameters check
Vitaly Buka [Mon, 28 Nov 2022 00:24:05 +0000 (16:24 -0800)]
[NFC][asan] Simplify parameters check

19 months ago[NFC][asan] Cleanup comments
Vitaly Buka [Mon, 28 Nov 2022 06:48:58 +0000 (22:48 -0800)]
[NFC][asan] Cleanup comments

D132090 is too verbose.
Don't explain obvious.
Add simpler explanation of rounding reasoning.

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

19 months ago[NFC][asan] Handle non-intersecting case early
Vitaly Buka [Mon, 28 Nov 2022 06:45:13 +0000 (22:45 -0800)]
[NFC][asan] Handle non-intersecting case early

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

19 months ago[asan] Add unaligned double ended container support
Vitaly Buka [Mon, 28 Nov 2022 00:19:57 +0000 (16:19 -0800)]
[asan] Add unaligned double ended container support

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

19 months ago[clang] Add serialization for loop hint annotation tokens
Mike Rice [Mon, 21 Nov 2022 18:56:05 +0000 (10:56 -0800)]
[clang] Add serialization for loop hint annotation tokens

When late parsed templates are used with PCH tokens are serialized. The
existing code does not handle annotation tokens which can occur due to
various pragmas.

This patch implements the serialization for annot_pragma_loop_hint.

This also enables use of OpenMP pragmas and #pragma unused which do not
need special serialization of the PtrData field.

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

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

19 months ago[lbc++] Implement the rest of P0600R1 (nodiscard in the library)
Nikolas Klauser [Tue, 29 Nov 2022 18:42:16 +0000 (19:42 +0100)]
[lbc++] Implement the rest of P0600R1 (nodiscard in the library)

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

19 months ago[libc++] Don't pass the allocator in substr()
Nikolas Klauser [Tue, 29 Nov 2022 18:39:29 +0000 (19:39 +0100)]
[libc++] Don't pass the allocator in substr()

This bug was dicoved when implementing P2438R2.

Fixes #57190

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

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

19 months ago[Clang] Fix Sema::ClassifyName so that it classifies EnumConstantDecl as NonType...
Shafik Yaghmour [Tue, 29 Nov 2022 18:35:24 +0000 (10:35 -0800)]
[Clang] Fix Sema::ClassifyName so that it classifies EnumConstantDecl as NonType when they are brought into scope via using enum

Currently Sema::ClassifyName(...) in some cases when an enumerator is brought
into scope via using enum during lookup it can end up being classified as an
OverloadSet. It looks like this was never accounted for when using enum support
was implemented and we need to add a check to allow an EnumConstantDecl to be
classified as NonType even when it is a class member.

This fixes:
  https://github.com/llvm/llvm-project/issues/58057
  https://github.com/llvm/llvm-project/issues/59014
  https://github.com/llvm/llvm-project/issues/54746

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

19 months ago[Windows] Convert tests to check 'target=<triple>'
Paul Robinson [Tue, 29 Nov 2022 18:32:01 +0000 (10:32 -0800)]
[Windows] Convert tests to check 'target=<triple>'

Part of the project to eliminate special handling for triples in lit
expressions.

19 months ago[NFC] Fix indentation in td file
Lei Huang [Tue, 29 Nov 2022 18:11:06 +0000 (12:11 -0600)]
[NFC] Fix indentation in td file

19 months ago[PCH] Remove useless UNSUPPORTED clause
Paul Robinson [Tue, 29 Nov 2022 18:07:10 +0000 (10:07 -0800)]
[PCH] Remove useless UNSUPPORTED clause

"win32" is never defined as a lit feature, AFAICT, and Windows bots
appear to be running this just fine.

Part of the project to eliminate special handling for triples in lit expressions.

19 months ago[asan][test] Fix SED issues with macOS (BSD)
Roy Sundahl [Mon, 28 Nov 2022 16:29:23 +0000 (08:29 -0800)]
[asan][test] Fix SED issues with macOS (BSD)

SED differs between GNU and BSD in handling semicolon and the use of
'\n' in regex patterns. For macOS we can't use these GNU extensions.

rdar://102686948

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

19 months ago[AMDGPU] Use GCNSubtarget::hasInstPrefetch instead of generation check. NFC.
Jay Foad [Tue, 29 Nov 2022 17:25:55 +0000 (17:25 +0000)]
[AMDGPU] Use GCNSubtarget::hasInstPrefetch instead of generation check. NFC.

19 months agoAMDGPU: Fix broken test
Matt Arsenault [Tue, 29 Nov 2022 17:33:15 +0000 (12:33 -0500)]
AMDGPU: Fix broken test

From ee29a846c622b52d82e208146a028cf866351fde

19 months ago[flang] Lower F08 FINDLOC intrinsic
Tarun Prabhu [Tue, 29 Nov 2022 16:34:58 +0000 (09:34 -0700)]
[flang] Lower F08 FINDLOC intrinsic

The implementation follows the patterns established by the lowering of other
similar intrinsics.

In addition to the code for lowering, the DoTotalReduction template had to be
fixed to correctly break when signaled to do so by the accumulator function.

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

19 months ago[flang] Remove warnings that fast-math options are unimplemented
Tom Eccles [Tue, 29 Nov 2022 11:06:27 +0000 (11:06 +0000)]
[flang] Remove warnings that fast-math options are unimplemented

These are now fully implemented, see
https://reviews.llvm.org/D137390
https://reviews.llvm.org/D137391
https://reviews.llvm.org/D137456
https://reviews.llvm.org/D137580
https://reviews.llvm.org/D137602
https://reviews.llvm.org/D138048

These flags are still tested in
flang/test/Driver/frontend-forwarding.f90 and
flang/test/Lower/fast-math-arithmetic.f90

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

19 months ago[lit] UNSUPPORTED ps4/ps5 => target={{.*-ps(4|5)}}
Paul Robinson [Tue, 29 Nov 2022 17:07:31 +0000 (09:07 -0800)]
[lit] UNSUPPORTED ps4/ps5 => target={{.*-ps(4|5)}}

Part of the project to eliminate special handling for triples in lit expressions.

19 months ago[lldb] Make SWIG an auto-detected dependency
Jonas Devlieghere [Tue, 29 Nov 2022 16:46:21 +0000 (08:46 -0800)]
[lldb] Make SWIG an auto-detected dependency

This patch makes SWIG itself an auto-detected dependency. This allows us
to look for SWIG once in a centralized place and makes it easier
downstream to detect whether to use the static bindings.

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

19 months agoRevert "Use-after-return sanitizer binary metadata"
Kazu Hirata [Tue, 29 Nov 2022 17:04:00 +0000 (09:04 -0800)]
Revert "Use-after-return sanitizer binary metadata"

This reverts commit a1255dc467f7ce57a966efa76bbbb4ee91d9115a.

This patch results in:

  llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp:57:17: error: no member
  named 'size' in 'llvm::MDTuple'

19 months agoFix Clang sphinx build
Aaron Ballman [Tue, 29 Nov 2022 17:01:25 +0000 (12:01 -0500)]
Fix Clang sphinx build

This addresses the issue found by:
https://lab.llvm.org/buildbot/#/builders/92/builds/36372

19 months ago[PS4] Remove an UNSUPPORTED, this test seems to work now
Paul Robinson [Tue, 29 Nov 2022 16:57:02 +0000 (08:57 -0800)]
[PS4] Remove an UNSUPPORTED, this test seems to work now

19 months agoDAG: Fix assert when alloca has inconsistent pointer size
Matt Arsenault [Tue, 29 Nov 2022 04:34:18 +0000 (23:34 -0500)]
DAG: Fix assert when alloca has inconsistent pointer size

Take the type from the alloca, not the type to use for allocas.

Fixes issue 59250.

19 months agoclang: Fix cast failure when using -fsanitize=undefined for HIP
Matt Arsenault [Mon, 21 Nov 2022 02:30:19 +0000 (18:30 -0800)]
clang: Fix cast failure when using -fsanitize=undefined for HIP

This was assuming a direct reference to the global variable. The
constant string is placed in addrspace 4, and has a constexpr
addrspacecast to the generic address space.

19 months agoUse-after-return sanitizer binary metadata
Dmitry Vyukov [Mon, 17 Oct 2022 13:13:56 +0000 (15:13 +0200)]
Use-after-return sanitizer binary metadata

Currently per-function metadata consists of:
(start-pc, size, features)

This adds a new UAR feature and if it's set an additional element:
(start-pc, size, features, stack-args-size)

Reviewed By: melver

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

19 months ago[AMDGPU] Add error line number checking
Jay Foad [Tue, 29 Nov 2022 13:18:24 +0000 (13:18 +0000)]
[AMDGPU] Add error line number checking

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

19 months ago[SDAG] Allow scalable vectors in ComputeNumSignBits (try 2)
Philip Reames [Tue, 29 Nov 2022 16:14:48 +0000 (08:14 -0800)]
[SDAG] Allow scalable vectors in ComputeNumSignBits (try 2)

I had reverted this before the holiday week because a problem was reported with a related change (D137140 - scalable vector known bits in DAG).  I had initially confused the two patches, and then decided to leave this reverted out an abundance of caution.  Now that we're through the holiday week, reapplying.

I also roled in fixes for several post commit review comments that hadn't landed with the original change.

Original commit message

This is a continuation of the series of patches adding lane wise support for scalable vectors in various knownbit-esq routines.

The basic idea here is that we track a single lane for scalable vectors which corresponds to an unknown number of lanes at runtime. This is enough for us to perform lane wise reasoning on many arithmetic operations.

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

19 months ago[Clang] Implement CWG2654: Un-deprecation of compound volatile assignments
Corentin Jabot [Tue, 29 Nov 2022 14:31:21 +0000 (15:31 +0100)]
[Clang] Implement CWG2654: Un-deprecation of compound volatile assignments

Reviewed By: #clang-language-wg, erichkeane

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

19 months agoAMDGPU: Remove unnecessary metadata from test
Matt Arsenault [Tue, 29 Nov 2022 15:59:14 +0000 (10:59 -0500)]
AMDGPU: Remove unnecessary metadata from test

The pass isn't doing anything with it, and the line wrapping is
confusing update_test_checks.

19 months ago[Coroutines] createStructType takes alignment in bits but receives bytes
Guillaume Chatelet [Mon, 28 Nov 2022 10:54:34 +0000 (10:54 +0000)]
[Coroutines] createStructType takes alignment in bits but receives bytes

This has been found while trying to remove the last few places relying on `unsigned` to convey alignment operations.
This seems to be untested.

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

19 months ago[AMDGPU] Add support for new LLVM vector types
Mateja Marjanovic [Thu, 17 Nov 2022 10:58:14 +0000 (11:58 +0100)]
[AMDGPU] Add support for new LLVM vector types

Add VReg, AReg and SReg on AMDGPU for bit widths: 288, 320, 352 and 384.

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

19 months agoAdd new vector types for LLVM
Mateja Marjanovic [Thu, 17 Nov 2022 10:04:24 +0000 (11:04 +0100)]
Add new vector types for LLVM

Add v9i32, v9f32, v10i32, v10f32, v11i32, v11f32, v12i32 and v12f32.

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

19 months agoUtils: Fix appending to global_ctors with program address spaces
Matt Arsenault [Tue, 29 Nov 2022 15:31:20 +0000 (10:31 -0500)]
Utils: Fix appending to global_ctors with program address spaces

Also fix constructing sanitizer constructors in address space 0 so
it's testable (this was also failing the verifier on the type of
global_ctors).

19 months ago[AArch64] Extend testing for widening conditions under SVE. NFC
David Green [Tue, 29 Nov 2022 15:53:39 +0000 (15:53 +0000)]
[AArch64] Extend testing for widening conditions under SVE. NFC

19 months ago[Libomptarget][NFC] Add missing LLVM header
Joseph Huber [Tue, 29 Nov 2022 15:46:33 +0000 (09:46 -0600)]
[Libomptarget][NFC] Add missing LLVM header

19 months ago[LinkerWrapper] Ignore OFK_None kinds for building registration code
Joseph Huber [Tue, 29 Nov 2022 15:42:03 +0000 (09:42 -0600)]
[LinkerWrapper] Ignore OFK_None kinds for building registration code

Summary:
The linker wrapper uses this metadata to determine which registration
code to emit, e.g. CUDA, HIP or OpenMP. If we encounter an OFK_None we
should just ignore it.

19 months ago[AMDGPU][MC][GFX11] Correct op_sel handling for permlane*16
Dmitry Preobrazhensky [Tue, 29 Nov 2022 15:15:21 +0000 (18:15 +0300)]
[AMDGPU][MC][GFX11] Correct op_sel handling for permlane*16

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

19 months ago[AIX][pg] Add Correct Search Paths for Profiled Libraries
Michael Francis [Thu, 10 Nov 2022 21:50:53 +0000 (21:50 +0000)]
[AIX][pg] Add Correct Search Paths for Profiled Libraries

On AIX, profiled system libraries are stored at `/lib/profiled` and
`/usr/lib/profiled`. When compiling with `-pg`, we want to link against
libraries in those directories. This PR modifies the AIX toolchain to
add those directories to the linker search paths.

Differential Review: https://reviews.llvm.org/D137375

19 months ago[NFC][ORC] Fix lljit-with-thinlto-summaries.test output ordering issue
Filipp Zhinkin [Tue, 29 Nov 2022 13:16:37 +0000 (16:16 +0300)]
[NFC][ORC] Fix lljit-with-thinlto-summaries.test output ordering issue

Use CHECK-DAG to check module names that printed in order depending
on full file path.

Related issue: https://github.com/llvm/llvm-project/issues/59248

Reviewed By: sgraenitz

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

19 months agollvm-reduce: Add some missing consts
Matt Arsenault [Tue, 29 Nov 2022 14:00:51 +0000 (09:00 -0500)]
llvm-reduce: Add some missing consts

19 months ago[include-cleaner] Implement IWYU begin_keep/end_keep pragma support.
Viktoriia Bakalova [Mon, 28 Nov 2022 13:35:59 +0000 (13:35 +0000)]
[include-cleaner] Implement IWYU begin_keep/end_keep pragma support.

Implement support for begin_keep/end_keep pragmas.

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

19 months ago[clang] Propely handle tests for open DRs in make_cxx_dr_status
Vlad Serebrennikov [Tue, 29 Nov 2022 14:46:47 +0000 (06:46 -0800)]
[clang] Propely handle tests for open DRs in make_cxx_dr_status

A follow-up to D136133. It was mentioned in #58382 that there is a need
to test for DRs that have not been officially resolved yet. This patch
aims to replace original "hackery" with proper handling for such cases.
Highlights:

- Availability can be suffixed (further) with "open", "drafting", or
  "review", e.g. // dr2565: 16 open, // drXXXX: 16 c++17 drafting
- Checks are implemented to ensure that this suffix corresponds to
  actual issue status
- Non-resolved DRs are counted (stdout of make_cxx_dr_status)
- No changes made to cxx_dr_status.html
- 'c++20' availability suffix added
- Remove 'concurrency' status since it's no longer
  on the list of statuses in CWG Active Issues

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

19 months ago[SLP]Fix PR59230: Use actual vector factor when sorting entries.
Alexey Bataev [Mon, 28 Nov 2022 14:30:44 +0000 (06:30 -0800)]
[SLP]Fix PR59230: Use actual vector factor when sorting entries.

When we sort entries for attempting to reorder scalars, need to use
actual vectorization factor, not the number of scalars. Otherwise the
compiler crashes, if the scalars has to be reordered.

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

19 months ago[InstSimplify] Fold !(X || Y) && X --> false
chenglin.bi [Tue, 29 Nov 2022 14:45:04 +0000 (22:45 +0800)]
[InstSimplify] Fold !(X || Y) && X --> false

!(X || Y) && X --> false
https://alive2.llvm.org/ce/z/693Jgv

Fix: [56654](https://github.com/llvm/llvm-project/issues/56654)
Fix: [56780](https://github.com/llvm/llvm-project/issues/56780)

Reviewed By: spatel

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

19 months ago[AMDGPU][MC][MI100+] Enable VOP3 variants of dot2c/dot4c/dot8c opcodes
Dmitry Preobrazhensky [Tue, 29 Nov 2022 14:35:46 +0000 (17:35 +0300)]
[AMDGPU][MC][MI100+] Enable VOP3 variants of dot2c/dot4c/dot8c opcodes

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

19 months ago[mlir][linalg] Allow some fusion on mixed generics
Ivan Butygin [Thu, 24 Nov 2022 02:45:04 +0000 (03:45 +0100)]
[mlir][linalg] Allow some fusion on mixed generics

Relax linalg elementwise fusion check to allow mixed consumers. Producer is still required to be fully tensor to avoid potential memref aliasing.

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

19 months ago[include-cleaner] Fix -Woverloaded-virtual warning, NFC.
Haojian Wu [Tue, 29 Nov 2022 14:04:28 +0000 (15:04 +0100)]
[include-cleaner] Fix -Woverloaded-virtual warning, NFC.

19 months ago[InstSimplify] Fold (X || Y) ? false : X --> false
chenglin.bi [Tue, 29 Nov 2022 13:58:38 +0000 (21:58 +0800)]
[InstSimplify] Fold (X || Y) ? false : X --> false

(X || Y) ? false : X --> false
https://alive2.llvm.org/ce/z/y93yUm

Reviewed By: spatel

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

19 months ago[mlir][spirv] Add group ops
Ivan Butygin [Sun, 27 Nov 2022 11:54:17 +0000 (12:54 +0100)]
[mlir][spirv] Add group ops

Also, gen_spirv_dialect script was broken was broken due to SPV->SPIRV renamings.

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

19 months ago[clang] Update CWG2635 status
Vlad Serebrennikov [Tue, 29 Nov 2022 13:54:34 +0000 (05:54 -0800)]
[clang] Update CWG2635 status

A follow-up to D138852. Apparently cxx_dr_status.html was changed
manually there, since make_cxx_dr_status script doesn't generate the
same HTML after that patch landed.

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

19 months ago[OpenCL] Remove arm-integer-dot-product extension pragmas
Sven van Haastregt [Tue, 29 Nov 2022 13:26:50 +0000 (13:26 +0000)]
[OpenCL] Remove arm-integer-dot-product extension pragmas

This extension only adds builtin functions and thus doesn't need to be
included as an extension.  Instead of a pragma, the builtin functions
of the extension can be exposed through enabling preprocessor defines.

19 months agoRevert "Cache memory buffer's name length"
Florian Hahn [Tue, 29 Nov 2022 13:22:52 +0000 (13:22 +0000)]
Revert "Cache memory buffer's name length"

This reverts commit 1824432174b3166b40bce59477beb5821170748e.

The change triggers an assertion when building clang on macOS:

FAILED: tools/clang/include/clang/Tooling/Syntax/Nodes.inc
cd /Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1 && /Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1/bin/clang-tblgen -gen-clang-syntax-node-list -I /Users/florianhahn/projects/llvm-project/clang/include/clang/Tooling/Syntax -I/Users/florianhahn/projects/llvm-project/clang/include -I/Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1/tools/clang/include -I/Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1/include -I/Users/florianhahn/projects/llvm-project/llvm/include /Users/florianhahn/projects/llvm-project/clang/include/clang/Tooling/Syntax/Nodes.td --write-if-changed -o tools/clang/include/clang/Tooling/Syntax/Nodes.inc -d tools/clang/include/clang/Tooling/Syntax/Nodes.inc.d
Assertion failed: ((!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"), function init, file MemoryBuffer.cpp, line 52.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  clang-tblgen             0x000000010466b68c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  clang-tblgen             0x000000010466a808 llvm::sys::RunSignalHandlers() + 64
2  clang-tblgen             0x000000010466bd60 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001877a92a4 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000018777acec pthread_kill + 288
5  libsystem_c.dylib        0x00000001876b42c8 abort + 180
6  libsystem_c.dylib        0x00000001876b3620 err + 0
7  clang-tblgen             0x00000001046ce150 llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>> getOpenFileImpl<llvm::MemoryBuffer>(int, llvm::Twine const&, unsigned long long, unsigned long long, long long, bool, bool, llvm::Optional<llvm::Align>) (.cold.1) + 0
8  clang-tblgen             0x000000010464a548 llvm::WritableMemoryBuffer::getNewUninitMemBuffer(unsigned long, llvm::Twine const&, llvm::Optional<llvm::Align>) + 496
9  clang-tblgen             0x000000010464a7a0 llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>> getOpenFileImpl<llvm::MemoryBuffer>(int, llvm::Twine const&, unsigned long long, unsigned long long, long long, bool, bool, llvm::Optional<llvm::Align>) + 528
10 clang-tblgen             0x000000010464a254 llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>> getFileAux<llvm::MemoryBuffer>(llvm::Twine const&, unsigned long long, unsigned long long, bool, bool, bool, llvm::Optional<llvm::Align>) + 176
11 clang-tblgen             0x000000010466fbbc llvm::TableGenMain(char const*, bool (*)(llvm::raw_ostream&, llvm::RecordKeeper&)) + 1428
12 clang-tblgen             0x0000000104626114 main + 156
13 dyld                     0x0000000187453e50 start + 2544

19 months ago[Support] Move getHostNumPhysicalCores to Threading.h
Archibald Elliott [Fri, 25 Nov 2022 16:25:19 +0000 (16:25 +0000)]
[Support] Move getHostNumPhysicalCores to Threading.h

This change is focussed on simplifying `Support/Host.h` to only do
target detection. In this case, this function is close in usage to
existing functions in `Support/Threading.h`, so I moved it into there.
The function is also renamed to `llvm::get_physical_cores()` to match
the style of threading's functions.

The big change here is that now if you have threading disabled,
`llvm::get_physical_cores()` will return -1, as if it had not been able
to work out the right info. This is due to how Threading.cpp includes
OS-specific code/headers. This seems ok, as if threading is disabled,
LLVM should not need to know the number of physical cores.

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

19 months ago[clang][CodeGen] Add default attributes to __clang_call_terminate
John Brawn [Tue, 22 Nov 2022 17:52:15 +0000 (17:52 +0000)]
[clang][CodeGen] Add default attributes to __clang_call_terminate

When generating __clang_call_terminate use SetLLVMFunctionAttributes
to set the default function attributes, like we do for all the other
functions generated by clang. This fixes a problem where target
features from the command line weren't being applied to this function.

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

19 months agoCache memory buffer's name length
serge-sans-paille [Wed, 23 Nov 2022 06:45:59 +0000 (07:45 +0100)]
Cache memory buffer's name length

This avoids repeated calls to strlen while we already know its value.

When preprocessing sqlite3.c, this gives a surprising 2% speedup.

Full benchmark available here: https://llvm-compile-time-tracker.com/compare.php?from=5279e6a7d677cdf4488883b77aacab911318100c&to=389601b0dbdf23cf25167ddfc49b3af5742ebd9a&stat=instructions:u

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

19 months ago[NFC] fix doc inconsistency in cxx_status
Roy Jacobson [Tue, 29 Nov 2022 13:00:40 +0000 (15:00 +0200)]
[NFC] fix doc inconsistency in cxx_status