Commit Graph

438627 Commits

Author SHA1 Message Date
Mark de Wever a1e13a80d0 [libc++] Implements constexpr <charconv>.
Implements:
- P2291R3 Add Constexpr Modifiers to Functions to_chars and from_chars for
  Integral Types in <charconv> Header

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D131317
2022-10-12 17:43:23 +02:00
Mark de Wever 261b5abf72 [libc++][format] Improves CTAD.
This partly reverts D133535 and enables CTAD for more parts in format.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D135292
2022-10-12 17:42:50 +02:00
Nicolas Vasilache f4ad1b6f69 [mlir][Linalg] Quarantine usage of LinalgTransformationFilter to TestTilingInterface.
This revision also retires code that has now become dead.

Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785

Differential Revision: https://reviews.llvm.org/D135771
2022-10-12 08:36:51 -07:00
Guillaume Chatelet e431731e08 Revert "[libc] New version of the mem* framework"
This reverts commit 4c19439d24.
2022-10-12 15:35:18 +00:00
Mirko Brkusanin 8b8463ef6c [SelectionDAG] Use consistent type sizes for opcode 2022-10-12 17:33:04 +02:00
Sanjay Patel 7b9482df3d [InstCombine] fold sdiv with common shl amount in operands
(X << Z) / (Y << Z) --> X / Y

https://alive2.llvm.org/ce/z/CLKzqT

This requires a surprising "nuw" constraint because we have
to guard against immediate UB via signed-div overflow with
-1 divisor.

This extends 008a89037a and is another transform
derived from issue #58137.
2022-10-12 11:32:15 -04:00
Guillaume Chatelet 4c19439d24 [libc] New version of the mem* framework
This version is more composable and also simpler at the expense of being more explicit and more verbose.
This patch is not meant to be submitted but gives an idea of the change.
Codegen can be checked in https://godbolt.org/z/6z1dEoWbs by removing the "static inline" before individual functions.

Unittests are coming.

Suggested review order:
 - utils
 - op_base
 - op_builtin
 - op_generic
 - op_x86 / op_aarch64
 - *_implementations.h

Differential Revision: https://reviews.llvm.org/D135134
2022-10-12 15:26:26 +00:00
Alexey Bataev d71ad41080 [SLP]Fix insertpoint of the extractellements instructions to avoid reshuffle crash.
Need to set the insertpoint for extractelement to point to the first
instruction in the node to avoid possible crash during external uses
combine  process. Without it we may endup with the incorrect
transformation.

Differential Revision: https://reviews.llvm.org/D135591
2022-10-12 08:18:30 -07:00
Andre Vieira bc71aa4fbc [libc] Update benchmarks/README.md
This patch updates the instructions on how to run the mem* benchmarks in
README.md.

Differential Revision: https://reviews.llvm.org/D135582
2022-10-12 16:13:24 +01:00
Sanjay Patel 008a89037a [InstCombine] fold udiv with common shl amount in operands
(X << Z) / (Y << Z) --> X / Y

https://alive2.llvm.org/ce/z/E5eaxU

This fixes the motivating example from issue #58137,
but it is not the most general transform. We should
probably also convert left-shift in the divisor to
right-shift in the dividend for that, but that exposes
another missed canonicalization for shifts and adds.
2022-10-12 11:12:26 -04:00
Nikita Popov dbd29ed54b [FunctionAttrs] Regenerate test checks (NFC) 2022-10-12 17:11:48 +02:00
Jordan Rupprecht cbae57c0e1 [NFC] Ignore unused var in no-asserts builds 2022-10-12 08:11:10 -07:00
Simon Pilgrim 8727248b79 [UpdateTestChecks] Add basic BPF triple handling
Working on Issue #57872 - its really useful to be able to autogenerate checks
2022-10-12 15:57:52 +01:00
Louis Dionne 3fe2db8cf9 [libc++] Remove _LIBCPP_HAS_NO_CXX20_COROUTINES
As far as I can tell, all the compilers we support have support for
C++20 coroutines now.

Differential Revision: https://reviews.llvm.org/D135274
2022-10-12 10:42:06 -04:00
Louis Dionne 1d29657acb [libc++] Disable the GDB pretty printer tests again, since they break the CI 2022-10-12 10:40:11 -04:00
Nikita Popov 01bbe87fbb [CGStmt] Use helper functions to set memory attributes (NFC) 2022-10-12 16:38:39 +02:00
Alexey Bataev 1be3428ea0 [SLP]Fix PR58177: Improve isUndefVector function to avoid extra freeze.
Freeze instruction in some cases makes codegen worse, so need to be very
careful when emitting it. Instead improve analysis in isUndefVector
function to generate mask of unused elements and use it in the analysis.

Differential Revision: https://reviews.llvm.org/D135382
2022-10-12 07:32:54 -07:00
Nicolas Vasilache e0cea169f7 [mlir][Linalg] Drop filter-based splitReduction
This transformation is available and tested via the transform dialect.

Differential Revision: https://reviews.llvm.org/D135767
2022-10-12 07:27:35 -07:00
Nicolas Vasilache bbe4441d33 [mlir][Linalg] NFC - Drop LinalgLoweringPattern
Linalg ops are generally lowered to loops using a pass and the individual application
of patterns has no concrete uses.
If/when necessary, this can later be reintroduced via a proper transform dialect op.

Differential Revision: https://reviews.llvm.org/D135766
2022-10-12 07:27:35 -07:00
Kai Nacke 0b9264006d [SystemZ] Revert migration of SystemZ/Large/branch-01.ll
Root cause for the regression is that value %6598 is
defined as a label, and later as an i32 value.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D135778
2022-10-12 14:24:04 +00:00
Florian Hahn 26c8632f22
[LV] Add extra tests for epilogue vectorization with widened inductions.
Extend test coverage to also include inductions with step > 1 and also
with runtime trip counts.
2022-10-12 15:21:38 +01:00
Valentin Clement 0ff137c1ef
[flang] Use fir.rebox for tbp fir.dispatch call with allocatable or pointer
Polymorphic entities with allocatable or pointer attribute cannot be passed
directly as passed-object when the type-bound procedure is expecting a
simply dummy polymorphic entity. Use fir.rebox to adapt the fir.class box
to the tbp type.

Depends on D135649

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D135654
2022-10-12 16:19:03 +02:00
Tobias Gysi a938f3a9b5 [mlir] Fix bitwidth of memref-to-llvm constant.
One constant generated in MemRefToLLVM had a hardcoded bitwidth of
64 bits. The fix uses the typeConverter to create a constant that
matches the bitwidth of the provided by the data layout. The issue was
detected in an attempt to add a verifier to the LLVM ICmp operation that
checks that the types of the compared arguments match.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135775
2022-10-12 17:13:01 +03:00
Louis Dionne 79ee0342db [runtimes] Always define cxx_shared, cxx_static & other targets
However, mark them as EXCLUDE_FROM_ALL when we don't want to build them.
Simply declaring the targets should be of no harm, and it allows other
projects to mention these targets regardless of whether they end up
being built or not.

While the diff may not make that obvious, this patch basically
moves the definition of e.g. `cxx_shared` out of the `if (LIBCXX_ENABLE_SHARED)`
and instead marks it as `EXCLUDE_FROM_ALL` conditionally on whether
LIBCXX_ENABLE_SHARED is passed. It then does the same for libunwind
and libc++abi targets.

Differential Revision: https://reviews.llvm.org/D134221
2022-10-12 09:36:29 -04:00
gonglingqin ec2640bf3a [LoongArch] Handle missing CondCodes
Support SETLE/SETEQ and expand SETGE/SETNE/SETGT

Differential Revision: https://reviews.llvm.org/D135511
2022-10-12 21:26:57 +08:00
Sanjay Patel fe97f95036 [InstCombine] propagate "exact" through folds of div
These folds were added recently with:
6b869be810
8da2fa856f
...but they didn't account for the "exact" attribute,
and that can be safely propagated:
https://alive2.llvm.org/ce/z/F_WhnR
https://alive2.llvm.org/ce/z/ft9Cgr
2022-10-12 09:25:05 -04:00
Sanjay Patel 2639caf560 [InstCombine] add "exact" to div tests to show missing propagation; NFC 2022-10-12 09:25:04 -04:00
Sanjay Patel d117ee25b8 [InstCombine] add helper function for div+shl folds; NFC
There are at least 2 similar patterns that could be added here,
and the existing fold can be improved because it fails to
propagate "exact".
2022-10-12 09:25:04 -04:00
Sanjay Patel bc032c7f53 [InstCombine] add tests for div with shl operands; NFC 2022-10-12 09:25:04 -04:00
Valentin Clement 7883900c04
[flang] Lower type-bound procedure call needing dynamic dispatch to fir.dispatch
Lower call with polymorphic entities to fir.dispatch operation. This patch only
focus one lowering with simple scalar polymorphic entities. A follow-up patch
will deal with allocatble, pointer and array of polymorphic entities as they
require box manipulation for the passed-object.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D135649
2022-10-12 15:24:49 +02:00
gonglingqin b1d7a95e4e [LoongArch] Add earlyclobber of destination register to atomic instructions
If the AM* atomic memory access instruction has the same register number as
rd and rj, the execution will trigger an Instruction Non-defined Exception.
If the AM* atomic memory access instruction has the same register number as
rd and rk, the execution result is uncertain.

Reference: https://github.com/loongson/LoongArch-Documentation

Differential Revision: https://reviews.llvm.org/D135641
2022-10-12 21:09:21 +08:00
Arseniy Zaostrovnykh ec6da3fb9d Fix false positive related to handling of [[noreturn]] function pointers
Before this change, the `NoReturnFunctionChecker` was missing function pointers
with a `[[noreturn]]` attribute, while `CFG` was constructed taking that into
account, which leads CSA to take impossible paths. The reason was that the
`NoReturnFunctionChecker` was looking for the attribute in the type of the
entire call expression rather than the type of the function being called.

This change makes the `[[noreturn]]` attribute of a function pointer visible
to `NoReturnFunctionChecker`. This leads to a more coherent behavior of the
CSA on the AST involving.

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D135682
2022-10-12 14:46:32 +02:00
Peixin Qiao 78c66cf300 [flang][NFC] Fix FIRTypes.td
Fix two typos and remove the incorrectly added `extraClassDeclaration` in
`FIRTypes.td`.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D135665
2022-10-12 20:25:34 +08:00
Chen Zheng 5f4927da77 [PowerPC][NFC] refactor some test cases. 2022-10-12 12:19:52 +00:00
Tonko Sabolčec 0205aa4a02 [lldb] Fix member access in GetExpressionPath
This change fixes two issues in ValueObject::GetExpressionPath method:

 1. Accessing members of struct references used to produce expression
    paths such as "str.&str.member" (instead of the expected
    "str.member"). This is fixed by assigning the flag tha the child
    value is a dereference when calling Dereference() on references
    and adjusting logic in expression path creation.

 2. If the parent of member access is dereference, the produced
    expression path was "*(ptr).member". This is incorrect, since it
    dereferences the member instead of the pointer. This is fixed by
    wrapping dereference expression into parenthesis, resulting with
    "(*ptr).member".

Reviewed By: werat, clayborg

Differential Revision: https://reviews.llvm.org/D132734
2022-10-12 12:08:57 +00:00
Adrian Kuegel b781ef890f [mlir][Bazel] Port 8446f24ef0 2022-10-12 14:07:31 +02:00
Adrian Kuegel 95630b93b0 [mlir][Linalg] Add MapOp to Linalg structured ops.
This will allow to model elementwise ops with this special op instead of using
GenericOp.
Also allow MapOp and ReduceOp to have no result if the output type is not a tensor.
This is needed for buffer semantics.

Differential Revision: https://reviews.llvm.org/D135754
2022-10-12 13:56:21 +02:00
Florian Hahn c1fe52bfa6
[VPlan] Remove dead recipes before sinking.
optimizeInductions may leave dead recipes which can prevent sinking.
Sinking on the other hand should not introduce new dead recipes, so
clean up dead recipes before sinking.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D133762
2022-10-12 12:49:42 +01:00
Nicolas Vasilache bcfbf8cc41 [mlir][Linalg] NFC - Drop filter from LinalgGeneralizationPattern
Differential Revision: https://reviews.llvm.org/D135761
2022-10-12 04:47:12 -07:00
Nicolas Vasilache 15faa55f65 [mlir][Linalg] NFC - Drop CodegenStrategy and remaining strategy passes
Differential Revision: https://reviews.llvm.org/D135759
2022-10-12 04:47:12 -07:00
Tobias Gysi 8446f24ef0 [mlir][llvm] Tablegen based operation import from LLVM IR.
The revision uses tablegen generated builders to convert the most common
LLVM IR instructions to MLIR LLVM dialect operations. All instructions
with special handlers, except for alloca and fence, still use manual
handlers. The revision also introduces an additional "instructions.ll"
test file to test the import of instructions that have tablegen builders
(except for the resume instruction whose test remains untouched). A part
of the test cases are new, for example the integer instruction test,
while others are migrated from the "basic.ll" test file.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135709
2022-10-12 14:36:41 +03:00
Max Kazantsev fbad5fdc03 [NFC] Perform all legality checks for non-trivial unswitch in one function
They have been scattered over the code. For better structuring, perform
them in one place. Potential CT drop is possible because we collect exit
blocks twice, but it's small price to pay for much better code structure.
2022-10-12 18:35:12 +07:00
Luo, Yuanke f885c08034 Don't widen shuffle element with AVX512
Fix crash issue of D129537 and reopen it.

Currently the X86 shuffle lowering would widen the element type for
shuffle if the mask element value is adjacent. For below example

  %t2 = add nsw <16 x i32> %t0, %t1
  %t3 = sub nsw <16 x i32> %t0, %t1
  %t4 = shufflevector <16 x i32> %t2, <16 x i32> %t3,
                      <16 x i32> <i32 16, i32 17, i32 2, i32 3, i32 4,
                       i32 5, i32 6, i32 7, i32 8, i32 9, i32 10,
                       i32 11, i32 12, i32 13, i32 14, i32 15>

  ret <16 x i32> %t4

Compiler would transform the shuffle to
  %t4 = shufflevector <8 x i64> %t2, <8 x i64> %t3,
                      <8 x i64> <i32 8, i32 1, i32 2, i32 3, i32 4,
                                 i32 5, i32 6, i32 7>
This may lose the oppotunity to let ISel select mask instruction when
avx512 is enabled.

This patch is to prevent the tranform when avx512 feature is enabled.
Thank Simon for the idea.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D130830
2022-10-12 19:18:10 +08:00
OCHyams 251e614019 [Dexter] Ignore step information in __libc_start_call_main
The test dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp
was failing on a machine because __libc_start_call_main was not identified as a
"frame below main" (a frame we don't want to gather information from), causing
dexter to count one more step than expected in the test.

Add __libc_start_call_main to the list of "frames below main". There may
be a more robust way of doing this but this is a pragmatic solution we can
use for now.
2022-10-12 12:21:56 +01:00
Florian Hahn bbf01ab7b6
[VPlan] Add test for sinking pointer induction increments.
Extra test for D133762.
2022-10-12 12:06:40 +01:00
Alex Zinenko 209843e050 [mlir][doc] move transform dialect docs to .md, NFC
The description of the Transform dialect has become quite lengthy to be
kept as a Tablegen string literal. Move it to a proper Markdown file.
2022-10-12 11:02:01 +00:00
Alex Zinenko ad7aa09672 [mlir] document transform dialect types 2022-10-12 10:56:11 +00:00
Bjorn Pettersson 391f323690 [test][DebugInfo] Convert some test cases to opaque pointers. NFC
Conversion performed using the script at:
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
2022-10-12 12:49:17 +02:00
Adrian Kuegel d903fa4c62 [mlir] Apply ClangTidyLegacy findings.
Use '= default' to define a trivial default constructor.
2022-10-12 12:46:41 +02:00
Pierre van Houtryve 02b5d3bc3b [llvm-objdump] Support nonzero section addresses in addSymbolizer
The previous calculations seem to have assumed that the section address would be zero.
This is true for relocatable object files, but certainly not for linked files like shared libraries.

Fixed the calculations to make them identical to the "real" `getInstruction` call below & added a regression test.

Reviewed By: scott.linder, simon_tatham

Differential Revision: https://reviews.llvm.org/D135430
2022-10-12 10:44:03 +00:00