Commit Graph

418209 Commits

Author SHA1 Message Date
Kiran Chandramohan
2cdf5ef136 [Flang] Lower the trim intrinsic
The trim intrinsic removes trailing blank spaces from a string. The
intrinsic is lowered to a runtime call.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 12:36:56 +00:00
Kiran Chandramohan
5be0f0c83d [Flang] Lower Matmul intrinsic
The Matmul intrinsic performs matrix multiplication on rank 2 arrays.
The intrinsic is lowered to a runtime call.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
2022-03-17 12:31:03 +00:00
Sanjay Patel
ab982eace6 [Sema] add warning for tautological FP compare with literal
If we are equality comparing an FP literal with a value cast from a type
where the literal can't be represented, that's known true or false and
probably a programmer error.

Fixes issue #54222.
https://github.com/llvm/llvm-project/issues/54222

Note - I added the optimizer change with:
9397bdc67e
...and as discussed in the post-commit comments, that transform might be
too dangerous without this warning in place, so it was reverted to allow
this change first.

Differential Revision: https://reviews.llvm.org/D121306
2022-03-17 08:22:30 -04:00
Valentin Clement
51cf471dc1
[flang] Lower misc intrinsics
This patch adds lowering for couple of intrinsics:
- `btest`
- `ceiling`
- `nearest`
- `scale`

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: AlexisPerry <aperry@lanl.gov>
2022-03-17 13:21:53 +01:00
Valentin Clement
96fd54c964
[flang] Lower present intrinsic
This patch adds lowering for the `present` intrinsic.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 13:19:40 +01:00
Valentin Clement
4d323f4837
[flang] Lower exit intrinsic
This patch adds lowering for the `exit`
intrinsic.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Josh Mottley <Josh.Mottley@arm.com>
2022-03-17 13:18:32 +01:00
Andrzej Warzynski
6321113f78 [flang][lowering] Add support for lowering of the index intrinsics
This patch adds support for lowering of the `index` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 12:04:11 +00:00
Florian Hahn
a6e70e4056
[VPlan] VPInterleaveRecipe only requires the first lane of the address.
VPInterleaveRecipe only uses the first lane of the address. Add
onlyFirstLaneUsed implementation. This is needed for a follow-up patch.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D121612
2022-03-17 11:56:43 +00:00
Andrzej Warzynski
cd18a6a5e2 [flang][nfc] Update comment in test 2022-03-17 11:54:02 +00:00
Dmitry Preobrazhensky
9c632b61eb [AMDGPU][MC] A fix for commit 5977dfb
The commit code 5977dfba64
failed to compile with GCC5. This patch addresses the issue.
For a related discussion, see https://reviews.llvm.org/D121696
2022-03-17 14:41:21 +03:00
Shreyas Atre
9e1f4f1398 [clang-tidy][run-clang-tidy.py] Add --config-file=<string> option
Link to the GitHub Issue: https://github.com/llvm/llvm-project/issues/53745

Added config_path variable within the python script which makes the
required call to the clang-tidy binary with --config-file option.
If the config_path is None then config will be used. No error is raised
if both are given but silently chooses config_path over config
2022-03-17 07:30:28 -04:00
Evgeny Shulgin
6043520c20 [clang-tidy] Don't check decltype return types in readability-const-return-type
The checker removes `const`s that are superfluos and badly affect
readability. `decltype(auto)`/`decltype(expr)` are often const-qualified, but
have no effect on readability and usually can't stop being const-qualified
without significant code change.

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

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D119470
2022-03-17 14:27:09 +03:00
Nikita Popov
1dbeb64493 [SLP] Avoid unnecessary getIncomingValueForBlock() call (NFC)
This code just wants to check all incoming values, we don't care
care what the incoming block is here.
2022-03-17 12:23:46 +01:00
David Spickett
14452c4958 Revert "[libcxx][CI] Use temporary clang-13 bots for Arm/AArch64"
This reverts commit 406d418c0c.

Our regular bots are now using clang-13. The previous set will remain
online for a while to check reviews that haven't rebased to include
this change yet.

Differential Revision: https://reviews.llvm.org/D121894
2022-03-17 10:49:49 +00:00
Simon Pilgrim
4e4f839ac2 [X86] Use the unaligned vector typedefs for the lddqu intrinsics pointer arguments (PR20670)
Extension to 4390c721cb - similar to the vanilla load/store intrinsics, _mm_lddqu_si128/_mm256_lddqu_si256 should take an unaligned pointer, but were using the aligned m128i/m256i types which can cause alignment warnings.

The existing sse3-builtins.c and avx-builtins.c tests in llvm-project\clang\test\CodeGen\X86 should cover this.

Differential Revision: https://reviews.llvm.org/D121815
2022-03-17 10:42:29 +00:00
Alex Zinenko
6864d27088 [mlir][bazel] make .pyi files available to Bazel
These files are necessary for various type checking and autocompletion
tooling to work.

Differential Revision: https://reviews.llvm.org/D121810
2022-03-17 11:02:17 +01:00
Jean Perier
3ed899cc74 [flang] handle allocatable components when creating array temps
When creating an array temporary in the array copy pass, care must be
taken with allocatable components. The element components needs to be
given a clean unallocated status before being used in the assignments.
This is because assignment of allocatable components makes deep copy,
and may cause deallocation of the previous value if it was allocated.
Hence the previous allocation status cannot be let undefined.

On top of that, when cleaning-up the temp, all allocatable components
that may have been allocated must be deallocated.

This patch implements this by centralizing the code making and cleaning
array temps in ArrayValueCopy.cpp, and by calling Initialize and Destroy
runtime entry points when they are allocatable components.

Differential Revision: https://reviews.llvm.org/D121892
2022-03-17 10:56:20 +01:00
Adrian Kuegel
0e694e1426 [Bazel] Update Bazel build to add symbol_graph.
Differential Revision: https://reviews.llvm.org/D121886
2022-03-17 10:53:04 +01:00
Kazushi (Jam) Marukawa
9df395bb68 [Clang][VE] Add vector mask intrinsics to clang
Add vector mask intrinsics instructions to clang.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D121816
2022-03-17 18:52:28 +09:00
Jay Foad
a3a4591856 [LegacyPassManager] Move structural hashing into Pass classes. NFC.
Move structural hashing into virtual methods on Pass. This will
allow MachineFunctionPass to override the method to add hashing of
the MachineFunction.

Differential Revision: https://reviews.llvm.org/D120123
2022-03-17 09:51:12 +00:00
David Green
0b6df40c52 [AArch64] Combine ISD::AND into AArch64ISD::ANDS
If we already have a AArch64ISD::ANDS node with identical operands, we
can merge any ISD::AND into it, reducing the instruction count by
calculating the value and the flags in a single operation. This code is
taken from the X86 backend, and could also handle AArch64ISD::ADDS and
AArch64ISD::SUBS, but I couldn't find any test cases where it came up.

Differential Revision: https://reviews.llvm.org/D118584
2022-03-17 09:44:11 +00:00
Adrian Kuegel
d8740912dd [mlir][Bazel] Add missing dependency.
Differential Revision: https://reviews.llvm.org/D121893
2022-03-17 10:25:20 +01:00
Adrian Kuegel
bd0bf9674b [mlir][Bazel] Adapt BUILD.bazel for move of lsp-server support files.
Differential Revision: https://reviews.llvm.org/D121891
2022-03-17 10:04:11 +01:00
Nikita Popov
4010a7a5d0 Reapply [InstCombine] Support switch in phi to cond fold
Reapply with an explicit check for multi-edges, as the expected
behavior of multi-edge dominance is unclear (D120811).

-----

For conditional branches, we know the value is i1 0 or i1 1 along
the outgoing edges. For switches we can apply exactly the same
optimization, just with the known values determined by the switch
cases.
2022-03-17 10:03:09 +01:00
Haojian Wu
5a624956ce [pseudo] Fix some naming-style violations. 2022-03-17 09:47:24 +01:00
Krystian Kuzniarek
45cb2df678 [clang-format][docs] Regenerate ClangFormatStyleOptions.rst
Misalignment of clang/docs/ClangFormatStyleOptions.rst and
clang/include/clang/Format/Format.h was introduced in c24b3db45.

Regenerated with:
python clang/docs/tools/dump_format_style.py

Reviewed By: sstwcw, curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D121749
2022-03-17 09:45:43 +01:00
Adrian Kuegel
7733a61fbc [mlir][Bazel] Also fix mlir/unittests/BUILD.bazel. 2022-03-17 09:42:06 +01:00
Marek Kurdej
dc142ea184 [clang-format] Correctly recognize binary operators in template arguments with parenthesized literals.
Fixes https://github.com/llvm/llvm-project/issues/24602.

Before, code like `foo<b & 1>` was formatted correctly but `foo<b & (1)>` wasn't.
This patch fixes this inconsistency.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D121846
2022-03-17 09:36:25 +01:00
Yi Kong
e2a1f8ec27 Reland "[clang][driver] Emit a warning if -xc/-xc++ is after the last input file"
This reverts commit ba59476515.
2022-03-17 16:31:01 +08:00
Marek Kurdej
34ce42fe4d [clang-format] Reformat. NFC. 2022-03-17 09:27:31 +01:00
Adrian Kuegel
2f1d918c0b [mlir][Bazel] Adapt to move of FuncOp. 2022-03-17 09:25:30 +01:00
Adrian Kuegel
713c8f6ae5 [mlir] Make header standalone (NFC) 2022-03-17 09:20:18 +01:00
Lian Wang
214afc7116 [RISCV] Add patterns for vnsrl.wi and vnsra.wi instructions
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D121675
2022-03-17 07:22:32 +00:00
River Riddle
7bc5273367 [mlir][NFC] Move the LSP agnostic files to a new lsp-server directory
This allows for sharing the implementation of key components across multiple
MLIR language servers. These will be used in a followup to help implement
a PDLL language server.

Differential Revision: https://reviews.llvm.org/D121540
2022-03-16 23:40:00 -07:00
River Riddle
943ad665e2 [PDLL] Add proper expansive documentation for PDLL
This commit adds detailed documentation for PDLL, its language design, and
captures a bit of the rationale. This document captures everything in-tree at present,
and is intended to be an all encompassing manual for interacting with and understanding
PDLL.

Differential Revision: https://reviews.llvm.org/D119903
2022-03-16 23:40:00 -07:00
Valentin Clement
eea7c935d2
[flang] Lower array related intrinsics
This patch adds lowering for somw array related intrinsics:
- `reshape`
- `spread`

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: schweitz

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
2022-03-17 07:21:44 +01:00
Jonas Devlieghere
cae735f72b
[lldb] Migrate runtime instrumentation plugins to ReportWarning 2022-03-16 23:20:58 -07:00
Valentin Clement
cc38a4a665
[flang] Lower character related intrinsics
This patch adds lowering for some character related
intrinsics:
- `scan`
- `verify`

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-17 07:16:08 +01:00
Jonas Devlieghere
ea0f8ecc43
[lldb] Remove commented-out code in CommandObjectExpression (NFC) 2022-03-16 23:02:59 -07:00
Jonas Devlieghere
d10c0c7b18
[lldb] Migrate condition evaluation failure to ReportError
Migrate to using ReportError to report a failure to evaluate a
watchpoint condition. I had already done so for the parallel code for
breakpoints.

In the process, I noticed that I accidentally regressed the error
reporting for breakpoint conditions by dropping the call to
GetDescription. This patch rectifies that and adds a test.

Because the call to GetDescription expects a Stream*, I also switches
from using a raw_string_ostream to a StreamString for both breakpoints
and watchpoints.
2022-03-16 22:54:02 -07:00
River Riddle
77eee5795e [mlir] Refactor DialectRegistry delayed interface support into a general DialectExtension mechanism
The current dialect registry allows for attaching delayed interfaces, that are added to attrs/dialects/ops/etc.
when the owning dialect gets loaded. This is clunky for quite a few reasons, e.g. each interface type has a
separate tracking structure, and is also quite limiting. This commit refactors this delayed mutation of
dialect constructs into a more general DialectExtension mechanism. This mechanism is essentially a registration
callback that is invoked when a set of dialects have been loaded. This allows for attaching interfaces directly
on the loaded constructs, and also allows for loading new dependent dialects. The latter of which is
extremely useful as it will now enable dependent dialects to only apply in the contexts in which they
are necessary. For example, a dialect dependency can now be conditional on if a user actually needs the
interface that relies on it.

Differential Revision: https://reviews.llvm.org/D120367
2022-03-16 22:15:25 -07:00
Jonas Devlieghere
8212b41b7b
[lldb] Fix flakiness in command-disassemble-process.yaml (2/2)
I split up the test so we could stop redirecting stderr to stdout but I
forgot to include that part in the previous commit.
2022-03-16 22:12:39 -07:00
Jacques Pienaar
999fb7d045 [mlir][vscode] Don't inject inside strings
Avoids matching R"mlir( while already inside a string.
2022-03-16 21:57:56 -07:00
Abinav Puthan Purayil
f59cb41ba1 [AMDGPU] Select buffer_atomic_cmpswap* in tblgen
This change replaces the manual selection of buffer_atomic_cmpswap*
instructions in SelectionDAG and GlobalISel with a tblgen based
selection in BUFInstructions.td. This allows us to select the return and
no-return variants in tblgen.

Differential Revision: https://reviews.llvm.org/D121770
2022-03-17 10:12:32 +05:30
Jonas Devlieghere
557a0e7b96
[lldb] Fix flakyness in command-disassemble-process.yaml 2022-03-16 21:27:54 -07:00
Jonas Devlieghere
8e893dfed5
[lldb] Fix flakyness in Minidump/no-process-id.yaml 2022-03-16 21:21:11 -07:00
Jonas Devlieghere
c354f13e69
[lldb] Update TargetProperties::CheckJITObjectsDir to use ReportError 2022-03-16 21:11:53 -07:00
wangliushuai
1c04b52b25 [LTO][ELF] Add --stats-file= option.
This patch adds a StatsFile option supported by gold to lld, related patch https://reviews.llvm.org/D45531.

Reviewed By: tejohnson, MaskRay

Differential Revision: https://reviews.llvm.org/D121809
2022-03-17 12:01:39 +08:00
Heejin Ahn
b8038a916d [WebAssembly] Disable SimplifyDemandedVectorElts after legalization
This fixes a reported bug that caused an infinite loop during the
SelectionDAG optimization phase in ISel, by creating an overridable hook
in `TargetLowering` that allows us to bail out from running
`SimplifyDemandedVectorElts`.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D121869
2022-03-16 20:52:43 -07:00
Heejin Ahn
0ca2132067 [WebAssembly] Improve EH/SjLj error messages
This includes a function name and a relevant instruction in error
messages when possible, making them more helpful.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D120678
2022-03-16 20:50:34 -07:00