462645 Commits

Author SHA1 Message Date
Paul Robinson
d8291908ef [Headers][doc] Add add/sub/mul intrinsic descriptions to avx2intrin.h
Differential Revision: https://reviews.llvm.org/D150114
2023-05-30 10:15:18 -07:00
Ben Hamilton
85670ac868 [Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser
This adds to the ObjC language guesser a few more common macros used
in ObjC headers. These can help distinguish ObjC headers which
otherwise lack ObjC types from C++ headers.

Contributed by danblakemore.

Tested: New tests included. Ran unit tests with:
  ```
  % cmake -S llvm -B build -G Ninja && \
    ninja -C build FormatTests && \
    ./build/tools/clang/unittests/Format/FormatTests --gtest_filter="*FormatTestObjC*"

  (snip)
  [----------] 24 tests from FormatTestObjC (265 ms total)

  [----------] Global test environment tear-down
  [==========] 26 tests from 2 test suites ran. (270 ms total)
  [  PASSED  ] 26 tests.
  ```

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D151578
2023-05-30 11:12:03 -06:00
Peter Steinfeld
5c000df215 [flang] [NFC] Remove an unneeded include.
The title says it all.

Differential Revision: https://reviews.llvm.org/D151712
2023-05-30 10:09:55 -07:00
Craig Topper
86821b54eb [RISCV] Add copyright header to IntrinsicsRISCVXTHead.td and IntrinsicsRISCVXsf.td. NFC 2023-05-30 10:07:14 -07:00
max
ab70b63a71 [MLIR][CAPI] Move DenseMapInfo<MlirTypeID>
I mistakenly put this in `mlir/CAPI/Support.h` at some point during the flurry of refactoring of `TypeCaster`s but as @jpienaar rightly pointed out, it doesn't belong there.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D151669
2023-05-30 12:03:56 -05:00
Mark de Wever
0ee73debf7 [libc++][format] Fixes year formatter on Windows.
Windows' libc, like some other libc implementations do not work as
specified for %Y and %y. This uses the fixes used for other libc
implementations.

The work was part of D150593.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151612
2023-05-30 18:57:55 +02:00
Mark de Wever
66c7388c83 [libc++] Deprecate the classes in strstream.
These have been deprecated since their initial version in libc++. It
seems they were never properly marked as deprecated.

Discovered while working on D151223.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D151474
2023-05-30 18:57:09 +02:00
Marco Elver
8c5ad4a0e2 Fix "[compiler-rt] Refactor memintrinsic interceptors"
Fix the Fuchsia build. asan_interceptors_memintrinsics.cpp should not
include any interceptors on Fuchsia.

Reported-by: haowei
Link: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8779679021892159153/+/u/clang/build/stdout
2023-05-30 18:55:46 +02:00
Craig Topper
93f8554e65 [RISCV] Correct capitalization of SiFive in a comment. NFC 2023-05-30 09:51:49 -07:00
David Green
5e98dbff72 [AArch64] Add i1 insert/extract cost tests. NFC
See D151189. The existing files check lines have also been adjusted whilst
here.
2023-05-30 17:45:16 +01:00
Mark de Wever
d951c6a533 [libc++][CI] Installs libomp.
This is needed to build clang-tidy plugins using clang-tidy 17.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151488
2023-05-30 18:40:36 +02:00
Dmitri Gribenko
8a40f89e2e [clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace
MemRegion::getMemorySpace() is annotated with
LLVM_ATTRIBUTE_RETURNS_NONNULL (which triggers instant UB if a null
pointer is returned), and callers indeed don't check the return value
for null. Thus, even though llvm::dyn_cast is called, it can never
return null in this context. Therefore, we can safely call llvm::cast.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D151727
2023-05-30 18:30:30 +02:00
Dmitri Gribenko
0989ce947e [clang][analyzer][NFC] Move dyn_cast's into if statements for readability
Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D151725
2023-05-30 18:22:43 +02:00
Simon Pilgrim
0ec79f413e [X86] Regenerate sqrt-fastmath-mir.ll 2023-05-30 17:21:53 +01:00
Adrian Prantl
d6e1909526 Mark header as textual 2023-05-30 09:21:39 -07:00
Igor Kirillov
40a81d3100 [CodeGen] Refactor IR generation functions to use IRBuilder in ComplexDeinterleaving pass
This patch updates several functions in LLVM's IR generation code to accept
an IRBuilder object as an argument, rather than an Instruction that indicates
the insertion point for new instructions.
This change is necessary to handle sophisticated -Ofast optimization cases
from D148558 where it's unclear which instructions should be used as the
insertion point for new operations.

Differential Revision: https://reviews.llvm.org/D148703
2023-05-30 16:18:28 +00:00
Dmitri Gribenko
daa95c7de5 [clang][analyzer][NFC] Remove unnecessary FALLTHROUGH markers
They are redundant with the [[fallthrough]]; attribute that follows.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D151723
2023-05-30 18:16:35 +02:00
Dmitri Gribenko
0da99ffe1a [clang][analyzer][NFC] Remove unnecessary casts around Allocate function calls
Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D151726
2023-05-30 18:10:15 +02:00
Alex Zinenko
7cdb875d4d [mlir] silence msvc warning 2023-05-30 15:59:19 +00:00
Lukas Sommer
2582b2e3ac [mlir][llvm] Add LLVM TargetExtType
Add support for the `llvm::TargetExtType` to the MLIR LLVM dialect.

Target extension types were introduced to represent target-specific types, which are opaque to the compiler and optimizations.

The patch also enforces some of the constraints defined for the target extension type in the LLVM language reference manual.

Signed-off-by: Lukas Sommer <lukas.sommer@codeplay.com>

Reviewed By: ftynse, gysit, Dinistro

Differential Revision: https://reviews.llvm.org/D151446
2023-05-30 15:55:45 +00:00
Quinn Dawkins
5e7ac2503a [mlir][transform] Add op for adding attributes to payload IR
The ability to add attributes to payload IR is useful functionality
independent of any dialect. This is added here through `transform.annotate`
by enabling attributes tied to a `TransformParamTypeInterface` (which
internally refers to an Attribute) to be added to a target operation by
name.

The AnnotateOp does not produce a new handle as no existing handles
should be affected by adding an attribute. Existing attributes on
the payload with the same name will be overwritten.

Differential Revision: https://reviews.llvm.org/D151689
2023-05-30 11:46:18 -04:00
Florian Hahn
8098f2577e
[LV] Use Legal::isUniform to detect uniform pointers.
Update collectLoopUniforms to identify uniform pointers using
Legal::isUniform. This is more powerful and  brings pointer
classification here in sync with setCostBasedWideningDecision
which uses isUniformMemOp. The existing mis-match in reasoning
can causes crashes due to D134460, which is fixed by this patch.

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

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D150991
2023-05-30 16:42:55 +01:00
Nikolas Klauser
0e4c4c7773 [clang] Extend __is_trivially_equality_comparable to check for hidden friends
This allows types to be considered trivially equality comparable if a defaulted hidden friend is used.

Reviewed By: erichkeane

Spies: cfe-commits

Differential Revision: https://reviews.llvm.org/D151623
2023-05-30 08:33:31 -07:00
Alex Zinenko
68ae0d7803 [mlir] add initial chapters of the transform dialect tutorial
The transform dialect has been around for a while and is sufficiently
stable at this point. Add the first three chapters of the tutorial
describing its usage and extension.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D151491
2023-05-30 15:26:58 +00:00
Manna, Soumi
f64f760e2d [NFC][CLANG] Fix nullptr dereference issue in Type::getSveEltType()
This patch uses castAs instead of getAs which will assert if the type
 doesn't match in clang::Type::getSveEltType(clang::ASTContext const &)

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D151525
2023-05-30 08:00:12 -07:00
Florian Hahn
1a28b9bce7
[VPlan] Handle invariant GEPs in isUniformAfterVectorization.
This fixes a crash caused by legal treating a scalable GEP as invariant,
but isUniformAfterVectorization does not handle GEPs.

Partially fixes https://github.com/llvm/llvm-project/issues/60831.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D144434
2023-05-30 15:53:26 +01:00
Jacob Crawley
8a6dadaad0 [flang][hlfir] lower hlfir.all into runtime call
Depends on: D151111

Differential Revision: https://reviews.llvm.org/D151415
2023-05-30 14:46:06 +00:00
Jacob Crawley
9e7699a21b [flang] lower all intrinsic to hlfir.all operation
Carries out the lowering of the all intrinsic into HLFIR

Differential Revision: https://reviews.llvm.org/D151111
2023-05-30 14:46:06 +00:00
Jacob Crawley
206b8538a6 [flang] add hlfir.all intrinsic
Adds a new HLFIR operation for the ALL intrinsic according to the
design set out in flang/docs/HighLevel.md

Differential Revision: https://reviews.llvm.org/D151090
2023-05-30 14:46:06 +00:00
Philip Reames
544a240ff7 [RISCV] Use v(f)slide1up for shuffle+insert idiom
This is pretty straight forward in the basic form. I did need to move the slideup matching earlier, but that looks generally profitable on it's own.

As follow ups, I plan to explore the v(f)slide1down variants, and see what I can do to canonicalize the shuffle then insert pattern (see _inverse tests at the end of the vslide1up.ll test).

Differential Revision: https://reviews.llvm.org/D151468
2023-05-30 07:37:41 -07:00
Kohei Yamaguchi
891fad0448 [mlir] [NFC] Add a newline to debug message at inserting of InterfaceMap
At inserting of InterfaceMap, a debug message lacked a newline, so it repeatedly displayed this message within a single line.
Clean up the debug log by inserting a newline at the end of the message.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D150182
2023-05-30 14:29:14 +00:00
Michael Maitland
d70573b18e [RISCV][NFC] Make Reduction scheduler resources SEW aware
Create SchedWrites, WriteRes for reduction instructions that
are SEW specific. Future patches can use these resources
to customize the behavior of these resources depending on SEW.

Differential Revision: https://reviews.llvm.org/D151470
2023-05-30 07:27:25 -07:00
Oleksandr "Alex" Zinenko
6042a1ac18
[mlir] fix mis-merge 2023-05-30 16:07:51 +02:00
Nikita Popov
8378f1f4cd [InstCombine] Remove adjustMinMax() fold (PR62088)
This fold is buggy if the constant adjustment overflows.
Additionally, since we now canonicalize to min/max intrinsics,
the constants picked here don't actually matter, as long as SPF
still recognizes the pattern.

Fixes https://github.com/llvm/llvm-project/issues/62088.
2023-05-30 16:06:38 +02:00
Simon Pilgrim
9d6f2b1907 [X86] Fix SunnyCove ROB/MicroOpBufferSize
As raised on Issue #62602 - the IceLake scheduler model is still mainly a copy of the SkylakeServer model. This initial commit just fixes the ROB/MicroOpBufferSize to match the size reported on WikiChip/Agner, further fixes to follow in later commits.
2023-05-30 15:01:30 +01:00
Oleksandr "Alex" Zinenko
baefd6650c
[mlir] clarify transform.foreach_match documentation
Clarify the restrictions on actions that are implied by the implementation as a post-order walk.
2023-05-30 16:00:59 +02:00
Matthias Springer
2d73190417 [mlir][linalg] Fix bug in FuseIntoContainingOp implementation
Do not replace uses inside the body of `scf.forall` ops with results of the same op.

Differential Revision: https://reviews.llvm.org/D151706
2023-05-30 15:55:30 +02:00
Matthias Springer
9ec52275ac [mlir][linalg] FuseIntoContainingOp: Always set newContainingOp
All result handles must be set in case of success.

Differential Revision: https://reviews.llvm.org/D151705
2023-05-30 15:14:36 +02:00
LLVM GN Syncbot
c8319cf958 [gn build] Port 96a14f388b1a 2023-05-30 12:49:12 +00:00
Nikita Popov
96a14f388b Revert "[FuncSpec] Replace LoopInfo with BlockFrequencyInfo"
As reported on https://reviews.llvm.org/D150375#4367861 and
following, this change causes PDT invalidation issues. Revert
it and dependent commits.

This reverts commit 0524534d5220da5ecb2cd424a46520184d2be366.
This reverts commit ced90d1ff64a89a13479a37a3b17a411a3259f9f.
This reverts commit 9f992cc9350a7f7072a6dbf018ea07142ea7a7ed.
This reverts commit 1b1232047e83b69561fd64b9547cb0a0d374473a.
2023-05-30 14:49:03 +02:00
Simon Pilgrim
f81f32adc9 [X86] lowerBuildVectorAsBroadcast - remove repeated hasAVX() check. NFC.
We already early-out at the top of the function.
2023-05-30 13:21:28 +01:00
Simon Pilgrim
ab4b924832 [X86] X86FixupVectorConstantsPass - attempt to replace full width integer vector constant loads with broadcasts on AVX2+ targets
lowerBuildVectorAsBroadcast will not broadcast splat constants in all cases, resulting in a lot of situations where a full width vector load that has failed to fold but is loading splat constant values could use a broadcast load instruction just as cheaply, and save constant pool space.
2023-05-30 13:17:26 +01:00
Igor Kirillov
48339d0fbb [CodeGen] Add pre-commit tests for D148558
This patch adds four new tests for upcoming functionality in LLVM:
* complex-deinterleaving-add-mull-fixed-contract.ll
* complex-deinterleaving-add-mull-scalable-contract.ll
* complex-deinterleaving-add-mull-fixed-fast.ll
* complex-deinterleaving-add-mull-scalable-fast.ll.

These tests were generated from the IR of vectorizable loops, which were
compiled from C++ code using different optimization flags in Clang. Each pair
of tests corresponds to Neon and SVE architectures, respectively, and
each pair contains tests compiled with -Ofast and -O3 -ffp-contract=fast
-ffinite-math-only optimization flags.
The tests were stripped of nnan and ninf flags as they have no impact on the
output.
The primary objective of these tests is to show the various sequences of
complex computations that may be encountered and to demonstrate the ability
of ComplexDeinterleaving to support any ordering.

Depends on D147451

Differential Revision: https://reviews.llvm.org/D148550
2023-05-30 11:49:59 +00:00
Joseph Huber
1ef0bafc4f [libc][NFC] Move the Linux file implementation to a subdirectory
This patch simply moves the special handling for `linux` files to a
subdirectory. This is done to make it easier in the future to extend
this support to targets (like the GPU) that will have different
dependencies.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D151231
2023-05-30 06:49:21 -05:00
Florian Hahn
b750862107
[LV] Use early exit for stores storing the ptr operand. (NFC)
Cleanup suggested in D150991.
2023-05-30 12:14:12 +01:00
Pierre Gousseau
686b4d250b Reland 2nd attempt: [tsan] Add debugging interfaces into interface header.
Change __tsan_get_report_loc 6th argument 'size' to unsigned long *

Reviewers: vitalybuka, dvyukov

Differential Revision: https://reviews.llvm.org/D148214
2023-05-30 10:43:00 +00:00
Simon Pilgrim
95661b9c75 [X86] getTargetConstantBitsFromNode - support extracting fp data from ConstantDataSequential
Fixes issue introduced by 0f8e0f4228805cbecce13dcfadef4c48a4f0f4cd where SimplifyDemandedBits could crash when trying to extract fp data from broadcasted constants
2023-05-30 11:38:31 +01:00
Jie Fu
d0a4dcf52f [InstCombine] Remove unused function 'isMustTailCall' (NFC)
/data/llvm-project/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2467:13: error: unused function 'isMustTailCall' [-Werror,-Wunused-function]
static bool isMustTailCall(Value *V) {
            ^
1 error generated.
2023-05-30 18:30:44 +08:00
Nikita Popov
f1106ef6c9 [InstCombine] Remove computeKnownBits() fold for returns
We try to fold constant computeKnownBits() with context for return
instructions only. Otherwise, we rely on SimplifyDemandedBits() to
fold instructions with constant known bits.

The presence of this special fold for returns is dangerous, because
it makes our tests lie about what works and what doesn't. Tests are
usually written by returning the result we're interested in, but
will go through this separate code path that is not used for anything
else. This patch removes the special fold.

This primarily regresses patterns of the style "assume(x); return x".
The responsibility of handling such patterns lies with passes like
EarlyCSE/GVN anyway, which will do this reliably, and not just for
returns.

Differential Revision: https://reviews.llvm.org/D151099
2023-05-30 12:16:51 +02:00
Alex Bradbury
c4efcd6970 [RISCV] Generalise shouldExtendTypeInLibcall logic to apply to all <XLEN floats on soft ABIs
This results in improved codegen for half/bf16 libcalls on soft ABIs

Adds a RISCVSubtarget helper method for determining if a soft FP ABI is
being targeted (future bf16 related patches make use of this).

Differential Revision: https://reviews.llvm.org/D151434
2023-05-30 11:04:03 +01:00