Commit Graph

412957 Commits

Author SHA1 Message Date
Paul Walker 30efee764d [SVE] Remove AArch64ISD::PFALSE.
AArch64ISD::PFALSE does not provide any value, in fact it can
prevent common combines from firing.  We only needed to lower
to PFALSE until ISD::SPLAT_VECTOR became generally available.

Differential Revision: https://reviews.llvm.org/D118469
2022-01-29 11:31:00 +00:00
Paul Walker 3bc876d0a3 [AArch64] Add isel for bitcasting between bfloat and half types.
Differential Revision: https://reviews.llvm.org/D118420
2022-01-29 11:26:13 +00:00
Simon Pilgrim 058c5dfc78 Raise the minimum Visual Studio version to VS2019
As raised here: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153881.html

Now that VS2022 is on general release, LLVM is expected to build on VS2017, VS2019 and VS2022, which is proving hazardous to maintain due to changes in behaviour including preprocessor and constexpr changes. Plus of the few developers that work with VS, many have already moved to VS2019/22.

This patch proposes to raise the minimum supported version to VS2019 (16.x) - I've made the hard limit 16.0 or later, with the soft limit VS2019 16.7 - older versions of VS2019 are "allowed" (at your own risk) via the LLVM_FORCE_USE_OLD_TOOLCHAIN cmake flag.

Differential Revision: https://reviews.llvm.org/D114639
2022-01-29 10:56:41 +00:00
Nikita Popov 784e01abca [IR] Require matching signature in getCalledFunction()
With opaque pointers, it's possible to directly call a function with
a different signature, without an intermediate bitcast. However,
lot's of code using getCalledFunction() reasonably assumes that the
signatures match (which is always true without opaque pointers).
Add an explicit check to that effect.

The test case is from D105313, where I ran into the problem, but on
further investigation this also affects lots of other code, we just
have little coverage with mismatching signatures. The change from
D105313 is still desirable for other reasons, but this patch
addresses the root problem when it comes to opaque pointers.

Differential Revision: https://reviews.llvm.org/D105733
2022-01-29 10:01:20 +01:00
Craig Topper 8faf2a0638 [RISCV] Correct predicate orc.b pattern to not include Zbkb.
This was incorrectly lumped in when the predicate was changed for
the rotate instructions.
2022-01-29 00:10:54 -08:00
Paulo Matos 864767ab09 [WebAssembly][NFC] Refactor WasmSymbol type setting code
This refactors some code dealing with setting Wasm symbol types.
Some of the code dealing with types was moved from
`WebAssemblyUtilities` to  `WebAssemblyTypeUtilities`.

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D118121
2022-01-29 09:00:51 +01:00
Craig Topper d8f929a567 [RISCV] Custom legalize BITREVERSE with Zbkb.
With Zbkb, a bitreverse can be split into a rev8 and a brev8.

Reviewed By: VincentWu

Differential Revision: https://reviews.llvm.org/D118430
2022-01-28 23:11:12 -08:00
Shivam Gupta c95df64ce0 [NFC] Add missing doxygen file tag in llvm/include/llvm/ADT/ headers
Few header file don't have file tag in them. This patch can be help
in viewing doxygen documentation. When we hover on the included header
file, small description will display.

Reviewed By: aaron.ballman, xgupta

Differential Revision: https://reviews.llvm.org/D116004
2022-01-29 12:26:32 +05:30
Craig Topper 1aeb3314d8 [TableGen] Detect multiple Processors with the same name.
Due to a bad merge we ended up with duplicate entries in our
downstream repo. I was surprised that nothing caught it. I wrote
this check so I could fix our downstream repo and figured I might
as well share it.

Reviewed By: RKSimon, spatel

Differential Revision: https://reviews.llvm.org/D118497
2022-01-28 22:53:51 -08:00
Konstantin Varlamov 46283589ef [libc++][ranges][NFC] Small cleanup to the Ranges status page.
- add a few missing links to code reviews;
- reorder the views to follow the same order as in the Standard.
2022-01-28 22:40:07 -08:00
Fangrui Song f097c108b8 [ELF][test] Improve INSERT [AFTER|BEFORE] and adjustSectionsBeforeSorting tests 2022-01-28 22:21:13 -08:00
John Ericson 7017e6c9cf [cmake] Partially deduplicate `{llvm,compiler_rt}_check_linker_flag` for runtime libs and llvm
We previously had a few varied definitions of this floating around.

I had tried to make the one installed with LLVM handle all the cases, and then made the others use it, but this ran into issues with `HandleOutOfTreeLLVM` not working for compiler-rt, and also `CMAKE_EXE_LINKER_FLAGS` not working right without `CMP0056` set to the new behavior.

 My compromise solution is this:

 - No not completely deduplicate: the runtime libs will instead use a version that still exists as part of the internal and not installed common shared CMake utilities. This avoids `HandleOutOfTreeLLVM` or a workaround for compiler-rt.

- Continue to use `CMAKE_REQUIRED_FLAGS`, which effects compilation and linking. Maybe this is unnecessary, but it's safer to leave that as a future change. Also means we can avoid `CMP0056` for now, to try out later, which is good incrementality too.

- Call it `llvm_check_compiler_linker_flag` since it, in fact is about both per its implementation (before and after this patch), so there is no name collision.

In the future, we might still enable CMP0056 and make compiler-rt work with HandleOutOfTreeLLVM, which case we delete `llvm_check_compiler_flag` and go back to the old way (as these are, in fact, linking related flags), but that I leave for someone else as future work.

The original issue was reported to me in https://reviews.llvm.org/D116521#3248117 as
D116521 made clang and LLVM use the common cmake utils.

Reviewed By: sebastian-ne, phosek, #libunwind, #libc, #libc_abi, ldionne

Differential Revision: https://reviews.llvm.org/D117537
2022-01-29 06:07:24 +00:00
Shilei Tian 184f94a8a8 [OpenMP] Fix wrong number in openmp/runtime/src/dllexports
This patch fixes the issue that numbers assigned to `interop` functions were already taken in `openmp/runtime/src/dllexports`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118523
2022-01-29 00:23:08 -05:00
Petr Hosek 71dcd9bd04 [ELF] Change the search order for dependent libraries
When processing dependent libraries, if there's a directory of the same
name as the library being searched for, either in the current directory
or earlier in the search order, LLD will try to open it and report an
error. This is because LLD uses file existence check. To address this
issue we reverse the order, searching the library by basename first
and only considering search paths later, and current directory last.

Differential Revision: https://reviews.llvm.org/D118498
2022-01-28 20:46:01 -08:00
Max Kazantsev 3b194ca7ab Recommit "[InstCombine] Fold and-reduce idiom"
Checks of original vector types made more thorough.

Differential Revision: https://reviews.llvm.org/D118317
2022-01-29 11:27:48 +07:00
Konstantin Varlamov c38c134b62 [libc++][ranges][NFC] Update and slightly cleanup Ranges status page.
- add missing links to sections of the Standard and to patches;
- update the status on a couple of items.
2022-01-28 20:15:36 -08:00
Sanjoy Das c080456d64 Delete dead code
Differential Revision: https://reviews.llvm.org/D118501
2022-01-28 20:01:35 -08:00
Luo, Yuanke be44177ede [X86][avx512fp16] Promote fp16 to fp32 for frem.
Promote fp16 to fp32 for frem.

Differential Revision: https://reviews.llvm.org/D118470
2022-01-29 11:41:27 +08:00
Nico Weber 106f2b2dfb [gn build] (manually) port 99217fa8a0 2022-01-28 22:33:19 -05:00
Ye Luo bafb6f3e9c [OpenMP] disable build of old nvptx device runtime
Fully respect LIBOMPTARGET_BUILD_NVPTX_BCLIB. There is no CUDA toolchain dependency. Complement D118268.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118522
2022-01-28 21:25:48 -06:00
Max Kazantsev 521205c084 [Test] Add pointer comparison test that crashed with D118317 2022-01-29 10:13:00 +07:00
jacquesguan 1276678982 [RISCV] Improve extract_vector_elt for fixed mask registers.
Now the backend promotes mask vector to an i8 vector and extract element from that. We could bitcast to a widen element vector, and extract from it to GPR, then use I instruction to extract the certain bit.

Differential Revision: https://reviews.llvm.org/D117389
2022-01-29 11:07:53 +08:00
Max Kazantsev bf4cab29f5 [Test] Recommit tests that were reverted by mistake along with other patch 2022-01-29 09:53:36 +07:00
Sheng e64feaf00f [M68k][GlobalISel] Legalize more instruction in M68k Legalizer.
This patch legalizes more instructions and data types.

Differential Revision: https://reviews.llvm.org/D117264
2022-01-29 09:59:58 +08:00
Sam McCall 93cf9640fa Add 'clangd' prefix to remote index proto targets
Some pieces of build infrastructure (shlib, debian package) classify
targets based on whether they begin with "clang".
2022-01-29 02:20:52 +01:00
David Greene 7e32d2b21a Revert "[UpdateTestChecks] Add --filter and --filter-out options"
Broke some update-test-checks tests.  Reverting while developing a fix.

This reverts commit 030f71698d.
2022-01-28 17:06:51 -08:00
Jeff Bailey 4465c29906 Move LLVM Proposal to doc directory, create index
The LLVM Libc project is no longer just a proposal and should have
a webpage tracking the status of the project.  This changes
puts the pieces into the right place so that the webpage can be
created.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D117436
2022-01-29 00:29:31 +00:00
Peter Steinfeld eb933225f4 [flang] Implement a runtime routine to report fatal errors with source position
The title says it all.

I implemented a routine called "Crash" and added a test.

Differential Revision: https://reviews.llvm.org/D118509
2022-01-28 15:46:00 -08:00
Joseph Huber 24f88f57de [OpenMP] Accept shortened triples for -Xopenmp-target=
This patch builds on the change in D117634 that expanded the short
triples when passed in by the user. This patch adds the same
functionality for the `-Xopenmp-target=` flag. Previously it was
unintuitive that passing `-fopenmp-targets=nvptx64
-Xopenmp-target=nvptx64 <arg>` would not forward the arg because the
triples did not match on account of `nvptx64` being expanded to
`nvptx64-nvidia-cuda`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118495
2022-01-28 18:22:17 -05:00
Jan Korous fad7e491a0 Revert "Add BITINT_MAXWIDTH support"
This reverts commit 86797fdb6f.

Differential Revision: https://reviews.llvm.org/D117238
2022-01-28 15:18:49 -08:00
wren romano b85ed4e0e1 [mlir][sparse] Adding standard pipeline for tests.
Addresses https://bugs.llvm.org/show_bug.cgi?id=52409 aka https://github.com/llvm/llvm-project/issues/51751

Reviewed By: aartbik, mehdi_amini

Differential Revision: https://reviews.llvm.org/D117919
2022-01-28 15:11:12 -08:00
Richard 99217fa8a0 [clang-tidy] Recognize labelled statements when simplifying boolean exprs
Inside a switch the caseStmt() and defaultStmt() have a nested statement
associated with them.  Similarly, labelStmt() has a nested statement.
These statements were being missed when looking for a compound-if of the
form "if (x) return true; return false;" when the if is nested under one
of these labelling constructs.

Enhance the matchers to look for these nested statements using some
private matcher hasSubstatement() traversal matcher on case, default
and label statements.  Add the private matcher hasSubstatementSequence()
to match the compound "if (x) return true; return false;" pattern.

- Add unit tests for private matchers and corresponding test
  infrastructure
- Add corresponding test file readability-simplify-bool-expr-case.cpp.
- Fix variable name copy/paste error in readability-simplify-bool-expr.cpp.
- Drop the asserts, which were used only for debugging matchers.
- Run clang-format on the whole check.
- Move local functions out of anonymous namespace and declare state, per
  LLVM style guide
- Declare labels constexpr
- Declare visitor arguments as pointer to const
- Drop braces around simple control statements per LLVM style guide
- Prefer explicit arguments over default arguments to methods

Differential Revision: https://reviews.llvm.org/D56303

Fixes #27078
2022-01-28 16:09:46 -07:00
Fangrui Song 5fc1261ef3 [Driver] Remove -fno-experimental-new-pass-manager
to give users a final warning that they need to migrate away. They could still
use -flegacy-pass-manager for Clang 14.0.0, but the functionality may not work
for 15.0.0.

-fexperimental-new-pass-manager is a no-op for default builds, so not urgent to
be removed for 14.0.0.

clang/test/Frontend/optimization-remark-with-hotness.c is removed because its
new PM replacement optimization-remark-with-hotness-new-pm.c exists.

Reviewed By: aeubanks, nikic

Differential Revision: https://reviews.llvm.org/D118313
2022-01-28 14:58:26 -08:00
Krzysztof Drewniak e7d0dae76e [MLIR][GPU] Add missing #include to SerializeToHsaco.cpp
llvm/Support/Path.h was likely previously implicitly included, and a
refactoring removed that inclusion, breaking the pass.

Differential Revision: https://reviews.llvm.org/D118508
2022-01-28 22:56:38 +00:00
Krzysztof Drewniak c918c68f5c [MLIR] Factor out common parts of the TLike constraint
Type constraints such as BoolLike and SignlessIntegerLike appear to
have been defined by copy-paste and all share an underlying TypesLike
structure that can be factored out.

This also allows for defining additional constraints of a similar
form, such as F32Like.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118382
2022-01-28 22:55:41 +00:00
Adrian Prantl 2081ffe4b2 Update module map for 4ce1f3d47c 2022-01-28 14:52:25 -08:00
Daniele Castagna 6eb826567a
[Driver] Add CUDA support for --offload param
The --offload option was added in D110622 to "override the default
device target". When it landed it supported only HIP.  This patch
extends that option to support SPIR-V targets for CUDA.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D117137
2022-01-28 14:50:39 -08:00
William S. Moses 99d2582164 [ScalarEvolution] Handle <= and >= in non infinite loops
Extend scalar evolution to handle >= and <= if a loop is known to be finite and the induction variable guards the condition. Specifically, with these assumptions lhs <= rhs is equivalent to lhs < rhs + 1 and lhs >= rhs to lhs > rhs -1.

In the case of lhs <= rhs, this is true since the only case these are not equivalent
is when rhs == unsigned/signed intmax, which would have resulted in an infinite loop.

In the case of lhs >= rhs, this is true since the only case these are not equivalent
is when rhs == unsigned/signed intmin, which would again have resulted in an infinite loop.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D118090
2022-01-28 17:41:08 -05:00
Fangrui Song 354ec4af74 [AttrDocs] Fix docs for the sycl_special_class attribute after D114483
Fixes `AttributeReference.rst:6628:Explicit markup ends without a blank line; unexpected unindent.`
for `ninja docs-clang-html`
2022-01-28 14:30:49 -08:00
Alexandre Ganea 1cf9876661 [mlir] Fix build after 83d59e05b2
Differential Revision: https://reviews.llvm.org/D118510
2022-01-28 17:21:30 -05:00
David Greene 030f71698d [UpdateTestChecks] Add --filter and --filter-out options
Enhance the various update_*_test_checks.py tools to allow filtering the tool
output with regular expressions.  The --filter option will emit only tool output
lines matching the given regular expression while the --filter-out option will
emit only tools output lines not matching the given regular expression.  Filters
are applied in order of appearance on the command line (or in UTC_ARGS) and the
first matching filter terminates the search.

This allows test authors to create more focused tests by removing irrelevant
tool output and checking only the pieces of output necessary to test the desired
functionality.

Differential Revision: https://reviews.llvm.org/D117694
2022-01-28 14:08:07 -08:00
Valentin Clement e1a12767ee
[flang] Initial lowering for empty program
This patch enable lowering from Fortran to FIR for a basic empty
program. It brings all the infrastructure needed for that. As discussed
previously, this is the first patch for lowering and follow up patches
should be smaller.

With this patch we can lower the following code:

```
program basic
end program
```

To a the FIR equivalent:

```
func @_QQmain() {
  return
}
```

Follow up patch will add lowering of more complex constructs.

Reviewed By: kiranchandramohan, schweitz, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D118436
2022-01-28 22:39:58 +01:00
Valentin Clement b62e5928e4
[flang][NFC] Remove obsolete IntrinsicCall helper
Remove obsolete code that has moved to the
`flang/Optimizer/Builder/Intrinsic` directory.

`genMin` is inlined in the code since it's not available
in the builder.

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118465
2022-01-28 22:37:56 +01:00
Aart Bik 0daa72a505 [mlir][sparse][pytaco] enable dimension ordering syntax
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D118500
2022-01-28 13:33:04 -08:00
Marek Kurdej 64df51624f [clang-format] Fix misaligned trailing comments in the presence of an empty block comment.
Fixes https://github.com/llvm/llvm-project/issues/53441.

Expected code:
```
/**/   //
int a; //
```

was before misformatted to:
```
/**/     //
int a; //
```

Because the "remaining length" (after the starting `/*`) of an empty block comment `/**/` was computed to be 0 instead of 2.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D118475
2022-01-28 22:28:48 +01:00
Weverything be2147db05 Remove reference type when checking const structs
ConstStructBuilder::Finalize in CGExprConstant.ccp assumes that the
passed in QualType is a RecordType.  In some instances, the type is a
reference to a RecordType and the reference needs to be removed first.

Differential Revision: https://reviews.llvm.org/D117376
2022-01-28 13:08:58 -08:00
Yaxun (Sam) Liu 8428c75da1 [CUDA][HIP] Do not treat host var address as constant in device compilation
Currently clang treats host var address as constant in device compilation,
which causes const vars initialized with host var address promoted to
device variables incorrectly and results in undefined symbols.

This patch fixes that.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D118153

Fixes: SWDEV-309881

Change-Id: I0a69357063c6f8539ef259c96c250d04615f4473
2022-01-28 16:04:52 -05:00
Rainer Orth 15a3476f3f [polly][unittests] Link DeLICMTests with libLLVMCore
A `-DBUILD_SHARED_LIBS=ON` build on Solaris/amd64 failed with

  Undefined                       first referenced
   symbol                             in file
  _ZNK4llvm3cfg6UpdateIPNS_10BasicBlockEE4dumpEv tools/polly/unittests/DeLICM/CMakeFiles/DeLICMTests.dir/DeLICMTest.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-stage2-shared-A/bin/../lib/libLLVMCore.so.14git)
  ld: fatal: symbol referencing errors

Solaris `ld` requires to directly link with dependant libraries, so this
patch explicitly adds `libLLVMCore`.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D118452
2022-01-28 21:58:40 +01:00
Philip Reames 6888081e32 [SLP] Use moveBefore to simplify code [NFC] 2022-01-28 12:44:07 -08:00
Ahmed Bougacha 634ca7349d [ObjCARC] Require the function argument in the clang.arc.attachedcall bundle.
Currently, the clang.arc.attachedcall bundle takes an optional function
argument.  Depending on whether the argument is present, calls with this
bundle have the following semantics:

- on x86, with the argument present, the call is lowered to:
    call _target
    mov rax, rdi
    call _objc_retainAutoreleasedReturnValue

- on AArch64, without the argument, the call is lowered to:
    bl _target
    mov x29, x29

  and the objc runtime call is expected to be emitted separately.

That's because, on x86, the objc runtime checks for both the mov and
the call on x86, and treats the combination as the ARC autorelease elision
marker.

But on AArch64, it only checks for the dedicated NOP marker, as that's
historically been sufficiently unique.  Thanks to that, the runtime call
wasn't required to be adjacent to the NOP marker, so it wasn't emitted
as part of the bundle sequence.

This patch unifies both architectures: on AArch64, we now emit all
3 instructions for the bundle.  This guarantees that the runtime call
is adjacent to the marker in the sequence, and that's information the
runtime can use to further optimize this.

This helps simplify some of the handling, in particular
BundledRetainClaimRVs, which no longer needs to know whether the bundle
is sufficient or not: it now always should be.

Note that this does not include an AutoUpgrade for the nullary bundles,
as they are only produced in ObjCContract as part of the obj/asm emission
pipeline, and are not expected to be in bitcode.

Differential Revision: https://reviews.llvm.org/D118214
2022-01-28 12:41:45 -08:00