Commit Graph

458353 Commits

Author SHA1 Message Date
Sam McCall
bf47c1ed85 [dataflow] Extract arena for Value/StorageLocation out of DataflowAnalysisContext
DataflowAnalysisContext has a few too many responsibilities, this narrows them.

It also allows the Arena to be shared with analysis steps, which need to create
Values, without exposing the whole DACtx API (flow conditions etc).
This means Environment no longer needs to proxy all these methods.
(For now it still does, because there are many callsites to update, and maybe
if we separate bool formulas from values we can avoid churning them twice)

In future, if we untangle the concepts of Values from boolean formulas/atoms,
Arena would also be responsible for creating formulas and managing atom IDs.

Differential Revision: https://reviews.llvm.org/D148554
2023-04-19 14:32:13 +02:00
Matt Arsenault
dea4f37b7d ValueTracking: Handle shufflevector in computeKnownFPClass 2023-04-19 08:18:37 -04:00
Matt Arsenault
8e42341e50 ValueTracking: Add baseline tests for shufflevector computeKnownFPClass handling 2023-04-19 08:18:37 -04:00
Matt Arsenault
8e70ed6efd ValueTracking: Handle insertelement in computeKnownFPClass 2023-04-19 08:18:37 -04:00
Matt Arsenault
0d448783c3 ValueTracking: sitofp cannot return -0 2023-04-19 08:18:37 -04:00
Matt Arsenault
30f9c38013 ValueTracking: Add baseline test for computeKnownFPClass for minnum/maxnum 2023-04-19 08:18:37 -04:00
Matt Arsenault
d9f31976d1 ValueTracking: Add more fpext and fptrunc tests 2023-04-19 08:18:37 -04:00
David Spickett
ee9a646192 [lldb][RISCV] Add missing flags pointer to register infos
efd64c2f25 added these.
2023-04-19 11:42:14 +00:00
Enna1
b720a59c11 [hwasan] provide a runtime flag for printing remaining threads in error report as an extra information
This patch adds a runtime flag `print_live_threads_info`, which defaults to true, controls whether or not prints remaining threads in error report as an extra information.
We(ByteDance) are in the process of enabling hwasan for our server-side applications on AArch64/Linux, these server-side applications have thousands of threads, so it is nice to have this option.

Reviewed By: fmayer

Differential Revision: https://reviews.llvm.org/D148513
2023-04-19 19:28:16 +08:00
OCHyams
ca10e73b53 [NFC] Rename isPointerOffset to getPointerOffsetFrom and move to Value.h
Linking LLVMCore failed when building D148536 with shared libs enabled:
https://lab.llvm.org/buildbot/#/builders/121/builds/29766

Make isPointerOffset a Value method and rename it to getPointerOffsetFrom.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D148698
2023-04-19 12:22:58 +01:00
Martin Storsjö
637d572f7b [libcxxabi] [test] Fix the mingw test config
Don't link libc++abi separately in addition to the main -lc++; in
mingw build configs, libc++abi is always bundled into libc++
(via LIBCXX_ENABLE_STATIC_ABI_LIBRARY).

In the case of a shared linked libc++, linking a separate static
libc++abi leads to linker errors.

Differential Revision: https://reviews.llvm.org/D147638
2023-04-19 13:36:05 +03:00
Martin Storsjö
f3ee6695e0 [libcxxabi] [test] Avoid mingw warnings about missing a return statement
With current versions of mingw-w64 headers, code following
assert(false) isn't considered unreachable - thus add a dummy
"return nullptr;", to avoid warnings (treated as errors) for a
missing return statement.

The root cause does get fixed further upstream in mingw-w64 in
1690994f51
though.

Differential Revision: https://reviews.llvm.org/D147860
2023-04-19 13:35:37 +03:00
Martin Storsjö
692518d04b [libcxxabi] Omit dllimport in public headers in MinGW mode
This matches the corresponding change to libcxx headers in
dfa88927ae.

This avoids needing to define _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
when building libcxxabi tests, for two reasons:
- It defaults to normal linkage (as opposed to dllimport), fixing
  linking of a static library version of libcxx/libcxxabi
- It avoids issues with using dllimport declarations on symbols when
  including cxxabi implementations into the testcase itself

Differential Revision: https://reviews.llvm.org/D148441
2023-04-19 13:34:54 +03:00
Hassnaa Hamdi
045eec61f3 [AArch64][CostModel]: Add costs for zero/sign extend.
Add cost for extending to illegal scalable vector types.
Add testing file for the extend operations.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D142456
2023-04-19 10:26:43 +00:00
Martin Liska
ad42ea33bb Make use of '#pragma clang diagnostic' only with __clang__.
Otherwise one gets the following warning with GCC:
warning: ignoring ‘#pragma clang diagnostic’ [-Wunknown-pragmas]

Differential Revision: https://reviews.llvm.org/D148695
2023-04-19 11:47:43 +02:00
pvanhout
047bf17eab [AMDGPU] Add more verbose logs to PromoteAlloca
More specifically make it more talkative when it's looking at the users of
an alloca to promote it to a vector.

A common failure point of the pass is unknown or weird users of the alloca.
While debugging issues related to this pass one of the first thing I usually
did was to add logs to see how the users were being handled.
Having such logs in directly seems to be a nice addition.

Reviewed By: arsenm, rampitec

Differential Revision: https://reviews.llvm.org/D148629
2023-04-19 11:30:14 +02:00
David Spickett
21ca46c1aa [compiler-rt][ASAN] Replace find_executable with shtuil.which in script
distutils is deprecated and shutil.which is the suggested
replacement for this function.

https://peps.python.org/pep-0632/#migration-advice
https://docs.python.org/3/library/shutil.html#shutil.which

which was added in 3.3 (https://docs.python.org/3/library/shutil.html#shutil.which)
and LLVM requires at least 3.6 (https://llvm.org/docs/GettingStarted.html#software).

Reviewed By: delcypher, vitalybuka

Differential Revision: https://reviews.llvm.org/D148528
2023-04-19 09:18:47 +00:00
OCHyams
6db6ab4815 Revert "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"
This reverts commit fca3e8e024.

Buildbot: https://lab.llvm.org/buildbot/#/builders/121/builds/29766
2023-04-19 10:03:33 +01:00
OCHyams
7674ae7231 Revert D146987 "[Assignment Tracking] Enable by default"
This reverts commit 107b307bd6 due
to build errors in a parent commit fca3e8e024
2023-04-19 10:03:32 +01:00
Jay Foad
bf4dc4381e [AMDGPU] Don't transform illegal intrinsics to V_ILLEGAL
This reverts parts of D123693. The functionality of allowing unsupported
intrinsics to select has been superseded by D139000 "Remove function
with incompatible features".

Retain assembler/disassembler support for v_illegal on GFX10+ only,
where it is documented.

Differential Revision: https://reviews.llvm.org/D148127
2023-04-19 09:59:46 +01:00
terrydang
3a44c576b1 [docs] Fix the CMAKE_BUILD_TYPE option in the cmake command in GettingStarted.rst
The cmake command contained a duplicate CMAKE_BUILD_TYPE option in the
section "Compiling the LLVM Suite Source Code".
2023-04-19 09:46:29 +01:00
Guillaume Chatelet
458734b8b9 [reland][libc] handle memset sequence as a separate struct
These sequence of calls don't really make sense for head_tail and loop_and_tail.
2023-04-19 08:37:49 +00:00
Luke Lau
18dc205112 [RISCV] Combine concat_vectors of loads into strided loads
If we're concatenating several smaller loads separated by a stride, we
can try and increase the element size and perform a strided load.
For example:

```
concat_vectors (load v4i8, p+0), (load v4i8, p+n), (load v4i8, p+n*2), (load v4i8, p+n*3)
=>
vlse32 p, stride=n, VL=4
```

This pattern can be produced by the SLP vectorizer.

A special case is when the stride is exactly equal to the width of the
vector, in which case it can be converted into a single consecutive
vector load. For example:

```
concat_vectors (load v4i8, p), (load v4i8, p+4), (load v4i8, p+8), (load v4i8, p+12)
=>
vle8 p, VL=16
```

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D147713
2023-04-19 09:36:19 +01:00
Luke Lau
d23de1bd15 [RISCV] Add tests for concats of vectors that could become strided loads
These patterns of concat_vector nodes of loads can be combined into
widened vector loads or a strided vector loads.

Co-authored-by: Philip Reames <preames@rivosinc.com>

Differential Revision: https://reviews.llvm.org/D147712
2023-04-19 09:36:14 +01:00
OCHyams
107b307bd6 Reapply D146987 "[Assignment Tracking] Enable by default"
This reverts commit efc8b52cbd
which reverts D146987.

See https://reviews.llvm.org/D146987 for issues.
2023-04-19 09:32:09 +01:00
OCHyams
fca3e8e024 [Assignment Tracking] Fix fragment error for some DSE-shortened stores
`shortenAssignment` inserts dbg.assigns with fragments describing the dead part
of a shortened store after each dbg.assign linked to the store.

Without this patch it doesn't take into account that the dead part of a
shortened store may be outside the bounds of a variable of a linked
dbg.assign. It also doesn't correctly account for a non-zero offset in the
address modifying `DIExpression` of the dbg.assign (which is possible for
fragments now even though whole variables currently cannot have a non-zero
offset in their alloca).

Fix this by moving the dead slice into variable-space and performing an
intersect of that adjusted slice with the existing fragment.

This fixes a verifier error reported when building fuchsia with assignment
tracking enabled:
https://ci.chromium.org/ui/p/fuchsia/builders/ci/
        clang_toolchain.ci.core.x64-release/b8784000953022145169/overview

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D148536
2023-04-19 09:32:09 +01:00
Krasimir Georgiev
bf7f6b4436 Revert "Reapply [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating"
This reverts commit 6f7e5c0f1a.

Seems to expose a miscompile in rust, possibly exposing a bug in LLVM
somewhere. Investigation thread over at:
https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/LLVM.20D146629.20breakage
2023-04-19 08:28:48 +00:00
Emmmer
efd64c2f25 [LLDB][RISCV] Add RVV register infos
RVV stands for "RISC-V V Extension", which adds 32 vector registers, and seven unprivileged CSRs (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) to a base scalar RISC-V ISA.

The base vector extension is intended to provide general support for data-parallel execution within the 32-bit instruction encoding space, with later vector extensions supporting richer functionality for certain domains.

This patch adds the definitions of RVV registers in `RegisterInfos_riscv64.h`, whose purpose is to provide support (such as reading, writing, and calculating the offsets) for future register-related functions.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D143374
2023-04-19 16:26:33 +08:00
Pavel Kosov
8e0ee5ab9f [llvm-exegesis] Allow setting dump file name
This will be used for writing test cases.

~~

Huawei RRI, OS Lab

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D147700
2023-04-19 10:59:07 +03:00
Jean Perier
752bd78f06 [flang][hlfir] Apply component lower bounds in hlfir.designate codegen
The array component indices in the "path" of a fir.slice are zero based
because FIR does not know about the component lower bounds.
When lowering hlfir.designate to FIR for `array%x(i, j)`, convert `i` and
`j` to zero based indices before generating the fir.slice.

Differential Revision: https://reviews.llvm.org/D148627
2023-04-19 09:01:37 +02:00
Chen Zheng
3f4055dec4 [GlobalISelEmitter] handle operand without MVT/class
There are some patterns in td files without MVT/class set
for some operands in target pattern that are from the source
pattern. This prevents GlobalISelEmitter from adding them as
a valid rule, because the target child operand is an
unsupported kind operand. For now, for a leaf child, only
IntInit and DefInit are handled in GlobalISelEmitter.

This issue can be workaround by adding MVT/class to the
patterns in the td files, like the workarounds for patterns
anyext and setcc in PPCInstrInfo.td in D140878.

To avoid adding the same workarounds for other patterns in
td files, this patch tries to handle the UnsetInit case in
GlobalISelEmitter.

Adding the new handling allows us to remove the workarounds
in the td files and also generates many selection rules for
PPC target.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D141247
2023-04-19 07:00:57 +00:00
Matthias Springer
289cfe9ccd [mlir][linalg] ValueBoundsOpInterface: Add support for linalg.index
Differential Revision: https://reviews.llvm.org/D148598
2023-04-19 15:51:37 +09:00
Timm Bäder
70ba243c6a [clang][Interp][NFC] Small State.cpp refactoring 2023-04-19 08:13:16 +02:00
Alex Bradbury
c8318b973a [RISCV] Fix canonical ordering of s* vs z* extensions in RISCVISAInfo
As noted in https://reviews.llvm.org/D148315, the ordering logic for
OrderedExtensionMap currently puts s* before z* extensions, but per the
ISA manual the correct order should be z* and then s* (with the
exception of zxm*, which are ordered after s*).

This patch fixes the ordering and adds a TODO for zxm*. The changes are
visible in the test case added in
a35e67fc5b which also demonstrates an
issue with the ordering of single letter extensions (which isn't
addressed in this patch).

This ordering matches the one used by GCC/binutils as well.

Differential Revision: https://reviews.llvm.org/D148615
2023-04-19 07:04:48 +01:00
Adrian Kuegel
a91f44271b [clang][Bazel] Add missing dependency after 310ee08d5d 2023-04-19 07:56:28 +02:00
Alex Bradbury
0386546b08 [docs][RISCV] Use anonymous references in RISCVUsage to avoid warnings
2a5661c841 added a new external link with
the link text "0.2 draft specification". Surprisingly, as multiple links
have this same text but different targets this causes a warning, which
causes a failure on the llvm-sphinx-docs builder (which treats warnings
as errors). As suggested in
<https://github.com/sphinx-doc/sphinx/issues/3921>, this commit moves to
using anonymous references for the links in the experimental extensions
section.
2023-04-19 06:43:40 +01:00
Alex Bradbury
522c7b1e76 [RISCV][NFC] Consistently use Opcode local variable in RISCVAsmParser::validateInstruction
As we already do `unsigned Opcode = Inst.getOpcode();`, we may as well
use that variable.
2023-04-19 06:31:10 +01:00
Alex Bradbury
2a5661c841 [RISCV] Bump Zfa version to 0.2 and correct RISCVUsage description
As of
1f03818281
in the riscv-isa-manual, Zfa is at version 0.2. Reviewing the commit
history for
zfa.tex
<https://github.com/riscv/riscv-isa-manual/commits/master/src/zfa.tex>
there are no relevant changes since 0.1. As such, we can simply
increment the version number.

This change also removes the claim in RISCVUsage that we implement a
"subset of" Zfa, as I believe this is no longer true. That sentence
previously incorrectly claimed we didn't implement fli.{h,s,d} (I
[corrected this a couple of weeks
ago](https://reviews.llvm.org/rG3d969191b277)) but I think should have
removed the "subset of" wording too.

As was noted during the review, we never added Zfa to the release notes.
This is corrected in this patch.

Differential Revision: https://reviews.llvm.org/D148634
2023-04-19 06:27:35 +01:00
Serguei Katkov
7ae436d891 [InstSimplify] Update tests for max(min,max) to cover more types. 2023-04-19 12:05:29 +07:00
chenglin.bi
9356097206 Revert "[AMDGPU] Ressociate patterns with sub to use SALU"
The patch will caused dead loop because of DAGCombiner's canonicalization:
  // (x + C) - y  ->  (x - y) + C
  // y - (x + C)  ->  (y - x) - C
  // (x - C) - y  ->  (x - y) - C
  // (C - x) - y  ->  C - (x + y)

This reverts commit b3529b5bf3.
2023-04-19 11:15:14 +08:00
Yeting Kuo
35c877a6f0 [RISCV] Customed lower vector nearbyint and rint in RISC-V.
The patch lowers vector rint/nearbyint like vp.rint/nearbyint.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D148619
2023-04-19 11:07:23 +08:00
wangpc
1c96847242 [RISCV] Remove SEW=8 case for floating-point
For floating-point instructions, SEW won't be 8. So we don't need
to generate scheduling resources for it.

Reviewed By: michaelmaitland

Differential Revision: https://reviews.llvm.org/D148317
2023-04-19 10:46:07 +08:00
Matthias Springer
eb7f355725 [mlir][NFC] Minor cleanups around ShapedType
* Remove unnecessary casts.
* Use concrete shaped types (e.g., `MemRefType`, `RankedTensorType`) instead of `ShapedType` when possible.
* Minor documentation cleanups.

Differential Revision: https://reviews.llvm.org/D148488
2023-04-19 11:30:45 +09:00
Matthias Springer
d1cb68525c [mlir][IR] Remove ShapedType::getSizeInBits
This function returns incorrect values for memrefs and vectors due to "widening".

Differential Revision: https://reviews.llvm.org/D148501
2023-04-19 11:01:33 +09:00
Aart Bik
ec42398e8a bazel patch for OpenACC changes
Reviewed By: razvanlupusoru, anlunx

Differential Revision: https://reviews.llvm.org/D148678
2023-04-18 18:43:22 -07:00
Lang Hames
2060a72b4d Revert "[ExecutionEngine] Allow JIT tests to run on PowerPC."
This reverts commit d771f54107 due to builder
failures, e.g. https://lab.llvm.org/buildbot#builders/93/builds/14488.
2023-04-18 18:03:06 -07:00
Alex Brachet
8bd723b071 [libc] Add fuchsia/io.h for TestLogger
b3c696fb86 started using TestLogger in tests. This class depends on
write_to_stderr which was previously only provided for Linux and
GPU's. Note, this function is used on those platforms in the libc
proper, though for Fuchsia we only ever want to provide this for
TestLogger.

No CMake files are changed because this fuchsia/ directory isn't
useful in any CMake build.

Differential Revision: https://reviews.llvm.org/D148675
2023-04-19 00:54:32 +00:00
Michael Jones
0acb639fd2 [libc] move strerror and strsignal to OS msg maps
Other OSes may have different mappings from error number to message.
This creates a system to allow new platforms to define their own
mappings.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D147967
2023-04-18 16:42:43 -07:00
Razvan Lupusoru
6e9ca8c7df [mlir][openacc] Fix build after D148389
Buildbot reported undefined references to LLVM dialect and Memref
dialect. The issue is that OpenACC dialect now depends on those
(since it attaches interface to the types) but the cmake file
did not explicitly add those dependencies.

Reviewed By: clementval, vzakhari

Differential Revision: https://reviews.llvm.org/D148673
2023-04-18 16:33:43 -07:00
Peiming Liu
b9589545c4 [mlir][sparse] introduce a new compressed(hi) dimension level type
`compressed(hi)` is similar to `compressed`, but instead of reusing the previous position high as the current position low, it uses a pair of positions for each sparse index.

The patch only introduces the definition (syntax) but does not provide codegen implementation.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D148664
2023-04-18 23:26:11 +00:00