Commit Graph

443339 Commits

Author SHA1 Message Date
Hanhan Wang 9b16d9d271 [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
2022-11-28 14:14:43 -08:00
Volodymyr Sapsai eac90d1236 [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
2022-11-28 13:48:29 -08:00
Mircea Trofin 255e7e1c21 [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
2022-11-28 13:24:32 -08:00
Martin Storsjö 5611bf69fc Revert "[openmp] [test] XFAIL many-microtask-args.c on ARM"
This reverts commit 03bf001b6d.

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
2022-11-28 23:08:10 +02:00
Janek van Oirschot 322966f8f8 [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
2022-11-28 16:00:36 -05:00
Sanjay Patel a00936484b [InstCombine] improve readability of combineLoadToOperationType(); NFC 2022-11-28 16:00:06 -05:00
Sanjay Patel c7bd82dfd8 [PhaseOrdering] add test for vector load combining; NFC
This is another example from issue #17113
2022-11-28 16:00:06 -05:00
Slava Zakharin 5bd8175dd7 [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
2022-11-28 12:50:31 -08:00
Philip Reames 1a5be5265c [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.
2022-11-28 12:41:00 -08:00
Martin Storsjö 4ed8fcc59a [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
2022-11-28 22:40:02 +02:00
Martin Storsjö 03bf001b6d [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
2022-11-28 22:40:02 +02:00
Martin Storsjö 63f0fdc262 [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
2022-11-28 22:40:01 +02:00
Martin Storsjö db6406acec [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
2022-11-28 22:40:01 +02:00
Martin Storsjö 30d5b755ea [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
2022-11-28 22:40:00 +02:00
Matt Arsenault 94f73fd6f8 AMDGPU: Code simplification for ctor/dtor lowering
Move the shared global variable lookup into the function.
2022-11-28 15:39:50 -05:00
Corentin Jabot 5607fc002d [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
2022-11-28 21:38:31 +01:00
Raul Ferrando b24d89a042 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
2022-11-28 15:32:40 -05:00
Matt Arsenault a2f9ca8875 Utils: Use StringRef and rename variable for clarity 2022-11-28 15:25:45 -05:00
Matt Arsenault 4e0ca5ef00 GlobalValue: Move trivial getAddressSpace getter to header 2022-11-28 15:25:45 -05:00
Arthur Eubanks 16312c5d7a [MCJIT][test] Use new pass manager API 2022-11-28 12:23:42 -08:00
Arthur Eubanks 7ae6838def [LegacyPM] Remove pipeline extension mechanism
Part of gradually removing the legacy PM optimization pipeline.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D136622
2022-11-28 12:23:15 -08:00
chenglin.bi 0869a96ca9 [InstSimplify] add precommit test for pattern !(X || Y) && X --> false; NFC 2022-11-29 04:07:43 +08:00
Valentin Clement 545db9c41f
[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
2022-11-28 20:56:27 +01:00
Ben Barham 699ae92f04 [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
2022-11-28 11:51:08 -08:00
chenglin.bi 52dd5b6e95 [InstSimplify] add precommit test for pattern (X || Y) ? false : X -> false; NFC 2022-11-29 03:47:34 +08:00
Arthur Eubanks b5f2167804 [opt] Hoist errors between flags and legacy PM interaction 2022-11-28 11:30:53 -08:00
Jakub Kuderski f0fe38035c [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
2022-11-28 14:25:28 -05:00
Matt Arsenault ad386a886b AMDGPU: Bulk update some intrinsic tests to opaque pointers
Done entirely with the script.
2022-11-28 14:21:31 -05:00
Vlad Serebrennikov b1a6f2aa89 [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
2022-11-28 11:20:22 -08:00
Matt Arsenault 7a3fb6a6e3 AMDGPU: Convert some memcpy test to opaque pointers
memcpy-scoped-aa.ll required manually updating the IR references in
the MMOs
2022-11-28 14:11:56 -05:00
Arthur Eubanks 4b3202e639 [opt] Remove "new-pm" from some cl::opt names 2022-11-28 11:00:45 -08:00
Arthur Eubanks f976a2d244 [NFC][opt] Move some cl::opts into the only file they're used in 2022-11-28 10:57:57 -08:00
Luke Nihlen afd800fc56 [clang] Require parameter pack to be last argument in concepts.
Fixes GH48182.
2022-11-28 18:40:19 +00:00
Erich Keane 9061928ebb 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.
2022-11-28 10:22:54 -08:00
Aaron Ballman c9d38bd713 Remove this type from Parser.h; NFC
TypeVector is only used once and isn't used in any interfaces, so this
removes the typedef.
2022-11-28 13:12:34 -05:00
Philip Reames 5583972fe1 [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
2022-11-28 10:09:37 -08:00
Simon Pilgrim f51170bffd [X86] Fix SLM ldmxcsr/stmxcsr schedule classes
Fix a long standing FIXME comment using a mixture of llvm-exegesis and Agner numbers
2022-11-28 17:43:17 +00:00
Arthur Eubanks d620bae999 [opt][NFC] Simplify GetCodeGenOptLevel()
Removed code is unreachable after D137663.
2022-11-28 09:30:54 -08:00
Ayke van Laethem 5527b21516
[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
2022-11-28 18:05:55 +01:00
Philip Reames db07d79ab0 [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.)
2022-11-28 09:04:38 -08:00
Florian Hahn 6a834d2f2b
[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.
2022-11-28 16:54:58 +00:00
Matt Arsenault 8e0fadda10 AMDGPU: Bulk update all GlobalISel tests to use opaque pointers 2022-11-28 11:51:36 -05:00
Nicola Lancellotti 7bbfc6cd8c [AArch64] Add patterns for SVE predicated add/sub and mov combine
Differential Revision: https://reviews.llvm.org/D138570
2022-11-28 16:37:30 +00:00
Nicola Lancellotti 1884ada741 [AArch64] Pre-commit test for "Add patterns for SVE predicated add/sub and mov combine" 2022-11-28 16:37:30 +00:00
Nicola Lancellotti 49cd18c55e Revert "[AArch64] Canonicalize ZERO_EXTEND to VSELECT"
This reverts commit 43fe14c056.
2022-11-28 16:37:30 +00:00
Valentin Clement 1ea66eefec
[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
2022-11-28 17:36:03 +01:00
Simon Pilgrim c65d5d4aec [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
2022-11-28 16:32:55 +00:00
Florian Hahn 0fa666eced
[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
2022-11-28 16:32:31 +00:00
Matt Arsenault da0293e3cc 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.
2022-11-28 11:25:44 -05:00
Joseph Huber 37edd91047 [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
2022-11-28 10:20:31 -06:00