platform/upstream/llvm.git
20 months agoRevert "[Test] Add couple more tests where we can compute symbolic max exit count"
Max Kazantsev [Fri, 25 Nov 2022 06:37:24 +0000 (13:37 +0700)]
Revert "[Test] Add couple more tests where we can compute symbolic max exit count"

This reverts commit 7e3373c9e174eff6edb1214efb3e67d7b7ad447d.

Some changes that were not supposed to be commited came with it.

20 months ago[Test] Add couple more tests where we can compute symbolic max exit count
Max Kazantsev [Fri, 25 Nov 2022 06:35:16 +0000 (13:35 +0700)]
[Test] Add couple more tests where we can compute symbolic max exit count

20 months ago[SCEV][NFC] Rename constructor parameter to match its field name
Max Kazantsev [Fri, 25 Nov 2022 05:49:43 +0000 (12:49 +0700)]
[SCEV][NFC] Rename constructor parameter to match its field name

20 months ago[LSR] precommit test for D138636; NFC
chenglin.bi [Fri, 25 Nov 2022 05:46:51 +0000 (13:46 +0800)]
[LSR] precommit test for D138636; NFC

20 months ago[SCEV][NFC] Get rid of redundant constructor, replace with default parameter
Max Kazantsev [Fri, 25 Nov 2022 05:07:16 +0000 (12:07 +0700)]
[SCEV][NFC] Get rid of redundant constructor, replace with default parameter

20 months ago[Test] Add test showing that SCEV fails to evaluate symbolic max for 'and' conditions
Max Kazantsev [Fri, 25 Nov 2022 04:45:10 +0000 (11:45 +0700)]
[Test] Add test showing that SCEV fails to evaluate symbolic max for 'and' conditions

20 months ago[SCEV] Fix misplaced \n in printout of max symbolic exit counts
Max Kazantsev [Fri, 25 Nov 2022 04:40:54 +0000 (11:40 +0700)]
[SCEV] Fix misplaced \n in printout of max symbolic exit counts

20 months ago[Inliner] Move cl::opt inside llvm::
Fangrui Song [Fri, 25 Nov 2022 04:31:13 +0000 (20:31 -0800)]
[Inliner] Move cl::opt inside llvm::

20 months ago[Hexagon] Don't lower legal EXTRACT_SUBVECTOR to EXTRACT_SUBREG
Krzysztof Parzyszek [Thu, 24 Nov 2022 21:26:21 +0000 (13:26 -0800)]
[Hexagon] Don't lower legal EXTRACT_SUBVECTOR to EXTRACT_SUBREG

EXTRACT_SUBREG is a machine opcode and cannot be a part of an input
selection pattern.

20 months ago[modules] Fix marking `ObjCMethodDecl::isOverriding` when there are no overrides.
Volodymyr Sapsai [Thu, 24 Nov 2022 01:42:30 +0000 (17:42 -0800)]
[modules] Fix marking `ObjCMethodDecl::isOverriding` when there are no overrides.

Incorrect `isOverriding` flag triggers the assertion
`!Overridden.empty()` in `ObjCMethodDecl::getOverriddenMethods` when a
method is marked as overriding but we cannot find any overrides.

When a method is declared in a category and defined in implementation,
we don't treat it as an override because it is the same method with
a separate declaration and a definition. But with modules we can find
a method declaration both in a modular category and a non-modular category
with different memory addresses. Thus we erroneously conclude the method
is overriding. Fix by comparing canonical declarations that are the same
for equal entities coming from different modules.

rdar://92845511

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

20 months ago[openmp] Use z_Linux_asm.S to provide __kmp_invoke_microtask with Clang for Windows...
Martin Storsjö [Thu, 10 Nov 2022 22:21:22 +0000 (00:21 +0200)]
[openmp] Use z_Linux_asm.S to provide __kmp_invoke_microtask with Clang for Windows/aarch64

When building for Windows aarch64, and not using the actual MSVC,
we can assemble gnu assembly files just fine, and the existing
correct implementation of __kmp_invoke_microtask is fully usable.

The C implementation of __kmp_invoke_microtask in
z_Windows_NT-586_util.cpp relies on unguaranteed assumptions about
the compiler behaviour - it does work currently on MSVC, but doesn't
necessarily on other compilers. That function uses an alloca to pass
parameters on the stack to the called functions.

There's no guarantee that the buffer allocated by alloca is exactly
at the bottom of the stack when doing the call; the compiler might
have left space for extra things to save on the stack there.

Additionally, when compiled with Clang with optimization, Clang
optimizes out the alloca and memcpy entirely. On the C language
level, they don't have any visible effect outside of the function
and thus can be omitted entirely.

This fixes calling microtasks with more than 6 parameters, in
builds for Windows/aarch64 with Clang.

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

20 months ago[flang] Adapt descriptor codegen to support unlimited polymorphic entities
Valentin Clement [Thu, 24 Nov 2022 19:33:15 +0000 (20:33 +0100)]
[flang] Adapt descriptor codegen to support unlimited polymorphic entities

Code generation to create and populate the descriptor (element size and
type code) is based on the boxed result type. This does not work well with
unlimited polymorphic entities since the fir type does not represent what is
actually emboxed or reboxed.
In the case of emboxing, the input type will be used to populate
the descriptor element size and type code.
When reboxing an unlimited polymorphic to a unlimited polymorphic entities, the
element size and type code is retrieve from the input box.

Reviewed By: jeanPerier

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

20 months ago[libc] Improve bcmp performance for aarch64
Guillaume Chatelet [Thu, 24 Nov 2022 19:24:21 +0000 (19:24 +0000)]
[libc] Improve bcmp performance for aarch64

20 months ago[MemoryLocation] Support memcpy_chk in getForArgument.
Florian Hahn [Thu, 24 Nov 2022 19:17:48 +0000 (19:17 +0000)]
[MemoryLocation] Support memcpy_chk in getForArgument.

Similar to 9f9e8ba114ce, add support for memcyp_chk to
MemoryLocation::getForArgument.

The size argument for memcpy_chk is an upper bound for the size of the
pointer argument. memcpy_chk may read/write less than the specified length,
if it exceeds the specified max size and aborts.

Reviewed By: xbolva00, jdoerfert

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

20 months ago[bazel] Add copts attribute to gentbl_cc_library macro.
Benjamin Kramer [Thu, 24 Nov 2022 19:16:16 +0000 (20:16 +0100)]
[bazel] Add copts attribute to gentbl_cc_library macro.

20 months agoChange debugserver to spawn processes in their own pgrp
Jason Molenda [Thu, 24 Nov 2022 18:56:01 +0000 (10:56 -0800)]
Change debugserver to spawn processes in their own pgrp

Change debugserver's posix_spawn() to spawn an inferior process in
its own process group, so signals from the terminal like control-c
are passed to the inferior process instead of debugserer.  In lldb's
own native-host launching, there is a LaunchInfo option
LaunchInSeparateProcessGroup, and this mirrors the most common
setting of that on Darwin systems.

Patch by Alessandro Arzilli <alessandro.arzilli@gmail.com>.

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

20 months ago[InstCombine] ease restriction for extractelt (bitcast X) fold
Sanjay Patel [Thu, 24 Nov 2022 17:56:19 +0000 (12:56 -0500)]
[InstCombine] ease restriction for extractelt (bitcast X) fold

We were checking for a desirable integer type even when there
is no shift in the transform. This is unnecessary since we
are truncating directly to the destination type.

This removes an extractelt in more cases and seems to make the
canonicalization more uniform overall. There's still a potential
difference between patterns that need a shift vs. trunc-only.

I'm not sure if that is worth keeping at this point, but it can
be adjusted in another step (assuming this change does not cause
trouble).

In the most basic case where I noticed this, we missed a fold
that would have completely removed vector ops from a pattern
like:
https://alive2.llvm.org/ce/z/y4Qdte

20 months ago[AArch64][SME]: Generate streaming-compatible code for int/fp select/vselect
Hassnaa Hamdi [Tue, 22 Nov 2022 20:39:44 +0000 (20:39 +0000)]
[AArch64][SME]: Generate streaming-compatible code for int/fp select/vselect

To generate code compatible to streaming mode:
 - enable custom lowering for VSETCC, needed for (fp-vselect.ll, int-vselect.ll).

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

20 months ago[AArch64][SME]: Add precursory tests for D138519
Hassnaa Hamdi [Tue, 22 Nov 2022 20:36:54 +0000 (20:36 +0000)]
[AArch64][SME]: Add precursory tests for D138519

Add testing files:
 - fp-select.ll
 - int-select.ll
 - fp-vselect.ll
 - int-vselect.ll

20 months ago[AArch64] Add hasSVEorSME() helper and fix some incorrect checks
Benjamin Maxwell [Wed, 23 Nov 2022 15:15:02 +0000 (15:15 +0000)]
[AArch64] Add hasSVEorSME() helper and fix some incorrect checks

This adds a little hasSVEorSME() helper, and as a NFC updates existing
code to use it. The assertions get[Min|Max]SVEVectorSizeInBits() are
also now corrected to use hasSVEorSME() rather than just hasSVE().

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

20 months ago[AArch64] Add Missing System Registers
Archibald Elliott [Tue, 22 Nov 2022 17:26:52 +0000 (17:26 +0000)]
[AArch64] Add Missing System Registers

The following system registers have been missing upstream:
- ID_DFR1_EL1
- AMCG1IDR_EL0 (present when FEAT_AMUv1p1 implemented - optional from v8.6-a)
- HAFGRTR_EL2 (present when FEAT_AMUv1 and FEAT_FGT are implemented)

With regards to HAFGRTR_EL2, this is only present when you have both
extensions. As FEAT_FGT is part of a later architecture, we group it
with those registers. In all honesty, this is a good example of the
kinds of place where just enabling all system registers all the time
would be easiest.

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

20 months ago[AArch64][SME]: Generate streaming-compatible code for FP rounding operations.
Hassnaa Hamdi [Mon, 21 Nov 2022 16:17:01 +0000 (16:17 +0000)]
[AArch64][SME]: Generate streaming-compatible code for FP rounding operations.

1- To generate code compatible to streaming mode:
 - enable custom lowering for fcopysign, isd::fp_round, isd::fceil, isd::ffloor, isd::fnearbyint,
   isd::frint, isd::fround, isd::froundeven, isd::ftrunc.

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

20 months ago[AArch64][SME]: Add precursory tests for D138440
Hassnaa Hamdi [Mon, 21 Nov 2022 15:30:17 +0000 (15:30 +0000)]
[AArch64][SME]: Add precursory tests for D138440

Add testing files:
 - fcopysign.ll
 - fp-rounding.ll

20 months ago[InstCombine] avoid 'tmp' variable name in tests; NFC
Sanjay Patel [Thu, 24 Nov 2022 17:21:39 +0000 (12:21 -0500)]
[InstCombine] avoid 'tmp' variable name in tests; NFC

The auto-generation script warns on these files because
of the potential to conflict with the scripted regex names.

20 months ago[clang-fuzzer] Add missing dependency
Arthur Eubanks [Thu, 24 Nov 2022 17:20:47 +0000 (09:20 -0800)]
[clang-fuzzer] Add missing dependency

20 months agoReland [clang-fuzzer] Use new pass manager for optimizing IR
Arthur Eubanks [Thu, 24 Nov 2022 00:59:28 +0000 (16:59 -0800)]
Reland [clang-fuzzer] Use new pass manager for optimizing IR

With CMakeLists.txt fix.

20 months ago[AArch64][SME]: Generate streaming-compatible code for int-reduce, fp-reduce
Hassnaa Hamdi [Fri, 18 Nov 2022 16:56:03 +0000 (16:56 +0000)]
[AArch64][SME]: Generate streaming-compatible code for int-reduce, fp-reduce

 1- To generate code compatible to streaming mode:
  - enable custom lowering for VECREDUCE_(smin, smax, umin, umax, add, fadd).

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

20 months ago[AArch64][SME]: Add precursory tests for D138309
Hassnaa Hamdi [Fri, 18 Nov 2022 16:50:27 +0000 (16:50 +0000)]
[AArch64][SME]: Add precursory tests for D138309

Add testing files:
 - int-reduce.ll
 - fp-reduce.ll

20 months agoRevert "[clang-fuzzer] Use new pass manager for optimizing IR"
Arthur Eubanks [Thu, 24 Nov 2022 16:56:53 +0000 (08:56 -0800)]
Revert "[clang-fuzzer] Use new pass manager for optimizing IR"

This reverts commit a46a746cfa08a72f9e9188451ed5cac2f77d5237.

Breaks bots, e.g. https://lab.llvm.org/buildbot#builders/121/builds/25511.

20 months ago[llvm] [cmake] Set EXCLUDE_FROM_ALL on gtest and TestingSupport
Michał Górny [Sun, 30 Oct 2022 06:37:15 +0000 (07:37 +0100)]
[llvm] [cmake] Set EXCLUDE_FROM_ALL on gtest and TestingSupport

Exclude building googletest and LLVMTestingSupport libraries from
the `all` target.  If unittests are being built, these libraries will
be built as a dependency anyway.  If they are not being built, building
them makes little sense as they are not installed or used otherwise.

This will also make standalone builds of other projects easier, as it
makes it possible to include these directories without having to cover
them with additional conditions to prevent them from being built
unconditionally.

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

20 months ago[libc++][AIX] Add AIX buildbot owners
David Tenty [Wed, 23 Nov 2022 16:10:30 +0000 (11:10 -0500)]
[libc++][AIX] Add AIX buildbot owners

This adds the AIX (i.e. Power) buildbot owners in the format established
by https://reviews.llvm.org/D138445

Reviewed By: ldionne

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

20 months ago[lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE
Arthur Eubanks [Wed, 23 Nov 2022 22:29:40 +0000 (14:29 -0800)]
[lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE

This simplifies an upcoming patch.

Reviewed By: labath

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

20 months ago[clang-fuzzer] Use new pass manager for optimizing IR
Arthur Eubanks [Thu, 24 Nov 2022 00:59:28 +0000 (16:59 -0800)]
[clang-fuzzer] Use new pass manager for optimizing IR

20 months ago[X86] combineScalarAndWithMaskSetcc - optionally peek through (oneuse) any_extend...
Simon Pilgrim [Thu, 24 Nov 2022 16:26:29 +0000 (16:26 +0000)]
[X86] combineScalarAndWithMaskSetcc - optionally peek through (oneuse) any_extend node

Extend pass to handle: (and (any_extend (bitcast (vXi1 (concat_vectors (vYi1 setcc), undef,)))), C)

Fixes several regressions identified in D127115

20 months ago[AArch64] Add support for v8.9-A/v9.4-A Debug and PMU extensions
Lucas Prates [Wed, 16 Nov 2022 16:56:54 +0000 (16:56 +0000)]
[AArch64] Add support for v8.9-A/v9.4-A Debug and PMU extensions

This adds support for the 2022 Debug and PMU extensions that are part of
the v8.9-A and v9.4-A architecture versions. This includes:

* New archtecture extension for the v9.4-A Instrumentation Extension
  (FEAT_ITE), including 'trcit' instruction and system registers
* New system registers for:
  * 2022 Debug features (FEAT_Debugv8p9)
  * 2022 Performance Monitors Extension features (FEAT_PMUv3p9)
  * PMU Snapshot extension (FEAT_PMUv3_SS)
  * PMU Fixed-function instruction counter (FEAT_PMUv3_ICNTR)
  * System Performance Monitors Extension (FEAT_SPMU)
  * Synchornous-exception-based event profiling (FEAT_SEBEP)
  * Fine Grained Traps Extension (FEAT_FGT2)
  * SPE Data Source filtering (FEAT_SPE_FDS)

More information on the new extensions can be found on:
* https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022
* https://developer.arm.com/downloads/-/exploration-tools

Changes by Son Tuan Vu, Sam Elliott and me.

Reviewed By: tmatheson

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

20 months agoRevert "[Debugify] Accumulate the number of variables in debugify metadata"
Anton Sidorenko [Thu, 24 Nov 2022 16:08:32 +0000 (19:08 +0300)]
Revert "[Debugify] Accumulate the number of variables in debugify metadata"

This brokes some builds
This reverts commit a1bbe8a4e2e50e7100dc17d9ddd1bfc3bfe44977.

20 months ago[Alignment][NFC] Use Align in MCStreamer::emitValueToAlignment
Guillaume Chatelet [Thu, 24 Nov 2022 15:23:06 +0000 (15:23 +0000)]
[Alignment][NFC] Use Align in MCStreamer::emitValueToAlignment

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

20 months ago[Alignment][NFC] Use Align for MCStreamer::emitXCOFFLocalCommonSymbol
Guillaume Chatelet [Thu, 24 Nov 2022 14:45:37 +0000 (14:45 +0000)]
[Alignment][NFC] Use Align for MCStreamer::emitXCOFFLocalCommonSymbol

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

20 months ago[Debugify] Accumulate the number of variables in debugify metadata
Anton Sidorenko [Fri, 28 Oct 2022 13:47:44 +0000 (16:47 +0300)]
[Debugify] Accumulate the number of variables in debugify metadata

When a module contains more than one function, we should update debugify metadata
by increasing the number of variables in the function rather than overwritting it.

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

20 months ago[flang] Lowering LOC intrinsic
Kelvin Li [Tue, 15 Nov 2022 19:46:25 +0000 (14:46 -0500)]
[flang] Lowering LOC intrinsic

This patch is to implement the lowering of the LOC intrinsic.

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

20 months ago[flang][test] Adjust Driver/pass-plugin-not-found.f90 error message
Rainer Orth [Thu, 24 Nov 2022 15:20:33 +0000 (16:20 +0100)]
[flang][test] Adjust Driver/pass-plugin-not-found.f90 error message

The `Driver/pass-plugin-not-found.f90` test `FAIL`s on Solaris since part
of the error message differs from what the test expects: Solaris has

  error: unable to load plugin 'X.Y': 'Could not load library 'X.Y':
ld.so.1: flang-new: X.Y: open failed: No such file or directory'

while the test expects

  error: unable to load plugin 'X.Y': 'Could not load library 'X.Y': X.Y:
cannot open shared object file: No such file or directory'

The last part is emitted by the system `dlerror` and is thus unportable.
Hopefully the error text itself is the same everywhere.

The following patch adjusts the expected message accordingly.

Tested on `x86_64-pc-linux-gnu` and `amd64-pc-solaris2.11`.

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

20 months ago[Debugify] Precommit test for D136949
Anton Sidorenko [Mon, 21 Nov 2022 10:49:46 +0000 (13:49 +0300)]
[Debugify] Precommit test for D136949

20 months ago[InstCombine] reduce code duplication in foldBitcastExtElt(); NFC
Sanjay Patel [Thu, 24 Nov 2022 14:27:06 +0000 (09:27 -0500)]
[InstCombine] reduce code duplication in foldBitcastExtElt(); NFC

20 months ago[InstCombine] add tests for trunc+insertelt; NFC
Sanjay Patel [Tue, 22 Nov 2022 19:14:27 +0000 (14:14 -0500)]
[InstCombine] add tests for trunc+insertelt; NFC

20 months ago[OpenMP][OMPIRBuilder] Mirgrate getName from clang to OMPIRBuilder
Jan Sjodin [Wed, 9 Nov 2022 16:59:30 +0000 (11:59 -0500)]
[OpenMP][OMPIRBuilder] Mirgrate getName from clang to OMPIRBuilder

This change moves the getName function from clang and moves the separator class
members from CGOpenMPRuntime into OMPIRBuilder. Also enusre all the getters
in the config class are const.

Reviewed By: jdoerfert

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

20 months ago[Alignment][NFC] Use Align in MCStreamer::emitCodeAlignment
Guillaume Chatelet [Thu, 24 Nov 2022 14:27:38 +0000 (14:27 +0000)]
[Alignment][NFC] Use Align in MCStreamer::emitCodeAlignment

This patch makes code less readable but it will clean itself after all functions are converted.

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

20 months ago[include-cleaner] Show details for #include directives (used/unused)
Sam McCall [Thu, 24 Nov 2022 11:34:08 +0000 (12:34 +0100)]
[include-cleaner] Show details for #include directives (used/unused)

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

20 months ago[Alignment][NFC] Use Align in MCStreamer::emitBundleAlignMode
Guillaume Chatelet [Thu, 24 Nov 2022 13:43:11 +0000 (13:43 +0000)]
[Alignment][NFC] Use Align in MCStreamer::emitBundleAlignMode

Summary:

Reviewers: courbet

Subscribers:

20 months ago[SelectOpt] Don't treat LogicalAnd/LogicalOr as selects
David Green [Thu, 24 Nov 2022 14:29:57 +0000 (14:29 +0000)]
[SelectOpt] Don't treat LogicalAnd/LogicalOr as selects

A `select i1 %c, i1 true, i1 %d` is just an or and a `select i1 %c, i1 %d, i1 false`
is just an and. There are better treated as such in the logic of SelectOpt, allowing
the backend to optimize them to and/or directly.

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

20 months ago[include-cleaner] Make Symbol (and Macro) hashable.
Sam McCall [Thu, 24 Nov 2022 11:29:50 +0000 (12:29 +0100)]
[include-cleaner] Make Symbol (and Macro) hashable.

For now, we decided not to add operator< or handle other variants.
(If we do so in future we may want to extract a base class).

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

20 months ago[Format] Don't crash on mismatched brackets
Sam McCall [Thu, 24 Nov 2022 14:13:42 +0000 (15:13 +0100)]
[Format] Don't crash on mismatched brackets

20 months ago[X86] Replace InstRW instregex single matches with instrs entries
Simon Pilgrim [Thu, 24 Nov 2022 14:08:19 +0000 (14:08 +0000)]
[X86] Replace InstRW instregex single matches with instrs entries

This reduces diffs between znver1/znver2 and should marginally speed up tlbgen build time (Issue #35303)

Found by adding a temp check inside InstRegexOp::apply inside single matches

20 months agoFix MSVC "signed/unsigned mismatch" warning. NFC.
Simon Pilgrim [Thu, 24 Nov 2022 13:58:34 +0000 (13:58 +0000)]
Fix MSVC "signed/unsigned mismatch" warning. NFC.

20 months agoFix remaining build errors introduced in D90568 - 15e76eed0c7.
Nathan James [Thu, 24 Nov 2022 14:01:08 +0000 (14:01 +0000)]
Fix remaining build errors introduced in D90568 - 15e76eed0c7.

A few cases were missed in 0923628d26d

20 months ago[include-cleaner] Record macro references in #ifdef clause.
Viktoriia Bakalova [Thu, 24 Nov 2022 13:40:49 +0000 (14:40 +0100)]
[include-cleaner] Record macro references in #ifdef clause.

Records macro references in #ifdef clauses as ambiguous.

Reviewed By: hokein

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

20 months agoFix build error introduced in D90568 - 15e76eed0c7
Nathan James [Thu, 24 Nov 2022 13:42:53 +0000 (13:42 +0000)]
Fix build error introduced in D90568 - 15e76eed0c7

20 months agoRevert "[libcxxabi] Always use thread_local for cxa_exception_storage"
Louis Dionne [Thu, 24 Nov 2022 13:32:10 +0000 (08:32 -0500)]
Revert "[libcxxabi] Always use thread_local for cxa_exception_storage"

This reverts commit 8271aa5335668a1dc62168a4e90b4554bd3a0ca7 since it
broke some downstream builds. See https://reviews.llvm.org/D138461 for
details.

20 months ago[libc++] Keep char_traits<T> for arbitrary T around until LLVM 18
Louis Dionne [Wed, 23 Nov 2022 19:06:14 +0000 (14:06 -0500)]
[libc++] Keep char_traits<T> for arbitrary T around until LLVM 18

This is in response to failures seen after landing D138307.

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

20 months ago[reland][Alignment][NFC] Use the Align type in MCSection
Guillaume Chatelet [Thu, 24 Nov 2022 13:19:00 +0000 (13:19 +0000)]
[reland][Alignment][NFC] Use the Align type in MCSection

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

20 months ago[libc++] Remove P1908 from the status page
Nikolas Klauser [Wed, 16 Nov 2022 13:38:58 +0000 (14:38 +0100)]
[libc++] Remove P1908 from the status page

The paper doesn't include anything affecting the library. AFAICT there isn't even anything to do for the compiler, since it just reserved the std attribute namespace.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

20 months ago[clang] Add [is|set]Nested methods to NamespaceDecl
Nathan James [Thu, 24 Nov 2022 12:44:33 +0000 (12:44 +0000)]
[clang] Add [is|set]Nested methods to NamespaceDecl

Adds support for NamespaceDecl to inform if its part of a nested namespace.
This flag only corresponds to the inner namespaces in a nested namespace declaration.
In this example:
namespace <X>::<Y>::<Z> {}
Only <Y> and <Z> will be classified as nested.

This flag isn't meant for assisting in building the AST, more for static analysis and refactorings.

Reviewed By: aaron.ballman

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

20 months agoRevert D138653 [Alignment][NFC] Use the Align type in MCSection"
Guillaume Chatelet [Thu, 24 Nov 2022 12:42:30 +0000 (12:42 +0000)]
Revert D138653 [Alignment][NFC] Use the Align type in MCSection"

This breaks the bolt project.
This reverts commit 409f0dc4a420db1c6b259d5ae965a070c169d930.

20 months ago[Alignment][NFC] Use the Align type in MCSection
Guillaume Chatelet [Thu, 24 Nov 2022 11:46:33 +0000 (11:46 +0000)]
[Alignment][NFC] Use the Align type in MCSection

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

20 months ago[SCEV] Add printout of symbolic max backedge-taken and block exit count
Max Kazantsev [Thu, 24 Nov 2022 12:28:30 +0000 (19:28 +0700)]
[SCEV] Add printout of symbolic max backedge-taken and block exit count

We do compute it and use in optimizations, but never print it out. We need
to do it in order to be able to track improvements in its computation.

20 months ago[SCEV][NFC] Call getConstantMaxBackedgeTakenCount once in printout
Max Kazantsev [Thu, 24 Nov 2022 11:48:30 +0000 (18:48 +0700)]
[SCEV][NFC] Call getConstantMaxBackedgeTakenCount once in printout

20 months ago[SCEV] Rename max backedge-taken count -> constant max backedge taken-count in printout
Max Kazantsev [Thu, 24 Nov 2022 11:42:16 +0000 (18:42 +0700)]
[SCEV] Rename max backedge-taken count -> constant max backedge taken-count in printout

This is a preparatory step for introducing symbolic max backedge-taken count.

20 months ago[flang][NFC] move genCallOpAndResult into new ConvertCall.cpp file
Jean Perier [Thu, 24 Nov 2022 11:37:13 +0000 (12:37 +0100)]
[flang][NFC] move genCallOpAndResult into new ConvertCall.cpp file

Move genCallOpAndResult from ConvertExpr.cpp into a new file so that
it can be shared with lowering to FIR and HLFIR during the transition.
After the transition, call lowering to HLFIR will be implemented in
this new file.

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

20 months ago[AMDGPU][AsmParser] Refine parsing instruction operands.
Ivan Kosarev [Thu, 24 Nov 2022 10:50:00 +0000 (10:50 +0000)]
[AMDGPU][AsmParser] Refine parsing instruction operands.

Eliminates the need for working around optional and token operands being
mistakenly parsed as expressions.

Reviewed By: dp

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

20 months ago[AMDGPU][CodeGen] Support raw format TFE buffer loads other than byte, short and...
Ivan Kosarev [Thu, 17 Nov 2022 15:38:48 +0000 (15:38 +0000)]
[AMDGPU][CodeGen] Support raw format TFE buffer loads other than byte, short and d16 ones.

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

20 months ago[X86] combine-and.ll - add AVX2/AVX512 test coverage
Simon Pilgrim [Thu, 24 Nov 2022 10:38:05 +0000 (10:38 +0000)]
[X86] combine-and.ll - add AVX2/AVX512 test coverage

20 months ago[SCEV][NFC] Rename MaxNotTaken -> ConstantMaxNotTaken
Max Kazantsev [Thu, 24 Nov 2022 10:18:29 +0000 (17:18 +0700)]
[SCEV][NFC] Rename MaxNotTaken -> ConstantMaxNotTaken

We are going to introduce SymbolicMaxNotTaken, avoid mixing
things up.

Differential Revision: https://reviews.llvm.org/D138568
Reviewed By: lebedev.ri

20 months ago[lldb] Fix PathMappingListTest for the Optional interface change
Pavel Labath [Thu, 24 Nov 2022 10:10:26 +0000 (11:10 +0100)]
[lldb] Fix PathMappingListTest for the Optional interface change

20 months ago[include-cleaner] Remove an unused local variable, NFC.
Haojian Wu [Thu, 24 Nov 2022 10:05:34 +0000 (11:05 +0100)]
[include-cleaner] Remove an unused local variable, NFC.

20 months ago[Debugify] Strip llvm.mir.debugify metadata
Anton Sidorenko [Mon, 21 Nov 2022 12:26:27 +0000 (15:26 +0300)]
[Debugify] Strip llvm.mir.debugify metadata

We don't strip llvm.mir.debugify metadata in `llvm::stripDebugifyMetadata`. This
may lead to incorrect number of lines and variables in the metadata when we run
debugify twice, e.g. -run-pass=mir-debugify,...,mir-strip-debug,...,mir-debugify.

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

20 months ago[Debugify] Add precommit test for D138417
Anton Sidorenko [Mon, 21 Nov 2022 12:27:05 +0000 (15:27 +0300)]
[Debugify] Add precommit test for D138417

Check that we erase `llvm.debugify` metadata, but forget to erase `llvm.mir.debugify`.

20 months ago[SCEV] Fix wrong initialization of MaxNotTaken
Max Kazantsev [Wed, 23 Nov 2022 08:13:40 +0000 (15:13 +0700)]
[SCEV] Fix wrong initialization of MaxNotTaken

I'm not sure why, but since this code was introduced back in 2019, this
variable used wrong value to initialize. Somehow it just worked, but
needs to be fixed.

Differential Revision: https://reviews.llvm.org/D138549
Reviewed By: fhahn

20 months ago[CodeGen] Use poison instead of undef as placeholder in AtomicExpandPass [NFC]
Manuel Brito [Thu, 24 Nov 2022 08:42:05 +0000 (08:42 +0000)]
[CodeGen] Use poison instead of undef as placeholder in AtomicExpandPass [NFC]

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

20 months ago[NFC] Replaced BB->getInstList().front() with BB->front()
Vasileios Porpodas [Wed, 23 Nov 2022 22:54:37 +0000 (14:54 -0800)]
[NFC] Replaced BB->getInstList().front() with BB->front()

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

20 months ago[LTO] Move cl::opt inside llvm:: after D53294
Fangrui Song [Thu, 24 Nov 2022 07:22:26 +0000 (23:22 -0800)]
[LTO] Move cl::opt inside llvm:: after D53294

20 months ago[MC] Move AsmMacroMaxNestingDepth inside llvm:: after D72680
Fangrui Song [Thu, 24 Nov 2022 07:13:55 +0000 (23:13 -0800)]
[MC] Move AsmMacroMaxNestingDepth inside llvm:: after D72680

20 months ago[CSSPGO] Move cl::opt inside llvm:: after D100528 and D108342
Fangrui Song [Thu, 24 Nov 2022 07:08:49 +0000 (23:08 -0800)]
[CSSPGO] Move cl::opt inside llvm:: after D100528 and D108342

20 months ago[LoopVectorize] Internalize some cl::opt
Fangrui Song [Thu, 24 Nov 2022 07:03:02 +0000 (23:03 -0800)]
[LoopVectorize] Internalize some cl::opt

20 months agoStandardInstrumentations: Internalize some cl::opt
Fangrui Song [Thu, 24 Nov 2022 06:58:14 +0000 (22:58 -0800)]
StandardInstrumentations: Internalize some cl::opt

20 months agoAST: Internalize functions after D111283
Fangrui Song [Thu, 24 Nov 2022 06:53:23 +0000 (22:53 -0800)]
AST: Internalize functions after D111283

20 months ago[NFC] Replaced BB->getInstList().{erase(),pop_front(),pop_back()} with eraseFromParent().
Vasileios Porpodas [Wed, 23 Nov 2022 22:53:00 +0000 (14:53 -0800)]
[NFC] Replaced BB->getInstList().{erase(),pop_front(),pop_back()} with eraseFromParent().

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

20 months agotsan: intercept epoll_pwait2
Dmitry Vyukov [Wed, 23 Nov 2022 15:20:29 +0000 (16:20 +0100)]
tsan: intercept epoll_pwait2

It's a new syscall similar to epoll_pwait.
Add a similar interceptor for it and add synchronization
annotations in epoll_wait* syscall wrappers.
Testing this is problematic b/c it's not present in glibc
and the syscall itself may not be supported by the kernel.

Reviewed By: melver

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

20 months agoHost: Internalize computeHostNumPhysicalCores/computeHostNumHardwareThreads
Fangrui Song [Thu, 24 Nov 2022 05:09:44 +0000 (21:09 -0800)]
Host: Internalize computeHostNumPhysicalCores/computeHostNumHardwareThreads

Windows computeHostNumPhysicalCores is defined by Threading.cpp. Leave it
unchanged.

20 months agoRevert "Host: Internalize computeHostNumPhysicalCores/computeHostNumHardwareThreads"
Fangrui Song [Thu, 24 Nov 2022 04:12:16 +0000 (20:12 -0800)]
Revert "Host: Internalize computeHostNumPhysicalCores/computeHostNumHardwareThreads"

This reverts commit 9969ceb36b440eaafa17c486f29a69c7a7da3b3b.

On Windows:

lld-link: error: undefined symbol: int __cdecl computeHostNumPhysicalCores(void)
>>> referenced by LLVMSupport.lib(Support.Host.obj):(int __cdecl llvm::sys::getHostNumPhysicalCores(void))

20 months ago[MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal
Aiden Grossman [Thu, 24 Nov 2022 03:36:13 +0000 (03:36 +0000)]
[MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal

Recentlyin 4b6b248, llvm::Optional's hasValue method was removed as
described in
https://discourse.llvm.org/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor
This breaks InlineAdvisor and ModelUnderTrainingRunner. This patch fixes
them by changing the method to has_value, which hasValue was evaluating
to before.

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

20 months ago[RISCV] Lower unmasked zero-stride vector load to (scalar load + splat)
wangpc [Thu, 24 Nov 2022 03:08:59 +0000 (11:08 +0800)]
[RISCV] Lower unmasked zero-stride vector load to (scalar load + splat)

So we have the opportunity to fold splat into .vx instruction as what
D101138 has done. If failed, we can select zero-stride vector load
again.

Reviewed By: reames

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

20 months ago[RISCV] Precommit test for D138101
wangpc [Thu, 24 Nov 2022 02:36:06 +0000 (10:36 +0800)]
[RISCV] Precommit test for D138101

Add a test that splat can't be folded.

Reviewed By: pcwang-thead

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

20 months agoRevert "[mlir][linalg] Add a new pattern to handle folding unit reduction dims."
Hanhan Wang [Thu, 24 Nov 2022 03:04:21 +0000 (19:04 -0800)]
Revert "[mlir][linalg] Add a new pattern to handle folding unit reduction dims."

This reverts commit 6eee66d12ab33f35a37a1514342b51ae93d175e8.

It breaks builds, see https://lab.llvm.org/buildbot/#/builders/61/builds/35742

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

20 months ago[LoongArch] Diagnose the behavior of reading and writing registers that do not confor...
gonglingqin [Thu, 24 Nov 2022 02:15:18 +0000 (10:15 +0800)]
[LoongArch] Diagnose the behavior of reading and writing registers that do not conform to the hardware register size

When reading or writing a register that does not conform to the size of a
hardware register, an error message is generated instead of a compiler crash.

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

20 months ago[X86][AMX] Fix typo of the headerfile.
Luo, Yuanke [Wed, 23 Nov 2022 08:44:54 +0000 (16:44 +0800)]
[X86][AMX] Fix typo of the headerfile.

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

20 months ago[flang] Harmonize standalone gtest support with other projects
Michał Górny [Wed, 23 Nov 2022 15:07:03 +0000 (16:07 +0100)]
[flang] Harmonize standalone gtest support with other projects

Use the CMake rules of unittest libraries via `add_subdirectory()`
when using standalone builds, similarly to how e.g. Clang does that.
Besides making things more consistent, I hope this also unblocks D137035
and effectively we'll be able to simplify things further and have LLVM
semi-automatically include gtest support for us in the future.

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

20 months ago[Object] Internalize readBBAddrMapImpl
Fangrui Song [Thu, 24 Nov 2022 01:46:59 +0000 (17:46 -0800)]
[Object] Internalize readBBAddrMapImpl

20 months agoHost: Internalize computeHostNumPhysicalCores/computeHostNumHardwareThreads
Fangrui Song [Thu, 24 Nov 2022 01:44:04 +0000 (17:44 -0800)]
Host: Internalize computeHostNumPhysicalCores/computeHostNumHardwareThreads

20 months agoModuleSummaryAnalysis: Internalize some cl::opt
Fangrui Song [Thu, 24 Nov 2022 01:33:34 +0000 (17:33 -0800)]
ModuleSummaryAnalysis: Internalize some cl::opt

20 months ago[NFC] Use BB->size() instead of BB->getInstList().size().
Vasileios Porpodas [Wed, 23 Nov 2022 22:30:18 +0000 (14:30 -0800)]
[NFC] Use BB->size() instead of BB->getInstList().size().

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

20 months agoRISCVISAInfo: Internalize struct FindByName
Fangrui Song [Thu, 24 Nov 2022 01:22:49 +0000 (17:22 -0800)]
RISCVISAInfo: Internalize struct FindByName