Benjamin Kramer [Mon, 19 Dec 2022 19:21:15 +0000 (20:21 +0100)]
[FileCheck] Remove the last llvm::Optional
It doesn't seem necessary and it's blocking std::optional.
Utkarsh Saxena [Tue, 29 Nov 2022 13:05:53 +0000 (14:05 +0100)]
Make evaluation of nested requirement consistent with requires expr.
Fixes: https://github.com/llvm/llvm-project/issues/45563
```
template<class T> concept True = true;
template <class T>
concept C1 = requires (T) {
requires True<typename T::value> || True<T>;
};
template <class T>
constexpr bool foo()
requires True<typename T::value> || True<T> {
return true;
}
static_assert(C1<double>); // Previously failed due to SFINAE error
static_assert(foo<int>()); // but this works fine.
```
The issue here is the discrepancy between how a [nested requirement is evaluated](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplateInstantiate.cpp#L2331) Vs how a [non-nested requirement is evaluated](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaConcept.cpp#L167-L200).
This patch makes constraint checking consistent for nested requirement
and trailing requires expressions by reusing the same evaluator.
Differential Revision: https://reviews.llvm.org/D138914
Matt Arsenault [Sun, 20 Nov 2022 22:36:02 +0000 (14:36 -0800)]
HIP: Directly call fabs builtins
All the attribute numbering changes are due to the ocml function being
assumed convergent, and the direct call is not.
This begins a series of patches to avoid using the thinnest
ocml wrappers around llvm intrinsics. These wrapper functions
aren't buying anything and add complexity. As we do not propagate
fast math flags into the library on linking, and cannot generally
safely do so, we're losing information by calling into them. Directly
call the builtins so we get the fast math flags set appropriate for the
translation unit naturally.
Mitch Phillips [Mon, 19 Dec 2022 19:02:14 +0000 (11:02 -0800)]
Revert "[AIX][BigArchive] Treat the archive is empty if the first child member offset is zero"
This reverts commit
b26fe2a3e520a520e785dc6b4e5758b7fde6af9d.
Reason: Broke the ASan build bots. See more info in the original
phabricator review: https://reviews.llvm.org/D138986
Paul Robinson [Mon, 19 Dec 2022 19:00:50 +0000 (11:00 -0800)]
[sanitizer-common] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Haojian Wu [Mon, 19 Dec 2022 14:10:49 +0000 (15:10 +0100)]
[lit] Fix a few issues in relative_lines.py
- fixes error: Line: 91 result += contents[pos:m.start(index)] TypeError: can only concatenate str (not "bytes") to str
- fixes the "-code-completion-at=%s:%(lineb'-7')" rewritten results
Differential Revision: https://reviews.llvm.org/D140300
Saleem Abdulrasool [Mon, 19 Dec 2022 18:12:08 +0000 (18:12 +0000)]
Revert "Reland "[TargetLowering] Teach DemandedBits about VSCALE""
This reverts commit
3010f60381bcd828d1b409cfaa576328bcd05bbc.
This change introduced undefined behaviour (reported at
https://reviews.llvm.org/D138508#inline-1352840). Additionally, it
appears to be responsible for a mis-compilation on RISCV64 with the
vector extension (https://github.com/llvm/llvm-project/issues/59594).
The commit message indicates that this is meant to be ARM64 specific
though is a generic selection change.
Haojian Wu [Mon, 19 Dec 2022 08:22:42 +0000 (09:22 +0100)]
[include-cleaner] Base-type usage from member exprs is implicit.
Per the discussion on https://reviews.llvm.org/D140095#inline-1352956
Differential Revision: https://reviews.llvm.org/D140284
Paul Kirth [Fri, 9 Dec 2022 04:35:23 +0000 (04:35 +0000)]
Reland "[pgo] Avoid introducing relocations by using private alias"
In many cases, we can use an alias to avoid a symbolic relocations,
instead of using the public, interposable symbol. When the instrumented
function is in a COMDAT, we can use a hidden alias, and still avoid
references to discarded sections.
New compiler-rt tests are Linux only for now.
Previous versions of this patch allowed the compiler to name the
generated alias, but that would only be valid when the functions were
local. Since the alias may be used across TUs we use a more
deterministic naming convention, and add a `.local` suffix to the alias
name just as we do for relative vtables aliases.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D137982
Michal Paszkowski [Mon, 19 Dec 2022 18:36:32 +0000 (19:36 +0100)]
[SPIR-V] Support memory(...) function attributes
Adds support for memory(...) function attributes in SPIR-V function
control info lowering.
Differential Revision: https://reviews.llvm.org/D139133
Michal Paszkowski [Mon, 19 Dec 2022 18:05:30 +0000 (19:05 +0100)]
[SPIR-V] Disable MachineLateInstrsCleanup pass
This patch disables MachineLateInstrsCleanup pass (since it does not
work with virtual registers) and modifies LIT tests to run with -O0.
Differential Revision: https://reviews.llvm.org/D140103
Simon Pilgrim [Mon, 19 Dec 2022 11:23:02 +0000 (11:23 +0000)]
[X86] Fix SLM uops counts for WriteBitTestSetRegRMW instructions
The set/reset/complement RMW variants use +1uop compared to the BT read-only instructions
Based off llvm-exegesis captures, confirmed with Agner + uops.info
Siva Chandra Reddy [Sat, 17 Dec 2022 17:02:00 +0000 (17:02 +0000)]
[libc][gpu][NFC] Move CMake logic to prepare GPU build to a separate file.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D140309
Kautuk Consul [Mon, 19 Dec 2022 17:42:24 +0000 (09:42 -0800)]
[RISCV] Add codegen support for RISCV XVentanaCondOps Extension
This patch adds codegen support for part of XVentanaCondOps extension.
This extension is designed to reduce the number of branches in
the generated RISCV assembly by replacing branches with conditional
move instructions as defined by XVentanaCondOps specification.
The specification for XVentanaCondOps extension can be found at:
https://github.com/ventanamicro/ventana-custom-extensions/releases/download/v1.0.1/ventana-custom-extensions-v1.0.1.pdf
Co-authored-by: Mikhail Gudim <mgudim@ventanamicro.com>
Differential Revision: https://reviews.llvm.org/D139394
Stephen Tozer [Mon, 19 Dec 2022 17:53:46 +0000 (17:53 +0000)]
Fix: [DebugInfo] Add function to test debug values for equivalence
Fixes a test in
6d169089 which had unspecified platform dependencies
and platform-dependent output.
Ramkumar Ramachandra [Mon, 19 Dec 2022 13:25:14 +0000 (14:25 +0100)]
mlir/DialectConversion: use std::optional (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional. This patch touches DialectConversion, and modifies
existing conversions and tests appropriately.
See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Signed-off-by: Ramkumar Ramachandra <r@artagnon.com>
Differential Revision: https://reviews.llvm.org/D140303
Paul Robinson [Mon, 19 Dec 2022 17:43:59 +0000 (09:43 -0800)]
[profile] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Stephen Tozer [Mon, 19 Dec 2022 15:44:16 +0000 (15:44 +0000)]
[DebugInfo] Add function to test debug values for equivalence
This patch adds a new function that can be used to check all the
properties, other than the machine values, of a pair of debug values for
equivalence. This is done by folding the "directness" into the
expression, converting the expression to variadic form if it is not
already in that form, and then comparing directly. In a few places which
check whether two debug values are identical to see if their ranges can
be merged, this function will correctly identify cases where two debug
values are expressed differently but have the same meaning, allowing
those ranges to be correctly merged.
Differential Revision: https://reviews.llvm.org/D136173
Matt Arsenault [Mon, 19 Dec 2022 00:29:59 +0000 (19:29 -0500)]
Reapply "GlobalISel: Make LLT constructors constexpr"
I initially attempted this in
5a95be22d248be654b992dfb25e3850dbb182a14. It
was reverted in
81cbe0ca83c2f912ff612ddb65629a108197b0d1 since it
crashed GCC 5.3. That has dropped out of the list of supported host
compilers, so try again.
Simon Pilgrim [Thu, 15 Dec 2022 23:35:45 +0000 (18:35 -0500)]
DAG: Pull fneg out of select feeding fadd into fsub
Enables folding fadd x, (select c, (fneg a), (fneg b))
-> fsub (select a, b), c
Avoids some regressions in a future AMDGPU change.
Matt Arsenault [Thu, 15 Dec 2022 12:44:32 +0000 (07:44 -0500)]
AMDGPU: Add regression tests for fmin/fmax legacy matching
Sebastian Neubauer [Mon, 19 Dec 2022 13:25:05 +0000 (14:25 +0100)]
[llvm][ADT] Fix Any with msvc and lto
llvm::Any had and has several bugs, so we eventually want to replace it
with std::any.
Unfortunately, we cannot do that right now because of bugs in the msvc
standard library that are only fixed in VS 2022 17.4.
When lto is enabled in msvc, constant symbols end up at the same
address, breaking the TypeId implementation of llvm::Any.
Make the TypeId<T>::Id non-const to fix this.
I was able to find an easy reproducer (tried in godbolt with
x64 msvc v19.32 and `/GL` as compiler flags to enable lto):
```c++
template <typename T> struct TypeId {
// Remove the const here and below to make it work.
static const char Id;
};
template <typename T> const char TypeId<T>::Id = 0;
template <typename A, typename B>
bool isSame() {
return &TypeId<A>::Id == &TypeId<B>::Id;
}
class A {};
class B {};
int main() {
// This should output "is same 0" because the addresses of A's and B's
// TypeId::Id should be different.
printf("is same %d\n", isSame<A, B>());
return 0;
}
```
Differential Revision: https://reviews.llvm.org/D139974
Nikita Popov [Fri, 16 Dec 2022 12:00:59 +0000 (13:00 +0100)]
[LAA] Convert test to opaque pointers (NFC)
When converting this test to opaque pointers (and dropping bitcast),
we get improved memory checks. Per fhahn:
> It looks like the difference is due to the logic that determines
> pointer strides in LAA not handling bitcasts. Without the
> bitcasts, the logic now triggers successfully.
Differential Revision: https://reviews.llvm.org/D140204
Caroline.Concatto@arm.com [Mon, 19 Dec 2022 14:01:39 +0000 (14:01 +0000)]
[AArch64] Add alias predicate-as-counter register for PFALSE
According to:
https://developer.arm.com/documentation/ddi0602/2022-09/
PFALSE should:
"...an assembler must also accept predicate-as-counter register
name for the destination predicate register."
Differential Revision: https://reviews.llvm.org/D140301
Matt Arsenault [Fri, 16 Dec 2022 01:09:08 +0000 (20:09 -0500)]
AMDGPU: Add more fneg combine tests
Yitzhak Mandelbaum [Mon, 19 Dec 2022 14:49:03 +0000 (14:49 +0000)]
[clang][dataflow] Remove stray lines from `Environment::join`
Removes an assertion and a useless line. The assertion seems left over from
earlier debugging and the line that follows is a stray line.
Differential Revision: https://reviews.llvm.org/D140306
Matt Arsenault [Fri, 16 Dec 2022 01:08:23 +0000 (20:08 -0500)]
ARM: Add baseline tests for fadd with select combine
Carlos Galvez [Mon, 19 Dec 2022 15:22:47 +0000 (15:22 +0000)]
[clang-tidy][NFC] Replace custom isStatic matcher with the existing isStaticStorageClass
LLVM GN Syncbot [Mon, 19 Dec 2022 15:16:21 +0000 (15:16 +0000)]
[gn build] Port
ca0f4e193b05
Roman Lebedev [Mon, 19 Dec 2022 15:09:30 +0000 (18:09 +0300)]
[NFC][llvm-exegesis] Try to fix GCC7 build
https://lab.llvm.org/staging/#/builders/235/builds/1121
Lucas Prates [Thu, 15 Dec 2022 11:26:17 +0000 (11:26 +0000)]
[AArch64] Add missing v8.8a Non-maskable Interrupts feature
This adds support for the missing Non-maskable Interrupts (FEAT_NMI)
feature from armv8.8-A, which consists of the `ALLINT` pstate register.
This is a second iteration of the patch from D131389, building on top of
the D139925 changes that enable better support for `msr (immediate)`
instructions that take 1-bit immediates.
Contributors:
* David Candler
* Tomas Matheson
* Sam Elliott
Reviewed By: lenary, tmatheson
Differential Revision: https://reviews.llvm.org/D140216
Lucas Prates [Thu, 8 Dec 2022 15:01:06 +0000 (15:01 +0000)]
[AArch64] Add new v9.4-A PM pstate system register
This adds support for the new PM pstate system register introduced by
the v9.4-A Exception-based Event Profiling extension (FEAT_EBEP).
The new PM pstate register takes a 1-bit immediate and requires
different values to be specified for the higher bits of the Crm field.
To enable that, this patch creates an explicit separation between the
pstate system registers that take 4-bit and 1-bit immediate operands,
allowing each entry to specify the value for the 3 high bits of Crm.
This also updates other pstate registers to correctly accept 4-bit
immediates, matching their decoding specification from the Arm ARM.
These include: `PAN`, `UAO`, `DIT` and `SSBS`.
More information about this extension and the new register can be found
at:
* https://developer.arm.com/documentation/ddi0601/2022-09/AArch64-Registers/PM--PMU-Exception-Mask
Contributors:
* Lucas Prates
* Sam Elliott
Reviewed By: lenary
Differential Revision: https://reviews.llvm.org/D139925
Tarun Prabhu [Mon, 19 Dec 2022 14:51:59 +0000 (07:51 -0700)]
[flang] Lowering and runtime support for F08 transformational intrinsics: BESSEL_JN and BESSEL_YN
The runtime implementation uses the recurrence relations
`J(n-1, x) = (2.0 / x) * n * J(n, x) - J(n+1, x)`
`Y(n+1, x) = (2.0 / x) * n * Y(n, x) - Y(n-1, x)`
(see https://dlmf.nist.gov/10.74.iv and https://dlmf.nist.gov/10.6.E1).
Although the standard requires that `N1` and `N2` in `BESSEL_JN(N1, N2, x)`
and `BESSEL_YN(N1, N2, x)` be non-negative, this is not checked in the
runtime functions. This is in keeping with some other compilers which also
return some results when `N1` and/or `N2` are negative.
The special case for `x == 0` is handled in different runtime functions
for each of `BESSEL_JN` and `BESSEL_YN`. The lowering code checks for this
case and inserts the checks and the appropriate runtime calls in FIR.
The existing tests for the two intrinsics was modified to keep the style
consistent with the additional lowering tests that were added.
Anna Thomas [Thu, 17 Nov 2022 18:40:33 +0000 (13:40 -0500)]
[LoopPeel] Expose ValueMap of last peeled iteration. NFC
The value map of last peeled iteration is computed within peelLoop API.
This patch exposes it for callers of peelLoop.
While this is not currently used by upstream passes, we have a usecase
downstream which benefits from this API update. Future users of peelLoop
can also use the ValueMap if needed.
Similar value maps are exposed by other loop utilities such as loop
cloning.
Differential Revision: https://reviews.llvm.org/D138228
Matt Arsenault [Mon, 19 Dec 2022 03:14:00 +0000 (22:14 -0500)]
Support: Make TypeSize constructors constexpr
This is to enable LLT to be constexpr
Paul Robinson [Mon, 19 Dec 2022 14:44:27 +0000 (06:44 -0800)]
[msan] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Matt Arsenault [Mon, 19 Dec 2022 14:31:17 +0000 (09:31 -0500)]
AMDGPU: Convert a few more special case tests to opaque pointers
lower-kernargs.ll needed a switch to use update_test_checks metadata
matching.
Matt Arsenault [Mon, 19 Dec 2022 14:23:45 +0000 (09:23 -0500)]
AMDGPU: Update some tests to use opaque pointers
vectorize-buffer-fat-pointer.ll required a manual check line fix.
vector-alloca-addrspacecast.ll required a manual fixup of a check
line. partial-regcopy-and-spill-missed-at-regalloc.ll required
re-running update_mir_test_checks. The HSA metadata tests required
avoiding the script touching the type name in the metadata.
annotate-noclobber.ll ran into one update script bug. It deleted a
check line with a 0 offset GEP, moving the following -NEXT check
logically up one line.
Matt Arsenault [Mon, 5 Dec 2022 18:06:16 +0000 (13:06 -0500)]
AMDGPU: Convert some amdgpu-codegenprepare tests to opaque pointers
amdgpu-late-codegenprepare.ll required running update_test_checks
after converting.
Paul Robinson [Mon, 19 Dec 2022 14:24:50 +0000 (06:24 -0800)]
[lsan] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Nikita Popov [Mon, 19 Dec 2022 13:47:28 +0000 (14:47 +0100)]
[BPFAbstractMemberAccess] Use WeakTrackingVH for Base
The value will be RAUWd, make sure the reference in CallInfo gets
updated.
It seems like this was not a problem without opaque pointers due
to the bitcast in between.
Viktoriia Bakalova [Thu, 8 Dec 2022 10:20:14 +0000 (10:20 +0000)]
[include-cleaner] Use expansion locations for macros.
Use expansion locations for target symbol decls when finding headers for macros.
Fix: https://github.com/llvm/llvm-project/issues/59392
Differential Revision: https://reviews.llvm.org/D139716
Roman Lebedev [Mon, 19 Dec 2022 14:14:55 +0000 (17:14 +0300)]
[NFC][llvm-exegesis] Try to fix GCC7 build
https://lab.llvm.org/staging/#/builders/235/builds/1090
Paul Walker [Fri, 16 Dec 2022 17:14:38 +0000 (17:14 +0000)]
[SeparateConstOffsetFromGEP] Remove TypeSize error when collecting constant indices.
Differential Revision: https://reviews.llvm.org/D140229
Matt Arsenault [Mon, 19 Dec 2022 13:35:55 +0000 (08:35 -0500)]
AMDGPU: Convert some tests to opaque pointers
These required update_mir_test_checks.
Doru Bercea [Mon, 19 Dec 2022 13:00:05 +0000 (07:00 -0600)]
Nikita Popov [Mon, 19 Dec 2022 13:30:29 +0000 (14:30 +0100)]
[BPF] Restore failing offset-reloc-cast-struct tests (NFC)
After opaque pointer conversion these tests fail with a use after
free under asan, due to bugs in BPFAbstractMemberAccess. For now,
restore the tests to unbreak build bots.
Sam McCall [Fri, 16 Dec 2022 14:59:11 +0000 (15:59 +0100)]
[lit] Script to automate use of %(line-n). Use in CodeComplete tests.
Tests where the RUN-lines/CHECK-ed output refer to line numbers in the test
file are a maintenance burden, as inserting text in the appropriate place
invalidates all the subsequent line numbers.
Lit supports %(line+n) for this, and FileCheck supports [[@LINE+N]].
But many existing tests don't make use of it and still need to be modified.
This commit adds a script that can find line numbers in tests according to a
regex and replace them with the appropriate relative-line reference.
It contains some options to avoid inappropriately rewriting tests where absolute
numbers are appropriate: a "nearby" threshold and a refusal by default to
replace only some matched line numbers.
I've applied it to CodeComplete tests, this proves the concept but also are the
single worst group of tests I've seen in this respect.
These changes are likely to hit merge conflicts, but can be regenerated with:
```
find ../clang/test/CodeCompletion/ -type f | grep -v /Inputs/ | xargs ../llvm/utils/relative_lines.py --verbose --near=20 --pattern='-code-completion-at[ =]%s:(\\d+):' --pattern='requires fix-it: {(\d+):\d+-(\d+):\d+}'
````
As requested in https://reviews.llvm.org/D140044
Fixes https://github.com/llvm/llvm-project/issues/59553
Differential Revision: https://reviews.llvm.org/D140217
Nikita Popov [Mon, 19 Dec 2022 13:14:00 +0000 (14:14 +0100)]
[SystemZ] Fix test (NFC)
Broken during opaque pointer conversion. I did not notice because
it requires -Drun_long_tests=1 to run.
Run the test through instnamer so updating it works properly.
Matt Arsenault [Sat, 3 Dec 2022 19:13:50 +0000 (14:13 -0500)]
InstCombine: Match pattern that appears in clang's __builtin_isnormal
and (fcmp ord x, 0), (fcmp u* x, inf) -> fcmp o* x, inf
and (fcmp ord x, 0), (fcmp u* fabs(x), inf) -> fcmp o* x, inf
Clang emits this peculiar pattern as an isfinite check in
__builtin_isnormal which can be simplified. We should fix clang to
emit this in the first place, but should also fold it here.
Matt Arsenault [Sat, 3 Dec 2022 15:12:00 +0000 (10:12 -0500)]
InstCombine: Add baseline tests for and (fcmp ord x), (fcmp u* x)
Viktoriia Bakalova [Tue, 6 Dec 2022 10:58:25 +0000 (10:58 +0000)]
[include-cleaner] Handle dependent type members in AST.
Handles dependent type members in AST.
Fix: https://github.com/llvm/llvm-project/issues/59354
Differential Revision: https://reviews.llvm.org/D139409
LLVM GN Syncbot [Mon, 19 Dec 2022 12:30:15 +0000 (12:30 +0000)]
[gn build] Port
Doru Bercea [Fri, 9 Dec 2022 17:01:04 +0000 (11:01 -0600)]
Fix abs labs and llabs to work in C code.
Matt Arsenault [Sat, 3 Dec 2022 20:47:58 +0000 (15:47 -0500)]
InstCombine: Add baseline test for pattern in clang's isnormal
Clang emits this peculiar pattern as an isfinite check in
__builtin_isnormal which can be simplified. We should fix clang to
emit this in the first place, but should also fold it here.
luxufan [Mon, 19 Dec 2022 12:10:12 +0000 (20:10 +0800)]
[InstCombine][NFC] Add tests of combining ZExt(B-A) + ZExt(A) to ZExt(B)
Doru Bercea [Thu, 15 Dec 2022 20:34:56 +0000 (14:34 -0600)]
Fix host call to nohost function with host variant.
Nikita Popov [Mon, 19 Dec 2022 12:12:03 +0000 (13:12 +0100)]
[XCore] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:09:40 +0000 (13:09 +0100)]
[X86] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:08:24 +0000 (13:08 +0100)]
[WinEH] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:07:12 +0000 (13:07 +0100)]
[WebAssembly] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:06:08 +0000 (13:06 +0100)]
[VE] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:04:48 +0000 (13:04 +0100)]
[Thumb] Convert tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:03:31 +0000 (13:03 +0100)]
[Thumb2] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:01:54 +0000 (13:01 +0100)]
[SystemZ] Convert test to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 12:00:01 +0000 (13:00 +0100)]
[RISCV] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:58:16 +0000 (12:58 +0100)]
[PowerPC] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:56:42 +0000 (12:56 +0100)]
[NVPTX] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:55:15 +0000 (12:55 +0100)]
[Mips] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:54:50 +0000 (12:54 +0100)]
[MIR] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:52:45 +0000 (12:52 +0100)]
[Hexagon] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:48:20 +0000 (12:48 +0100)]
[CodeGen] Convert some tests to opaque pointers (NFC)
Balazs Benics [Mon, 19 Dec 2022 11:49:43 +0000 (12:49 +0100)]
[analyzer] Fix crash inside RangeConstraintManager.cpp introduced by D112621
It seems like `LHS` and `RHS` could be empty range sets.
This caused an assertion failure inside RangeConstraintManager.
I'm hoisting out the check from the function into the call-site.
This way we could assert that we only want to deal with non-empty range
sets.
The relevant part of the trace:
```
#6 0x00007fe6ff5f81a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#7 0x00007fe6ff5f8252 (/lib64/libc.so.6+0x2f252)
#8 0x00000000049caed2 (anonymous namespace)::SymbolicRangeInferrer::VisitBinaryOperator(clang::ento::RangeSet, clang::BinaryOperatorKind, clang::ento::RangeSet, clang::QualType) RangeConstraintManager.cpp:0:0
#9 0x00000000049c9867 (anonymous namespace)::SymbolicRangeInferrer::infer(clang::ento::SymExpr const*) RangeConstraintManager.cpp:0:0
#10 0x00000000049bebf5 (anonymous namespace)::RangeConstraintManager::assumeSymNE(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, llvm::APSInt const&, llvm::APSInt const&) RangeConstraintManager.cpp:0:0
#11 0x00000000049d368c clang::ento::RangedConstraintManager::assumeSymUnsupported(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, bool) (../../main-github/llvm/build-all/bin/clang+0x49d368c)
#12 0x00000000049f0b09 clang::ento::SimpleConstraintManager::assumeAux(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (../../main-github/llvm/build-all/bin/clang+0x49f0b09)
#13 0x00000000049f096a clang::ento::SimpleConstraintManager::assume(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (../../main-github/llvm/build-all/bin/clang+0x49f096a)
#14 0x00000000049f086d clang::ento::SimpleConstraintManager::assumeInternal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal, bool) (../../main-github/llvm/build-all/bin/clang+0x49f086d)
#15 0x000000000492d3e3 clang::ento::ConstraintManager::assumeDual(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal) (../../main-github/llvm/build-all/bin/clang+0x492d3e3)
#16 0x0000000004955b6d clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet&, clang::Expr const*) (../../main-github/llvm/build-all/bin/clang+0x4955b6d)
#17 0x00000000049514b6 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (../../main-github/llvm/build-all/bin/clang+0x49514b6)
#18 0x000000000494c73e clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*, clang::ento::ExplodedNode*) (../../main-github/llvm/build-all/bin/clang+0x494c73e)
#19 0x000000000494c459 clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) (../../main-github/llvm/build-all/bin/clang+0x494c459)
#20 0x000000000492f3d0 clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) (../../main-github/llvm/build-all/bin/clang+0x492f3d0)
#21 0x000000000492e1f6 clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (../../main-github/llvm/build-all/bin/clang+0x492e1f6)
```
Differential Revision: https://reviews.llvm.org/D112621
Florian Hahn [Mon, 19 Dec 2022 11:47:51 +0000 (11:47 +0000)]
[ValueTracking] Consider single poison operands in propgatesPoison.
This patch updates propgatesPoison to take a Use as argument and
propagatesPoison now returns true if the passed in operand causes the
user to yield poison if the operand is poison
This allows propagating poison if the condition of a select is poison.
This helps improve results for programUndefinedIfUndefOrPoison.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D111643
Nikita Popov [Mon, 19 Dec 2022 11:46:13 +0000 (12:46 +0100)]
[BPF] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:44:09 +0000 (12:44 +0100)]
[ARM] Convert some tests to opaque pointers (NFC)
Nikita Popov [Mon, 19 Dec 2022 11:39:01 +0000 (12:39 +0100)]
[AMDGPU] Convert some tests to opaque pointers (NFC)
Ivan Kosarev [Mon, 19 Dec 2022 11:07:41 +0000 (11:07 +0000)]
[AMDGPU][CodeGen] Support raw format TFE buffer loads other than byte, short and d16 ones.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D138215
Nikita Popov [Mon, 19 Dec 2022 11:13:38 +0000 (12:13 +0100)]
[AArch64] Convert some tests to opaque pointers (NFC)
Adrian Kuegel [Mon, 19 Dec 2022 11:04:47 +0000 (12:04 +0100)]
[mlir][Bazel] Add ModuleImport sources to FromLLVMIRTranslation target.
Simon Pilgrim [Mon, 19 Dec 2022 11:03:41 +0000 (11:03 +0000)]
[X86] Fix SLM uops counts for AES instructions
Based off llvm-exegesis captures, confirmed with uops.info
Simon Pilgrim [Sat, 17 Dec 2022 22:21:45 +0000 (22:21 +0000)]
[X86] Add default LoadUOps argument to Intel models WriteResPair macro
This will make it easier to override the folded uop count on a class-by-class basis
Jean Perier [Mon, 19 Dec 2022 10:40:25 +0000 (02:40 -0800)]
[flang] Fix llvm::Optional warning caused by D140220
Using llvm::Optional::value() was just deprecated in LLVM.
Remove the usage that was added by D140220 and replace it by an assert.
https://lab.llvm.org/buildbot/#/builders/160/builds/14222
Luke Lau [Fri, 16 Dec 2022 12:20:26 +0000 (12:20 +0000)]
[WebAssembly] Fix crash when selecting 64 bit lane extract operand
The tablegen patterns on vector_extract only match i32 constants, but
on wasm64 these come in as i64 constants. In certain situations this
would cause crashes whenever it couldn't select an extract_vector_elt
instruction.
Rather than add duplicate patterns for every instruction, this just
canonicalizes the constant to be i32 when lowering.
Fixes https://github.com/llvm/llvm-project/issues/57577
Differential Revision: https://reviews.llvm.org/D140205
Nikita Popov [Mon, 19 Dec 2022 10:13:37 +0000 (11:13 +0100)]
[Bitcode] Convert tests to opaque pointers (NFC)
Tobias Gysi [Mon, 19 Dec 2022 10:10:49 +0000 (11:10 +0100)]
[mlir][llvm] Move LLVM IR import into separate file (NFC).
The revision renames the Importer to ModuleImport and moves the class
out of the ConvertFromLLVMIR.cpp file into ModuleImport.h and
ModuleImport.cpp. Additionally, it introduces two helper methods
on the ModuleImport class that convert functions and globals, and it
merges the translateLLVMIRToModule function into the
registerFromLLVMIRTranslation function to match the design of
the MLIR to LLVM IR export.
This restructuring is a step towards the file structure of the export
and a preparation for an extensible import
https://discourse.llvm.org/t/rfc-extensible-llvm-ir-import/67256/6 that
uses a dialect interface to import intrinsics and metadata.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D140285
Jean Perier [Mon, 19 Dec 2022 10:11:23 +0000 (11:11 +0100)]
[flang] Lower statement function references in HLFIR
Enable lowering of statement function references in HLFIR. This follows
the same principle as statement function lowering with the current
lowering:
- Actual arguments are lowered and mapped to the statement function
dummy symbols.
- "HostAssociated" symbols are mapped to their host values (these are
the symbols referred to inside the statement function expressions that
are not statement function dummies. e.g: `x` in `stmt_func(i) =
x(i)`).
- The statement function expression is evaluated.
evaluate::SetLength has to be lowered to deal with statement functions
returning characters since the front-end is generating one to ensure the
statement function expression value is trimmed/padded to match the statement
function declared type.
Differential Revision: https://reviews.llvm.org/D140220
Pavel Labath [Mon, 19 Dec 2022 09:47:53 +0000 (10:47 +0100)]
[lldb] Modernize sprintf in FormatEntity.cpp
Avoid buffer overflows with large indexes, and spurious nul characters
with small ones.
Adrian Kuegel [Mon, 19 Dec 2022 09:42:47 +0000 (10:42 +0100)]
[MLIR][Bufferization] Remove extra trailing spaces (NFC)
Matthias Springer [Mon, 19 Dec 2022 09:24:46 +0000 (10:24 +0100)]
[mlir][vector] Add scalar vector xfer to memref patterns
These patterns devectorize scalar transfers such as vector<f32> or vector<1xf32>.
Differential Revision: https://reviews.llvm.org/D140215
Matthias Springer [Mon, 19 Dec 2022 08:59:21 +0000 (09:59 +0100)]
[mlir][vector] Fix error handling in VectorizationState::initState
This function used to create new ops even if the vectorization failed. Those ops were then folded away. This caused a failure of the GreedyPatternRewriter, which no longer terminated (each time the IR is modified => one more iteration).
Differential Revision: https://reviews.llvm.org/D140286
Adrian Kuegel [Mon, 19 Dec 2022 09:03:44 +0000 (10:03 +0100)]
[mlir][Bazel] Add missing dependency to TensorDialect.
Muhammad Omair Javaid [Mon, 19 Dec 2022 09:00:10 +0000 (14:00 +0500)]
[CLANG] XFAIL c-strings.c & volatile-1.c AArch64/Windows
c-strings.c was marked XFAIL for msvc ABI on AArch64/Windows platform.
But it is failing due to alignment issue on WoA for both msvc and gnu
gnu ABIs. I am going to mark them as XFAIL for both.
Alex Zinenko [Thu, 15 Dec 2022 18:48:09 +0000 (18:48 +0000)]
[mlir] optionally allow repeated handles in transform dialect
Some operations may be able to deal with handles pointing to the same
operation when the handle is consumed. For example, merge handles with
deduplication doesn't actually destroy payload operations and is
specifically intended to remove the situation with duplicates. Add a
method to the transform interface to allow ops to declare they can
support repeated handles.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D140124
Muhammad Omair Javaid [Mon, 19 Dec 2022 08:50:31 +0000 (13:50 +0500)]
Revert "[lldb] Remove redundant .c_str() and .get() calls"
This reverts commit
fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd.
This has broken all LLDB buildbots:
https://lab.llvm.org/buildbot/#/builders/68/builds/44990
https://lab.llvm.org/buildbot/#/builders/96/builds/33160
Adrian Kuegel [Mon, 19 Dec 2022 08:50:43 +0000 (09:50 +0100)]
[mlir] Apply ClangTidy readability finding.
Use empty() instead of checking for size 0.
Jean Perier [Mon, 19 Dec 2022 08:50:13 +0000 (09:50 +0100)]
[flang] Add hlfir.set_length operation
This will implement evaluate::SetLength where the length of
a character entity is changed (with trimming and padding).
Differential Revision: https://reviews.llvm.org/D140219
Jean Perier [Mon, 19 Dec 2022 08:49:06 +0000 (09:49 +0100)]
[flang][NFC] move getIntIfConstant into FIROpsSupport.h
The motivation is to have it accessible in HLFIROps.cpp to
use it in hlfir.set_length builder to build the result length
type as best as possible.
Differential Revision: https://reviews.llvm.org/D140214
Nikita Popov [Mon, 19 Dec 2022 08:38:44 +0000 (09:38 +0100)]
[Examples] Fix build (NFC)
Can't use VLA at file scope.
Haojian Wu [Mon, 19 Dec 2022 08:12:35 +0000 (09:12 +0100)]
[include-cleaner] Fix a missing review comment.
I forgot to add the change to the commit when committing.