Commit Graph

443458 Commits

Author SHA1 Message Date
Ron Lieberman a1066569b8 [check-openmp] fix bug49334 bot fails - temporary 2022-11-28 19:10:43 -06:00
wlei ef0cb372dc [llvm_stats] Do not import llvm.stats metadata for thinlto
The stats are computed per module and will all be merged in the binary, importing the metadata will cause duplication of the stats.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D138833
2022-11-28 16:47:20 -08:00
Stanislav Mekhanoshin 28eb9ed3bb [AMDGPU] Fine tune LDS misaligned access speed
Differential Revision: https://reviews.llvm.org/D124219
2022-11-28 16:12:02 -08:00
Usman Nadeem 54dc764db7 [Flang][Test] Add support to change the default target triple for tests
In this patch I added support to change the default target triple used
by flang tests using the cmake variable: FLANG_TEST_TARGET_TRIPLE.

This functionality is implemented using the LLVM_TARGET_TRIPLE_ENV
variable, so that must be defined as well.

An example use:
`-DLLVM_TARGET_TRIPLE_ENV="LLVM_TARGET_TRIPLE_ENV" -DFLANG_TEST_TARGET_TRIPLE="aarch64-linux-gnu"`

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

Change-Id: I38e4a46a65109d415a9b72c8a0bf8a955e937280
2022-11-28 16:02:22 -08:00
Diego Caballero f6d90055fd [mlir][Vector] Remove 'lower-permutation-maps' option from VectorToSCF
This patch is part of a larger simplification effort of vector transfer
operations. It removes the flag `lower-permutation-maps` from
VectorToSCF conversion and enables the lowering of permutation maps
by default. This means that VectorToSCF will always lower permutation
maps to independent broadcast/transpose operations before lowering
vector operations to SCF.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D138742
2022-11-28 23:56:43 +00:00
Stanislav Mekhanoshin c46634554d [LoadStoreVectorizer] Consider if operation is faster than before
Compare a relative speed of misaligned accesses before and
after vectorization, not just check the new instruction is
not going to be slower.

Since no target now returns anything but 0 or 1 for Fast
argument of the allowsMisalignedMemoryAccesses this is still NFCI.

The subsequent patch will tune actual vaues of Fast on AMDGPU.

Differential Revision: https://reviews.llvm.org/D124218
2022-11-28 15:52:32 -08:00
Kazu Hirata 55378ae87c [Analysis] Remove unused fields in MemorySSA.cpp (NFC)
The last uses of AR were removed on July 28, 2022 in commit
f96ea53e89.

Differential Revision: https://reviews.llvm.org/D138730
2022-11-28 15:39:32 -08:00
Hanhan Wang 0a1569a400 [mlir][NFC] Remove trailing whitespaces from `*.td` and `*.mlir` files.
This is generated by running

```
sed --in-place 's/[[:space:]]\+$//' mlir/**/*.td
sed --in-place 's/[[:space:]]\+$//' mlir/**/*.mlir
```

Reviewed By: rriddle, dcaballe

Differential Revision: https://reviews.llvm.org/D138866
2022-11-28 15:26:30 -08:00
Koakuma 17d0a15478 [SPARC][clang] Enable frame pointer optimization by default
Enable frame pointer optimization by default to match it with other targets.

This brings a small reduction in generated binary sizes.

Fixes bug #48327

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138532
2022-11-28 18:22:46 -05:00
Hanhan Wang e86169f090 [mlir][tensor] Add a custom builder for pack op.
The `paddingValue` and `outerDimsPerm` are optional to the op;
`innerTiles` can be variadic in terms of static sizes and dynamic sizes.
Add a custom builder for building pack op easier.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D138860
2022-11-28 15:18:42 -08:00
Shilei Tian fa06d4d3e2 [OpenMP][Test] Fixed the issue that lit complains test doesn't have run line 2022-11-28 18:13:55 -05:00
Shilei Tian 3523f94bfa [OpenMP][Test] Disable bug49334.cpp because of its flaky failure 2022-11-28 18:08:14 -05:00
Matt Arsenault aa4acea8cd clang/HIP: Add another math header test
This needs more exhaustive checks for the other things here;
for now just test the ones directly calling ocml functions.
2022-11-28 18:02:20 -05:00
Qihan Cai bac88e898f [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
2022-11-29 09:49:26 +11:00
Florian Hahn bf15f1e489
Revert "[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe."
This reverts commit 0fa666eced.

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
2022-11-28 22:43:11 +00:00
Erich Keane 07008a8df5 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
2022-11-28 14:41:14 -08:00
Louis Dionne 5935db6ebd [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
2022-11-28 14:33:49 -08:00
Thomas Raoux df47f3ea0d [mlir][spirv] Add lowering for gpu shuffle idx
Differential Revision: https://reviews.llvm.org/D138863
2022-11-28 22:17:19 +00:00
Corentin Jabot e6624a2f36 [Clang] Update the status of mostly-editorial defect reports
- CWG2644 and CWG2650 fix examples
- CWG2636 updates Annex E
- CWG2642 is editorial
2022-11-28 23:16:04 +01:00
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