Commit Graph

403507 Commits

Author SHA1 Message Date
Pavel Labath adf5e9c9b6 [lldb] Remove ConstString from TypeSystem and REPL plugin names 2021-11-02 16:13:52 +01:00
thomasraoux d88cc07943 [mlir][gpuTonvvm] Remove hardcoded values in MMAType to llvm struct
Also relax the types allowed in GPU wmma ops

Differential Revision: https://reviews.llvm.org/D112969
2021-11-02 08:12:27 -07:00
Dmitry Makogon dd000e67f0 [Test] Regenerate IndVars test's checks
This just regenerates a certain IndVars test's checks.
2021-11-02 22:03:58 +07:00
Jay Foad be1a8f8834 [AMDGPU] Really preserve LiveVariables in SILowerControlFlow
https://bugs.llvm.org/show_bug.cgi?id=52204

Differential Revision: https://reviews.llvm.org/D112731
2021-11-02 15:03:37 +00:00
thomasraoux 7fbb0678fa [mlir][VectorToGPU] Add support for elementwise mma to vector to GPU
Differential Revision: https://reviews.llvm.org/D112960
2021-11-02 08:01:04 -07:00
Matt Morehouse 498a4c2fd7 [HWASan] Print short tags in tag mismatch description.
I recently spent some extra time debugging a false positive because I
didn't realize the "real" tag was in the short granule.  Adding the
short tag here makes it more obvious that we could be dealing with a
short granule.

Reviewed By: hctim, eugenis

Differential Revision: https://reviews.llvm.org/D112949
2021-11-02 08:00:33 -07:00
Matt Morehouse 8c60e0b632 [HWASan] Print short tags in __hwasan_print_shadow.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D112959
2021-11-02 07:59:25 -07:00
Dmitry Makogon e15cf498f6 [Test] Fix tests showing generation of already existent PHIs by GVN
Add target triple to the test module, so IndVars has a TTI to perform
congruent IVs elimination.
2021-11-02 21:57:37 +07:00
Fraser Cormack 6fb41c3dea [LangRef][VP] Correct mask type in vp.slice documentation
The mask type for the llvm.experimental.vp.splice intrinsics must have
the same number of elements as the result type.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D112924
2021-11-02 14:48:23 +00:00
Matt 895145aacb Revert "[AArch64][SVE] Combine predicated FMUL/FADD into FMA"
This reverts commit fc28a2f8ce.
2021-11-02 14:56:01 +00:00
Dmitry Makogon 94128f04d6 [Test] Add tests showing congruent IVs not removed by IndVars
In the added cases we have two congruent IVs. IndVars widens at least one of them.
If they are both widened, then one of them is erased as they stay congruent after
widening. However if only one IV is widened, the other one stays in the loop.
We can simply erase the narrow IV and replace its uses with truncates of the
widest IV.
2021-11-02 21:46:56 +07:00
Fraser Cormack 1fc80ffc92 [RISCV][VP] Add tests for "unmasked" VP loads
These aren't currently matched against unmasked vector load
instructions. A patch to fix that will come later.
2021-11-02 14:35:14 +00:00
Sam McCall 5880c835bd [Sema] Avoid crash in CheckEnumConstant with contains-error expressions
Fixes https://bugs.llvm.org/show_bug.cgi?id=51554

Differential Revision: https://reviews.llvm.org/D108451
2021-11-02 15:35:53 +01:00
John Ericson 6fd2db04d0 Use `GNUInstallDirs` to support custom installation dirs. -- LLVM
This is a new draft of D28234. I previously did the unorthodox thing of
pushing to it when I wasn't the original author, but since this version

- Uses `GNUInstallDirs`, rather than mimics it, as the original author
  was hesitant to do but others requested.

- Is much broader, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I am using this patch (and many back-ports) as the basis of
https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS). It
looked like people were generally on board in D28234, but I make note of
this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM
already has some partial support for these sorts of things. For example
`LLVM_LIBDIR_SUFFIX`, or `COMPILER_RT_INSTALL_PATH`. Because it's not
quite clear yet what to do about those, we are holding off on changing
libdirs and `compiler-rt`. for this initial PR.

---

On the advice of @lebedev.ri, I am splitting this up a bit per
subproject, starting with LLVM. To allow it to be more easily reviewed. This and the subsequent patch must be landed together, as this will not build alone. But the rest can be landed on their own.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D100810
2021-11-02 10:23:30 -04:00
Youngsuk Kim 76b53da3ce
[SimpleLoopUnswitch] Remove duplicate include.
Header "llvm/Transforms/Scalar/SimpleLoopUnswitch.h" is currently
included twice. This commit removes the duplicate 'include' line.

Previous commit 693eedb138
seems to have mistakenly added the duplicate 'include'.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D112979
2021-11-02 15:22:41 +01:00
Alex Zinenko 795aa48fc1 [mlir] replace class with struct in a forward declaration
Silence the warning.

Differential Revision: https://reviews.llvm.org/D113018
2021-11-02 15:16:31 +01:00
Sanjay Patel 829146164f [InstCombine] change 'not' match for bitwise select
The tests diffs are logically equivalent, and so this is
generally NFC, but this makes the code match the code
comment.

It should also be more efficient. If we choose the 'not'
operand (rather than the 'not' instruction) as the select
condition, then we don't have to invert the select
condition/operands as a subsequent transform.
2021-11-02 10:16:01 -04:00
Alex Zinenko e178b56c12 [mlir] drop spurious semicolon 2021-11-02 15:15:03 +01:00
Simon Pilgrim e173631dd1 [X86][AVX] SimplifyDemandedVectorEltsForTargetNode - use getBROADCAST_LOAD helper. NFCI.
Reduce width of X86ISD::SUBV_BROADCAST_LOAD node.
2021-11-02 14:07:22 +00:00
Simon Pilgrim 8ca666a280 [X86][AVX] lowerV2X128Shuffle - use getBROADCAST_LOAD helper. NFCI. 2021-11-02 14:07:21 +00:00
Florian Hahn 7999355106
[Clang] Add min/max reduction builtins.
This patch implements __builtin_reduce_max and __builtin_reduce_min as
specified in D111529.

The order of operations does not matter for min or max reductions and
they can be directly lowered to the corresponding
llvm.vector.reduce.{fmin,fmax,umin,umax,smin,smax} intrinsic calls.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D112001
2021-11-02 15:01:42 +01:00
Lei Zhang 7b615a87dc [mlir][linalg] Rewrite `linalg.conv_2d_nhwc_hwcf` into 1-D
We'd like to take a progressive approach towards Fconvolution op
CodeGen, by 1) tiling it to fit compute hierarchy first, and then
2) tiling along window dimensions with size 1 to reduce the problem
to be matmul-like. After that, we can 3) downscale high-D convolution
ops to low-D by removing the size-1 window dimensions. The final
step would be 4) vectorizing the low-D convolution op directly.

We have patterns for 1), 2), and 4). This commit adds a pattern for
3) for `linalg.conv_2d_nhwc_hwcf` ops as a starter. Supporting other
high-D convolution ops should be similar and mechanical.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D112928
2021-11-02 09:56:26 -04:00
Daniele Vettorel 67887b0f81 [Scalarizer] Do not insert instructions between PHI nodes and debug intrinsics.
The scalarizer pass seems to be inserting instructions in-between PHI nodes or debug intrinsics that end up staying at the end of the pass, resulting in malformed IR and violating assumptions.

This patch adds a check to make sure the `extractelement` instructions that it adds are correctly placed after all PHI nodes and debug intrinsics.

Patch by vettoreldaniele.

Reviewed By: bjope

Differential Revision: https://reviews.llvm.org/D112472
2021-11-02 09:53:59 -04:00
LLVM GN Syncbot 95a6d3e831 [gn build] Port 9b5c9c469d 2021-11-02 13:45:10 +00:00
Balazs Benics 9b5c9c469d [analyzer] Dump checker name if multiple checkers evaluate the same call
Previously, if accidentally multiple checkers `eval::Call`-ed the same
`CallEvent`, in debug builds the analyzer detected this and crashed
with the message stating this. Unfortunately, the message did not state
the offending checkers violating this invariant.
This revision addresses this by printing a more descriptive message
before aborting.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D112889
2021-11-02 14:42:14 +01:00
Sam McCall 6a5e08cc4a [AST] injected-class-name is not a redecl, even in template specializations
Back in the mists of time, the CXXRecordDecl for the injected-class-name was
a redecl of the outer class itself.
This got changed in 470c454a61, but only for plain
classes: class template instantation was still detecting the injected-class-name
in the template body and marking its instantiation as a redecl.

This causes some subtle inconsistent behavior between the two, e.g.
hasDefinition() returns true for Foo<int>::Foo but false for Bar::Bar.
This is the root cause of PR51912.

Differential Revision: https://reviews.llvm.org/D112765
2021-11-02 14:37:45 +01:00
Martin Liska c5029023fb Fix building with GCC 12:
Fixes: https://bugs.llvm.org/show_bug.cgi?id=52380

Differential Revision: https://reviews.llvm.org/D112990
2021-11-02 14:28:00 +01:00
Jay Foad fce5a567c6 [AMDGPU] More robust checks in extract_vector_dynelt.ll 2021-11-02 13:26:31 +00:00
Alex Zinenko 30d61893fb [mlir] provide C API and Python bindings for symbol tables
Symbol tables are a largely useful top-level IR construct, for example, they
make it easy to access functions in a module by name instead of traversing the
list of module's operations to find the corresponding function.

Depends On D112886

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112821
2021-11-02 14:22:58 +01:00
Alex Zinenko feec2d901c [mlir] return the updated symbol table after inserting into SymbolTable
Inserting a symbol into a SymbolTable may lead to the name of the symbol being
changed in order to ensure uniqueness of symbol names in the table. Return this
new name to spare the caller the need to extract it from the symbol operation.

Depends On D112700

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112886
2021-11-02 14:22:57 +01:00
jacquesguan a39eadcf16 [DAGCombiner] Teach combineShiftToMULH to handle constant and const splat vector.
Fold (srl (mul (zext i32:$a to i64), i64:c), 32) -> (mulhu $a, $b),
if c can truncate to i32 without loss.

Reviewed By: frasercrmck, craig.topper, RKSimon

Differential Revision: https://reviews.llvm.org/D108129
2021-11-02 12:04:23 +00:00
David Callahan 4ec1b8eeac [RISCV] Fix invalid kill on callee save
A callee save may be live (specifically X1) on entry and so a spill
should not mark it killed.

Differential Revision: https://reviews.llvm.org/D111285
2021-11-02 11:56:54 +00:00
Raphael Isemann 58dd658583 [lldb] Fix a use-after-free in FindFileTest.cpp
ArrayRef doesn't take ownership.
2021-11-02 12:39:26 +01:00
Simon Pilgrim 325031786e [SelectionDAG] Optimize expansion for rotates/funnel shifts
If the type of a funnel shift needs to be expanded, expand it to two funnel shifts instead of regular shifts. For constant shifts, this doesn't make much difference, but for variable shifts it allows a more optimal lowering.

Also use the optimized funnel shift lowering for rotates.

Alive2: https://alive2.llvm.org/ce/z/TvHDB- / https://alive2.llvm.org/ce/z/yzPept

(Branched from D108058 as getting this completed should help unlock some other WIP patches).

Original Patch: @efriedma (Eli Friedman)

Differential Revision: https://reviews.llvm.org/D112443
2021-11-02 11:38:25 +00:00
Simon Pilgrim 37e17f278f [DAG] MatchRotate - remove (redundant) legal type check.
Rely on the hasOperation() instead - as commented on D77804, the mid-term intention is to recognise rotate/funnel-by-constant pre-legalization to help avoid SimplifyDemandedBits regressions.
2021-11-02 11:24:50 +00:00
Tres Popp bcad20bc65 [bazel] Update BUILD file for llvm-reduce
This is needed after fd41738e2c
2021-11-02 12:01:33 +01:00
Guillaume Chatelet 0aea170b97 [libc] Add more robust compile time architecture detection
We may want to restrict the detected platforms to only `x86_64` and `aarch64`.
There are still custom detection in api.td but I don't think we can handle these:
 - config/linux/api.td:205
 - config/linux/api.td:199

Differential Revision: https://reviews.llvm.org/D112818
2021-11-02 11:00:33 +00:00
David Carlier 56513e3e42 [sanitizers] remove extra comma for sha2 interceptors 2021-11-02 10:35:44 +00:00
David Green 0e3a5f1ab3 [ARM] Some extra gather/scatter tests. NFC 2021-11-02 10:32:22 +00:00
Balázs Kéri 4bcbb3d4d7 [clang-tidy] Add check 'cert-err33-c'.
The CERT rule ERR33-C can be modeled partially by the existing check
'bugprone-unused-return-value'. The existing check is reused with
a fixed set of checked functions.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D112409
2021-11-02 11:38:47 +01:00
Matthias Springer 1ca35fc89e [mlir][linalg][bufferize] Move BufferizableOpInterface implementations
This commit moves parts of the existing bufferization code into external op interface implementations. Furthermore, Comprehensive Bufferize is adapted to use the new interface.

Future commits will decouple the interface and its op implementations from Comprehensive Bufferize and the Linalg dialect, as well as split them into multiple files with their own build targets. This commit leaves the file structure and build rules mostly unchanged.

Differential Revision: https://reviews.llvm.org/D112900
2021-11-02 18:30:01 +09:00
LLVM GN Syncbot ca791f8c9a [gn build] Port fd41738e2c 2021-11-02 09:21:12 +00:00
Matthias Springer a672319c2e [mlir][linalg][bufferize] Add BufferizableOpInterface
This commit adds a new op interface: BufferizableOpInterface. In the future, ops that implement this interface can be bufferized using Comprehensive Bufferize.

Note: The interface methods of this interface correspond to the "op interface" in ComprehensiveBufferize.cpp.

Differential Revision: https://reviews.llvm.org/D112974
2021-11-02 18:19:58 +09:00
Frederic Cambus 650311737e [llvm-readobj] Add support for reading OpenBSD ELF core notes.
Notes generated in OpenBSD core files provide additional information
about the kernel state and CPU registers. These notes are described
in core.5, which can be viewed here: https://man.openbsd.org/core.5

Differential Revision: https://reviews.llvm.org/D111966
2021-11-02 10:18:54 +01:00
Markus Lavin fd41738e2c Recommit "[llvm-reduce] Add MIR support"
(Second try. Need to link against CodeGen and MC libs.)

The llvm-reduce tool has been extended to operate on MIR (import, clone and
export). Current limitation is that only a single machine function is
supported. A single reducer pass that operates on machine instructions (while
on SSA-form) has been added. Additional MIR specific reducer passes can be
added later as needed.

Differential Revision: https://reviews.llvm.org/D110527
2021-11-02 10:16:42 +01:00
Raphael Isemann cd2e66efa6 [lldb][gmodules] Fix TestDataFormatterGlobals under gmodules
Same reason as in 548dbfaf447cc5fdfc26d34e60e3da08eb609531 -> macOS has a
struct called 'Point' in the libc module. Just remove the redundant includes
here.
2021-11-02 10:14:11 +01:00
Rosie Sumpter dcb8222d87 [LoopVectorize] Propagate fast-math flags for inloop reductions
This patch updates VPReductionRecipe::execute so that the fast-math
flags associated with the underlying instruction of the VPRecipe are
propagated through to the reductions which are created.

Differential Revision: https://reviews.llvm.org/D112548
2021-11-02 08:59:53 +00:00
serge-sans-paille 6bfc85c217 Fix inline builtin handling in case of redefinition
Basically, inline builtin definition are shadowed by externally visible
redefinition. This matches GCC behavior.

The implementation has to workaround the fact that:

1. inline builtin are renamed at callsite during codegen, but
2. they may be shadowed by a later external definition

As a consequence, during codegen, we need to walk redecls and eventually rewrite
some call sites, which is totally inelegant.

Differential Revision: https://reviews.llvm.org/D112059
2021-11-02 09:53:49 +01:00
Benjamin Kramer 48677f58b0 [lldb] Unbreak the macOS build after dfd499a61c 2021-11-02 09:47:44 +01:00
LLVM GN Syncbot c26649688e [gn build] Port aee7f3384b 2021-11-02 08:41:58 +00:00