Commit Graph

394219 Commits

Author SHA1 Message Date
Joel E. Denny 2f5b2ea6cd [UpdateCCTestChecks] Implement --global-value-regex
`--check-globals` activates checks for all global values, and
`--global-value-regex` filters them.  For example, I'd like to use it
in OpenMP offload codegen tests to check only global variables like
`.offload_maptypes*`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D104742
2021-07-20 11:23:20 -04:00
LLVM GN Syncbot 7cefcd9230 [gn build] Port 1a29403d2f 2021-07-20 15:13:51 +00:00
zoecarver 1a29403d2f [libcxx][ranges] Add common_iterator.
Differential Revision: https://reviews.llvm.org/D103335
2021-07-20 08:12:44 -07:00
Kazu Hirata 4a30a5c8d9 [SampleProfile] Remove ProfileIsValid (NFC)
The last use was removed on Jan 22, 2021 in commit
c9cd9a0066.
2021-07-20 08:07:04 -07:00
Rahul Joshi 53e5a60fd5 [NFC] Fix some comments and only look at terminators when looking for ReturnLike ops
Differential Revision: https://reviews.llvm.org/D106326
2021-07-20 08:05:20 -07:00
Melanie Blower ea864c9933 [clang][patch][NFC] Refactor calculation of FunctionDecl to avoid duplicate code 2021-07-20 11:01:22 -04:00
Caroline Concatto cf78995c4a [NFC][LoopVectorizer] Remove VF.isScalable() assertion from collectInstsToScalarize and getInstructionCost
This patch removes the assertion when VF is scalable and replaces
getKnownMinValue() by getFixedValue(),  so it still guards the code against
scalable vector types.
The assertions were used to guarantee that getknownMinValue were not used for
scalable vectors.

Differential Revision: https://reviews.llvm.org/D106359
2021-07-20 15:56:30 +01:00
Anirudh Prasad 0977f31cec [SystemZ][z/OS] Add GOFF support to file magic identification
- This patch adds in the GOFF format to the file magic identification logic in LLVM
- Currently, for the object file support, GOFF is marked as having as an error
- However, this is only temporary until https://reviews.llvm.org/D98437 is merged in

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D105993
2021-07-20 10:50:47 -04:00
Quinn Pham fd855c24c7 [PowerPC] Restore FastMathFlags of Builder for Vector FDiv Builtins
This patch fixes `__builtin_ppc_recipdivf`, `__builtin_ppc_recipdivd`,
`__builtin_ppc_rsqrtf`, and `__builtin_ppc_rsqrtd`. FastMathFlags are
set to fast immediately before emitting these builtins. Now the flags
are restored to their previous values after the builtins are emitted.

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D105984
2021-07-20 09:41:00 -05:00
Simon Pilgrim 4ffc3c3726 [CostModel] Templatize EntryCost::Cost to allow custom cost metrics
We currently use an unsigned value for our CostTblEntry and TypeConversionCostTblEntry cost tables which is limiting depending on how the target wishes to handle various CostKinds etc.

For instance, targets might wish to store separate instruction count, latency or throughput values etc. On D46276 we have been investigating storing a code snippet to improve latency/throughput cost calculations.

There is a slight problem in that template argument deduction was struggling to match the now templatized Costs[] tables in a ArrayRef constructor - I've added helper wrappers for CostTableLookup/ConvertCostTableLookup which avoids us having to update all existing calls with a template hint.

Differential Revision: https://reviews.llvm.org/D106351
2021-07-20 15:31:39 +01:00
Johannes Doerfert d62bbbebbf [Attributor] Initialize effectively unused value to appease UBSAN 2021-07-20 09:18:51 -05:00
Bradley Smith 191f9fa5d2 [AArch64][SVE] Move instcombine like transforms out of SVEIntrinsicOpts
Instead move them to the instcombine that happens in AArch64TargetTransformInfo.

Differential Revision: https://reviews.llvm.org/D106144
2021-07-20 14:17:30 +00:00
Florian Hahn 82834a6732
[VPlan] Fix formatting glitch from d2a73fb44e. 2021-07-20 16:16:30 +02:00
Florian Hahn d2a73fb44e
[VPlan] Add recipe for first-order rec phis, make splicing explicit.
This patch adds a VPFirstOrderRecurrencePHIRecipe, to further untangle
VPWidenPHIRecipe into distinct recipes for distinct use cases/lowering.
See D104989 for a new recipe for reduction phis.

This patch also introduces a new `FirstOrderRecurrenceSplice`
VPInstruction opcode, which is used to make the forming of the vector
recurrence value explicit in VPlan. This more accurately models def-uses
in VPlan and also simplifies code-generation. Now, the vector recurrence
values are created at the right place during VPlan-codegeneration,
rather than during post-VPlan fixups.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D105008
2021-07-20 16:14:17 +02:00
Nico Weber ce5abfafb5 [gn build] remove stray character in a comment 2021-07-20 10:13:48 -04:00
Jamie Schmeiser 9cb00b9ecb Reland Produce warning for performing pointer arithmetic on a null pointer.
Summary:
Test and produce warning for subtracting a pointer from null or subtracting
null from a pointer.

This reland adds the functionality that the warning is no longer reusing an
existing warning, it has different wording for C vs C++ to refect the fact
that nullptr-nullptr has defined behaviour in C++,  it is suppressed
when the warning is triggered by a system header and adds
-Wnull-pointer-subtraction to allow the warning to be controlled.  -Wextra
implies -Wnull-pointer-subtraction.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: efriedma (Eli Friedman), nickdesaulniers (Nick Desaulniers)
Differential Revision: https://reviews.llvm.org/D98798
2021-07-20 10:12:20 -04:00
Stefan Pintilie 02cd937945 [PowerPC][Builtins] Added a number of builtins for compatibility with XL.
Added a number of different builtins that exist in the XL compiler. Most of
these builtins already exist in clang under a different name.

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D104386
2021-07-20 08:57:55 -05:00
Stella Laurenzo 3d25fa21d0 Exclude pybind11 2.7.0 from MLIR python requirements.
Appears to have a broken CMake installation. Reported bug: https://github.com/pybind/pybind11/issues/3136
2021-07-20 06:56:05 -07:00
David Green ee072e20f5 [AArch64] Regenerate some tests checks. NFC 2021-07-20 14:52:36 +01:00
Louis Dionne ec2bdf86f0 [libc++][NFC] Add missing commits to the ABI changelog 2021-07-20 09:19:52 -04:00
Tobias Gysi 3396377743 [linalg] Add TensorDimOp to list of ops known by bufferization.
Bufferization handles all unknown ops conservative. The patch ensures accessing the dimension of an output tensor does not prevent in place bufferization.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D106356
2021-07-20 12:44:13 +00:00
Simon Pilgrim c188f0b876 [X86] X86InstCombineIntrinsic.cpp - silence clang-tidy warnings about incorrect uses of auto. NFCI.
We were using auto instead of auto* in a number of places which failed the llvm-qualified-auto check.

Additionally we were using auto in some places where the type wasn't immediately obvious - the style guide rule of thumb is only to use auto from casts etc. where the type is already explicitly stated.
2021-07-20 13:37:45 +01:00
Simon Pilgrim e7accb75be [MIPS][MSA] Regenerate basic operations test checks
Cleanup the check prefixes to make refresh a lot easier
2021-07-20 13:37:44 +01:00
Sam McCall fd22785054 [Lex] Consider a PCH header-guarded even with #endif truncated
This seems to be a more useful behavior for tools that use preambles.
I believe it doesn't affect real compiles: the PCH is only included once
when used, and recursive inclusion of the main-file *within* the PCH
isn't supported in any case.

Differential Revision: https://reviews.llvm.org/D106204
2021-07-20 14:25:36 +02:00
Haojian Wu eb03fa1d2c [clang-tidy] Don't suggest "inline" fix for main function in
definitions-in-headers check.
2021-07-20 14:24:38 +02:00
Sam McCall 69c04ef95a [clangd] Propagate header-guarded flag from preamble to main AST
Fixes https://github.com/clangd/clangd/issues/377

Differential Revision: https://reviews.llvm.org/D106203
2021-07-20 14:21:39 +02:00
Sam McCall 4190017245 [clangd] Add tests covering existing header-guard behavior. NFC
A few different mechanisms here that will need some work to untangle:
 - self-include in a preamble being an error even if the file is ifdef-guarded
 - the is-include-guarded flag not being propagated from preamble to main ast
 - preambles containing the first half on an include guard discard that info

For now just record current behavior.

Relevant to:
- https://github.com/clangd/clangd/issues/811
- https://github.com/clangd/clangd/issues/377
- https://github.com/clangd/clangd/issues/262

Differential Revision: https://reviews.llvm.org/D106201
2021-07-20 14:12:23 +02:00
LLVM GN Syncbot 978c5d8d2a [gn build] Port 2b08f6af62 2021-07-20 12:00:01 +00:00
Sebastian Neubauer 2b08f6af62 [AMDGPU] Improve register computation for indirect calls
First, collect the register usage in each function, then apply the
maximum register usage of all functions to functions with indirect
calls.

This is more accurate than guessing the maximum register usage without
looking at the actual usage.

As before, assume that indirect calls will hit a function in the
current module.

Differential Revision: https://reviews.llvm.org/D105839
2021-07-20 13:48:50 +02:00
Ulrich Weigand e04c05e823 [SystemZ] Fix invalid assumption in getCPUNameFromS390Model
Code in getCPUNameFromS390Model currently assumes that the
numerical value of the model number always increases with
future hardware.  While this has happened to be the case
with the last few machines, it is not guaranteed -- that
assumption was violated with (much) older machines, and
it can be violated again with future machines.

Fix by explicitly listing model numbers for all supported
machine models.
2021-07-20 13:39:22 +02:00
Timm Bäder 669275f8a0 [llvm][tools] Hide more unrelated tool options
Differential Revision: https://reviews.llvm.org/D106271
2021-07-20 13:27:33 +02:00
Jan Svoboda c94a345a5c [clang][deps] Fix test by checking ignored files correctly
After a rebase, bc1a2979fc accidentally changed `shouldIgnoreFile(Filename)` to incorrect `IgnoredFiles.count(Filename)`. This avoided using native filenames, which the patch intended to solve in the first place.

Failing Windows builds:
* https://lab.llvm.org/buildbot#builders/123/builds/5147
* https://lab.llvm.org/buildbot#builders/86/builds/17177
2021-07-20 13:20:56 +02:00
Jay Foad 0821c8824b [AMDGPU] Pre-commit test case for D106284
This test case shows the scheduler wrongly reordering two buffer
accesses that might alias.
2021-07-20 12:05:33 +01:00
Jeremy Morse 241f3e386c [DebugInfo][InstrRef] Fix a broken substitution method, add test coverage
This patch fixes a clearly-broken function that I absent-mindedly bodged
many months ago.

Over in D85749 I landed the substituteDebugValuesForInst, that creates
substitution records for all the def operands from one debug-labelled
instruction to the new one. Unfortunately it would crash if the two
instructions had different numbers of operands; I tried to fix this in
537f0fbe82 by adding a "max operand" parameter to the method, but then
didn't actually change the loop bound to take account of this. It passed
all the tests because.... well there wasn't any real test coverage of this
method.

This patch fixes up the loop to be bounded by the MaxOperand bound; and
adds test coverage for the x86-fixup-LEAs calls to this method, so that
it's actually tested.

Differential Revision: https://reviews.llvm.org/D105820
2021-07-20 11:45:13 +01:00
Nico Weber 9ced84de09 [gn build] (manually) port bc1a2979fc 2021-07-20 06:43:30 -04:00
Chen Zheng fe8b26199b [PowerPC][NFC] add more cases for lfiwzx/lfiwax 2021-07-20 10:29:56 +00:00
Jan Svoboda e564fd93ab [clang][deps] Avoid minimizing PCH input files
This patch avoid minimizing input files that contributed to a PCH or its modules. This prevents the implicit modular build to fail on unexpected file size. Depends on D106146.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D104536
2021-07-20 12:20:10 +02:00
Jan Svoboda bc1a2979fc [clang][deps] Separate filesystem caches for minimized and original files
This patch separates the local and global caches of `DependencyScanningFilesystem` into two buckets: minimized files and original files. This is necessary to deal with precompiled modules/headers.

Consider a single worker with its instance of filesystem:
1. Build system uses the worker to scan dependencies of module A => filesystem cache gets populated with minimized input files.
2. Build system uses the results to explicitly build module A => explicitly built module captures the state of the real filesystem (containing non-minimized input files).
3. Build system uses the prebuilt module A as an explicit precompiled dependency for another compile job B.
4. Build system uses the same worker to scan dependencies for job B => worker uses implicit modular build to discover dependencies, which validates the filesystem state embedded in the prebuilt module (non-minimized files) to the current view of the filesystem (minimized files), resulting in validation failures.

This problem can be avoided in step 4 by collecting input files from the precompiled module and marking them as "ignored" in the minimizing filesystem. This way, the validation should succeed, since we should be always dealing with the original (non-minized) input files. However, the filesystem already minimized the input files in step 1 and put it in the cache, which gets used in step 4 as well even though it's marked ignored (do not minimize). This patch essentially fixes this oversight by making the `"file is minimized"` part of the cache key (from high level).

Depends on D106064.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D106146
2021-07-20 12:08:46 +02:00
Stanislav Mekhanoshin 9dc2636623 [AMDGPU] Disable LDS lowering for GFX shaders
Apparently these need external LDS symbols to remain.

Fixes: SC1-3279

Differential Revision: https://reviews.llvm.org/D106288
2021-07-20 02:55:25 -07:00
Dawid Jurczak 43234b1595 [DSE] Transform memset + malloc --> calloc (PR25892)
After this change DSE can eliminate malloc + memset and emit calloc.
It's https://reviews.llvm.org/D101440 follow-up.

Differential Revision: https://reviews.llvm.org/D103009
2021-07-20 11:39:05 +02:00
Florian Mayer 5f08219322 Revert "[hwasan] Use stack safety analysis."
This reverts commit e9c63ed10b.
2021-07-20 10:36:46 +01:00
Jan Svoboda 63fd109d3a [clang][deps] Normalize ignored filenames in minimizing file system
This patch normalizes filenames in `DependencyScanningWorkerFilesystem` so that lookup of ignored files works correctly on Windows (where `/` and `\` are equivalent).

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D106064
2021-07-20 11:31:31 +02:00
Florian Mayer 98687aa0d6 [NFC] run clang-format on hwasan use-after-scope tests.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106259
2021-07-20 10:26:26 +01:00
Kai Luo 1453f048cf [PowerPC] Add lit.local.cfg in AtomicExpand tests
Fixed build errors on other platforms.
2021-07-20 09:13:50 +00:00
Florian Mayer f3f287f0f6 [hwasan] [NFC] copy and disable ASAN tests to hwasan.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106159
2021-07-20 10:12:14 +01:00
Florian Mayer e9c63ed10b [hwasan] Use stack safety analysis.
This avoids unnecessary instrumentation.

Reviewed By: eugenis, vitalybuka

Differential Revision: https://reviews.llvm.org/D105703
2021-07-20 10:06:35 +01:00
Sander de Smalen eb1a5120b8 [AArch64][SVE][InstCombine] last{a,b} of a splat vector
Replace last{a,b}(splat(X)) with X, irrespective of the predicate.

Patch by/Committing on behalf of: Usman Nadeem (mnadeem)

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D105520
2021-07-20 09:44:43 +01:00
Benjamin Kramer aa09d1f9c9 [lldb] Remove unused variable. NFCI 2021-07-20 10:34:05 +02:00
Cullen Rhodes 15af3aaa2e [AArch64][SME] Add system registers and related instructions
This patch adds the new system registers introduced in SME:

  - ID_AA64SMFR0_EL1 (ro) SME feature identifier.
  - SMCR_ELx (r/w) streaming mode control register for configuring
    effective SVE Streaming SVE Vector length when the PE is in
    Streaming SVE mode.
  - SVCR (r/w) streaming vector control register, visible at all
    exception levels. Provides access to PSTATE.SM and PSTATE.ZA
    using MSR and MRS instructions.
  - SMPRI_EL1 (r/w) streaming mode execution priority register.
  - SMPRIMAP_EL2 (r/w) streaming mode priority mapping register.
  - SMIDR_EL1 (ro) streaming mode identification register.
  - TPIDR2_EL0 (r/w) for use by SME software to manage per-thread
    SME context.
  - MPAMSM_EL1 (r/w) MPAM (v8.4) streaming mode register, for
    labelling memory accesses performed in streaming mode.

Also added in this patch are the SME mode change instructions.
Three MSR immediate instructions are implemented to set or clear
PSTATE.SM, PSTATE.ZA, or both respectively:

  - MSR SVCRSM, #<imm1>
  - MSR SVCRZA, #<imm1>
  - MSR SVCRSMZA, #<imm1>

The following smstart/smstop aliases are also implemented for
convenience:

  smstart    -> MSR SVCRSMZA, #1
  smstart sm -> MSR SVCRSM,   #1
  smstart za -> MSR SVCRZA,   #1

  smstop     -> MSR SVCRSMZA, #0
  smstop sm  -> MSR SVCRSM,   #0
  smstop za  -> MSR SVCRZA,   #0

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D105576
2021-07-20 08:06:26 +00:00
Chia-hung Duan b4001ae885 [mlir-tblgen] Fix failed matching when binds same operand of an op in different depth
For example, we will generate incorrect code for the pattern,

def : Pat<((FooOp (FooOp, $a, $b), $b)), (...)>;

We didn't allow $b to be bond twice with same operand of same op.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105677
2021-07-20 15:43:09 +08:00