Commit Graph

378200 Commits

Author SHA1 Message Date
Mircea Trofin 0c0d009a88 [NFC] Disallow unused prefixes under clang/test/CodeGen
Differential Revision: https://reviews.llvm.org/D95417
2021-01-26 08:05:45 -08:00
Alexander Belyaev 80966447a2 [mlir][nfc] Move `getInnermostParallelLoops` to SCF/Transforms/Utils.h. 2021-01-26 17:00:15 +01:00
Simon Pilgrim feb0b4ec0a [Sema] diagnoseEquivalentInternalLinkageDeclarations - assert for non-null NamedDecl. NFCI.
Fixes clang static analysis warnings.
2021-01-26 15:51:49 +00:00
Simon Pilgrim ee3da8958a [AMDGPU] Fix null-dereference static analysis warnings. NFCI.
Avoid repeated calls to isZeroValue() and check for a null pointer before dereferencing a dyn_cast<>.
2021-01-26 15:43:59 +00:00
George Rokos 94cf89d1c2 [libomptarget][NFC] Fixed obsolete function names in comments 2021-01-26 07:39:42 -08:00
Matt Arsenault 551a69e418 AMDGPU: Clear IsSSA property in SIFormMemoryClauses
Fixes verifier error when writing MIR testcases
2021-01-26 10:40:41 -05:00
Florian Hahn 1272f16d14
[LoopUnswitch] Avoid partially unswitching too aggressively.
This patch adds additional checks to avoid partial unswitching
in cases where it won't be profitable, e.g. because the path directly
exits the loop anyways.
2021-01-26 15:18:41 +00:00
Florian Hahn b2b2aa1c60
[LoopUnswitch] Add some additional tests.
Add a few additional tests where partial unswitching is not really
profitable and should be avoided.
2021-01-26 15:12:45 +00:00
Simon Pilgrim 110837fbf6 Fix signed/unsigned comparison warning. NFCI. 2021-01-26 15:04:49 +00:00
Sander de Smalen b9417c3616 [CostModel] Handle CTLZ and CCTZ in getTypeBasedIntrinsicInstrCost
Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D95355
2021-01-26 14:37:51 +00:00
Sebastian Neubauer b36370d153 [AMDGPU] Add IntrWillReturn to three intrinsics
None of these can terminate a wave or lane.
With these, all intrinsic are IntrWillReturn except those that change
exec or can terminate the wave.

Not marking intrinsics as WillReturn may prevent optimizations in the
future: https://lists.llvm.org/pipermail/llvm-dev/2021-January/148047.html

Differential Revision: https://reviews.llvm.org/D95436
2021-01-26 15:33:15 +01:00
Mirko Brkusanin 608ac62540 [AMDGPU] Fix use of HasModifiers in VopProfile
HasModifiers should be true if at least one modifier is used.
This should make the use of this field bit more consistent.

Differential Revision: https://reviews.llvm.org/D94795
2021-01-26 15:21:11 +01:00
Florian Hahn 35b3989a30
[Passes] Run peeling as part of simple/full loop unrolling.
Loop peeling removes conditions from loop bodies that become invariant
after a small number of iterations. When triggered, this leads to fewer
compares and possibly PHIs in loop bodies, enabling further
optimizations. The current cost-model of loop peeling should be quite
conservative/safe, i.e. only peel if a condition in the loop becomes
known after peeling.

For example, see PR47671, where loop peeling enables vectorization by
removing a PHI the vectorizer does not understand. Granted, the
loop-vectorizer could also be taught about constant PHIs, but loop
peeling is likely to enable other optimizations as well.

This has an impact on quite a few benchmarks from
MultiSource/SPEC2000/SPEC2006 on X86 with -O3 -flto, for example

    Same hash: 186 (filtered out)
    Remaining: 51
    Metric: loop-vectorize.LoopsVectorized

    Program                                        base   patch  diff
     test-suite...ve-susan/automotive-susan.test     8.00   9.00 12.5%
     test-suite...nal/skidmarks10/skidmarks.test    35.00  31.00 -11.4%
     test-suite...lications/sqlite3/sqlite3.test    41.00  43.00  4.9%
     test-suite...s/ASC_Sequoia/AMGmk/AMGmk.test    25.00  26.00  4.0%
     test-suite...006/450.soplex/450.soplex.test    88.00  89.00  1.1%
     test-suite...TimberWolfMC/timberwolfmc.test   120.00 119.00 -0.8%
     test-suite.../CINT2006/403.gcc/403.gcc.test   215.00 216.00  0.5%
     test-suite...006/447.dealII/447.dealII.test   957.00 958.00  0.1%
     test-suite...ternal/HMMER/hmmcalibrate.test    75.00  75.00  0.0%

    Same hash: 186 (filtered out)
    Remaining: 51
    Metric: loop-vectorize.LoopsAnalyzed

    Program                                        base    patch   diff
     test-suite...ks/Prolangs-C/agrep/agrep.test   440.00  434.00  -1.4%
     test-suite...nal/skidmarks10/skidmarks.test   312.00  308.00  -1.3%
     test-suite...marks/7zip/7zip-benchmark.test   6399.00 6323.00 -1.2%
     test-suite...lications/minisat/minisat.test   134.00  135.00   0.7%
     test-suite...rks/FreeBench/pifft/pifft.test   295.00  297.00   0.7%
     test-suite...TimberWolfMC/timberwolfmc.test   1879.00 1869.00 -0.5%
     test-suite...pplications/treecc/treecc.test   689.00  691.00   0.3%
     test-suite...T2000/300.twolf/300.twolf.test   1593.00 1597.00  0.3%
     test-suite.../Benchmarks/Bullet/bullet.test   1394.00 1392.00 -0.1%
     test-suite...ications/JM/ldecod/ldecod.test   1431.00 1429.00 -0.1%
     test-suite...6/464.h264ref/464.h264ref.test   2229.00 2230.00  0.0%
     test-suite...lications/sqlite3/sqlite3.test   2590.00 2589.00 -0.0%
     test-suite...ications/JM/lencod/lencod.test   2732.00 2733.00  0.0%
     test-suite...006/453.povray/453.povray.test   3395.00 3394.00 -0.0%

Note the -11% regression in number of loops vectorized for skidmarks. I
suspect this corresponds to the fact that those loops are gone now (see
the reduction in number of loops analyzed by LV).

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D88471
2021-01-26 13:52:30 +00:00
Lang Hames 4dc110a4b8 [ORC] Attempt to auto-claim responsibility for weak defs in ObjectLinkingLayer.
Compilers may insert new definitions during compilation, E.g. EH personality
function pointers, or named constant pool entries. This commit causes
ObjectLinkingLayer to attempt to claim responsibility for all weak definitions
in objects as they're linked. This is always safe (first claimant for each
symbol is granted responsibility, subsequent claims are rejected without error)
and prevents compiler-injected symbols from being dead-stripped (which they
will be if they remain unclaimed by anyone).

This change was motivated by errors seen by an out-of-tree client while testing
eh-frame support in JITLink ELF/x86-64: IR containing exceptions didn't define
DW.ref.__gxx_personality_v0 (since it's added by CodeGen), and this caused
DW.ref.__gxx_personality_v0 to be dead-stripped leading to linker failures.

No test case yet: We won't have a way to test in-tree until we enable JITLink
for lli on Linux.
2021-01-27 00:09:40 +11:00
Andrzej Warzynski e878589098 Revert "[flang] Search for #include "file" in right directory"
This reverts commit d987b61b1d.

As pointed out in https://reviews.llvm.org/D95388, the reverted commit
causes build failures in the following Flang buildbots:
  * http://lab.llvm.org:8011/#/builders/32/builds/2642
  * http://lab.llvm.org:8011/#/builders/33/builds/2131
  * http://lab.llvm.org:8011/#/builders/135/builds/1473
  * http://lab.llvm.org:8011/#/builders/66/builds/1559
  * http://lab.llvm.org:8011/#/builders/134/builds/1409
  * http://lab.llvm.org:8011/#/builders/132/builds/1817
I'm guessing that the patch was only tested with
`FLANG_BUILD_NEW_DRIVER=Off` (i.e. the default). The builders listed
above set `FLANG_BUILD_NEW_DRIVER` to `On`.

Although fixing the build is relatively easy, the reverted patch
modifies the behaviour of the frontend, which breaks driver tests. In
particular, in https://reviews.llvm.org/D93453 support for `-I` was
added that depends on the current behaviour. The reverted patch
changes that behaviour. Either the tests have to be updated or the
change fine-tuned.
2021-01-26 13:07:14 +00:00
Zarko Todorovski 028d7a3668 Remove requirement for -maltivec to be used when using -mabi=vec-extabi or -mabi=vec-default when not using vector code
The previous implementation required that `-maltivec` be specified when using either `-mabi=vec-extabi` or `-mabi=vec-default`, this patch removes that requirement.

Reviewed By: cebowleratibm

Differential Revision: https://reviews.llvm.org/D94986
2021-01-26 07:58:01 -05:00
Lang Hames 476abdb562 [ORC] Fix debug logging message. 2021-01-26 23:52:44 +11:00
Lang Hames b3e0135a6f [JITLink][ELF/x86-64] When building PLT stub, use -4 offset for PCRel32.
This is required for ELF where PCRel32 doesn't implicitly subtract 4.

No test case yet: I haven't figured out a good way to test stub
generation -- this may required extensions to jitlink-check.
2021-01-26 23:51:58 +11:00
Alexey Bataev 4a63e53373
[LIBOMPTARGET]FIX define declaration, NFC
Fixed declaration of define by adding a comma symbol. Required to fix build without profiling.
2021-01-26 07:43:31 -05:00
Alex Zinenko 91bd1156f3 [mlir] drop unused statics 2021-01-26 13:30:45 +01:00
Adhemerval Zanella 988cc0a083 [LLD][ELF][AArch64] Add support for R_AARCH64_LD64_GOTPAGE_LO15 relocation
It is not used by LLVM, but GCC might generates it when compiling
with -fpie, as indicated by PR#40357 [1].

[1] https://bugs.llvm.org/show_bug.cgi?id=40357
2021-01-26 12:01:38 +00:00
Dmitry Preobrazhensky 745064e36b [AMDGPU][MC] Refactored exp tgt handling
Summary:
- Separated tgt encoding from parsing;
- Separated tgt decoding from printing;
- Improved errors handling;
- Disabled leading zeroes in index. The following code is no longer accepted: exp pos00 v3, v2, v1, v0

Reviewers: arsenm, rampitec, foad

Differential Revision: https://reviews.llvm.org/D95216
2021-01-26 14:54:15 +03:00
Eugene Zhulenev 25f80e16d1 [mlir] Async: add a separate pass to lower from async to async.coro and async.runtime
Depends On D95000

Move async.execute outlining and async -> async.runtime lowering into the separate Async transformation pass

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D95311
2021-01-26 03:33:20 -08:00
David Sherwood 7c164a9225 [SVE] Fix some logical arithmetic tests
There were some right-shift tests in

  CodeGen/AArch64/sve-int-arith-imm.ll

that were being folded away because we were shifting all the bits
out to the right. I've updated the tests to ensure this doesn't
happen.
2021-01-26 11:06:09 +00:00
Marek Kurdej 6d5c1cd2ab Revert "[clang-format] add case aware include sorting"
This reverts commit 3395a336b0 as there was a post-merge doubt about option naming and type.
2021-01-26 11:58:56 +01:00
Eugene Zhulenev 2f7baffdc1 [mlir:async] Use ODS to define async types
Depends On D94923

Migrate Async dialect to ODS `TypeDef`

Reviewed By: ftynse, rriddle

Differential Revision: https://reviews.llvm.org/D95000
2021-01-26 02:37:50 -08:00
Georgii Rymar d5e48f1347 [yaml2obj][obj2yaml] - Improve how we set/dump the sh_entsize field.
We already set the `sh_entsize` field in a single place
for all non-implicit sections.

This patch reorders the logic slightly and with it
we finally have the only one place where the `sh_entsize` is set.

obj2yaml will not dump the `EntSize` key for `SHT_DYNSYM/SHT_SYMTAB` sections anymore,
when the value of `sh_entsize` is equal to `sizeof(Elf_Sym)`

Note that this also seems revealed an issue in llvm-objcopy:
Previously yaml2obj set the `sh_entsize` for the `.symtab` section to 0x18,
now we it sets it for `SHT_SYMTAB` sections, i.e. by type.
But the `llvm-objcopy/ELF/only-keep-debug.test` has a `.symtab` section of type `SHT_STRTAB`,
and now yaml2obj sets the `sh_entsize` to 0 for it.
I had to update the corresponding check lines for `ES`, but the behavior of
`llvm-objcopy` should be fixed instead I think.
I've added a TODO and a comment.

Differential revision: https://reviews.llvm.org/D95364
2021-01-26 13:33:02 +03:00
Martin Storsjö 510b3d4b3e [llvm-nm] Silence a gcc warning about a stray semicolon. NFC. 2021-01-26 12:29:14 +02:00
Ben Shi 2d7aa149a4 [update_llc_test_checks] Support AVR
Reviewed By: arichardson

Differential Revision: https://reviews.llvm.org/D95240
2021-01-26 17:50:56 +08:00
Georgii Rymar 2a33b092f5 [LLDB][test] - Fix test after yaml2obj change.
D95354 started to set the sh_link field for SHT_SYMTAB sections.
Previously it was set for symbol tables basing on their names (e.g. ".symtab").

This test now crashes see:
http://lab.llvm.org:8011/#/builders/68/builds/5911

I updated it to restore the old behavior.
2021-01-26 12:42:54 +03:00
Jan Svoboda 7025fef3f6 [clang][cli] Port GPU-related language options to marshalling system
Port some GPU-related language options to the marshalling system for automatic command line parsing and generation.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95345
2021-01-26 10:36:16 +01:00
Georgii Rymar 029644ee51 [yaml2obj] - Refine how we set the sh_link field. NFCI.
This refactors the logic that sets the `sh_link` field.
With this patch we set it in a single place for all sections.

Differential revision: https://reviews.llvm.org/D95354
2021-01-26 12:20:57 +03:00
Georgii Rymar db92d47cf7 [llvm-nm][ELF] - Use @@ prefix when printing default versions.
llvm-readelf prints default versions with `@@` prefix.
This patch does the same for llvm-nm.

Differential revision: https://reviews.llvm.org/D94912
2021-01-26 12:16:38 +03:00
Haojian Wu 68dbd1aefe [clangd] Add include-fixer fixit for no_member_template diagnostic.
Differential Revision: https://reviews.llvm.org/D95365
2021-01-26 10:11:06 +01:00
Georgii Rymar e98d5c3192 [libObject,llvm-readelf/obj] - Don't use @@ when printing versions of undefined symbols.
A default version (@@) is only available for defined symbols.

Currently we use "@@" for undefined symbols too.
This patch fixes the issue and improves our test case.

Differential revision: https://reviews.llvm.org/D95219
2021-01-26 12:05:59 +03:00
Craig Topper bfc60acd98 [RISCV] Adjust RISCVInstrInfoVSDPatterns.td for different pseudo instructions for different FPR.
Move the Suffix string into the VTypeInfo class so we don't need a helper class to get to it.

Adjust pseudo naming scheme for FPRs to put F16/F32/F64 in
place of F in the pseudo instruction name rather than as a suffix.
This avoids special cases like VFMERGE from the original patch.

Differential Revision: https://reviews.llvm.org/D95404
2021-01-26 01:00:50 -08:00
Freddy Ye b3b0acdc6f [NFC] Refine some uninitialized used variables.
These warning are reported by static code analysis tool: Klocwork

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D95421
2021-01-26 16:51:05 +08:00
Kadir Cetinkaya 64cdba65bb
[clangd] Fix filename completion at the end of file
Fixes https://github.com/clangd/clangd/issues/433

Differential Revision: https://reviews.llvm.org/D95419
2021-01-26 09:45:21 +01:00
Jan Svoboda 9338f3a586 [clang][cli] Accept strings instead of options in ImpliedByAnyOf
To be able to refer to constant keypaths (e.g. `defvar cplusplus = LangOpts<"CPlusPlus">`) inside `ImpliedByAnyOf`, let's accept strings instead of `Option` instances.

This somewhat weakens the guarantees that we're referring to an existing (option) record, but we can still use the option.KeyPath syntax to simulate this.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95344
2021-01-26 09:30:36 +01:00
Jan Svoboda 956d8e02e8 [clang][cli] Port GNU language options to marshalling system
Port some GNU-related language options to the marshalling system for automatic command line parsing and generation.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95343
2021-01-26 09:20:42 +01:00
Jan Svoboda 2154cffdc2 [clang][cli] Store LangStandard::Kind in LangOptions
The `LangStandard::Kind` parsed from command line arguments is used to set up some `LangOption` defaults, but isn't stored anywhere.

To be able to generate `-std=` (in future patch), we need `CompilerInvocation` to not forget it.

This patch demonstrates another use-case: using `LangStd` to set up defaults of marshalled options.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95342
2021-01-26 09:05:43 +01:00
Hsiangkai Wang e72b22a40b [RISCV] Define different pseudo instructions for different FPR.
When spilling, the spill size will depend on the size of register class.
For .vf vector instructions, it may spill the floating point scalar
argument. In order to use the correct load/store instructions for
spilling, we need to provide the correct floating point register class
for the .vf vector pseudo instructions.

In this commit, we define the .vf pseudo instructions as three
different kinds of pseudo instructions for half/float/double. For
example, PseudoVFADD_M1 will become as PseudoVFADD_F16_M1,
PseudoVFADD_F32_M1, and PseudoVFADD_F64_M1.

Differential Revision: https://reviews.llvm.org/D95234
2021-01-26 15:48:35 +08:00
Jan Svoboda b61639985e [clang][cli] NFC: Simplify BoolOption API
The `Bool{,F,G}Option` TableGen classes were designed after `Opt{In,Out}FFlag`, which put marshalling info on only one of the boolean options. To encode which record is supposed to carry the marshalling info (and be visible on -cc1 command-line), we used the `ChangedBy` and `ResetBy` classes.

However, we need to put marshalling info on both records anyways (see D93008 for details). This means we don't really need the distinction between `ChangedBy/ResetBy + BoolOption` and `FlagDef + BoolOptionBase` anymore.

This patch reduces the number of ways one can encode the marshalling information for pairs of boolean flags. Regardless of whether the key path value defaults to a statically known boolean, or a result of an expression, one can always use the new `BoolOption` and `PosFlag<SetTrue>, NegFlag<SetFalse>` syntax.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95340
2021-01-26 08:41:39 +01:00
Matthias Springer 90ebc489de Add vp2intersect to AVX512 dialect.
Adds vp2intersect to the AVX512 dialect and defines a lowering to the
LLVM dialect.

Author: Matthias Springer <springerm@google.com>

Differential Revision: https://reviews.llvm.org/D95301
2021-01-26 07:32:26 +00:00
Sam Clegg d705c2fbd4 Revert "[WebAssembly] MC layer writes table symbols to object files"
This reverts commit d806618636.
Review: https://reviews.llvm.org/D92215

We had issues where older versions of wasm-ld were crashing on object
files containing a table symbol.  We decided that the best strategy
going forward is to only generate these symbol if refernece types is
enabled.  Without reference types enabled we should never geneate a
table symbol or a TABLE_NUMBER relocation.

This revert is in addition to the one already reverted in
https://reviews.llvm.org/D95005.

The plan is to re-land these in updated form after the llvm 12 branch.

Differential Revision: https://reviews.llvm.org/D95420
2021-01-25 22:32:36 -08:00
Sam Clegg 84c6f32584 [Object][WebAssembly] Update format of error messages
Error message should start with lowercase in accordance with
https://llvm.org/docs/CodingStandards.html#error-and-warning-messages

Differential Revision: https://reviews.llvm.org/D95239
2021-01-25 21:12:53 -08:00
zhanghb97 a2914e0c15 [mlir][Python] Fix comments of 'getCapsule' and 'createFromCapsule'
The `getCapsule` and `createFromCapsule` comments incorrectly state the `PyMlirContext` and `MlirContext` in `PyLocation`, `PyAttribute`, and `PyType` classes.

Differential Revision: https://reviews.llvm.org/D95413
2021-01-26 12:53:21 +08:00
Johannes Doerfert 8c7fdc4c61 [OpenMP] Add source location information to the libomptarget profile
In much of the libomptarget interface we have an ident_t object now, if
it is not null we can use it to improve the profile output. For now, we
simply use the ident_t "source information string" as generated by the
FE.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D95282
2021-01-25 22:43:43 -06:00
Johannes Doerfert bd756286d2 [OpenMP][FIX] Enforce a function boundary for a new data environment
Whenever we enter a new OpenMP data environment we want to enter a
function to simplify reasoning. Later we probably want to remove the
entire specialization wrt. the if clause and pass the result to the
runtime, for now this should fix PR48686.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D94315
2021-01-25 22:43:37 -06:00
Hsiangkai Wang f19849a07b [RISCV] Update V extension to v1.0-draft 08a0b464.
Differential Revision: https://reviews.llvm.org/D94583
2021-01-26 12:02:43 +08:00