Commit Graph

434820 Commits

Author SHA1 Message Date
Vitaly Buka a1f7b313fd [test][msan] Re-format RUN lines 2022-08-31 17:56:24 -07:00
Mehdi Amini 3c27005479 Apply clang-tidy fixes for readability-identifier-naming in TosaToLinalg.cpp (NFC) 2022-09-01 00:37:14 +00:00
Mehdi Amini 6ed4310e5c Apply clang-tidy fixes for readability-simplify-boolean-expr in SPIRVToLLVM.cpp (NFC) 2022-09-01 00:37:14 +00:00
Fangrui Song 98615fd376 [Driver] Remove Joined -X
The untested option triggers an IgnoredGCCCompat warning while GCC reports an error.
We support a few -X{assembler,linker,...}. Having the Joined -X may make typos unnoticed.
2022-08-31 17:30:51 -07:00
Vitaly Buka e0d3c10252 [test][msan] Re-format RUN lines 2022-08-31 17:00:52 -07:00
Jonas Devlieghere c7511b4ecf
[lldb] Correctly add runtime test dependencies
When a runtime is enabled through LLVM_ENABLE_RUNTIMES, it is loaded
after other projects (i.e. after LLDB). This means that the
corresponding targets don't exist when LLDB is configured. To support
runtimes being enable this way, we need to check if they're listed in
LLVM_ENABLE_RUNTIMES. For runtimes being enabled as projects (i.e.
through LLVM_ENABLE_RUNTIMES) we need to check for the target.

This patch unifies things and correctly adds compiler-rt and libcxx as
test dependencies in both scenarios.
2022-08-31 16:37:35 -07:00
Rob Suderman 5b0863f3ef [mlir][tosa] Bitwidth mismatch should be long-long not long
Reviewed By: scotttodd

Differential Revision: https://reviews.llvm.org/D133064
2022-08-31 16:02:33 -07:00
Jeff Niu 76f097cf14 [mlir] Ensure index attrs are always 64-bit APInts
This patch ensures that index integer attributes can only be
constructed with APInts whose widths are equal to the index
internal storage bitwidth (64).

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133059
2022-08-31 15:44:18 -07:00
Craig Topper 77dbc5200b [MachineCSE] Use TargetInstrInfo::isAsCheapAsAMove in isPRECandidate.
Some targets like RISC-V require operands to be inspected to
determine if an instruction is similar to a move.

Spotted while investigating code differences between using an ADDI
vs an ADDIW. RISC-V has the isAsCheapAsAMove flag for ADDI, but
the TII hook checks the immediate is 0 or the register is X0. ADDIW
is never generated with X0 or with an immediate of 0 so it doesn't
have the isAsCheapAsAMove flag.

I don't know enough about the PRE code to write a test for this yet.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D132981
2022-08-31 15:39:41 -07:00
Vitaly Buka 53d1ae88f8 [nfc][msan] Prepare the code for check sorting 2022-08-31 15:36:49 -07:00
Dan Gohman 9f049e9993 [lld][WebAssemby] Allow import module names to be empty strings.
The component-model [canonical ABI] is currently using import names with
empty strings. Remove the special cases for empty strings from
WasmObjectFile.cpp so that they can pass through as-is.

[canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md

Differential Revision: https://reviews.llvm.org/D133037
2022-08-31 15:30:15 -07:00
Rob Suderman 7e52e0fc72 [mlir][amdgpu] Fix signed/unsigned comparison for abid/cbsz comparison
Unsigned/signed comparison failure due to implicit signed value.

Reviewed By: stella.stamenova

Differential Revision: https://reviews.llvm.org/D133061
2022-08-31 15:29:31 -07:00
Slava Zakharin 69193c6cd7 [flang] Generate DOT_PRODUCT runtime call based on the result type.
We used to select the runtime function based on the first argument's
type, which was not correct behavior. The selection is done using
the result type now.

Differential Revision: https://reviews.llvm.org/D133032
2022-08-31 15:20:12 -07:00
Slava Zakharin f8a9f43ef7 [flang][runtime] Enable real/complex kind 10 and 16 variants of dot_product.
HasCppTypeFor<> used to evaluate to false always, so kind 10 and 16
variants of dot_product were not instantiated even though the host
supported 80- and 128-bit real and complex data types.
In addition, HAS_FLOAT128 was not enabling complex kind=16 variant
of dot_product. This is fixed now.

Note that the change for HasCppTypeFor<> may also affect other
functions such as matmul, i.e. kind 10 and 16 variants of them
may become available now (depending on the build host).

Differential Revision: https://reviews.llvm.org/D133051
2022-08-31 15:17:17 -07:00
Peiming Liu 7ea643c06d [mlir][sparse] Introduce new sparse_tensor.storage_get/set to access memory that stores the handle of a sparse tensor
Introduce new sparse_tensor.storage_get/set to access memory that stores the handle of a sparse tensor. The sparse tensor storage are represented as a tuple, these operation will later be eliminated and the tuple will be flattened after sparse tensor codegen

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D133049
2022-08-31 22:15:15 +00:00
Aart Bik f767f09252 [mlir][sparse] sparse storage scheme type conversion
This builds a compound type for the buffers required for the sparse storage scheme defined by the MLIR sparse tensor types. The use of a tuple allows for a simple 1:1 type conversion. A subsequent pass can expand this tuple into its component with an isolated 1:N type conversion.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D133050
2022-08-31 15:12:55 -07:00
Craig Topper 6e0ae7e940 [RISCV] Slightly simplify coode in combineVWADD_W_VL_VWSUB_W_VL and combineMUL_VLToVWMUL_VL. NFC
Use computeMaxSignificantBits instead of ComputeNumSignBits. Create
APInt as part of call to MaskedValueIsZero instead of creating
a named temporary.
2022-08-31 15:02:03 -07:00
Rob Suderman 6e3bc83c22 [mlir][tosa] Fix left shift that was implicitly converted to 64-bit
Missing long specifier so that a shift would occur in 64-bits rather
than implicitly in 32-bits.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D133058
2022-08-31 14:56:10 -07:00
Sam Clegg 349a2c37f9 [WebAssembly][MC] Update tests after recent removal of .size directives for functions
These were missing from https://reviews.llvm.org/D132929
2022-08-31 14:54:13 -07:00
Michele Scuttari a22af3e1eb
[MLIR] Keep but deprecate old autogenerated pass base classes
Restore the generation of the old pass base classes for better transitioning of external projects relying on them. They were eliminated with 67d0d7ac0a.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D133027
2022-08-31 23:39:01 +02:00
Sam Clegg 113b568829 [lld][WebAssembly] Rename SymbolTable::getSymbols to match ELF backend. NFC
The ELF backend originally used `getSymbols()` but went though a
sequence of changes that resulted in this method being called
`symbols()`.

d8f8abbd4a replaced `getSymbols()` with
`forEachSymbol`.

a2fc964417 replaced `forEachSymbol` with
`llvm::iterator_range`.

e9262edf0d replaced `llvm::iterator_range`
with `symbols()`.

Differential Revision: https://reviews.llvm.org/D131284
2022-08-31 14:33:45 -07:00
Sam Clegg c5c4ba37b1 [WebAssembly][MC] Avoid the need for .size directives for functions
Warn if `.size` is specified for a function symbol.  The size of a
function symbol is determined solely by its content.

I noticed this simplification was possible while debugging #57427, but
this change doesn't fix that specific issue.

Differential Revision: https://reviews.llvm.org/D132929
2022-08-31 14:28:56 -07:00
Jonas Devlieghere f328922f55
[lldb] Make the rumtimes target a test dependency
Make the rumtimes target a test dependency. This is needed or the parts
of the test suite that rely on the libcxx and libcxxabi.

Differential revision: https://reviews.llvm.org/D133046
2022-08-31 14:25:07 -07:00
Krzysztof Drewniak c55b41d519 [mlir][AMDGPU] Define amdgpu.mfma operator
The amdgpu.mfma operator is a wrapper around the Matrix Fused Multiply
Add (MFMA) instructions on some AMD GPUs (the CDNA-based MI-* cards).

This interface allows for selecting the operation to be performed by
specifying the dimensions of the multiplication to be performed and
any additional attributes (such as whether to use reduced-precision
floating-point math) that are needed to select the relevant mfma
instruction and set its parameters.

Reviewed By: ThomasRaoux, nirvedhmeshram

Differential Revision: https://reviews.llvm.org/D132956
2022-08-31 21:06:12 +00:00
Nikita Popov ab6876a40d reland: [Local] Allow creating callbr with duplicate successors
Since D129288, callbr is allowed to have duplicate successors. This patch removes a limitation which prevents optimizations from actually producing such callbrs.

This is probably the riskiest of all the recent callbr changes, because code with incorrect assumptions might be lurking somewhere. I fixed the one case I encountered ahead of time in 8201e3ef5c.

Reviewed By: nickdesaulniers

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

Originally landed as
commit 08860f525a ("[Local] Allow creating callbr with duplicate successors")

Reverted in
commit 1cf6b93df1 ("Revert "[Local] Allow creating callbr with duplicate successors"")
2022-08-31 13:23:00 -07:00
Mark de Wever 2928b230ce [NFC][libc++] char_traits code cleanups.
These cleanups were identified while working on D130295.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D131185
2022-08-31 22:18:10 +02:00
Roy Jacobson bb9dedce5d [Frontend] Restore Preprocessor::getPredefines()
https://reviews.llvm.org/rG6bbf51f3ed59ae37f0fec729f25af002111c9e74 from May removed Preprocessor::getPredefines() from Clang's API, presumably as a cleanup because this method is unused in the LLVM codebase.

However, it was/is used by a small number of third-party tools and is pretty harmless, so this patch adds it back and documents why it's here.

The issue was raised in https://github.com/llvm/llvm-project/issues/57483, it would be nice to be able to land it into Clang 15 as it breaks those third-party tools and we can't easily add it back in bug fix releases.

Reviewed By: brad.king, thieta

Differential Revision: https://reviews.llvm.org/D133044
2022-08-31 23:16:49 +03:00
Vitaly Buka 960e7a5513 [msan] Use Debug Info to point to affected fields
Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D132909
2022-08-31 13:12:17 -07:00
Nick Desaulniers d7474bef77 [llvm][TailDuplicator] don't taildup isInlineAsmBrIndirectTargets
This fixes a crash observed after
https://reviews.llvm.org/D129997.

Similar to D88823.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D130127
2022-08-31 13:07:10 -07:00
Alexey Bataev 588115c117 [SLP][NFC]Add a check for SelectInst to match description, NFC. 2022-08-31 13:04:21 -07:00
Nick Desaulniers 86b6b39411 [llvm][test] precommit test for D130127
Add a FIXME that will be immediately removed in D130127.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D132609
2022-08-31 12:40:52 -07:00
Alexey Bataev d8d9ee10bb [SLP][NFC]Fix comment and make function following naming standard, NFC. 2022-08-31 12:37:55 -07:00
Vitaly Buka cbf81558ab [mlir] Avoid nullptr as memcpy arguments after D132758 2022-08-31 12:30:18 -07:00
Martin Storsjö 61fb3fb458 [cmake] Disable the -Wmisleading-indentation warning with GCC
We do keep using the flag with Clang, which should keep catching
such issues in buildbots.

With GCC, the warning can cause lots of loud notes about the
warning logic getting disabled in large source files.

Differential Revision: https://reviews.llvm.org/D132914
2022-08-31 22:26:09 +03:00
Philip Reames 8524622bdc [SLP] Simplify getOperandInfo implementation and be consistent
This is NOT nfc.  Specifically, the following behavior changes:
* Pointers are now allowed.  Both uniform, and constants.
* FP uniform non-constants can now be recognized.
* FP undefs are no longer considered constant.  This matches int behavior which we had tests for.  FP behavior was untested.  Its not clear to me int behavior is reasonable, but it's what tests seem to expect, so go with minimum impact for now.
2022-08-31 12:24:05 -07:00
Ying Yi 41b1c9ff70 Re-add the REQUIRES line to fix a failed build on builder llvm-clang-win-x-aarch64. 2022-08-31 20:22:18 +01:00
Sanjay Patel cdf3de45d2 [CodeGen] fix misnamed "not" operation; NFC
Seeing the wrong instruction for this name in IR is confusing.
Most of the tests are not even checking a subsequent use of
the value, so I just deleted the over-specified CHECKs.
2022-08-31 15:11:48 -04:00
Katherine Rasmussen 183f1b5685 [flang] Write semantics test for atomic_fetch_or
Write a semantics test for the atomic intrinsic subroutine,
atomic_fetch_or.

Reviewed By: rouson

Differential Revision: https://reviews.llvm.org/D132519
2022-08-31 12:01:58 -07:00
LLVM GN Syncbot 3622e9bea0 [gn build] Port 74c8d9d5fc 2022-08-31 18:52:31 +00:00
Wei Yi Tee 74c8d9d5fc Revert "[clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`."
This reverts commit c9033eeb2e.
https://lab.llvm.org/buildbot#builders/57/builds/21618
Build failure due to comparison between unsigned int and const int
originating from EXPECT_EQ.
2022-08-31 18:49:56 +00:00
Arthur Eubanks 8c7b103055 [test][InstCombine] Precommit some undef/noundef tests 2022-08-31 11:19:31 -07:00
Michael Maitland 30a4264f5f [RISCV][CodeGen] add assertion to RISCVTargetStreamer getTargetStreamer()
X86 and ARM AsmParsers have this same assertion. This assertion provides better reporting when the RISCVTargetStreamer is null and helps to prevent null pointer access.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D132863
2022-08-31 11:15:47 -07:00
Craig Topper 8dce3507a0 [VP] Correct the LEGALPOS for VP_STORE.
VP_STORE has a Chain for operand 0, so the LEGALPOS should be 1.

VP_STORE is always considered Legal for MVT::Other. So I suspect this
was causing vp_store to be ignored by LegalizeVectorOps and instead
handled in LegalizeDAG.

VP_LOAD is Custom expanded in LegalizeVectorOps for RISC-V.

Differential Revision: https://reviews.llvm.org/D132972
2022-08-31 11:15:47 -07:00
Nico Weber 068fe0724d [gn build] port d45c04da7c (TestingADTTests) 2022-08-31 14:15:23 -04:00
Mark de Wever 37c98da395 [libc++][format] Fixes broken CI.
Some of the merged patches didn't have conflicts but were not
compatible. This should fix it.
2022-08-31 20:14:10 +02:00
Siva Chandra Reddy 4c810ecb68 [libc] Add arm-32 syscall implementation.
The implementation currently supports only non-thumb mode. As a test for
the implementation, mmap and munmap functions have been enabled.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D132825
2022-08-31 18:10:40 +00:00
Dong-hee Na e75cce76ab [libc] Fix typo in lseek syscall number macro.
Differential Revision: https://reviews.llvm.org/D133022
2022-08-31 17:50:24 +00:00
Mark de Wever 8ff2d6af69 [libc++] Reduces the number of transitive includes.
This defines a new policy for removal of transitive includes.
The goal of the policy it to make it relatively easy to remove
headers when needed, but avoid breaking developers using and
vendors shipping libc++.

The method used is to guard transitive includes based on the
C++ language version. For the upcoming C++23 we can remove
headers when we want, but for other language versions we try
to keep it to a minimum.

In this code the transitive include of `<chrono>` is removed
since D128577 introduces a header cycle between `<format>`
and `<chrono>`. This cycle is indirectly required by the
Standard. Our cycle dependency tool basically is a grep based
tool, so it needs some hints to ignore cycles. With the input
of our transitive include tests we can create a better tool.
However that's out of the scope of this patch.

Note the flag `_LIBCPP_REMOVE_TRANSITIVE_INCLUDES` remains
unchanged. So users can still opt-out of transitives includes
entirely.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D132284
2022-08-31 19:50:03 +02:00
Michael Jones 9ac66f0650 [libc][cmake] split fputil into individual targets
The libc.src.__support.FPUtil.fputil target encompassed many unrelated
files, and provided a lot of hidden dependencies. This patch splits out
all of these files into component parts and cleans up the cmake files
that used them. It does not touch any source files for simplicity, but
there may be changes made to them in future patches.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D132980
2022-08-31 10:44:52 -07:00
Wei Yi Tee d45c04da7c [llvm][ADT] Overload output stream operator `<<` for `StringMapEntry` and `StringMap`.
Printing support enables the production of more useful error messages in unit testing e.g. when using matchers such as `UnorderedElementsAre()` to inspect the contents of a `StringMap`.

Reviewed By: gribozavr2, sgatev, ymandel

Differential Revision: https://reviews.llvm.org/D132747
2022-08-31 17:37:58 +00:00