Peter Klausler [Wed, 15 Feb 2023 00:07:24 +0000 (16:07 -0800)]
[flang] Fix ISHFTC argument value check
The code that visits all pairs of constant SHIFT= and SIZE= arguments
in an array-valued call to the ISHFTC intrinsic function had a bad loop
test that affected the case where one of these arguments was scalar and
the other was not. Fix it, and add tests.
Differential Revision: https://reviews.llvm.org/D145092
Peter Klausler [Tue, 14 Feb 2023 22:58:34 +0000 (14:58 -0800)]
[flang] Warn about dangerous actual argument association with TARGET dummy arguments
The actual argument associated with a dummy argument with the TARGET attribute is
not required to be itself a target or pointer, or even to be a variable, but in
those cases, any pointer that is associated with the dummy argument during the
execution of the procedure is either going to be invalid afterwards because it
points to temporary storage that has since been deallocated or an optimization
time bomb because it aliases an object that isn't a target. Add warnings for
these cases.
Differential Revision: https://reviews.llvm.org/D145089
Siva Chandra Reddy [Wed, 1 Mar 2023 17:41:02 +0000 (17:41 +0000)]
[libc][NFC] Switch use of errno in src/unistd and src/sys to libc_errno.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D145096
Matthias Springer [Thu, 2 Mar 2023 16:22:06 +0000 (17:22 +0100)]
[mlir][SparseTensor] Fix incorrect API usage in RewritePatterns
Incorrect API usage was detected by D144552.
Differential Revision: https://reviews.llvm.org/D145166
Yaxun (Sam) Liu [Wed, 1 Mar 2023 15:56:11 +0000 (10:56 -0500)]
[AMDGPU] Mark mbcnt as convergent
since it depends on CFG.
Otherwise some passes will try to merge them and cause
incorrect results.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D145072
Jakub Kuderski [Thu, 2 Mar 2023 16:23:49 +0000 (11:23 -0500)]
[ADT] Drop append_range test that doesn't compile with EXPENSIVE_CHECKS
The issue seems to be caused by the definition of `SafeIntIterator` and
is otherwise unrelated to the implementation of `append_range`.
We have a simialr test below, so this does not meaningfully decrease the
test coverage of `append_range`.
See the discussion in: https://reviews.llvm.org/D144420#4164373
Issue: https://github.com/llvm/llvm-project/issues/61122
Sanjay Patel [Thu, 2 Mar 2023 14:43:23 +0000 (09:43 -0500)]
[InstCombine] add tests for absolute diff; NFC
More coverage for D145073.
Fanbo Meng [Thu, 2 Mar 2023 14:28:37 +0000 (09:28 -0500)]
Make clang/test/C/C2x/n2934.c compatible with targets that do not support thread_local storage.
Add an optional error check to test case for it to pass on targets that do not support thread_local storage.
Reviewed By: aaron.ballman, abhina.sreeskantharajan
Differential Revision: https://reviews.llvm.org/D145158
Nikita Popov [Thu, 2 Mar 2023 16:10:42 +0000 (17:10 +0100)]
[GlobalOpt] Drop bitcast handling in global to alloca fold
Pointer bitcasts no longer occur with opaque pointers -- and in
this case not handling them allows us to drop the code for
promoting constant expressions to instructions as well.
usama hameed [Thu, 2 Mar 2023 16:04:45 +0000 (21:04 +0500)]
[Sanitizers] Disable armv7* sanitizers slice for ios
rdar://
104059106
Differential Revision: https://reviews.llvm.org/D145000
Nikita Popov [Thu, 2 Mar 2023 16:06:08 +0000 (17:06 +0100)]
[GlobalOpt] Regenerate test checks (NFC)
And drop the unnecessary main function.
Philip Reames [Thu, 2 Mar 2023 15:44:00 +0000 (07:44 -0800)]
[ASAN] Use TypeSize in InterestingMemoryOperand [mostly NFC]
This is a mechanical prep change for scalable vector support. All it does is move the point of TypeSize to unsigned (i.e. the unsafe cast) closer to point of use.
Craig Topper [Thu, 2 Mar 2023 15:44:00 +0000 (07:44 -0800)]
[DAGCombiner] Replace LegalOperations check in visitSIGN_EXTEND with LegalTypes.
This is guarding a check for isTypeLegal so it should check is
LegalTypes.
Fixes PR61111.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D145139
Ankur [Thu, 2 Mar 2023 14:33:56 +0000 (14:33 +0000)]
[clang][ExtractAPI] Handle platform specific unavailability correctly
This Patch gives ExtractAPI the ability to emit correct availability information for symbols marked as unavailable on a specific platform ( PR#60954 )
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D144940
Matthias Springer [Thu, 2 Mar 2023 15:12:42 +0000 (16:12 +0100)]
[mlir][NVGPU] Fix incorrect API usage in RewritePatterns
Incorrect API usage was detected by D144552.
Differential Revision: https://reviews.llvm.org/D145156
Matthias Springer [Thu, 2 Mar 2023 14:43:59 +0000 (15:43 +0100)]
[mlir][linalg] Fix incorrect API usage in RewritePatterns
Incorrect API usage was detected by D144552.
Differential Revision: https://reviews.llvm.org/D145161
Stephan Bergmann [Wed, 1 Mar 2023 22:29:45 +0000 (23:29 +0100)]
Call MarkVirtualMembersReferenced on an actual class definition
...rather than on potentially just a declaration.
Without the fix, the newly added clang/test/SemaCXX/warn-undefined-internal.cpp
failed with
> error: 'warning' diagnostics expected but not seen:
> File /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp Line 12 (directive at /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp:13): function 'test2()::S::f' has internal linkage but is not defined
> error: 'note' diagnostics expected but not seen:
> File /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp Line 14 (directive at /home/sbergman/github.com/llvm/llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp:15): used here
(I ran into this when two LibreOffice Clang plugins produced false positive
warnings, as they relied on Decl::isReferenced() returning true for such virtual
member functions of local classes.)
Differential Revision: https://reviews.llvm.org/D145123
usama hameed [Thu, 2 Mar 2023 14:48:38 +0000 (19:48 +0500)]
Revert "[Sanitizers] Error out for -static-libsan on darwin"
This reverts commit
4e7d40e0928cfe448ba947d2a67895fccaa3535f.
Paul Walker [Thu, 2 Mar 2023 12:23:52 +0000 (12:23 +0000)]
Revert "Revert "[SCEV] Add SCEVType to represent `vscale`.""
Relanding after fixing Polly related build error.
This reverts commit
7b26dcae9eaf8cdcba7fef032fd83d060dffd4b4.
Utkarsh Saxena [Thu, 2 Mar 2023 12:04:07 +0000 (13:04 +0100)]
Change ClangTidy unit tests to run in C++20 mode instead of C++11.
Differential Revision: https://reviews.llvm.org/D145154
Matthias Springer [Thu, 2 Mar 2023 11:51:35 +0000 (12:51 +0100)]
[mlir][vector] Fix incorrect API usage in RewritePatterns
Incorrect API usage was detected by D144552.
Differential Revision: https://reviews.llvm.org/D145153
LLVM GN Syncbot [Thu, 2 Mar 2023 12:51:00 +0000 (12:51 +0000)]
[gn build] Port
97dcbea63e11
chenglin.bi [Thu, 2 Mar 2023 12:45:54 +0000 (20:45 +0800)]
[LogicCombine 1/?] Implement a general way to simplify logical operations.
This patch involves boolean ring to simplify logical operations. We can treat `&` as ring multiplication and `^` as ring addition.
So we need to canonicalize all other operations to `*` `+`. Like:
```
a & b -> a * b
a ^ b -> a + b
~a -> a + 1
a | b -> a * b + a + b
c ? a : b -> c * a + (c + 1) * b
```
In the code, we use a mask set to represent an expression. Every value that is not comes from logical operations could be a bit in the mask.
The mask itself is a multiplication chain. The mask set is an addiction chain.
We can calculate two expressions based on boolean algebras.
For now, the initial patch only enabled on and/or/xor, Later we can enhance the code step by step.
Reference: https://en.wikipedia.org/wiki/Boolean_ring
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D142803
Clement Courbet [Thu, 2 Mar 2023 12:34:43 +0000 (13:34 +0100)]
[MCA] Fix crash in `EntryStage::cycleEnd` when there are no instructions.
Sander de Smalen [Thu, 2 Mar 2023 12:20:53 +0000 (12:20 +0000)]
[AArch64] NFC: Add missing CHECK lines for sme-aarch64-svcount.ll test
Haojian Wu [Thu, 2 Mar 2023 12:31:04 +0000 (13:31 +0100)]
[clangd] Use the normalized file path to do the filtering.
This is an oversight, where we normalized the path, but we didn't use it
in the filtering.
Petar Avramovic [Wed, 1 Mar 2023 18:00:04 +0000 (19:00 +0100)]
AMDGPU: Add more flat scratch load and store tests for 8 and 16-bit types
Add tests for more complicated scratch load and store patterns.
Includes:
- sign and zero extending loads of i8 and i16 to i32 into 32-bit register
- D16 instructions that affect only high or low 16 bits of 32-bit register
- D16 sign and zero extending loads of i8 to i16 into high or low 16 bits
of 32-bit register
- D16 loads of i16 to high or low 16 bits of 32-bit register
- D16 stores of i8 and i16 from high 16 bits of 32-bit register
Differential Revision: https://reviews.llvm.org/D145081
Sander de Smalen [Thu, 2 Mar 2023 11:46:10 +0000 (11:46 +0000)]
[AArch64][SME2] Add CodeGen support for target("aarch64.svcount").
This patch adds AArch64 CodeGen support such that the type can be passed
and returned to/from functions, and also adds support to use this type in
load/store operations and PHI nodes.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D136862
Utkarsh Saxena [Tue, 21 Feb 2023 14:24:11 +0000 (15:24 +0100)]
[C++20][ClangTidy] Update the ClangTidy tests to also test in C++20 mode
Differential Revision: https://reviews.llvm.org/D144480
Tobias Gysi [Thu, 2 Mar 2023 11:55:57 +0000 (12:55 +0100)]
[mlir][llvm] Use interfaces in the translation to LLVMIR.
The revision consistently uses the AliasAnalysisOp and AccessGroupOp
interfaces in the translation from MLIR to LLVMIR. It thus drops the
last string based lookups of alias scope and access group attributes.
Depends on D144851
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D145037
Paul Walker [Thu, 2 Mar 2023 11:59:50 +0000 (11:59 +0000)]
Revert "[SCEV] Add SCEVType to represent `vscale`."
This reverts commit
7912f5cc92f65ad0d3c705f3683a0b69dbedcc57.
Paul Walker [Mon, 27 Feb 2023 14:49:32 +0000 (14:49 +0000)]
[SCEV] Add SCEVType to represent `vscale`.
This is part of an effort to remove ConstantExpr based
representations of `vscale` so that its LangRef definiton can
be relaxed to accommodate a less strict definition of constant.
Differential Revision: https://reviews.llvm.org/D144891
Luís Marques [Thu, 2 Mar 2023 10:39:56 +0000 (10:39 +0000)]
[Support] Implement findModulesAndOffsets on Apple 64-bit platforms
To have line number information in stack traces (per stack frame) it's
necessary to implement findModulesAndOffsets.
Differential Revision: https://reviews.llvm.org/D142282
Nikita Popov [Thu, 2 Mar 2023 10:45:27 +0000 (11:45 +0100)]
[GlobalOpt] Use more specific type (NFC)
SRA always works on GlobalVariables.
Nikita Popov [Thu, 2 Mar 2023 10:23:42 +0000 (11:23 +0100)]
[llvm-exegesis] Include more specific header (NFC)
Timm Bäder [Thu, 2 Mar 2023 09:23:48 +0000 (10:23 +0100)]
Revert "[clang][Interp] Implement C++ Range-for loops"
This reverts commit
bce8b3c1830434c10b8a30380db522d7c6a8658d.
This commit breaks memory-sanitizer builds:
https://lab.llvm.org/buildbot/#/builders/5/builds/31899
Haojian Wu [Thu, 2 Mar 2023 10:01:54 +0000 (11:01 +0100)]
[bazel] Add missing dep for llvm-c-test
Haojian Wu [Thu, 2 Mar 2023 09:38:41 +0000 (10:38 +0100)]
Alexander Belyaev [Thu, 2 Mar 2023 09:26:31 +0000 (10:26 +0100)]
[mlir][nfc] Clean-up ConvertToDestinationStyle.cpp.
Differential Revision: https://reviews.llvm.org/D145147
J. Ryan Stinnett [Sat, 25 Feb 2023 22:44:04 +0000 (22:44 +0000)]
[DebugInfo] Remove `dbg.addr` from IR
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144801
J. Ryan Stinnett [Sat, 25 Feb 2023 22:17:28 +0000 (22:17 +0000)]
[DebugInfo] Remove `dbg.addr` from CodeGen
As part of this work, removing `SDDbgValue::clearIsEmitted` originally added for
`dbg.addr` in
045c67769d7fe577fc38cccb6fb40fd814437447 was attempted, but it
appears some tests for `DBG_INSTR_REF` now depend on that behaviour as well, so
it was kept and comments were updated instead.
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144800
J. Ryan Stinnett [Sat, 25 Feb 2023 21:29:44 +0000 (21:29 +0000)]
[DebugInfo] Remove `dbg.addr` from Analysis
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144799
J. Ryan Stinnett [Sat, 25 Feb 2023 21:04:49 +0000 (21:04 +0000)]
[DebugInfo] Remove `dbg.addr` from llvm-reduce
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144798
J. Ryan Stinnett [Sat, 25 Feb 2023 20:59:04 +0000 (20:59 +0000)]
[DebugInfo] Remove `dbg.addr` from Transforms
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144797
J. Ryan Stinnett [Sat, 18 Feb 2023 22:59:35 +0000 (22:59 +0000)]
[DebugInfo] Remove `dbg.addr` from MLIR
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144796
J. Ryan Stinnett [Sat, 18 Feb 2023 22:48:03 +0000 (22:48 +0000)]
[DebugInfo] Remove `dbg.addr` from Coroutines
This removes `dbg.addr` support from the Coroutines transform. This effectively
reverts the `dbg.addr`-only portions of
19279ffc77b8d224c447d4eb0ee0c727ab64babf
and
0b647fc5299156bf83c46aa539d6c9c39647bb36.
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144795
J. Ryan Stinnett [Sat, 18 Feb 2023 22:16:42 +0000 (22:16 +0000)]
[DebugInfo][NFC] Remove `FuncArgumentDbgValueKind::Addr` from SelectionDAG
This removes the unused `FuncArgumentDbgValueKind::Addr` value originally added
by
e24f5348798605a799c63ff09169d177d262cd37. The intent was to signal the
original intrinsic that marked a function argument, but the `Addr` part was
never used.
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144794
J. Ryan Stinnett [Sun, 29 Jan 2023 00:59:33 +0000 (00:59 +0000)]
[DebugInfo] Upgrade `dbg.addr` to `dbg.value`
As part of removing `dbg.addr`, this upgrades any calls to `dbg.value` with
`DW_OP_deref` prepended onto the value expression.
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144793
J. Ryan Stinnett [Sat, 18 Feb 2023 23:13:44 +0000 (23:13 +0000)]
[DebugInfo][Docs] Remove `dbg.addr` from docs
Part of `dbg.addr` removal
Discussed in https://discourse.llvm.org/t/what-is-the-status-of-dbg-addr/62898
Differential Revision: https://reviews.llvm.org/D144792
Tobias Gysi [Thu, 2 Mar 2023 09:12:43 +0000 (10:12 +0100)]
[mlir][llvm] Add AliasAnalysis and AccessGroup interfaces to intrinsics.
This revision updates the memcpy, memove, and memset intrinsics to
implement the AliasAnalysis and AccessGroup interfaces. The changes
will enable the import and export of alias scope, tbaa, and
access group metadata attached to these intrinsics. It also
renames the requiresAliasScope flag to requiresAliasAnalysis since
the intrinsics also support tbaa and not only access scope metadata.
The revision still maintains the string based attribute lookup
in the translation from MLIR to LLVMIR. Using the interfaces
instead of the string based lookup is left to a followup revision.
Depends on D144851
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D144965
Andrzej Warzynski [Wed, 1 Mar 2023 15:44:01 +0000 (15:44 +0000)]
[mlir][linalg] Vectorize tensor.extract using contiguous loads
This patch implements vectorization of tensor.extract for n-D tensor (n
>= 2) using contiguous load operations, i.e. `vector.transfer_read`. This
is a follow-up of https://reviews.llvm.org/D137660 in which gather loads
were used, i.e. `vector.gather`.
It is always safe to use gather load operations when the underlying
memory pattern is contiguous, but not vice-verse. At the moment, the
following conditions have to be met for contiguous loads to be
generated:
1. The _output tensor_ must be a 1-D vector with the trailing dim > 1,
e.g. `tensor<1x1x4xi32`,
2. The trailing dim in the _input tensor_ must be > 1, e.g.
`tensor<1x1x4i32>` would be fine, but not `tensor<1x4x1xi32>`.
If these conditions are not satisfied, gather loads are generated
instead.
Condition 1 guarantees that the iteration space of the corresponding
`linalg.generic` Op is relatively simple. That makes analysing the
indices for `tensor.extract` rather straightforward.
Condition 2 is mostly there to avoid weird vectorisation patterns
resulting in vectors like: `vector<1x1x1xi32>`. In practice, tensors
like `tensor<1x4x1xi32>` should be collapsed to `tensor<1x4xi32>` before
vectorisation, but that's beyond the scope of this patch.
If needed, both conditions can be relaxed. I've not been able to find a
good motivating example for these, hence skipping. For reference,
`tosa.resize` (lowered to Linalg) was the driving example used here.
As a bonus, the test from "vectorization-unsupported.mlir" is moved to
"vectorization.mlir" with proper CHECK lines added.
NOTE: This relands
89b144ece330b363713bec369d2d89dc85f715f5 (added extra
test, refined comments and variable names).
Differential Revision: https://reviews.llvm.org/D141998
Co-authored-by: Diego Caballero <diegocaballero@google.com>
Ying Yi [Fri, 17 Feb 2023 11:42:20 +0000 (11:42 +0000)]
[Coverage] Fix an issue: a statement after calling 'assert()' function is wrongly
marked as 'not executed'.
In the current coverage mapping implementation, we terminate the current region
and start a zero region when we hit a nonreturn function. However, for logical OR,
the second operand is not executed if the first operand evaluates to true. If the
nonreturn function is called in the right side of logical OR and the left side of
logical OR is TRUE, we should not start a zero `GapRegionCounter`. This will also
apply to `VisitAbstractConditionalOperator`.
Fixes https://github.com/llvm/llvm-project/issues/59030
Reviewed By: zequanwu
Differential Revision: https://reviews.llvm.org/D144371
Florian Hahn [Thu, 2 Mar 2023 09:12:23 +0000 (10:12 +0100)]
[GlobalOpt] Extend CleanupPointerRootUsers to handle CE users.
Extend CleanupPointerRootUsers to iterate over a worklist, add users of
constant expressions to the worklist to enable additional cleanups.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D144468
Nicolas Vasilache [Thu, 2 Mar 2023 09:06:18 +0000 (01:06 -0800)]
[mlir][Transform] Fix transform::SequenceOp builder
Previously, the wrond type would be used and would not matche the number of locations triggering
an assertion failures in `createBlock`.
Timm Bäder [Sat, 31 Dec 2022 17:26:15 +0000 (18:26 +0100)]
[clang][Interp] Handle record initialization via CastExpr
Differential Revision: https://reviews.llvm.org/D140808
Corentin Jabot [Sun, 6 Feb 2022 21:58:43 +0000 (22:58 +0100)]
[Clang] Implement Change scope of lambda trailing-return-type
This implements P2036R3 and P2579R0.
That is, explicit, int, and implicit capture become visible
at the start of the parameter head.
Reviewed By: aaron.ballman, rupprecht, shafik
Differential Revision: https://reviews.llvm.org/D124351
Nikita Popov [Tue, 24 Jan 2023 14:32:31 +0000 (15:32 +0100)]
[UTC] Include return type/attributes under --version 2
If --function-signature is used with --version 2, then also include
the return type/attributes in the check lines. This is the
implementation of D133943 rebased on the --version mechanism from
D142473.
This doesn't bump the default version yet, because I'd like to do
that together with D140212 (which enables --function-signature by
default), as these changes seem closely related. For now this
functionality can be accessed by explicitly passing --version 2
to UTC.
Fixes https://github.com/llvm/llvm-project/issues/61058.
Differential Revision: https://reviews.llvm.org/D144963
Nikita Popov [Tue, 28 Feb 2023 15:38:45 +0000 (16:38 +0100)]
[llvm-c] Remove bindings for creating legacy passes
Legacy passes are only supported for codegen, and I don't believe
it's possible to write backends using the C API, so we should drop
all of those. Reduces the number of places that need to be modified
when removing legacy passes.
Differential Revision: https://reviews.llvm.org/D144970
Noah Goldstein [Thu, 2 Mar 2023 08:34:41 +0000 (02:34 -0600)]
Recommit "[X86] Add `TuningPreferShiftShuffle` for when Shifts are preferable to shuffles." (2nd Try)
Move the opcode checks to after we have already verified we found a
valid shift instruction (`0 < ShiftAmt`) in `matchUnaryPermuteShuffle`
and `lowerShuffleAsShift`.
Reviewed By: pengfei, RKSimon
Differential Revision: https://reviews.llvm.org/D143786
Timm Bäder [Sat, 31 Dec 2022 16:06:52 +0000 (17:06 +0100)]
[clang][Interp] Add ArrayElemPtr{,Pop} opcode
We usually access array elements in the same pattern, which uses
narrow(). Add an extra opcode for this. This saves us quite some
instructions and makes the bytecode easier to read.
Differential Revision: https://reviews.llvm.org/D140805
Marco Elver [Thu, 2 Mar 2023 08:24:25 +0000 (09:24 +0100)]
Revert "[SelectionDAG] Transitively copy NodeExtraInfo on RAUW"
This reverts commit
7f635b90e7bdf1378fd9a65fc62b99e8e07d4aaf.
The current implementation causes pathological slowdowns in certain
cases: https://github.com/llvm/llvm-project/issues/61108
Timm Bäder [Wed, 28 Dec 2022 10:43:26 +0000 (11:43 +0100)]
[clang][Interp] Only check constructors for global variables
Local variables may be partially initialized.
Differential Revision: https://reviews.llvm.org/D140723
Timm Bäder [Sat, 31 Dec 2022 15:14:33 +0000 (16:14 +0100)]
[clang][Interp] Implement C++ Range-for loops
Differential Revision: https://reviews.llvm.org/D140803
Nicolas Vasilache [Thu, 2 Mar 2023 07:54:21 +0000 (23:54 -0800)]
[mlir][Linalg] NFC - Improve debug messages for padding
Muhammad Omair Javaid [Thu, 2 Mar 2023 07:51:30 +0000 (11:51 +0400)]
[LLDB] XFAIL TestRunLocker.py for windows
TestRunLocker.py is failing on windows x64 and AArch64 buildbots.
Buildbot log suggests that test needs some minor modification for
windows which I will do later.
https://lab.llvm.org/buildbot/#/builders/83/builds/29680
https://lab.llvm.org/buildbot/#/builders/219/builds/942
Tobias Gysi [Thu, 2 Mar 2023 07:32:30 +0000 (08:32 +0100)]
[flang] Use the newly introduced AliasAnalysisOpInterface.
This revision uses the AliasAnalysisOpInterface introduced in
https://reviews.llvm.org/D144851 to set the tbaa attributes
of load and store ops. With the attribute it is also possible to
set the attribute on atomics as well as on memcopy and
memove intrinsics as soon as https://reviews.llvm.org/D144965
lands.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D145044
Muhammad Omair Javaid [Thu, 2 Mar 2023 07:22:08 +0000 (11:22 +0400)]
Revert "[LLDB] XFAIL TestRunLocker.py on Windows"
This reverts commit
9d28e00e741cb19684111656803434aceef4c2a0.
Timm Bäder [Fri, 30 Dec 2022 10:50:48 +0000 (11:50 +0100)]
[clang][Interp] Handle defined functions without a body
This happens when explicitly defaulting a constructor, for example.
Differential Revision: https://reviews.llvm.org/D140776
Yashwant Singh [Thu, 2 Mar 2023 07:08:52 +0000 (12:38 +0530)]
[llvm][GenericUniformity] Prevent assert while calculating temporal divergence
analyzeTemporalDivergence() was missing the check for always-uniform before
evaluating weather an instruction depends on a value defined in the cycle.
Fix for #60638
https://github.com/llvm/llvm-project/issues/60638
Reviewed By: sameerds, foad, #amdgpu
Differential Revision: https://reviews.llvm.org/D144070
Muhammad Omair Javaid [Thu, 2 Mar 2023 07:05:11 +0000 (11:05 +0400)]
[LLDB] XFAIL TestRunLocker.py on Windows
Kazu Hirata [Thu, 2 Mar 2023 07:03:39 +0000 (23:03 -0800)]
[x86] Precommit a test
This patch precommits a test for:
https://github.com/llvm/llvm-project/issues/60802
Timm Bäder [Mon, 26 Dec 2022 08:18:56 +0000 (09:18 +0100)]
[clang][Interp] Implement remaining MaterializeTemporaryExpr bits
As well as support for CompoundLiteralExprs.
Differential Revision: https://reviews.llvm.org/D140668
Peter Collingbourne [Thu, 2 Mar 2023 00:54:24 +0000 (16:54 -0800)]
ELF: Respect MEMORY command when specified without a SECTIONS command.
We were previously ignoring the MEMORY command unless SECTIONS was also
specified. Fix it.
Differential Revision: https://reviews.llvm.org/D145132
Vadim Paretsky (Intel Americas Inc) [Thu, 2 Mar 2023 04:32:35 +0000 (20:32 -0800)]
[llvm-lib] 'llvm-lib' currently cannot generate an import library from a Windows
.def file, functionality supported by 'lib'. This incompatibility is
breaking clang based Windows openmp builds. This revision adds
basic support for this feature to llvm-lib by cloning the corresponding
code from 'dlltool'.
Differential Revision:https://reviews.llvm.org/D144765
Fangrui Song [Thu, 2 Mar 2023 03:08:55 +0000 (19:08 -0800)]
Revert D143786 "[X86] Add `TuningPreferShiftShuffle` for when Shifts are preferable to shuffles."
This reverts commit
a98ee27416916c3f8af4cd229e0a633423d6d9a3.
It caused MemorySanitizer use-of-uninitialized-value in matchUnaryPermuteShuffle.
Shivam kunwar [Thu, 2 Mar 2023 02:28:15 +0000 (07:58 +0530)]
[libcxx][NFC] Added a note about the P2520R0
Differential Revision: https://reviews.llvm.org/D145087
Ed Maste [Wed, 1 Mar 2023 23:39:29 +0000 (18:39 -0500)]
[libc++] [FreeBSD] correct 64-bit test
Using __SIZEOF_LONG__ == 8 rather than __LP64__ is needed so we use umtx
on CHERI. I accidentally landed an older diff.
Fixes:
17ecbb3ea6ff0ae716dd524c0e2bf75a4815c95b
Wu, Yingcong [Thu, 2 Mar 2023 01:36:37 +0000 (01:36 +0000)]
[memprof] Avoid meaningless pod copy
The pointer `Buffer` is not changed, so there is no need to use reference, and the `Pod` here should use reference to avoid meaningless copy.
Reviewed By: snehasish
Differential Revision: https://reviews.llvm.org/D145024
Jun Ma [Thu, 23 Feb 2023 07:45:48 +0000 (15:45 +0800)]
[WebAssembly] Skip implied bitmask operation in LowerShift
This patch skips redundant explicit masks of the shift count since
it is implied inside wasm shift instruction.
Differential Revision: https://reviews.llvm.org/D144619
Zhongyunde [Thu, 2 Mar 2023 01:07:44 +0000 (09:07 +0800)]
Revert "[MergeICmps] Adapt to non-eq comparisons, retry"
This reverts commit
74ad19c25d7217d8f580a21d12fd4c784a1a0094.
test unittests/ProfileData/ProfileDataTests fails when built with
optimisations level -O1 with clang including this patch.
Michal Paszkowski [Wed, 1 Mar 2023 23:51:18 +0000 (00:51 +0100)]
[SPIR-V] Remove redundant check and fix typos
Lang Hames [Wed, 1 Mar 2023 23:34:23 +0000 (15:34 -0800)]
[ExecutionEngine] Silence warnings about sprintf use in interpreter.
We should review memory safety in the interpreter
(https://github.com/llvm/llvm-project/issues/58086), but for now just silence
the warnings to reduce noise.
rdar://
100555195
Lang Hames [Wed, 22 Feb 2023 05:22:28 +0000 (21:22 -0800)]
[ORC] Drop StaticLibraryDefinitionGenerator Load/Create overloads with triples.
We can get the triple from the ExecutionSession, so clients shouldn't have to
provide it.
Michael Jones [Wed, 1 Mar 2023 19:35:40 +0000 (11:35 -0800)]
[libc] add basic Intel MacOS configuration
The config is based on the ARM MacOS config, but with fenv and math
functions disabled.
This should unblock this bug: https://github.com/llvm/llvm-project/issues/60910
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145099
Nick Desaulniers [Wed, 1 Mar 2023 23:20:55 +0000 (15:20 -0800)]
[RegAllocFast] insert additional spills along indirect edges of INLINEASM_BR
When generating spills (stores) for values produced by INLINEASM_BR
instructions, make sure to insert one spill per indirect target.
Otherwise the reload generated may load from a stack slot that has not
yet been stored to (resulting in a load of an uninitialized stack slot).
Link: https://github.com/llvm/llvm-project/issues/53562
Fixes: https://github.com/llvm/llvm-project/issues/60855
Reviewed By: MatzeB
Differential Revision: https://reviews.llvm.org/D144907
Nick Desaulniers [Mon, 27 Feb 2023 19:22:42 +0000 (11:22 -0800)]
precommit test for pr60855
This test demonstrates an issue with callbr outputs being used along
indirect edges when using regallocfast.
Link: https://github.com/llvm/llvm-project/issues/60855
Differential Revision: https://reviews.llvm.org/D144906
Rahul Kayaith [Mon, 23 Jan 2023 04:31:18 +0000 (23:31 -0500)]
[mlir][python] Remove "Raw" OpView classes
The raw `OpView` classes are used to bypass the constructors of `OpView`
subclasses, but having a separate class can create some confusing
behaviour, e.g.:
```
op = MyOp(...)
# fails, lhs is 'MyOp', rhs is '_MyOp'
assert type(op) == type(op.operation.opview)
```
Instead we can use `__new__` to achieve the same thing without a
separate class:
```
my_op = MyOp.__new__(MyOp)
OpView.__init__(my_op, op)
```
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D143830
rkayaith [Wed, 9 Nov 2022 03:48:26 +0000 (22:48 -0500)]
[mlir][python] Allow running pass manager on any operation
`PassManager.run` is currently restricted to running on `builtin.module`
ops, but this restriction doesn't exist on the C++ side. This updates it
to take `ir.Operation/OpView` instead of `ir.Module`.
Depends on D143354
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D143356
rkayaith [Wed, 9 Nov 2022 03:39:18 +0000 (22:39 -0500)]
[mlir][CAPI] Allow running pass manager on any operation
`mlirPassManagerRun` is currently restricted to running on
`builtin.module` ops, but this restriction doesn't exist on the C++
side. This renames it to `mlirPassManagerRunOnOp` and updates it to take
`MlirOperation` instead of `MlirModule`.
Depends on D143352
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D143354
rkayaith [Tue, 8 Nov 2022 21:55:06 +0000 (16:55 -0500)]
[mlir][python] Add generic operation parse APIs
Currently the bindings only allow for parsing IR with a top-level
`builtin.module` op, since the parse APIs insert an implicit module op.
This change adds `Operation.parse`, which returns whatever top-level op
is actually in the source.
To simplify parsing of specific operations, `OpView.parse` is also
added, which handles the error checking for `OpView` subclasses.
Reviewed By: ftynse, stellaraccident
Differential Revision: https://reviews.llvm.org/D143352
Rahul Kayaith [Sat, 25 Feb 2023 07:30:46 +0000 (02:30 -0500)]
[mlir][AsmParser] Improve parse{Attribute,Type} error handling
Currently these functions report errors directly to stderr, this updates
them to use diagnostics instead. This also makes partially-consumed
strings an error if the `numRead` parameter isn't provided (the
docstrings already claimed this happened, but it didn't.)
While here I also tried to reduce the number of overloads by switching
to using default parameters.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D144804
Arthur Eubanks [Wed, 1 Mar 2023 21:21:04 +0000 (13:21 -0800)]
[NFC][Pipeline] Move PromotePass into GlobalCleanupPM
Joseph Huber [Wed, 1 Mar 2023 21:02:00 +0000 (15:02 -0600)]
[OpenMP][NFC] Clean up Twines and other issues in plugins
Summary:
Tihs patch is mostly NFC to fix some warning currently present in OpenMP
offloading plugins. Specifically this mostly removes the use of Twine
variables in favor of LLVM's small string. Twine variables are prone to
use-after-free and this is a cleaner way to concatenate a string.
Nick Desaulniers [Wed, 1 Mar 2023 20:58:13 +0000 (12:58 -0800)]
[llvm][LowerConstantIntrinsics] add debug statements
These can help us better understand what __builtin_constant_p and
__builtin_object_size get folded to.
$ clang -mllvm -debug-only=lower-is-constant-intrinsic ...
Reviewed By: void
Differential Revision: https://reviews.llvm.org/D143521
Jeff Bailey [Wed, 1 Mar 2023 20:55:59 +0000 (20:55 +0000)]
[libc] Fix mismatch in exception decl
When running the libc tests under vscode, I got an error about a
mismatches exception declaration for strerror. Since string.h
seems to be getting included transitively anyway, just include
it and rely on its definition.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D144803
Peiming Liu [Wed, 1 Mar 2023 19:03:02 +0000 (19:03 +0000)]
[mlir][sparse] support coiteration with fused reshape tensor
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D145091
Konstantin Belousov [Fri, 20 Jan 2023 23:32:11 +0000 (18:32 -0500)]
[libc++] [FreeBSD] only use _umtx_op(2) on 64bit arches
Only 64bit architectures can be supported this way, because libcxx
defines __cxx_contention_t to be int64_t for FreeBSD, and 32bit
arches do not have a kind of UMTX_OP_WAIT_INT64_PRIVATE operation.
Fixes:
83387dbc18e7998f87aa4a2d35320bcb2ed5c392
Reviewed by: arichardson, ldionne, emaste, Mordante
Differential Revision: https://reviews.llvm.org/D142422
Andrew Gozillon [Wed, 1 Mar 2023 20:32:54 +0000 (14:32 -0600)]
[Flang][Tool][bbc] Emit module wrapper in addition to body
This change seeks to emit the full module from the bbc tool and
not just the body. This change currently does not break existing tests
when running check-(mlir, flang, all). This stops the discarding of
any attributes that may be applied to the Module during
compilation.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D144869
Louis Dionne [Wed, 1 Mar 2023 20:25:29 +0000 (15:25 -0500)]
[libc++] Use generic-cxx20 instead of apple-cxx20 on Apple CI
apple-cxx20 is equivalent to generic-cxx20, so we don't need it anymore.
It had been introduced when clang-tidy was enabled explicitly from
run-buildbot, but that's not needed anymore since clang-tidy is
enabled from the buildkite pipeline definition.
Louis Dionne [Wed, 1 Mar 2023 20:11:44 +0000 (15:11 -0500)]
[libc++][NFC] Remove trailing whitespace on line and clang-format
This broke the CI after
813e1da974 was checked in.