Aleksandr Popov [Mon, 3 Jul 2023 04:48:13 +0000 (06:48 +0200)]
[NFC][IRCE] Check that Index is AddRec in the parseRangeCheckICmp
Next step of the preparatory refactoring for the upcoming support of
new range check form to parse.
Previous one: https://reviews.llvm.org/D154156
With this change we avoid meaningless parsing after realizing that Index
is not AddRec
Reviewed By: skatkov
Differential Revision: https://reviews.llvm.org/D154158
Florian Hahn [Tue, 4 Jul 2023 13:01:05 +0000 (14:01 +0100)]
[LV] Regenerate check lines to reduced diff.
Regenerate checks to avoid unnecessary changes in D154264.
Joseph Huber [Tue, 4 Jul 2023 12:59:11 +0000 (07:59 -0500)]
[Libomptarget] Fix misused macro name preventing printing of library name
Summary:
This code used `LIBOMPTARGET_DEBUG` which is not the macro name, but the
environment variable. This caused this portion to always be disabled. In
the long run we should aim for this to always be availible as it's
useful for other diagnostic message.
Matthias Springer [Tue, 4 Jul 2023 12:48:56 +0000 (14:48 +0200)]
[mlir][linalg] BufferizeToAllocationOp: Support vector.mask
This op needs special handling because the allocation for the masked op must be placed outside of the mask op.
Differential Revision: https://reviews.llvm.org/D154058
Matthias Springer [Tue, 4 Jul 2023 12:40:49 +0000 (14:40 +0200)]
[mlir][linalg] BufferizeToAllocation: Bufferize non-allocating ops
Until now, only `tensor.pad` ops could be bufferized to an allocation. This revision adds support for all bufferizable ops that do not already bufferize to an allocation. (Those still need special handling.)
Differential Revision: https://reviews.llvm.org/D153971
Martin Braenne [Tue, 4 Jul 2023 12:14:17 +0000 (12:14 +0000)]
[clang][dataflow] Make `runDataflowReturnError()` a non-template function.
It turns out this didn't need to be a template at all.
Likewise, change callers to they're non-template functions.
Also, correct / clarify some comments in RecordOps.h.
This is in response to post-commit comments on https://reviews.llvm.org/D153006.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D154339
Matthias Springer [Tue, 4 Jul 2023 12:34:00 +0000 (14:34 +0200)]
[mlir][linalg] BufferizeToAllocationOp: Bufferize ops, not values
The `bufferize_to_allocation` transform op now operates on payload ops, not payload values. Only ops can be bufferized, not values.
Also remove the `replacement` result from the transform op.
Differential Revision: https://reviews.llvm.org/D153970
Haojian Wu [Tue, 4 Jul 2023 11:16:05 +0000 (13:16 +0200)]
[clang-tidy] Don't emit the whole spelling include header in include-cleaner diagnostic message
To keep the message short and consistent with clangd, and the diagnostics are
attached to the #include line, users have enough context to understand the whole #include.
Differential Revision: https://reviews.llvm.org/D154434
Alex Bradbury [Tue, 4 Jul 2023 12:28:12 +0000 (13:28 +0100)]
[RISCV][NFC] Fix doc comment for RISCVDAGToDAGISel::selectSETCC
The doc comment referred to a boolean parameter that has since been
replaced with an ISD::CondCode.
Matthias Springer [Tue, 4 Jul 2023 12:18:32 +0000 (14:18 +0200)]
[mlir][linalg] Return tensor::PadOp handle from transform op
"transform.structured.pad" now returns all `tensor::PadOp` in addition to the padded ops.
Also add a test case that shows how to force an allocation for "tensor.pad" ops with a custom memory space.
Differential Revision: https://reviews.llvm.org/D153555
Matthias Springer [Tue, 4 Jul 2023 12:03:02 +0000 (14:03 +0200)]
[mlir][NFC] Use `getConstantIntValue` instead of casting to `ConstantIndexOp`
`getConstantIntValue` extracts constant values from all constant-like ops, not just `arith::ConstantIndexOp`.
Differential Revision: https://reviews.llvm.org/D154356
Martin Braenne [Tue, 4 Jul 2023 10:41:05 +0000 (10:41 +0000)]
[clang][dataflow] Add a test for a struct that is directly self-referential through a reference.
The ongoing migration to strict handling of value
categories (see https://discourse.llvm.org/t/70086) will change the way we
handle fields of reference type, and I want to put a test in place that makes
sure we continue to handle this special case correctly.
Depends On D154420
Reviewed By: gribozavr2, xazax.hun
Differential Revision: https://reviews.llvm.org/D154421
Martin Braenne [Tue, 4 Jul 2023 10:40:19 +0000 (10:40 +0000)]
[clang][dataflow] Model variables / fields / funcs used in default initializers.
The newly added test fails without the other changes in this patch.
Reviewed By: sammccall, gribozavr2
Differential Revision: https://reviews.llvm.org/D154420
Quentin Colombet [Mon, 3 Jul 2023 16:19:00 +0000 (18:19 +0200)]
[mlir][arith] Move getNeutralElement from Linalg utils to arith
This consolidates where this kind of implementations lives and
refactor the code to have more code sharing.
NFC
Differential Revision: https://reviews.llvm.org/D154362
Benjamin Kramer [Tue, 4 Jul 2023 11:34:03 +0000 (13:34 +0200)]
Jay Foad [Wed, 21 Jun 2023 20:16:08 +0000 (21:16 +0100)]
[AMDGPU] Do not wait for vscnt on function entry and return
SIInsertWaitcnts inserts waitcnt instructions to resolve data
dependencies. The GFX10+ vscnt (VMEM store count) counter is never used
in this way. It is only used to resolve memory dependencies, and that is
handled by SIMemoryLegalizer. Hence there is no need to conservatively
wait for vscnt to be 0 on function entry and before returns.
Differential Revision: https://reviews.llvm.org/D153537
Alexey Lapshin [Sat, 1 Jul 2023 10:20:50 +0000 (12:20 +0200)]
[DWARFLinker][NFC] Remove RangesTy &getValidAddressRanges().
This patch simplifies line table generation. It removes global
array of all units ranges(RangesTy &getValidAddressRanges()).
The comment says that global array of all units ranges is necessary
to handle corner cases inside line table rows. Removing that
special handling shows that its current usage is handling of
"end of range case" which is already handled correctly
(without special handling). .debug_line tables for clang binary
built with and without this patch are equal.
Differential Revision: https://reviews.llvm.org/D154288
Jan Svoboda [Tue, 4 Jul 2023 10:33:56 +0000 (12:33 +0200)]
[clang][modules] Mark fewer identifiers as out-of-date
In `clang-scan-deps` contexts, the number of interesting identifiers in PCM files is fairly low (only macros), while the number of identifiers in the importing instance is high (builtins). Marking the whole identifier table out-of-date triggers lots of benign and expensive calls to `ASTReader::updateOutOfDateIdentifiers()`. (That unfortunately happens even for unused identifiers due to `SemaRef.IdResolver.begin(II)` line in `ASTWriter::WriteASTCore()`.)
This patch makes the main code path more similar to C++ modules, where the PCM files have `INTERESTING_IDENTIFIERS` section which lists identifiers that get created in the identifier table of the importing instance and marked as out-of-date. The only difference is that the main code path doesn't *create* identifiers in the table and relies on the importing instance calling `ASTReader::get()` when creating new identifier on-demand. It only marks existing identifiers as out-of-date.
This speeds up `clang-scan-deps` by 5-10%.
Reviewed By: Bigcheese, benlangmuir
Differential Revision: https://reviews.llvm.org/D151277
Florian Hahn [Tue, 4 Jul 2023 10:56:50 +0000 (11:56 +0100)]
[LSR] Move normalization check to normalizeForPostIncUse.
Move the logic added in
3a57152d85e1 to normalizeForPostIncUse to catch
additional un-invertable cases. This fixes another mis-compile pointed
out by @peixin in D153004.
LLVM GN Syncbot [Tue, 4 Jul 2023 10:36:15 +0000 (10:36 +0000)]
[gn build] Port
d9d9be63a52d
LLVM GN Syncbot [Tue, 4 Jul 2023 10:36:14 +0000 (10:36 +0000)]
[gn build] Port
2fd614efc1bb
Ivan Kosarev [Tue, 4 Jul 2023 10:16:00 +0000 (11:16 +0100)]
[AMDGPU][AsmParser][NFC] Remove an unused function.
Was added in <https://reviews.llvm.org/D63293>, but never used.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D154331
Florian Hahn [Tue, 4 Jul 2023 10:24:11 +0000 (11:24 +0100)]
[LV] Move getBroadcastInstr to VPTransformState.::get (NFCI).
getBroadcastInstrs is only used in VPTransformState::get. Move it closer
to use to reduce unnecessary interaction with ILV object.
Ties Stuij [Tue, 4 Jul 2023 10:21:05 +0000 (11:21 +0100)]
[ARM] fix typo in large-stack.ll introduced when fixing another typo
Sam McCall [Thu, 15 Jun 2023 13:56:25 +0000 (15:56 +0200)]
[dataflow] Add dedicated representation of boolean formulas
This is the first step in untangling the two current jobs of BoolValue.
=== Desired end-state: ===
- BoolValue will model C++ booleans e.g. held in StorageLocations.
this includes describing uncertainty (e.g. "top" is a Value concern)
- Formula describes analysis-level assertions in terms of SAT atoms.
These can still be linked together: a BoolValue may have a corresponding
SAT atom which is constrained by formulas.
=== Done in this patch: ===
BoolValue is left intact, Formula is just the input type to the
SAT solver, and we build formulas as needed to invoke the solver.
=== Incidental changes to debug string printing: ===
- variables renamed from B0 etc to V0 etc
B0 collides with the names of basic blocks, which is confusing when
debugging flow conditions.
- debug printing of formulas (Formula and Atom) uses operator<<
rather than debugString(), so works with gtest.
Therefore moved out of DebugSupport.h
- Did the same to Solver::Result, and some helper changes to SolverTest,
so that we get useful messages on unit test failures
- formulas are now printed as infix expressions on one line, rather than
wrapped/indented S-exprs. My experience is that this is easier to scan
FCs for small examples, and large ones are unreadable either way.
- most of the several debugString() functions for constraints/results
are unused, so removed them rather than updating tests.
Inlined the one that was actually used into its callsite.
Differential Revision: https://reviews.llvm.org/D153366
Ties Stuij [Tue, 4 Jul 2023 10:09:07 +0000 (11:09 +0100)]
[ARM] fix typo in large-stack.ll test
In llvm/test/CodeGen/ARM/large-stack.ll, the C in FileCheck wasn't
uppercased. This wasn't spotted in development as MacOS's HFS+ fs is apparently
often configured case-insensitive.
David Spickett [Tue, 4 Jul 2023 10:17:37 +0000 (11:17 +0100)]
[lldb][AArch64] Handle different default vector length in SVE testing
This test previously ran on QEMU or A64FX both of which can/do have
512 bit SVE by default.
Graviton 3 has 256 bit SVE so the first part of the test failed.
To fix this, probe the supported vector lengths before starting
the test. The first check will use the default vector length and
the rest use either 256 or 128 bit.
Therefore this test will be skipped on a machine with only 128 bit SVE.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D154208
David Spickett [Tue, 4 Jul 2023 10:15:45 +0000 (11:15 +0100)]
[lldb][AArch64] Fix tagged watch test on Graviton 3
During __do_global_dtors_aux glibc sets a flag that is right
next to the global variable. This is done using a store byte.
On QEMU the watchpoints are handled with a finer granularity
than real hardware, so this wasn't a problem. On Graviton 3
(and Mountain Jade, though this test won't run there) watchpoints
look at larger chunks of memory.
This means that the final continue actually stops in __do_global_dtors_aux
instead of exiting.
We could fix this by padding the global to be away from the flag,
but that is fiddly and it is easier just to remove the watchpoint
before the final continue. We have already verified it worked by that
point.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D154201
David Spickett [Tue, 4 Jul 2023 10:14:45 +0000 (11:14 +0100)]
[lldb][AArch64] Account for extra libc frames in PAC unwind test
Running this on Amazon Ubuntu the final backtrace is:
```
(lldb) thread backtrace
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
* frame #0: 0x0000aaaaaaaa07d0 a.out`func_c at main.c:10:3
frame #1: 0x0000aaaaaaaa07c4 a.out`func_b at main.c:14:3
frame #2: 0x0000aaaaaaaa07b4 a.out`func_a at main.c:18:3
frame #3: 0x0000aaaaaaaa07a4 a.out`main(argc=<unavailable>, argv=<unavailable>) at main.c:22:3
frame #4: 0x0000fffff7b373fc libc.so.6`___lldb_unnamed_symbol2962 + 108
frame #5: 0x0000fffff7b374cc libc.so.6`__libc_start_main + 152
frame #6: 0x0000aaaaaaaa06b0 a.out`_start + 48
```
This causes the test to fail because of the extra ___lldb_unnamed_symbol2962 frame
(an inlined function?).
To fix this, strictly check all the frames in main.c then for the rest
just check we find __libc_start_main and _start in that order regardless
of other frames in between.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D154204
Stephen Thomas [Tue, 4 Jul 2023 09:28:15 +0000 (10:28 +0100)]
[AMDGPU] Add functions for composing and decomposing S_WAIT_DEPCTR operands
Add functions AMDGPU::DepCtr::encodeField*() and AMDGPU::DepCtr::decodeField*()
for each of vm_vsrc, va_vdst and sa_sdst. These are now used in
AMDGPUInsertDelayAlu and GCNHazardRecognizer so as to make working with
S_WAITCNT_DEPCTR operands easier and more readable.
Differential Revision: https://reviews.llvm.org/D154424
Evgeniy Brevnov [Tue, 23 May 2023 11:53:04 +0000 (18:53 +0700)]
[VPlan] Allow sinking of instructions with no defs
We started seeing new failure after D142886. Looks like it enabled new cases and we hit an assert:
assert(Current->getNumDefinedValues() == 1 &&
"only recipes with a single defined value expected");
When we do instruction sinking for the first order recurrence we hit an assert if instruction doesn't have single def. In case instruction doesn't produce any new def there is no new users and nothing to sink.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D151204
Ties Stuij [Tue, 4 Jul 2023 09:50:42 +0000 (10:50 +0100)]
[ARM] make execute only long call test checks more robust
Reviewed By: olista01
Differential Revision: https://reviews.llvm.org/D154355
Harvin Iriawan [Mon, 3 Jul 2023 13:41:50 +0000 (14:41 +0100)]
[AArch64] Update SVE scheduling of some CPUs
* Update cortex-a510 and neoverse-v2 SVE scheduling so that pseudos
have the same instruction latency as original instruction.
Differential Revision: https://reviews.llvm.org/D154084
Harvin Iriawan [Fri, 30 Jun 2023 16:28:19 +0000 (17:28 +0100)]
[AArch64] NFC : Change the way SVE pseudos are appended
* SVE pseudos don't pick up the right latency information during MI
scheduling as the regex do not match with instruction name.
* Move UNDEF, PSEUDO, and ZERO to the end of actual SVE instruction
* Some CPUs *td files will be fixed in the next commit
Differential Revision: https://reviews.llvm.org/D154232
Ties Stuij [Tue, 4 Jul 2023 08:25:58 +0000 (09:25 +0100)]
[ARM] generate correct code for armv6-m XO big stack operations
The ARM backend codebase is dotted with places where armv6-m will generate
constant pools. Now that we can generate execute-only code for armv6-m, we need
to make sure we use the movs/lsls/adds/lsls/adds/lsls/adds pattern instead of
these.
Big stacks is one of the obvious places. In this patch we take care of two
sites:
1. take care of big stacks in prologue/epilogue
2. take care of save/tSTRspi nodes, which implicitly fixes
emitThumbRegPlusImmInReg which is used in several frame lowering fns
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D154233
Tom Eccles [Fri, 30 Jun 2023 16:35:26 +0000 (16:35 +0000)]
[flang][hlfir] fix elemental subroutine calls
genElementalCall can return a null option when lowering elemental
subroutine calls (as there is no return value). Therefore
std::option::value should not be used as it will cause an
assertion failure.
This fixes uses of the mvbits intrinsic with array arguments, as used in
the gfortran test suite.
Differential Revision: https://reviews.llvm.org/D154340
Tom Eccles [Thu, 29 Jun 2023 17:26:35 +0000 (17:26 +0000)]
[flang][hlfir] intrinsic dynamically optional arguments
This adds support for dynamically optional arguments for intrinsics
which do not have their own hlfir operations.
The functions for processing these arguments are mostly the same as the
equivalent functions in ConvertExpr.cpp. I chose not to share
implementations so that HLFIR helpers can be used here. Presumably
ConvertExpr.cpp will go away one day.
Depends on D154236
Differential Revision: https://reviews.llvm.org/D154237
Tom Eccles [Wed, 28 Jun 2023 15:29:27 +0000 (15:29 +0000)]
[flang][hlfir] support optional args for intrinsic ops
This also adds support for allocatable non-optional arguments.
Of the transformational intrinsics which currently have their own hlfir
operations, all of the dynamically optional arguments are lowered as
boxes, so that is all that is implemented for now.
One alternative approach would have been to deal with the dynamically
optional arguments when lowering to FIR runtime calls. I decided not to
do this so that any passes working on the intrinsic operations would not
have to know about and handle the dynamically optional arguments.
Depends on D154235
Differential Revision: https://reviews.llvm.org/D154236
Tom Eccles [Mon, 26 Jun 2023 17:46:15 +0000 (17:46 +0000)]
[flang][hlfir][NFC] refactor transformational intrinsic lowering
The old code had overgrown itself and become difficult to read and
modify. I've rewritten it and moved it into its own translation unit.
I moved PreparedActualArgument to the header file for the
transformational intrinsic lowering. Logically, it belongs in
ConvertCall.h, but putting it there would create a circular dependency
between HlfirIntrinsics and ConvertCall.
Differential Revision: https://reviews.llvm.org/D154235
Igor Kirillov [Tue, 27 Jun 2023 10:43:15 +0000 (10:43 +0000)]
[CodeGen] Precommit tests for D153355
Differential Revision: https://reviews.llvm.org/D153856
Aleksandr Popov [Mon, 3 Jul 2023 01:07:18 +0000 (03:07 +0200)]
[IRCE][NFC] Set Index and End together inside parseRangeCheckICmp
Preparatory refactoring for the upcoming support of new range check form
to parse.
With this change we always set Index and End values together in the same
place.
parseRangeCheckICmp specification updated.
Reviewed By: skatkov
Differential Revision: https://reviews.llvm.org/D154156
Alexander Belyaev [Tue, 4 Jul 2023 07:40:38 +0000 (09:40 +0200)]
Revert "[mlir][transform] Allow arbitrary indices to be scalable"
This reverts commit
048764f23a380fd6f8cc562a0008dcc6095fb594.
Breaks https://lab.llvm.org/buildbot/#/builders/61/builds/45451
Cullen Rhodes [Mon, 3 Jul 2023 14:33:13 +0000 (14:33 +0000)]
[mlir-cpu-runner] Check entry function is void
Currently crashes if function isn't void when specifiying
'-entry-point-result=void'.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D154352
Ben Shi [Tue, 4 Jul 2023 05:25:15 +0000 (13:25 +0800)]
[CSKY] Optimize conditional select with CLRT/CLRF
Reviewed By: zixuan-wu
Differential Revision: https://reviews.llvm.org/D154409
Ben Shi [Tue, 4 Jul 2023 05:18:26 +0000 (13:18 +0800)]
[CSKY][test][NFC] Add more tests of conditional select
Reviewed By: zixuan-wu
Differential Revision: https://reviews.llvm.org/D154408
Kai Luo [Tue, 4 Jul 2023 07:04:34 +0000 (15:04 +0800)]
[Flang] Use llvm_unreachable to replace assert, NFC
IIUC, the `default` case should be unreachable inferred from the context.
Reviewed By: kkwli0
Differential Revision: https://reviews.llvm.org/D154344
Matthias Springer [Tue, 4 Jul 2023 06:57:55 +0000 (08:57 +0200)]
[mlir][SCF] Add `loop.promote_if_one_iteration` transform op
This transform op promotes loops with one iteration. I.e., the loop op is replaced by just the loop body.
Differential Revision: https://reviews.llvm.org/D154361
Haojian Wu [Mon, 3 Jul 2023 09:27:35 +0000 (11:27 +0200)]
[lldb] Replace llvm::writeFileAtomically with llvm::writeToOutput API.
Differential Revision: https://reviews.llvm.org/D154329
Christian Ulmann [Tue, 4 Jul 2023 06:26:53 +0000 (06:26 +0000)]
[mlir][LLVM] Add alignment to LLVMFuncOp
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D154410
Aleksandr Popov [Sun, 2 Jul 2023 18:19:23 +0000 (20:19 +0200)]
[NFC][IRCE] Remove dead variables
Jianjian GUAN [Wed, 28 Jun 2023 08:09:37 +0000 (16:09 +0800)]
[RISCV][NFC] Refactor lowerToScalableOp.
Refactor lowerToScalableOp to combine switch case code.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D153948
Christian Ulmann [Tue, 4 Jul 2023 05:39:35 +0000 (05:39 +0000)]
[mlir][LLVM] Add unnamed_addr to LLVMFuncOp
This commit adds LLVM's unnamed_addr enum to LLVMFuncOp.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D154360
Yashwant Singh [Tue, 4 Jul 2023 03:34:46 +0000 (09:04 +0530)]
[CodeGen] Move lowerCopy from expandPostRA to TII
This will allow targets to lower their 'copy' instructions easily.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D152261
Nikolas Klauser [Tue, 4 Jul 2023 01:35:07 +0000 (18:35 -0700)]
[libc++][NFC] Remove a redundant check for building the library
Owen Pan [Fri, 30 Jun 2023 01:14:18 +0000 (18:14 -0700)]
[clang-format] Correctly annotate */&/&& in operator function calls
Reverts
4986f3f2f220 (but keeps its unit tests) and fixes #49973
differently.
Also fixes bugs that incorrectly annotate the operator keyword as
TT_FunctionDeclarationName in function calls and as TT_Unknown in function
declarations and definitions.
Differential Revision: https://reviews.llvm.org/D154184
Akira Hatanaka [Mon, 3 Jul 2023 23:25:21 +0000 (16:25 -0700)]
Add a flag to disable "duplicate definition of category" warnings
Differential Revision: https://reviews.llvm.org/D154251
Johannes Doerfert [Mon, 3 Jul 2023 21:02:23 +0000 (14:02 -0700)]
[Attributor] Manifest attributes implied by the IR
If an attribute is implied by the IR we do not (always) create an AA
anymore. To keep test coverage, and given the lack of a good heuristic
to decide otherwise, we will now also manifest such attributes.
Johannes Doerfert [Sun, 2 Jul 2023 22:50:30 +0000 (15:50 -0700)]
[Attributor] Make isImpliedByIR and hasAssumedIRAttr more useful
Checking more than one attribute kind was never done and we want to
later check the IR w/o creating an AA as fallback.
Garvit Gupta [Mon, 3 Jul 2023 22:55:04 +0000 (15:55 -0700)]
[RISCV] Support constant operand for la and lla pseudoinstruction.
This patch improves compatibility with GNU assembler by adding support for
constant immediate in la and lla pseudo instruction, and expanding it in the
same way as we currently expands li pseudo instruction.
Links to discussion related to the above issue in the community -
https://github.com/riscv-non-isa/riscv-arch-test/issues/105
https://github.com/riscv-non-isa/riscv-arch-test/issues/108
https://github.com/riscv-non-isa/riscv-arch-test/issues/106
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D150133
Luke Lau [Fri, 30 Jun 2023 20:49:41 +0000 (21:49 +0100)]
[RISCV] Refactor vfcvt_rm pseudo insertion case statements. NFC
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D154258
Jennifer Yu [Fri, 30 Jun 2023 01:16:25 +0000 (18:16 -0700)]
[OPENMP52] Codegen support for doacross clause.
Differential Revision: https://reviews.llvm.org/D154180
Andrzej Warzynski [Sun, 2 Jul 2023 13:43:14 +0000 (14:43 +0100)]
[mlir][transform] Allow arbitrary indices to be scalable
This change lifts the limitation that only the trailing dimensions/sizes
in dynamic index lists can be scalable. It allows us to extend
`MaskedVectorizeOp` and `TileOp` from the Transform dialect so that the
following is allowed:
%1, %loops:3 = transform.structured.tile %0 [[4], [4], 4]
This is also a follow up for https://reviews.llvm.org/D153372
that will enable the following (middle vector dimension is scalable):
transform.structured.masked_vectorize %0 vector_sizes [2, [4], 8]
To facilate this change, the hooks for parsing and printing dynamic
index lists are updated accordingly (`printDynamicIndexList` and
`parseDynamicIndexList`, respectively). `MaskedVectorizeOp` and `TileOp`
are updated to include an array of attribute of bools that captures
whether the corresponding vector dimension/tile size, respectively, are
scalable or not.
This change is a part of a larger effort to enable scalable
vectorisation in Linalg. See this RFC for more context:
* https://discourse.llvm.org/t/rfc-scalable-vectorisation-in-linalg/
Differential Revision: https://reviews.llvm.org/D154336
Dave Lee [Mon, 3 Jul 2023 21:39:29 +0000 (14:39 -0700)]
[lldb] Remove old commented out code (NFC)
Move to `DumpAddress` in
c4a8a76048e91baecb5746b80b9733e4af299937.
Florian Hahn [Mon, 3 Jul 2023 21:39:40 +0000 (22:39 +0100)]
[LV] Break up condition in selectEpilogueVectorizationFactor loop (NFCI)
Restructure the loop as suggested in D154264 to increase readability and
make it easier to extend.
Jonas Devlieghere [Wed, 28 Jun 2023 17:48:00 +0000 (10:48 -0700)]
[lldb] SymbolFileJSON: Update outdates Text -> JSON (NFC)
Originally the symbol file format was going to textual, before we
decided to use JSON. Updated the plugin name and the header guard.
Jonas Devlieghere [Mon, 3 Jul 2023 21:06:57 +0000 (14:06 -0700)]
[lldb] Add two-level caching in the source manager
We recently saw an uptick in internal reports complaining that LLDB is
slow when sources on network file systems are inaccessible. I looked at
the SourceManger and its cache and I think there’s some room for
improvement in terms of reducing file system accesses:
1. We always resolve the path.
2. We always check the timestamp.
3. We always recheck the file system for negative cache hits.
D153726 fixes (1) but (2) and (3) are necessary because of the cache’s
current design. Source files are cached at the debugger level which
means that the source file cache can span multiple targets and
processes. It wouldn't be correct to not reload a modified or new file
from disk.
We can however significantly reduce the number of file system accesses
by using a two level cache design: one cache at the debugger level and
one at the process level:
- The cache at the debugger level works the way it does today. There is
no negative cache: if we can't find the file on disk, we'll try again
next time the cache is queried. If a cached file's timestamp changes
or if its path remapping changes, the cached file is evicted and we
reload it from disk.
- The cache at the process level is design to avoid accessing the file
system. It doesn't check the file's modification time. It caches
negative results, so if a file didn't exist, it doesn't try to reread
it from disk. Checking if the path remapping changed is cheap
(doesn't involve checking the file system) and is the only way for a
file to get evicted from the process cache.
The result of this patch is that LLDB will not show you new content if a
file is modified or created while a process is running. I would argue
that this is what most people would expect, but it is a change from how
LLDB behaves today.
For an average stop, we query the source cache 4 times. With the current
implementation, that's 4 stats to get the modification time, If the file
doesn't exist on disk, that's an additional 4 stats. Before D153726, if
the path starts with a ~ there are another additional 4 calls to
realpath. When debugging sources on a slow (network) file system, this
quickly adds up.
In addition to the two level caching, this patch also adds a source
logging channel and synchronization to the source file cache. The
logging was helpful during development and hopefully will help us triage
issues in the future. The synchronization isn't a new requirement: as
the cache is shared across targets, there is no guarantees that it can't
be accessed concurrently. The patch also fixes a bug where we would only
set the source remapping ID if the un-remapped file didn't exist, which
led to the file getting evicted from the cache on every access.
rdar://
110787562
Differential revision: https://reviews.llvm.org/D153834
Felipe de Azevedo Piovezan [Mon, 3 Jul 2023 16:48:01 +0000 (12:48 -0400)]
[lldb][nfc] Remove redundant nullptr check
The make_shared function never returns a nullptr, as such the test for nullptr
is not needed. We also move the empty string check earlier in the if
("oso_object"), as this is cheaper than loading the object file.
Differential Revision: https://reviews.llvm.org/D154365
Anshil Gandhi [Mon, 3 Jul 2023 21:11:04 +0000 (15:11 -0600)]
[InstSimplify] Fold all global variables with initializers
Allow computing size of interposable or externally initializable global variables.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D152145
Ian Anderson [Sun, 4 Jun 2023 21:21:50 +0000 (14:21 -0700)]
[libc++][Modules] std.functional.__functional.invoke and std.type_traits.underlying_type can't export std.type_traits
`__functional/invoke.h` currently only includes `__type_traits/invoke.h` and not all of `type_traits`. Keep it using the specific header, and update its export. Similarly, `__type_traits/underlying_type.h` currently only includes `__type_traits/is_enum.h`, so update its export as well. This requires adding lots of export statements to the module map to keep the transitive includes working. Adding direct includes to the headers fixes `check-cxx`, but leaves many `run-buildbot generic-modules` tests failing, some even with linker errors.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D153832
Peter Klausler [Thu, 29 Jun 2023 21:22:30 +0000 (14:22 -0700)]
[flang] Don't warn about a NaN argument to ISNAN()
Don't emit a warning when a compile-time constant argument to
ISNAN() or IEEE_IS_NAN() is a NaN.
Differential Revision: https://reviews.llvm.org/D154377
Yaxun (Sam) Liu [Mon, 3 Jul 2023 18:51:51 +0000 (14:51 -0400)]
[HIP] Pass -fno-hip-fp32-correctly-rounded-divide-sqrt to clang -cc1
-fno-hip-fp32-correctly-rounded-divide-sqrt affects clang codegen
and should be passed to clang -cc1 by clang driver.
Fixes: https://github.com/llvm/llvm-project/issues/63653
Reviewed by: Matt Arsenault
Differential Revision: https://reviews.llvm.org/D154385
Aiden Grossman [Mon, 3 Jul 2023 20:16:56 +0000 (13:16 -0700)]
[llvm-exegesis] Disable tests requiring the subprocess executor
This patch temporarily disables tests that require the subprocess
executor as they are currently flaky on systems that are able to run
them such as clang-cmake-x86_64-avx512-linux. Once I have a fix for the
flakiness they will be reenabled.
Peter Klausler [Thu, 29 Jun 2023 21:02:18 +0000 (14:02 -0700)]
[flang] Check constant POS/LEN arguments IBITS even when not both constant
Apply compile-time checks to the values supplied for the POS and LEN
arguments of the IBITS intrinsic function even when only one of them
is a known constant.
Differential Revision: https://reviews.llvm.org/D154376
Peter Klausler [Wed, 28 Jun 2023 23:38:08 +0000 (16:38 -0700)]
[flang] Fix overflow detection for folding SUM/PRODUCT
The overflow detection code in the templates that fold SUM and PRODUCT
was checking for overflow before performing the reduction, not after.
Fix and add tests.
Differential Revision: https://reviews.llvm.org/D154374
Johannes Doerfert [Mon, 3 Jul 2023 19:47:31 +0000 (12:47 -0700)]
[Polly][FIX] Adjust enum after D153305
Johannes Doerfert [Mon, 3 Jul 2023 06:48:02 +0000 (23:48 -0700)]
[Attributor] Use the right argument number (call site vs callee)
Peter Klausler [Wed, 28 Jun 2023 21:55:09 +0000 (14:55 -0700)]
[flang] More actual argument warnings
Emit warnings when CHARACTER lengths or array sizes of actual
and dummy arguments mismatch in risky ways.
Differential Revision: https://reviews.llvm.org/D154370
Louis Dionne [Wed, 28 Jun 2023 14:45:39 +0000 (10:45 -0400)]
[libc++] Remove support for .fail.cpp tests
We want to move away from those tests and towards explicit .verify.cpp
tests, since those have a simpler model.
Differential Revision: https://reviews.llvm.org/D153982
Christopher Bate [Fri, 30 Jun 2023 22:04:08 +0000 (16:04 -0600)]
[mlir][Conversion/GPUCommon] Fix bug in conversion of `math` ops
The common GPU operation transformation that lowers `math` operations
to function calls in the `gpu-to-nvvm` and `gpu-to-rocdl` passes handles
`vector` types by applying the function to each scalar and returning a
new vector. However, there was a typo that results in incorrectly
accumulating the result vector, and the rewrite returns an `llvm.mlir.undef`
result instead of the correct vector. A patch is added and tests are
strengthened.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D154269
Zhixun Tan [Mon, 3 Jul 2023 19:20:18 +0000 (12:20 -0700)]
[mlir][dataflow] Unify dependency management in AnalysisState.
In the MLIR dataflow analysis framework, when an `AnalysisState` is updated, it's dependents are enqueued to be visited.
Currently, there are two ways dependents are managed:
* `AnalysisState::dependents` stores a list of dependents. `DataFlowSolver::propagateIfChanged()` reads this list and enqueues them to the worklist.
* `AnalysisState::onUpdate()` allows custom logic to enqueue more to the worklist. This is called by `DataFlowSolver::propagateIfChanged()`.
This cleanup diff consolidates the two into `AnalysisState::onUpdate()`. This way, `DataFlowSolver` does not need to know the detail about `AnalysisState::dependents`, and the logic of dependency management is entirely handled by `AnalysisState`.
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D154170
Peter Klausler [Mon, 3 Jul 2023 16:53:20 +0000 (09:53 -0700)]
[flang] Prevent lowering crash by properly updating symbol pointer
Kind of an edge case. When a MODULE FUNCTION or SUBROUTINE
interface is defined by a MODULE PROCEDURE in the same program
unit, ensure that the symbol table pointer in the parse tree is
updated to point to the SubprogramDetails symbol for the
interface, and not left pointing to what should soon become
a dead SubprogramNameDetails symbol.
Differential Revision: https://reviews.llvm.org/D154380
Johannes Doerfert [Fri, 30 Jun 2023 22:12:24 +0000 (15:12 -0700)]
[Attributor][NFCI] Move attribute collection and manifest to Attributor
Before, we checked and manifested attributes right in the IR. This was
bad as we modified the IR before the manifest stage. Now we can
add/remove/inspect attributes w/o going to the IR (except for the
initial query).
Johannes Doerfert [Mon, 3 Jul 2023 18:30:36 +0000 (11:30 -0700)]
[Attributor][NFCI] Manifest assumption attributes explicitly
We had some custom manifest for assumption attributes but we use the
generic manifest logic. If we later decide to curb duplication (of
attributes on the call site and callee), we can do that at a single
location and for all attributes.
The test changes basically add known `llvm.assume` callee information to
the call sites.
Johannes Doerfert [Fri, 30 Jun 2023 22:56:08 +0000 (15:56 -0700)]
[Attributor][NFCI] Merge MemoryEffects explicitly
We had some custom handling for existing MemoryEffects but we now move
it to the place we check other existing attributes before we manifest
new ones. If we later decide to curb duplication (of attributes on the
call site and callee), we can do that at a single location and for all
attributes.
The test changes basically add known `memory` callee information to the
call sites.
Med Ismail Bennani [Mon, 3 Jul 2023 18:48:11 +0000 (11:48 -0700)]
[lldb] Fix data race when interacting with python scripts
This patch should fix some data races when a python script (i.e. a
Scripted Process) has a nested call to another python script (i.e. a
OperatingSystem Plugin), which can cause concurrent writes to the python
lock count.
This patch also fixes a data race happening when resetting the operating
system unique pointer.
To address these issues, both accesses is guarded by a mutex.
rdar://
109413039
Differential Revision: https://reviews.llvm.org/D154271
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Alex Langford [Tue, 27 Jun 2023 20:48:27 +0000 (13:48 -0700)]
[lldb][NFCI] Target::StopHook::GetDescription should take a Stream ref instead of pointer
We always assume that this is valid anyway, might as well take a
reference.
Differential Revision: https://reviews.llvm.org/D153917
Peter Klausler [Thu, 29 Jun 2023 22:19:23 +0000 (15:19 -0700)]
[flang][runtime] Allow OPEN(n,ENCODING=) to change the encoding
OPEN statements can be used to change some, but not all, attributes
of units that have already been opened. The I/O runtime library
wasn't allowing ENCODING= to be changed. Every other Fortran compiler
permits this usage, and it's safe and useful, so allow it.
(Otherwise there's no good way to ensure that the preconnected
unit 6 is in UTF-8 mode.)
Differential Revision: https://reviews.llvm.org/D154379
Peter Klausler [Thu, 29 Jun 2023 20:03:14 +0000 (13:03 -0700)]
[flang][NFC] Document semantics of an ambiguous/non-portable use case
We intentionally process NAMELIST groups in a scope after having
resolved all of the names in that scope. This means that a name
whose first appearance in a scope is in the NAMELIST group resolves
to a local object, if any, rather than to any host associated object.
The standard is unclear on this point, and there is no clear
precedent in other compilers.
This patch doesn't implement this choice -- that was done long ago --
but just documents the behavior in Extensions.md.
Differential Revision: https://reviews.llvm.org/D154375
Peter Klausler [Wed, 28 Jun 2023 23:08:54 +0000 (16:08 -0700)]
[flang] Warn about overflow after folding HYPOT
The code that folds the intrinsic function HYPOT was neglecting to
warn the programmer about overflow when it occurs.
Differential Revision: https://reviews.llvm.org/D154371
Alex Langford [Tue, 27 Jun 2023 22:51:27 +0000 (15:51 -0700)]
[lldb] Introduce a macro to mark methods as unsupported with no replacement
We already have LLDB_DEPRECATED which is used to mark methods as
deprecated with a message and an alternative to use instead. This is
expresses an intent of "We recognize this functionality is useful but
there are some pitfalls with the interface we have exposed."
In other cases, there are no "alternative" methods to use and the code should be
refactored to avoid using a method entirely. For example,
`SBValue::Cast` should be avoided in favor of using the expression
evaluator to perform a cast. There isn't a mechanical solution, the
recommendation is to instead refactor your code.
This commit renames the existing `LLDB_DEPRECATED` to
`LLDB_DEPRECATED_FIXME`, and adds a `LLDB_DEPRECATED` macro to cover the
second scenario.
Differential Revision: https://reviews.llvm.org/D153928
Alex Langford [Tue, 27 Jun 2023 01:13:38 +0000 (18:13 -0700)]
[lldb][NFCI] Remove use of ConstString from ProcessElfCore
I'm not convinced that it makes sense for the paths to be ConstStrings. We're
going to be putting them into FileSpecs (which are backed by
ConstStrings, for now) but otherwise there's no need to store them as
ConstStrings upfront.
Differential Revision: https://reviews.llvm.org/D153827
Florian Hahn [Mon, 3 Jul 2023 17:57:30 +0000 (18:57 +0100)]
[LSR] Add test for another normalization miscompile.
Based on @peixin test case shared in D153004.
Peter Klausler [Thu, 22 Jun 2023 18:28:47 +0000 (11:28 -0700)]
[flang][NFC] Add F2023X documentation
Add a document that summarizes Fortran 202X's upcoming
features and their urgency for implementation.
Differential Revision: https://reviews.llvm.org/D153916
Johannes Doerfert [Mon, 3 Jul 2023 06:49:18 +0000 (23:49 -0700)]
[Attributor] Ensure we call the specialized isImpliedByIR
Before we ended up not calling the specialized AAType::isImpliedByIR but
the generic IRAttribute::isImpliedByIR in the IRAttribute::initialize
function.
Johannes Doerfert [Fri, 30 Jun 2023 17:49:06 +0000 (10:49 -0700)]
[Attributor][NFC] Check for the Explorer first to avoid traversing uses
Johannes Doerfert [Fri, 30 Jun 2023 22:54:58 +0000 (15:54 -0700)]
[Attributor][NFC] Exit manifestAttrs early if there are no attributes
Johannes Doerfert [Thu, 15 Jun 2023 04:44:24 +0000 (21:44 -0700)]
[MemoryEffects][NFCI] Make the MemoryEffects class reusable
In a follow up we will reuse the logic in MemoryEffectsBase to merge
AAMemoryLocation and AAMemoryBehavior without duplicating all the bit
fiddling code already available in MemoryEffectsBase.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D153305
Alex Langford [Tue, 27 Jun 2023 00:57:48 +0000 (17:57 -0700)]
[lldb][NFCI] Change return type of GetProcessPluginName
Instead of just returning a raw `const char *`, I think llvm::StringRef
would make more sense. Most of the time that we use the return value of
`GetProcessPluginName` we're passing it to `CreateProcess` which takes a
StringRef anyway.
Differential Revision: https://reviews.llvm.org/D153825
Slava Zakharin [Mon, 3 Jul 2023 15:41:28 +0000 (08:41 -0700)]
[flang][hlfir] Evaluate actual args before impure elemental calls.
Actual argument expressions must be evaluated before the invocation
of the sequence of per-element calls of an impure elemental subprogram.
Otherwise, the side effects of the calls may affect the input for
the consequent elements.
The proposed changes are described by Jean in D154174.
Reviewed By: tblah
Differential Revision: https://reviews.llvm.org/D154263
Kiran Chandramohan [Mon, 3 Jul 2023 16:48:12 +0000 (16:48 +0000)]
[Flang] Mark as maybe_unused to fix warning in PPCIntrinsicCall.cpp