platform/upstream/llvm.git
20 months ago[flang] Add RISCV-64 support to Optimizer/CodeGen/Target.cpp
Qihan Cai [Sun, 23 Oct 2022 07:52:09 +0000 (18:52 +1100)]
[flang] Add RISCV-64 support to Optimizer/CodeGen/Target.cpp

As an attempt to fix errors in Flang regression tests on RISCV64 platform, RISCV64 target was added, and subsequent tests were provided.

Reviewed By: vzakhari

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

20 months agoRevert "[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe."
Florian Hahn [Mon, 28 Nov 2022 22:43:11 +0000 (22:43 +0000)]
Revert "[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe."

This reverts commit 0fa666ecedc3f36471c0fee925d664512e7525a8.

This triggers an assertion during AArch64 stage2 builds. Revert while I
investigate.

See https://lab.llvm.org/buildbot/#/builders/179/builds/4967/steps/11/logs/stdio

20 months agoCWG2635: Disallow constrained structured bindings.
Erich Keane [Mon, 28 Nov 2022 20:09:58 +0000 (12:09 -0800)]
CWG2635: Disallow constrained structured bindings.

CWG2635 prohibits adding a constraint to a structured as a defect
report.  This patch implements that restriction.

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

20 months ago[libc++] Fix incorrect guard against the presence of wide characters
Louis Dionne [Mon, 28 Nov 2022 16:49:23 +0000 (11:49 -0500)]
[libc++] Fix incorrect guard against the presence of wide characters

TEST_HAS_NO_WIDE_CHARACTERS should only be used in the tests.

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

20 months ago[mlir][spirv] Add lowering for gpu shuffle idx
Thomas Raoux [Mon, 28 Nov 2022 21:58:37 +0000 (21:58 +0000)]
[mlir][spirv] Add lowering for gpu shuffle idx

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

20 months ago[Clang] Update the status of mostly-editorial defect reports
Corentin Jabot [Mon, 28 Nov 2022 22:09:54 +0000 (23:09 +0100)]
[Clang] Update the status of mostly-editorial defect reports

- CWG2644 and CWG2650 fix examples
- CWG2636 updates Annex E
- CWG2642 is editorial

20 months ago[mlir][linalg] Add a new pattern to handle folding unit reduction dims.
Hanhan Wang [Wed, 23 Nov 2022 18:46:46 +0000 (10:46 -0800)]
[mlir][linalg] Add a new pattern to handle folding unit reduction dims.

The output operands will be added to input operands if the generic op (on tensors)
becomes an elementwise operation. The outputs of the generic op is still the same.
They will be cleaned up by ReplaceWithEmptyTensorIfUnused pattern.

This is https://reviews.llvm.org/D138251, plus a cmake dep fix.

Reviewed By: mravishankar

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

20 months ago[clang][deps] During scanning don't emit warnings-as-errors that are ignored with...
Volodymyr Sapsai [Fri, 18 Nov 2022 02:12:48 +0000 (18:12 -0800)]
[clang][deps] During scanning don't emit warnings-as-errors that are ignored with diagnostic pragmas.

Before the fix the scanning would fail with
`-Werror,-Wnon-modular-include-in-module` despite the warning being
suppressed in the source code.

Existing approach with `-Wno-error` is not sufficient because it negates
only general `-Werror` but not specific `-Werror=...` and some warnings
can still emitted as errors. Make the approach stricter by using `-w`
flag and ignore all warnings, including those upgraded to errors. This
approach is still valid as it doesn't affect the dependencies.

rdar://101588531

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

20 months ago[UpdateTestChecks] Fix `update_*_test_checks.py` to add "unused" prefixes
Mircea Trofin [Mon, 28 Nov 2022 18:02:14 +0000 (10:02 -0800)]
[UpdateTestChecks] Fix `update_*_test_checks.py` to add "unused" prefixes

The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)
cover update_test_checks.py, update_cc_test_checks.py, and
update_analyze_test_checks.py, too.

Issue #59220.

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

20 months agoRevert "[openmp] [test] XFAIL many-microtask-args.c on ARM"
Martin Storsjö [Mon, 28 Nov 2022 21:08:10 +0000 (23:08 +0200)]
Revert "[openmp] [test] XFAIL many-microtask-args.c on ARM"

This reverts commit 03bf001b6d95f7c6a88a2b95f3cad752b9d1ed45.

This commit broke a number of OpenMP buildbots, e.g.
https://lab.llvm.org/buildbot#builders/84/builds/31839, where
the build ends up with errors like this:

[0/1] Running OpenMP tests
llvm-lit: /b/1/openmp-clang-x86_64-linux-debian/llvm.src/llvm/utils/lit/lit/TestingConfig.py:140: fatal: unable to parse config file '/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/lit.site.cfg', traceback: Traceback (most recent call last):
 File "/b/1/openmp-clang-x86_64-linux-debian/llvm.src/llvm/utils/lit/lit/TestingConfig.py", line 129, in load_from_path
   exec(compile(data, path, 'exec'), cfg_globals, None)
 File "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/lit.site.cfg", line 6
   config.test_compiler_features =
                                   ^
SyntaxError: invalid syntax

20 months ago[AMDGPU] Add llvm.is.fpclass intrinsic to existing SelectionDAG fp
Janek van Oirschot [Mon, 28 Nov 2022 20:40:31 +0000 (15:40 -0500)]
[AMDGPU] Add llvm.is.fpclass intrinsic to existing SelectionDAG fp
class support and introduce GlobalISel implementation for AMDGPU

Uses existing SelectionDAG lowering of the llvm.amdgcn.class intrinsic
for llvm.is.fpclass

20 months ago[InstCombine] improve readability of combineLoadToOperationType(); NFC
Sanjay Patel [Mon, 28 Nov 2022 20:35:06 +0000 (15:35 -0500)]
[InstCombine] improve readability of combineLoadToOperationType(); NFC

20 months ago[PhaseOrdering] add test for vector load combining; NFC
Sanjay Patel [Mon, 28 Nov 2022 15:11:23 +0000 (10:11 -0500)]
[PhaseOrdering] add test for vector load combining; NFC

This is another example from issue #17113

20 months ago[AA] A global cannot escape through nocapture/nocallback call.
Slava Zakharin [Mon, 28 Nov 2022 17:17:28 +0000 (09:17 -0800)]
[AA] A global cannot escape through nocapture/nocallback call.

When an internal global is passed to a 'nocallback' call as
a 'nocapture' pointer, it cannot escape through this call and
be indirectly referenced in this module.
So it must not alias with any pointer in the module.

This may provide some remedy for Fortran module-private array descriptors
that are usually passed by address to some runtime functions
(e.g. to allocation/deallocation functions). In general, a good aliasing
information derived from Fortran language rules would solve the same issue,
but I think this change may be beneficial as-is (given that nocapture,
nocallback attributes are properly set).

Reviewed By: jdoerfert

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

20 months ago[RISCV] Move implementation of adjustReg from frame lowering to register info [nfc]
Philip Reames [Mon, 28 Nov 2022 20:38:50 +0000 (12:38 -0800)]
[RISCV] Move implementation of adjustReg from frame lowering to register info [nfc]

Putting both variants of this function in the same place, in advance of code resuse.  Note that I tweaked the API slightly in advance of additional callers without the alignment requirement.  Some of the existing callers may also be okay with weaker alignment requirements, but that should be it's own set of changes.

20 months ago[openmp] [test] Fix data structure mismatches for tests that define kmp_depend_info
Martin Storsjö [Tue, 8 Nov 2022 08:50:33 +0000 (10:50 +0200)]
[openmp] [test] Fix data structure mismatches for tests that define kmp_depend_info

Use the correct data type for pointer sized integers on Windows;
"long" is always 32 bit, even on 64 bit Windows - don't use it
for the kmp_intptr_t type.

Provide the exact correct definition of the kmp_depend_info
struct - avoid the risk of mismatches (if a platform would pack
things slightly differently when things are declared differently).

Zero initialize the whole dep_info struct before filling it in;
if only setting the in/out bits, the rest of the unallocated bits
in the bitfield can have undefined values. Libomp reads the flags
in combined form as an kmp_uint8 by reading the flag field - thus,
the unused bits do need to be zeroed. (Alternatively, the flag field
could be set to zero before setting the individual bits in the
bitfield).

Use kmp_intptr_t instead of long for casting pointers to integers.

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

20 months ago[openmp] [test] XFAIL many-microtask-args.c on ARM
Martin Storsjö [Fri, 25 Nov 2022 14:26:50 +0000 (16:26 +0200)]
[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.

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

20 months ago[openmp] [test] Set __COMPAT_LAYER=RunAsInvoker when running tests on Windows
Martin Storsjö [Sat, 5 Nov 2022 19:54:37 +0000 (21:54 +0200)]
[openmp] [test] Set __COMPAT_LAYER=RunAsInvoker when running tests on Windows

Windows heuristics may decide to want to run some tested processes
as elevated (since it may think some of them are installers - executables
with "dispatch" in the name may hit a heuristic looking for "patch").

Set this environment variable to disable this heuristic and just run
the executable with whatever privileges the caller has.

This fixes a couple tests on such versions of Windows where this
heuristic is active.

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

20 months ago[openmp] Use GCC style intrinsics for atomics on Clang-cl on aarch64 too
Martin Storsjö [Wed, 16 Nov 2022 09:42:16 +0000 (11:42 +0200)]
[openmp] Use GCC style intrinsics for atomics on Clang-cl on aarch64 too

This fixes compilation in the Clang-cl configuration on aarch64;
Clang doesn't implement all the aarch64 MSVC atomic intrinsics yet.

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

20 months ago[llvm-objcopy] [COFF] Always set PointerToRawData when writing a COFF file
Martin Storsjö [Mon, 28 Nov 2022 10:36:36 +0000 (12:36 +0200)]
[llvm-objcopy] [COFF] Always set PointerToRawData when writing a COFF file

If we don't want to set PointerToRawData, for an empty section,
we do must set it to zero explicitly. Some object file generators
do set it to zero for empty sections, while others set a nonzero
value pointing at the end of the previous section.

If the value was nonzero on input, we need to update it - either
setting it to zero, or to a valid offset in the output file (not
out of bounds)

This fixes https://github.com/mstorsjo/llvm-mingw/issues/313.

Testing this is tricky, because we can't use yaml2obj, since that
doesn't produce object files with nonzero PointerToRawData for
empty sections. We can use llvm-mc to assemble a small file
(assuming that LLVM's MC layer keeps this behaviour), or bundle
a small binary object file. I opted for using llvm-mc for now here
(with a test that it actually does keep this property), but I don't
mind changing it to a canned object file to make the test less brittle.

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

20 months agoAMDGPU: Code simplification for ctor/dtor lowering
Matt Arsenault [Mon, 28 Nov 2022 20:34:12 +0000 (15:34 -0500)]
AMDGPU: Code simplification for ctor/dtor lowering

Move the shared global variable lookup into the function.

20 months ago[Clang] Permit static constexpr variables in constexpr functions
Corentin Jabot [Mon, 28 Nov 2022 20:05:07 +0000 (21:05 +0100)]
[Clang] Permit static constexpr variables in constexpr functions

This implement the C++23 paper P2647R1 (adopted in Kona)

Reviewed By: #clang-language-wg, erichkeane

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

20 months agoUpdate wrong Unicode code point in confusable-identifiers.rst
Raul Ferrando [Mon, 28 Nov 2022 20:32:40 +0000 (15:32 -0500)]
Update wrong Unicode code point in confusable-identifiers.rst

In confusable-identifiers.rst the description refers to wrong Unicode code point.

The shown code point is U+1D41F, not U+1234.
Updated the code point and it's description.

Fixes #58934

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

20 months agoUtils: Use StringRef and rename variable for clarity
Matt Arsenault [Mon, 28 Nov 2022 20:24:16 +0000 (15:24 -0500)]
Utils: Use StringRef and rename variable for clarity

20 months agoGlobalValue: Move trivial getAddressSpace getter to header
Matt Arsenault [Mon, 28 Nov 2022 20:06:09 +0000 (15:06 -0500)]
GlobalValue: Move trivial getAddressSpace getter to header

20 months ago[MCJIT][test] Use new pass manager API
Arthur Eubanks [Mon, 28 Nov 2022 17:05:45 +0000 (09:05 -0800)]
[MCJIT][test] Use new pass manager API

20 months ago[LegacyPM] Remove pipeline extension mechanism
Arthur Eubanks [Mon, 24 Oct 2022 17:21:39 +0000 (10:21 -0700)]
[LegacyPM] Remove pipeline extension mechanism

Part of gradually removing the legacy PM optimization pipeline.

Reviewed By: MaskRay

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

20 months ago[InstSimplify] add precommit test for pattern !(X || Y) && X --> false; NFC
chenglin.bi [Mon, 28 Nov 2022 20:07:43 +0000 (04:07 +0800)]
[InstSimplify] add precommit test for pattern !(X || Y) && X --> false; NFC

20 months ago[flang] Handle polymorphic argument when expecting boxed derived-type
Valentin Clement [Mon, 28 Nov 2022 19:55:00 +0000 (20:55 +0100)]
[flang] Handle polymorphic argument when expecting boxed derived-type

Perform a rebox instead of a convert operation when the input type is
polymorphic and the output type is a boxed derived-type.

Reviewed By: PeteSteinfeld

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

20 months ago[Index] Add various missing USR generation
Ben Barham [Fri, 18 Nov 2022 20:32:39 +0000 (12:32 -0800)]
[Index] Add various missing USR generation

Over the years there's been many builtin types added without
corresponding USRs. Add a `@BT@<name>` USR for all these types. Also add
a comment so that hopefully this doesn't continue happening.

`MSGuid` was also missing a USR, use `@MG@GUID{<uuid>}` for it.

Resolves rdar://102198268.

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

20 months ago[InstSimplify] add precommit test for pattern (X || Y) ? false : X -> false; NFC
chenglin.bi [Mon, 28 Nov 2022 19:47:22 +0000 (03:47 +0800)]
[InstSimplify] add precommit test for pattern (X || Y) ? false : X -> false; NFC

20 months ago[opt] Hoist errors between flags and legacy PM interaction
Arthur Eubanks [Mon, 28 Nov 2022 19:30:09 +0000 (11:30 -0800)]
[opt] Hoist errors between flags and legacy PM interaction

20 months ago[mlir][vector] Add fold pattern to constant-fold InsertStridedSliceOp
Jakub Kuderski [Mon, 28 Nov 2022 19:24:04 +0000 (14:24 -0500)]
[mlir][vector] Add fold pattern to constant-fold InsertStridedSliceOp

Fold InsertStridedOp(ConstantOp into ConstantOp) -> ConstantOp.

This pattern comes with vector size threshold to make sure we do not
introduce too many large constants.

This help clean up code created by the Wide Integer Emulation pass.

Reviewed By: antiagainst

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

20 months agoAMDGPU: Bulk update some intrinsic tests to opaque pointers
Matt Arsenault [Mon, 28 Nov 2022 19:13:14 +0000 (14:13 -0500)]
AMDGPU: Bulk update some intrinsic tests to opaque pointers

Done entirely with the script.

20 months ago[clang] Update DR status to Revision 110
Vlad Serebrennikov [Mon, 28 Nov 2022 19:19:59 +0000 (11:19 -0800)]
[clang] Update DR status to Revision 110

Also update a hack in make_cxx_dr_status that handles tests for CWGs
that are still open.

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

20 months agoAMDGPU: Convert some memcpy test to opaque pointers
Matt Arsenault [Mon, 28 Nov 2022 17:23:19 +0000 (12:23 -0500)]
AMDGPU: Convert some memcpy test to opaque pointers

memcpy-scoped-aa.ll required manually updating the IR references in
the MMOs

20 months ago[opt] Remove "new-pm" from some cl::opt names
Arthur Eubanks [Mon, 28 Nov 2022 19:00:45 +0000 (11:00 -0800)]
[opt] Remove "new-pm" from some cl::opt names

20 months ago[NFC][opt] Move some cl::opts into the only file they're used in
Arthur Eubanks [Mon, 28 Nov 2022 18:57:32 +0000 (10:57 -0800)]
[NFC][opt] Move some cl::opts into the only file they're used in

20 months ago[clang] Require parameter pack to be last argument in concepts.
Luke Nihlen [Thu, 17 Nov 2022 15:24:05 +0000 (15:24 +0000)]
[clang] Require parameter pack to be last argument in concepts.

Fixes GH48182.

20 months agoStop accepting 'bool' in a concept declaration as an extension.
Erich Keane [Mon, 28 Nov 2022 18:21:38 +0000 (10:21 -0800)]
Stop accepting 'bool' in a concept declaration as an extension.

We no longer support the concepts-ts flag for this release, so stop
supporting this concepts-ts compat extension as well.

20 months agoRemove this type from Parser.h; NFC
Aaron Ballman [Mon, 28 Nov 2022 18:11:31 +0000 (13:11 -0500)]
Remove this type from Parser.h; NFC

TypeVector is only used once and isn't used in any interfaces, so this
removes the typedef.

20 months ago[RISCV] Simplify eliminateFrameIndex in advance of reuse [nfc-ish]
Philip Reames [Mon, 28 Nov 2022 17:26:21 +0000 (09:26 -0800)]
[RISCV] Simplify eliminateFrameIndex in advance of reuse [nfc-ish]

The prior code intermixed several concerns - the actual materialization of the offset, the choice of destination register, and whether to prune the ADDI. This version factors the first part out, and then reasons only about the later two. My intention is to merge the adjustReg routine with the one from frame lowering, and then explore using the merged result to simplify frame setup and tear down.

This change is conceptually NFC, but since it results in slightly different vreg usage, the end result can change register allocation in minor ways.

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

20 months ago[X86] Fix SLM ldmxcsr/stmxcsr schedule classes
Simon Pilgrim [Mon, 28 Nov 2022 17:43:10 +0000 (17:43 +0000)]
[X86] Fix SLM ldmxcsr/stmxcsr schedule classes

Fix a long standing FIXME comment using a mixture of llvm-exegesis and Agner numbers

20 months ago[opt][NFC] Simplify GetCodeGenOptLevel()
Arthur Eubanks [Mon, 28 Nov 2022 17:29:08 +0000 (09:29 -0800)]
[opt][NFC] Simplify GetCodeGenOptLevel()

Removed code is unreachable after D137663.

20 months ago[AVR] Do not use R0/R1 on avrtiny
Ayke van Laethem [Wed, 23 Nov 2022 16:24:44 +0000 (17:24 +0100)]
[AVR] Do not use R0/R1 on avrtiny

This patch makes sure the compiler uses R16/R17 on avrtiny (attiny10
etc) instead of R0/R1.

Some notes:

  * For the NEGW and ROLB instructions, it adds an explicit zero
    register. This is necessary because the zero register is different
    on avrtiny (and InstrInfo Uses lines need a fixed register).
  * Not entirely sure about putting all tests in features/avr-tiny.ll,
    but it doesn't seem like the "target-cpu"="attiny10" attribute
    works.

Updates: https://github.com/llvm/llvm-project/issues/53459

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

20 months ago[RISCV] Add cost model for integer and float vector arithmetic instructions.
Philip Reames [Mon, 28 Nov 2022 17:00:57 +0000 (09:00 -0800)]
[RISCV] Add cost model for integer and float vector arithmetic instructions.

This patch implements getArithmeticInstrCost for RISCV, supports cost
model for integer and float vector arithmetic instructions.

Differential Revision: https://reviews.llvm.org/D133552 (Original patch by jacquesguan.  Subset by me with todos added.)

20 months ago[ConstraintElim] Use collectOffset instead of custom GEP idx iteration.
Florian Hahn [Mon, 28 Nov 2022 16:54:58 +0000 (16:54 +0000)]
[ConstraintElim] Use collectOffset instead of custom GEP idx iteration.

Use collectOffset to collect scaled indices and constant offset for GEP
instead of custom code. This simplifies the logic in decomposeGEP and
allows to handle all cases supported by the generic helper.

20 months agoAMDGPU: Bulk update all GlobalISel tests to use opaque pointers
Matt Arsenault [Mon, 28 Nov 2022 16:31:25 +0000 (11:31 -0500)]
AMDGPU: Bulk update all GlobalISel tests to use opaque pointers

20 months ago[AArch64] Add patterns for SVE predicated add/sub and mov combine
Nicola Lancellotti [Tue, 22 Nov 2022 15:35:29 +0000 (15:35 +0000)]
[AArch64] Add patterns for SVE predicated add/sub and mov combine

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

20 months ago[AArch64] Pre-commit test for "Add patterns for SVE predicated add/sub and mov combine"
Nicola Lancellotti [Tue, 22 Nov 2022 15:25:13 +0000 (15:25 +0000)]
[AArch64] Pre-commit test for "Add patterns for SVE predicated add/sub and mov combine"

20 months agoRevert "[AArch64] Canonicalize ZERO_EXTEND to VSELECT"
Nicola Lancellotti [Tue, 22 Nov 2022 15:13:42 +0000 (15:13 +0000)]
Revert "[AArch64] Canonicalize ZERO_EXTEND to VSELECT"

This reverts commit 43fe14c056458501990c3db2788f67268d1bdf38.

20 months ago[flang] Adapt target rewrite for fir.dispatch operation
Valentin Clement [Mon, 28 Nov 2022 16:32:26 +0000 (17:32 +0100)]
[flang] Adapt target rewrite for fir.dispatch operation

Handle rewriting dispatch operation with complex arguments or
return.

sret will be done in a separate patch.

Reviewed By: jeanPerier, PeteSteinfeld

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

20 months ago[X86] Remove unnecessary (V)?PBLENDW(Y)?rm overrides
Simon Pilgrim [Mon, 28 Nov 2022 16:30:24 +0000 (16:30 +0000)]
[X86] Remove unnecessary (V)?PBLENDW(Y)?rm overrides

The znver1/znver2 overrides shouldn't need 2uops for the xmm case (but znver1 should double-pump for the ymm case).

Found with the help of D138359

20 months ago[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe.
Florian Hahn [Mon, 28 Nov 2022 16:32:31 +0000 (16:32 +0000)]
[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe.

This patch splits off the logic to transform the canonical IV to a
a value for an induction with a different start and step. This
transformation only needs to be done once (independent of VF/UF) and
enables sinking of VPScalarIVStepsRecipe as follow-up.

Reviewed By: Ayal

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

20 months agoAMDGPU: Bulk update some r600 tests to opaque pointers
Matt Arsenault [Mon, 28 Nov 2022 16:14:03 +0000 (11:14 -0500)]
AMDGPU: Bulk update some r600 tests to opaque pointers

r600.amdgpu-alias-analysis.ll has something strange going on where
AliasAnalyisEvaluator's printing is reproducing the typed pointer
syntax.

20 months ago[OpenMP] Do not add wrapper headers if using '-nogpuinc'
Joseph Huber [Wed, 23 Nov 2022 19:24:56 +0000 (13:24 -0600)]
[OpenMP] Do not add wrapper headers if using '-nogpuinc'

The OpenMP offloading toolchain uses wrapper headers to implement some
standard features on the GPU. Currently there is no way to turn these
off without also disabling all the standard includes altogether. This
patch makes `-nogpuinc` apply to these wrapper headers so we can use a
sterile toolchain. This was causing problems when attempting to compile
a `libc` for the GPU using OpenMP.

Reviewed By: jdoerfert

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

20 months ago[libc++] Remove CMake workaround for the discontinued Projects build
Louis Dionne [Mon, 28 Nov 2022 13:52:13 +0000 (08:52 -0500)]
[libc++] Remove CMake workaround for the discontinued Projects build

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

20 months ago[libc++][NFC] Add assertions before calling memmove
Louis Dionne [Mon, 28 Nov 2022 13:39:42 +0000 (08:39 -0500)]
[libc++][NFC] Add assertions before calling memmove

Since we're checking preconditions for calling memmove, we might
as well do that properly.

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

20 months agoRevert "[Assignment Tracking][13/*] Account for assignment tracking in SROA"
OCHyams [Mon, 28 Nov 2022 16:06:10 +0000 (16:06 +0000)]
Revert "[Assignment Tracking][13/*] Account for assignment tracking in SROA"

This reverts commit e16d59973ffec77eeef73409570bdf04a69c2405.

Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/236/builds/1205

20 months agoRevert "[Assignment Tracking][SROA] Follow-up for failing test"
OCHyams [Mon, 28 Nov 2022 16:04:45 +0000 (16:04 +0000)]
Revert "[Assignment Tracking][SROA] Follow-up for failing test"

This reverts commit 285d46ef4b60c0919c00661199c1b010996cc2c1.

Failing buildbot:
https://lab.llvm.org/buildbot/#/builders/236/builds/1205

20 months ago[mlir][sparse] Improve concatenate operator rewriting for dense tensor results.
bixia1 [Tue, 22 Nov 2022 01:50:16 +0000 (17:50 -0800)]
[mlir][sparse] Improve concatenate operator rewriting for dense tensor results.

Reviewed By: Peiming

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

20 months ago[flang] Hanlde disptach op in abstract result pass
Valentin Clement [Mon, 28 Nov 2022 15:49:25 +0000 (16:49 +0100)]
[flang] Hanlde disptach op in abstract result pass

Update the call conversion pattern to support fir.dispatch
operation as well. The first operand of fir.dispatch op is always the
polymoprhic object. The pass_arg_pos attribute needs to be shifted when
the result is added as argument.

Reviewed By: jeanPerier

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

20 months agoAMDGPU: Convert promote alloca tests to opaque pointers
Matt Arsenault [Mon, 28 Nov 2022 15:36:38 +0000 (10:36 -0500)]
AMDGPU: Convert promote alloca tests to opaque pointers

20 months agoAMDGPU: Convert test to generated checks
Matt Arsenault [Mon, 28 Nov 2022 15:25:41 +0000 (10:25 -0500)]
AMDGPU: Convert test to generated checks

These checks were too thin to begin with, and required slightly
trickier updates for opaque pointers.

20 months agoAMDGPU: Use named values in a test
Matt Arsenault [Mon, 28 Nov 2022 15:24:47 +0000 (10:24 -0500)]
AMDGPU: Use named values in a test

As always, these were an obstacle to test updates.

20 months agoAdd more tests for Reverse Load and AA testing
bipmis [Mon, 28 Nov 2022 15:34:26 +0000 (15:34 +0000)]
Add more tests for Reverse Load and AA testing

20 months ago[mlir][vector] Fix folding of vector.extract from vector.broadcast
Nicolas Vasilache [Mon, 28 Nov 2022 14:12:03 +0000 (06:12 -0800)]
[mlir][vector] Fix folding of vector.extract from vector.broadcast

This revision fixes a bug in the vector.extract folding that was missing
handling the "dim-1" broadcasting case in vector.broadcast.

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

20 months agoSmallVector: Declare explicit instantiations.
Thomas Köppe [Mon, 28 Nov 2022 15:08:54 +0000 (16:08 +0100)]
SmallVector: Declare explicit instantiations.

This was an ODR violation

20 months agoAMDGPU: Use modern address spaces in some tests
Matt Arsenault [Mon, 28 Nov 2022 15:01:20 +0000 (10:01 -0500)]
AMDGPU: Use modern address spaces in some tests

This was way out of date, still using 4 for generic and 0 for private.

20 months ago[SLPVectorizer] Do Not Move Loads/Stores Beyond Stacksave/Stackrestore Boundaries
Qiongsi Wu [Mon, 28 Nov 2022 14:55:11 +0000 (09:55 -0500)]
[SLPVectorizer] Do Not Move Loads/Stores Beyond Stacksave/Stackrestore Boundaries

If left unchecked, the SLPVecrtorizer can move loads/stores below a stackrestore. The move can cause issues if the loads/stores have pointer operands from `alloca`s that are reset by the stackrestores. This patch adds the dependency check.

The check is conservative, in that it does not check if the pointer operands of the loads/stores are actually from `alloca`s that may be reset. We did not observe any SPECCPU2017 performance degradation so this simple fix seems sufficient.

The test could have been added to `llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll`, but that test has not been updated to use opaque pointers. I am not inclined to add tests that still use typed pointers, or to refactor `llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll` to use opaque pointers in this patch. If desired, I will open a different patch to refactor and consolidate the tests.

Reviewed By: ABataev

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

20 months ago[InstSimplify] Add precommit tests for select+or patterns; NFC
chenglin.bi [Mon, 28 Nov 2022 14:47:30 +0000 (22:47 +0800)]
[InstSimplify] Add precommit tests for select+or patterns; NFC

20 months agoEncode columnWidthUTF8 tests as UTF-8 sequences.
Corentin Jabot [Mon, 28 Nov 2022 14:53:44 +0000 (15:53 +0100)]
Encode columnWidthUTF8 tests as UTF-8 sequences.

Some platforms do not encode string literals as UTF-8
when building llvm

20 months agoGCOVProfiling: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:35:56 +0000 (17:35 -0500)]
GCOVProfiling: Convert tests to opaque pointers

function-numbering.ll was a special case where the checks are for a
new function which does have unnecessary GEPs with 0 indices.

20 months agoInstMerge: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:51:44 +0000 (17:51 -0500)]
InstMerge: Convert tests to opaque pointers

20 months agollvm-split: Convert tests to opaque pointers
Matt Arsenault [Sun, 27 Nov 2022 18:29:14 +0000 (13:29 -0500)]
llvm-split: Convert tests to opaque pointers

global.ll and scc-const-alias.ll needed some manual fixups; the script
seems to not correctly deal with constantexpr bitcasts.

20 months agoNameAnonGlobals: Convert tests to opaque pointers
Matt Arsenault [Sun, 27 Nov 2022 01:11:15 +0000 (20:11 -0500)]
NameAnonGlobals: Convert tests to opaque pointers

20 months agoFunctionSpecialization: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:32:52 +0000 (17:32 -0500)]
FunctionSpecialization: Convert tests to opaque pointers

20 months agoIndirectBrExpand: Convert test to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:31:49 +0000 (17:31 -0500)]
IndirectBrExpand: Convert test to opaque pointers

20 months agoGuardWidening: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:31:09 +0000 (17:31 -0500)]
GuardWidening: Convert tests to opaque pointers

20 months agoIRCE: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:27:10 +0000 (17:27 -0500)]
IRCE: Convert tests to opaque pointers

20 months agoPlaceSafepoints: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 21:54:52 +0000 (16:54 -0500)]
PlaceSafepoints: Convert tests to opaque pointers

20 months agoRelLookupTableConverter: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 21:49:43 +0000 (16:49 -0500)]
RelLookupTableConverter: Convert tests to opaque pointers

20 months agoStripSymbols: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 21:15:58 +0000 (16:15 -0500)]
StripSymbols: Convert tests to opaque pointers

20 months agoSyntheticCountsPropagation: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 21:15:07 +0000 (16:15 -0500)]
SyntheticCountsPropagation: Convert tests to opaque pointers

20 months agoTailCallElim: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 21:12:58 +0000 (16:12 -0500)]
TailCallElim: Convert tests to opaque pointers

This was painless and all converted by the script fine.

20 months agoBoundsChecking: Convert tests to opaque pointers
Matt Arsenault [Sun, 27 Nov 2022 20:53:27 +0000 (15:53 -0500)]
BoundsChecking: Convert tests to opaque pointers

20 months agoPoisonChecking: Convert tests to opaque pointers
Matt Arsenault [Sun, 27 Nov 2022 21:02:31 +0000 (16:02 -0500)]
PoisonChecking: Convert tests to opaque pointers

20 months agoHeapProfiler: Convert tests to opaque pointers
Matt Arsenault [Sun, 27 Nov 2022 21:44:53 +0000 (16:44 -0500)]
HeapProfiler: Convert tests to opaque pointers

Needed to manually fix masked-load-store.ll.

20 months agoAMDGPU: Convert debug info tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 19:34:21 +0000 (14:34 -0500)]
AMDGPU: Convert debug info tests to opaque pointers

20 months agoRevert "[MemProf] Defer profile file setup until dump time"
Teresa Johnson [Mon, 28 Nov 2022 14:29:24 +0000 (06:29 -0800)]
Revert "[MemProf] Defer profile file setup until dump time"

This reverts commit ea1826ee57984d4f44fdb4b35a47169d393618ed.

This change is breaking the ability of tests to override the profile
output file. Need to add a mechanism to do that before resubmitting.

20 months agoCodeGenPrepare: Convert most tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 16:33:38 +0000 (11:33 -0500)]
CodeGenPrepare: Convert most tests to opaque pointers

NVPTX/dont-introduce-addrspacecast.ll required manually removing a check for
a bitcast.

AArch64/combine-address-mode.ll required rerunning update_test_checks

Mips required some manual updates due to a CHECK-NEXT coming after a
deleted bitcast.

ARM/sink-addrmode.ll needed one small manual fix.

Excludes one X86 function which needs more attention.

20 months agoUpdate the list of double width codepoints
Corentin Jabot [Tue, 22 Nov 2022 19:30:19 +0000 (20:30 +0100)]
Update the list of double width codepoints

All east asian width wide and full-width codepoints
are considered double width, as well as emojis and
symbols commonely rendered as emoji.

Reviewed By: aaron.ballman

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

20 months agoScalarizeMaskedMemIntrin: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 21:21:39 +0000 (16:21 -0500)]
ScalarizeMaskedMemIntrin: Convert tests to opaque pointers

This was as easy as running the script and running
update_test_checks. I did notice the pass produces some GEPs with 0
indexes, such that running the opaquify script a second time produces
a diff.

20 months agoLowerInvoke: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:23:50 +0000 (17:23 -0500)]
LowerInvoke: Convert tests to opaque pointers

20 months agoLowerGuardIntrinsic: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:24:16 +0000 (17:24 -0500)]
LowerGuardIntrinsic: Convert tests to opaque pointers

20 months agoLowerGlobalDestructors: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:24:55 +0000 (17:24 -0500)]
LowerGlobalDestructors: Convert tests to opaque pointers

20 months agoDivRemPairs: Convert tests to use opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:30:20 +0000 (17:30 -0500)]
DivRemPairs: Convert tests to use opaque pointers

20 months agoLowerExpectIntrinsic: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:25:22 +0000 (17:25 -0500)]
LowerExpectIntrinsic: Convert tests to opaque pointers

20 months agoLowerConstantIntrinsics: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:26:00 +0000 (17:26 -0500)]
LowerConstantIntrinsics: Convert tests to opaque pointers

20 months agoHardwareLoops: Convert tests to opaque pointers
Matt Arsenault [Sat, 26 Nov 2022 22:37:45 +0000 (17:37 -0500)]
HardwareLoops: Convert tests to opaque pointers