platform/upstream/llvm.git
21 months ago[X86] pr53419.ll - add AVX512 test coverage
Simon Pilgrim [Mon, 30 Jan 2023 09:32:50 +0000 (09:32 +0000)]
[X86] pr53419.ll - add AVX512 test coverage

21 months ago[mlir][bufferization] Better handling of unranked tensors in resolveTensorOpOperandCo...
Matthias Springer [Mon, 30 Jan 2023 09:19:32 +0000 (10:19 +0100)]
[mlir][bufferization] Better handling of unranked tensors in resolveTensorOpOperandConflicts

Unranked tensors can currently not be copied. They are forced to always bufferize in-place. There is typically some other OpOperand that can bufferize out-of-place instead if needed.

Note: There is IR that cannot be bufferized with One-Shot Bufferize at the moment (see invalid test case). But it is unclear if we need to support such cases. We do not have a use case at the moment. This restriction could be loosened in the future if needed.

This change improves error handling when bufferizing IR where an unranked tensor would be copied. It also disables an optimization where an OpResult was copied instead of an OpOperand in case the OpResult is an unranked tensor (Github #60187).

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

21 months ago[mlir][bufferization][NFC] Simplify func bufferization state
Matthias Springer [Mon, 30 Jan 2023 09:12:28 +0000 (10:12 +0100)]
[mlir][bufferization][NFC] Simplify func bufferization state

The analysis previous kept track of OpOperand -> OpResult and OpResult -> OpOperand aliasing mappings. Only one mapping is needed, the other one can be inferred.

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

21 months ago[mlir][bufferization] Fix getAliasingOpOperand/OpResult for non-bufferizable ops
Matthias Springer [Mon, 30 Jan 2023 09:03:23 +0000 (10:03 +0100)]
[mlir][bufferization] Fix getAliasingOpOperand/OpResult for non-bufferizable ops

Also enable analysis of unknown ops.

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

21 months ago[clang][ASTImporter] Handle UsingType in friend declarations.
Balázs Kéri [Mon, 30 Jan 2023 08:39:55 +0000 (09:39 +0100)]
[clang][ASTImporter] Handle UsingType in friend declarations.

ASTImporterLookupTable did not handle correctly friend declarations
where the friend type is an UsingType (type of a declaration that
comes from an using-declaration). The problem is fixed by handling
it in the same way as a friend with TypedefType.

Reviewed By: steakhal

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

21 months ago[UTC] Add --version argument
Nikita Popov [Fri, 27 Jan 2023 13:53:33 +0000 (14:53 +0100)]
[UTC] Add --version argument

We have a number of pending changes to update_test_checks.py
(and friends) that are essentially blocked on test churn:
If the output of UTC for an existing flag combination changes,
then the next time a test is regenerated, it will contain many
spurious changes. This makes changes to UTC default
behavior essentially impossible.

Examples of such changes are:

* D133943/D142373 want --function-signature to also check the
  return type/attributes.
* D139006/D140212 want to make --function-signature the default
  behavior.
* D142452 wants to add wildcards for block labels.

This patch tries to resolve this issue by adding a --version
argument, which works as follows:

* When regenerating an old test, the default version is 1.
* When generating a new test, the default version is the newest.
 When an explicit version is specified, that of course wins.

This means that any currently existing tests will keep using
--version 1 format, while any new tests will automatically embed
--version N where N is the latest version, and then keep using
that test format from then on.

This patch only implements the --version flag without bumping
the default version, so it does not have any visible behavior
change by itself.

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

21 months agoRevert "[llvm] Use llvm::bit_ceil (NFC)"
Nikita Popov [Mon, 30 Jan 2023 08:37:38 +0000 (09:37 +0100)]
Revert "[llvm] Use llvm::bit_ceil (NFC)"

This reverts commit 54971c8a39e8b682e7a042eee33f94a8283d8305.

This causes a compile-time regression. bit_ceil should probably
not be used in performance-critical code.

21 months ago[mlir][bufferization][NFC] Rename: "last-write" -> "definition"
Matthias Springer [Mon, 30 Jan 2023 08:41:31 +0000 (09:41 +0100)]
[mlir][bufferization][NFC] Rename: "last-write" -> "definition"

The previous lingo was confusing. There are no writes on tensors. There are only definitions.

Also some minor cleanup and better documentation.

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

21 months agoRevert "[mlir][LLVM] Add all LLVM parameter attributes"
Christian Ulmann [Mon, 30 Jan 2023 08:34:29 +0000 (09:34 +0100)]
Revert "[mlir][LLVM] Add all LLVM parameter attributes"

This reverts commit 54941942c82f3a1640d50c0e354d29a3cf5535f6.

The commit introduced a linking error in flang.

21 months ago[libc++][ranges] Temporarily mark `ranges::join_view` as experimental.
varconst [Mon, 30 Jan 2023 08:35:55 +0000 (00:35 -0800)]
[libc++][ranges] Temporarily mark `ranges::join_view` as experimental.

This is in anticipation of https://isocpp.org/files/papers/D2770R0.html,
which is ABI-breaking for `join_view`.

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

21 months ago[mlir][bufferization] Generalize and rename isMemoryWrite
Matthias Springer [Mon, 30 Jan 2023 08:26:15 +0000 (09:26 +0100)]
[mlir][bufferization] Generalize and rename isMemoryWrite

The name of the method was confusing. It is bufferizesToMemoryWrite, but from the perspective of OpResults.

`bufferizesToMemoryWrite(OpResult)` now supports ops with regions that do not have aliasing OpOperands (such as `scf.if`). These ops no longer need to implement `isMemoryWrite`.

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

21 months ago[libc++] Fix some missed `return 0` statements in test `main` functions.
Konstantin Varlamov [Mon, 30 Jan 2023 08:29:55 +0000 (00:29 -0800)]
[libc++] Fix some missed `return 0` statements in test `main` functions.

21 months ago[mlir][NFC] GreedyPatternRewriteDriver: Remove single-op entry point
Matthias Springer [Mon, 30 Jan 2023 08:04:31 +0000 (09:04 +0100)]
[mlir][NFC] GreedyPatternRewriteDriver: Remove single-op entry point

This is to simplify the API. The multi-op entry point can be used directly. GreedyRewriteStrictness must now be specified explicitly.

Depends On: D141396

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

21 months ago[mlir][LLVM] Add all LLVM parameter attributes
Christian Ulmann [Mon, 30 Jan 2023 07:27:14 +0000 (08:27 +0100)]
[mlir][LLVM] Add all LLVM parameter attributes

This commit adds name accessors and verifiers for all LLVM parameter
attributes excluding the swift specific ones to the LLVM dialect.
Additionally, these attributes are now also imported and exported.

Reviewed By: gysit

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

21 months agoRevert "[lldb] Make SBSection::GetSectionData call Section::GetSectionData."
Muhammad Omair Javaid [Mon, 30 Jan 2023 07:32:23 +0000 (12:32 +0500)]
Revert "[lldb] Make SBSection::GetSectionData call Section::GetSectionData."

This reverts commit 805600c7d573cf88cf035d01a2ea9389fc24d435.

LLDB windows buildbots were broken by the TestSectionAPI.py test. I dont
have full context of the commit to fix it. Reverting it temporarily.

https://lab.llvm.org/buildbot/#/builders/83/builds/28617
https://lab.llvm.org/buildbot/#/builders/219/builds/180

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

21 months ago[clangd] Fix test failure in TypeHints.Decltype
Nathan Ridge [Mon, 30 Jan 2023 07:07:46 +0000 (02:07 -0500)]
[clangd] Fix test failure in TypeHints.Decltype

21 months ago[Docs] Rename -dot-postdom -> -dom-post-dom in Passes.rst. NFC
Craig Topper [Mon, 30 Jan 2023 06:50:43 +0000 (22:50 -0800)]
[Docs] Rename -dot-postdom -> -dom-post-dom in Passes.rst. NFC

Same for -dot-postdom-only.

Looks like these passes got renamed when they moved to the new
pass manager.

21 months ago[clangd] Don't show 'auto' type hint when type deduction fails
Nathan Ridge [Tue, 24 Jan 2023 09:38:35 +0000 (04:38 -0500)]
[clangd] Don't show 'auto' type hint when type deduction fails

Fixes https://github.com/clangd/clangd/issues/1475

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

21 months ago[AIX][BigArchive] Treat the archive is empty if the first child member offset is...
Kai Luo [Mon, 30 Jan 2023 05:43:50 +0000 (13:43 +0800)]
[AIX][BigArchive] Treat the archive is empty if the first child member offset is zero

If the archive contains free list and contains no member file, the buffer length doesn't equal to length of the header.

Reviewed By: Esme, DiggerLin, #powerpc

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

21 months ago[mlir] skip 0-D vector in BubbleUpBitCastForStridedSliceInsert
Xiang Li [Mon, 30 Jan 2023 01:30:36 +0000 (20:30 -0500)]
[mlir] skip 0-D vector in BubbleUpBitCastForStridedSliceInsert

InsertStridedSliceOp will not get 0-D vector result, so just skip 0-D vector in BubbleUpBitCastForStridedSliceInsert.
Fixes #60214  https://github.com/llvm/llvm-project/issues/60214

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

21 months ago[WebAssembly] Convert some tests to opaque pointers (NFC)
Sergei Barannikov [Mon, 30 Jan 2023 03:39:37 +0000 (06:39 +0300)]
[WebAssembly] Convert some tests to opaque pointers (NFC)

21 months ago[Thumb2] Convert some tests to opaque pointers (NFC)
Sergei Barannikov [Mon, 30 Jan 2023 03:10:10 +0000 (06:10 +0300)]
[Thumb2] Convert some tests to opaque pointers (NFC)

21 months ago[AVR][NFC] Remove redundant target feature PROGMEM
Ben Shi [Fri, 13 Jan 2023 09:37:00 +0000 (17:37 +0800)]
[AVR][NFC] Remove redundant target feature PROGMEM

The functionality of FeaturePROGMEM is all equivalant to FeatureLPM.

Reviewed By: Chenbing.Zheng, aykevl

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

21 months ago[RISCV] Move IsRV64 field of RISCVOperand into RegOp and ImmOp sub-structs.
Craig Topper [Mon, 30 Jan 2023 02:45:58 +0000 (18:45 -0800)]
[RISCV] Move IsRV64 field of RISCVOperand into RegOp and ImmOp sub-structs.

We don't need this field for all operand types, so sync it into the
ones that do need it. Then remove it from the create* functions that
don't need it.

21 months ago[RISCV] Correct end pointer in RISCVAsmParser::parseGPRAsFPR.
Craig Topper [Sun, 29 Jan 2023 23:54:48 +0000 (15:54 -0800)]
[RISCV] Correct end pointer in RISCVAsmParser::parseGPRAsFPR.

Instead of using start pointer - 1, use start pointer + length of
the name string.

21 months ago[RISCV] Make RISCVOperand struct final.
Craig Topper [Sun, 29 Jan 2023 23:48:14 +0000 (15:48 -0800)]
[RISCV] Make RISCVOperand struct final.

Allows the compiler to de-virtualize some calls.

21 months ago[mlir][sparse] Extend sparse_tensor.sort with a enum attribute to specify a sorting...
bixia1 [Fri, 27 Jan 2023 23:16:31 +0000 (15:16 -0800)]
[mlir][sparse] Extend sparse_tensor.sort with a enum attribute to specify a sorting implementation.

Currently, all the non-stable sorting algorithms are implemented via the
straightforward quick sort. This will be fixed in the following PR.

Reviewed By: aartbik

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

21 months ago[PowerPC] Convert more tests to opaque pointers (NFC)
Sergei Barannikov [Mon, 30 Jan 2023 01:39:36 +0000 (04:39 +0300)]
[PowerPC] Convert more tests to opaque pointers (NFC)

21 months ago[clang] Remove clang::Optional
Kazu Hirata [Mon, 30 Jan 2023 02:08:00 +0000 (18:08 -0800)]
[clang] Remove clang::Optional

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

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

21 months ago[mlir][sparse] Change the quick sort pivot selection.
bixia1 [Fri, 27 Jan 2023 23:24:02 +0000 (15:24 -0800)]
[mlir][sparse] Change the quick sort pivot selection.

Previously, we choose the value at (lo + hi)/2 as a pivot for partitioning the
data in [lo, hi). We now choose the median for the three values at lo, (lo +
hi)/2, and (hi-1) as a pivot to match the std::qsort implementation.

Reviewed By: aartbik

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

21 months ago[JITLink] Fixes a bug in one of the test files which was causing build failures
Kshitij Jain [Mon, 30 Jan 2023 01:26:45 +0000 (01:26 +0000)]
[JITLink] Fixes a bug in one of the test files which was causing build failures

Reviewed By: MaskRay

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

21 months ago[PowerPC] Convert more tests to opaque pointers (NFC)
Sergei Barannikov [Sun, 29 Jan 2023 23:59:37 +0000 (02:59 +0300)]
[PowerPC] Convert more tests to opaque pointers (NFC)

* Add -fast-isel=false to func-alias.ll. The test was added as a
SelectionDAG test. Without this option, FastISel successfully selects
the call that had a ConstantExpr argument.
* fast-isel-branch.ll couldn't be handled by FastISel. Now it can,
hence the change in the stack offsets.

21 months ago[JITLink] Adds support for PLT based relocations to the ELF/i386 JITLink backend
Kshitij Jain [Sun, 29 Jan 2023 17:19:41 +0000 (17:19 +0000)]
[JITLink] Adds support for PLT based relocations to the ELF/i386 JITLink backend

This commit adds support for PLT based relocations. Specifically -
1. It adds logic to create a `PLTTableManager` in the `buildTables_ELF_i386`
function, which is called as part of the post-prune JITLink passes. The `PLTTableManager`
handles creating pointer jump stubs and related GOT entries for position independent
code.

2. It also adds a pre-fixup pass to optimize away PLT based calls in position independent
code, when possible.

Reviewed By: lhames

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

21 months ago[Support] Use llvm::bit_ceil (NFC)
Kazu Hirata [Mon, 30 Jan 2023 00:07:04 +0000 (16:07 -0800)]
[Support] Use llvm::bit_ceil (NFC)

For nonzero X, NextPowerOf2(X) is equivalent to llvm::bit_ceil(X + 1).

21 months ago[flang] Fix ENUMERATOR declarations in nested scopes
Peter Klausler [Fri, 20 Jan 2023 01:01:06 +0000 (17:01 -0800)]
[flang] Fix ENUMERATOR declarations in nested scopes

ENUMERATOR declarations are checking for conflicts between new
enumerator names and names in both the local scope and scopes
that contain it.  ENUMERATOR declarations belong to the local
scope and so only a conflict with a name therein is an error.
(In short, use FindInScope rather than FindSymbol.)

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

21 months ago[AST] Use llvm::bit_ceil (NFC)
Kazu Hirata [Sun, 29 Jan 2023 23:39:46 +0000 (15:39 -0800)]
[AST] Use llvm::bit_ceil (NFC)

For nonzero X that is not a power of 2, NextPowerOf2(X) is equivalent
to llvm::bit_ceil(X).

21 months ago[ADT] Use llvm::bit_ceil (NFC)
Kazu Hirata [Sun, 29 Jan 2023 23:25:49 +0000 (15:25 -0800)]
[ADT] Use llvm::bit_ceil (NFC)

For nonzero X, NextPowerOf2(X - 1) is equivalent to llvm::bit_ceil(X).

21 months ago[ORC] Add ordering to ExecutorAddrRanges.
Lang Hames [Sun, 29 Jan 2023 23:08:02 +0000 (15:08 -0800)]
[ORC] Add ordering to ExecutorAddrRanges.

This allows ranges to be sorted and used as map keys.

21 months ago[flang][MSVC] Change XFAIL to UNSUPPORTED for disabled test
Peter Klausler [Sun, 29 Jan 2023 22:53:40 +0000 (14:53 -0800)]
[flang][MSVC] Change XFAIL to UNSUPPORTED for disabled test

Test flang/test/Semantics/select-rank02.f90 has an unresolved
failure when built with MSVC on an x86 Windows buildbot, but it passes
on an Arm Windows buildbot.  Change XFAIL to UNSUPPORTED to dodge
an XPASS buildbot complaint on the Arm Windows buildbot.

21 months ago[VPlan] Add sideffect/read or write test for VPPredInstPHIRecipe. (NFC)
Florian Hahn [Sun, 29 Jan 2023 22:46:17 +0000 (22:46 +0000)]
[VPlan] Add sideffect/read or write test for VPPredInstPHIRecipe. (NFC)

21 months ago[flang] Check that DO index variables are definable
Peter Klausler [Tue, 10 Jan 2023 23:53:12 +0000 (15:53 -0800)]
[flang] Check that DO index variables are definable

We're letting immutable objects appear as DO index variables;
catch and diagnose this error.

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

21 months ago[PowerPC] Convert some tests to opaque pointers (NFC)
Sergei Barannikov [Sun, 29 Jan 2023 20:52:16 +0000 (23:52 +0300)]
[PowerPC] Convert some tests to opaque pointers (NFC)

21 months agoflang: remove the hardcoded 15 from the release notes
Sylvestre Ledru [Sun, 29 Jan 2023 09:09:16 +0000 (10:09 +0100)]
flang: remove the hardcoded 15 from the release notes

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

21 months ago[RISCV] Fix wrong comment style. NFC
Philipp Tomsich [Sun, 29 Jan 2023 21:00:32 +0000 (22:00 +0100)]
[RISCV] Fix wrong comment style.  NFC

21 months ago[RISCV] Alphabetize X-extensions (and add a comment). NFC.
Philipp Tomsich [Sun, 29 Jan 2023 19:21:11 +0000 (20:21 +0100)]
[RISCV] Alphabetize X-extensions (and add a comment).  NFC.

21 months ago[RISCV] Move IsGPRAsFPR into RegOp struct in RISCVOperand. NFC
Craig Topper [Sun, 29 Jan 2023 20:30:52 +0000 (12:30 -0800)]
[RISCV] Move IsGPRAsFPR into RegOp struct in RISCVOperand. NFC

This field is only initialized for register operands, move it into
the struct to make that clear.

This also fixes a potential bug where the field wasn't copied by
the RISCVOperand copy constructor.

21 months ago[RISCV] Move FRM parsing in the assembler to a custom operand parser.
Craig Topper [Sun, 29 Jan 2023 20:25:00 +0000 (12:25 -0800)]
[RISCV] Move FRM parsing in the assembler to a custom operand parser.

Previously we parsed it as a symbol, and then accessed the name.
This works, but seems like an unusual way to do it.

This adds a custom parser that looks for an Identifier token containing
one of the valid FRM strings.

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

21 months ago[X86] pr53419.ll - cleanup check-prefixes. NFC.
Simon Pilgrim [Sun, 29 Jan 2023 20:14:46 +0000 (20:14 +0000)]
[X86] pr53419.ll - cleanup check-prefixes. NFC.

Avoid using CHECK unless its for all possible RUNs

21 months ago[flang] Don't fold REPEAT() when the result would be too large
Peter Klausler [Tue, 17 Jan 2023 21:30:09 +0000 (13:30 -0800)]
[flang] Don't fold REPEAT() when the result would be too large

A test program shouldn't be able to crash the compiler by getting it to
fold REPEAT() with an absurdly large repetition count.

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

21 months ago[Support] Use std::clamp (NFC)
Kazu Hirata [Sun, 29 Jan 2023 19:43:10 +0000 (11:43 -0800)]
[Support] Use std::clamp (NFC)

21 months ago[flang] Fix defined I/O semantics crash & missing errors that exposed it
Peter Klausler [Fri, 13 Jan 2023 22:33:57 +0000 (14:33 -0800)]
[flang] Fix defined I/O semantics crash & missing errors that exposed it

Semantics crashes when emitting runtime derived type information tables
for a type that has user-defined I/O procedures declared outside the
type with explicit INTERFACE blocks (as opposed to a GENERIC binding
within the type).  This is due to the runtime table constructor
adding a table entry for each specific procedure of any explicit interface
 of the right kind (e.g., READ(UNFORMATTED)) that it found, rather than
just the ones that pertain to the derived type in question.  But
semantics also wasn't checking such interfaces for distinguishable
specific procedures, either.

Clean these up, improve the spelling of defined I/O procedure kinds
in error messages ("read(formatted)" rather than "READFORMATTED"),
and make error messages stemming from macro expansions only have
one "error:" prefix on the original message so that a new test
would work.

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

21 months ago[Support] ModRef.h - fix include guard
Simon Pilgrim [Sun, 29 Jan 2023 18:03:49 +0000 (18:03 +0000)]
[Support] ModRef.h - fix include guard

ModRef.h is part of Support not IR

Fixes clang-tidy warning

21 months ago[IR] PatternMatch.h - m_SplatOrUndefMask::match - specialise auto to const auto*
Simon Pilgrim [Sun, 29 Jan 2023 18:02:54 +0000 (18:02 +0000)]
[IR] PatternMatch.h - m_SplatOrUndefMask::match - specialise auto to const auto*

Fixes clang-tidy warning

21 months ago[IR] InstrTypes.h - operandBundleFromBundleOpInfo - specialise auto to const auto*
Simon Pilgrim [Sun, 29 Jan 2023 18:01:44 +0000 (18:01 +0000)]
[IR] InstrTypes.h - operandBundleFromBundleOpInfo - specialise auto to const auto*

Fixes clang-tidy warning

21 months ago[Scalar] Remove an unused local varable (NFC)
Kazu Hirata [Sun, 29 Jan 2023 18:03:15 +0000 (10:03 -0800)]
[Scalar] Remove an unused local varable (NFC)

The last uses of CRs were removed on Jan 17, 2023 in commit
61bb549cfd43fe4753fc78075b626ae18106fbeb.

21 months ago[AST] Use std::clamp (NFC)
Kazu Hirata [Sun, 29 Jan 2023 17:43:36 +0000 (09:43 -0800)]
[AST] Use std::clamp (NFC)

21 months ago[Support] StringSaver.h - add missing closing namespace comment. NFC.
Simon Pilgrim [Sun, 29 Jan 2023 16:50:37 +0000 (16:50 +0000)]
[Support] StringSaver.h - add missing closing namespace comment. NFC.

Fixes clang-tidy warning

21 months ago[Support] ReverseIteration.h - add missing closing namespace comment. NFC.
Simon Pilgrim [Sun, 29 Jan 2023 16:48:21 +0000 (16:48 +0000)]
[Support] ReverseIteration.h - add missing closing namespace comment. NFC.

Fixes clang-tidy warning

21 months ago[X86] vec_ss_load_fold.ll - use X86 check prefix instead of X32
Simon Pilgrim [Sun, 29 Jan 2023 16:47:13 +0000 (16:47 +0000)]
[X86] vec_ss_load_fold.ll - use X86 check prefix instead of X32

We try to use X32 for tests on gnux32 triples

21 months ago[flang] If it's got an argument keyword, it can't become an array reference
Peter Klausler [Tue, 10 Jan 2023 21:26:39 +0000 (13:26 -0800)]
[flang] If it's got an argument keyword, it can't become an array reference

Array references like A(1) are commonly misparsed as function references,
since the parser has almost no semantic context, and the parse tree is
fixed up later by semantics once it can be disambiguated.  In a case
like A(I=1), however, the presence of an argument keyword must prevent
conversion into an array reference.  (It might still also be a structure
constructor.)

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

21 months ago[AArch64] Add A+B+1 and A-B-1 macro fusion for Ampere1A
Philipp Tomsich [Tue, 24 Jan 2023 17:55:17 +0000 (18:55 +0100)]
[AArch64] Add A+B+1 and A-B-1 macro fusion for Ampere1A

The Ampere1A core supports a new fusion pattern that optimises the
case of A+B+1 and A-B-1.  Add support.

Depends on D142396

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

21 months ago[InstSimplify] !(X && Y) || X --> true (for poison-safe logical ops)
Sanjay Patel [Sun, 29 Jan 2023 15:24:52 +0000 (10:24 -0500)]
[InstSimplify] !(X && Y) || X --> true (for poison-safe logical ops)

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

This is the similar to the existing folds added with:
D138853 / f2973327496fc966c4e89597
7dbeb127eaf6
...but with the and/or swapped.

21 months ago[InstSimplify] add tests for poison-safe logical nand+or; NFC
Sanjay Patel [Sun, 29 Jan 2023 14:43:14 +0000 (09:43 -0500)]
[InstSimplify] add tests for poison-safe logical nand+or; NFC

21 months ago[Support] TypeName.h - add missing closing namespace comment. NFC.
Simon Pilgrim [Sun, 29 Jan 2023 14:37:47 +0000 (14:37 +0000)]
[Support] TypeName.h - add missing closing namespace comment. NFC.

Fixes clang-tidy warning

21 months ago[X86] avx2-conversions.ll - use X86 check prefix instead of X32 + add common CHECK...
Simon Pilgrim [Sun, 29 Jan 2023 14:30:35 +0000 (14:30 +0000)]
[X86] avx2-conversions.ll - use X86 check prefix instead of X32 + add common CHECK check-prefix

We try to use X32 for tests on gnux32 triples

21 months ago[X86] wide-scalar-shift-legalization.ll - use X86 check prefix instead of X32
Simon Pilgrim [Sun, 29 Jan 2023 14:24:45 +0000 (14:24 +0000)]
[X86] wide-scalar-shift-legalization.ll - use X86 check prefix instead of X32

We try to use X32 for tests on gnux32 triples

21 months ago[X86] wide-scalar-shift-by-byte-multiple-legalization.ll - use X86 check prefix inste...
Simon Pilgrim [Sun, 29 Jan 2023 14:24:28 +0000 (14:24 +0000)]
[X86] wide-scalar-shift-by-byte-multiple-legalization.ll - use X86 check prefix instead of X32

We try to use X32 for tests on gnux32 triples

21 months ago[X86] matchShuffleAsBlend - keep per-lane blend masks 'whole' if only one input is...
Simon Pilgrim [Sun, 29 Jan 2023 13:13:33 +0000 (13:13 +0000)]
[X86] matchShuffleAsBlend - keep per-lane blend masks 'whole' if only one input is used

For 32/64-bit element 256-bit X86ISD::BLENDI shuffle masks, see if each sub-lane only references (plus undefs) a single input - in which case ensure the blend mask component for that lane ONLY references that input.

This helps later subvector extraction/insertion nodes to peek through the blend node for that lane.

21 months agoGlobalISel: Include register class/bank in regbankselect debug printing
Matt Arsenault [Fri, 20 Jan 2023 17:03:56 +0000 (13:03 -0400)]
GlobalISel: Include register class/bank in regbankselect debug printing

21 months ago[mlir][gpu][spirv] Gpu min/max reductions lowering to SPIR-V
Ivan Butygin [Sat, 28 Jan 2023 15:14:07 +0000 (16:14 +0100)]
[mlir][gpu][spirv] Gpu min/max reductions lowering to SPIR-V

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

21 months ago[X86] lowerShuffleAsLanePermuteAndRepeatedMask - retain the per-lane undef elements...
Simon Pilgrim [Sun, 29 Jan 2023 11:03:41 +0000 (11:03 +0000)]
[X86] lowerShuffleAsLanePermuteAndRepeatedMask - retain the per-lane undef elements and don't just copy the repeated mask

lowerShuffleAsLanePermuteAndRepeatedMask expands a shuffle from shuffle(x,y,mask) to shuffle(shuffle(x,y,lanemask1),shuffle(x,y,lanemask2),repeatedinlanemask)

However, we weren't making use of the fact that elements of the original mask might be undef - instead of fully applying the entire repeatedinlanemask to every lane, we can simplify the mask if we never demanded that element in the original mask.

Yet another improvement addressing regressions from D127115

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

21 months ago[LLDB][RISCV] Add RVV registers enums
Emmmer [Sun, 15 Jan 2023 14:25:40 +0000 (22:25 +0800)]
[LLDB][RISCV] Add RVV registers enums

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.

Reviewed By: DavidSpickett, kito-cheng

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

21 months ago[ELF][test] Improve AVR relocation tests
Ben Shi [Sat, 7 Jan 2023 14:44:57 +0000 (22:44 +0800)]
[ELF][test] Improve AVR relocation tests

Reviewed By: aykevl, MaskRay

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

21 months ago[AVR] Fix incorrect decoding of conditional branch instructions
Ben Shi [Sat, 7 Jan 2023 07:25:38 +0000 (15:25 +0800)]
[AVR] Fix incorrect decoding of conditional branch instructions

This patch fixes the inaccurate decoding of the offset operand of
the conditional branch instructions.

Reviewed By: aykevl

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

21 months ago[llvm] Use llvm::bit_ceil (NFC)
Kazu Hirata [Sun, 29 Jan 2023 08:12:52 +0000 (00:12 -0800)]
[llvm] Use llvm::bit_ceil (NFC)

If X is nonzero, NextPowerOf2(X - 1) is equivalent to
llvm::bit_ceil(X).  In this patch, std::max guarantees that X is
nonzero.

21 months ago[RISCV] Simplify code slightly. NFC
Craig Topper [Sun, 29 Jan 2023 06:43:20 +0000 (22:43 -0800)]
[RISCV] Simplify code slightly. NFC

These two pieces of code were using a switch with a single case and
a default that always returned.

Replace with an if statement that early returns.

21 months agoRevert commit 01adf96ebc86 because it caused "Unhandled DeclRefExpr" errors.
Liming Liu [Sun, 29 Jan 2023 06:27:12 +0000 (14:27 +0800)]
Revert commit 01adf96ebc86 because it caused "Unhandled DeclRefExpr" errors.

21 months ago[RISCV] Bump Zca, Zcb, Zcd, Zcf version to 1.0.
Craig Topper [Sun, 29 Jan 2023 06:04:34 +0000 (22:04 -0800)]
[RISCV] Bump Zca, Zcb, Zcd, Zcf version to 1.0.

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

21 months ago[clang] Add the check of membership in decltype for the issue #58674
Liming Liu [Tue, 10 Jan 2023 12:28:52 +0000 (20:28 +0800)]
[clang] Add the check of membership in decltype for the issue #58674

D137531 had once fixed the issue. However, it caused a crash during compiling
llvm/unittests/IR/PatternMatch.cpp in stage-2. The reason is the predicator
isDerivedFrom does not consider independent types if the derived type is
dependent.

This patch improves D137531 by adding an option to make isDerivedFrom consider
independent types.

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

21 months ago[JITLink][MachO] Error on N_EXT symbols with illegal string-table index 0.
Lang Hames [Sat, 28 Jan 2023 05:10:03 +0000 (21:10 -0800)]
[JITLink][MachO] Error on N_EXT symbols with illegal string-table index 0.

Index 0 is reserved for anonymous symbols, which can't have the N_EXT bit
set (since N_EXT means non-local scope, and non-local scope requires a name).

21 months agoAMDGPU: Don't insert pointer bitcasts for printf lowering
Matt Arsenault [Fri, 6 Jan 2023 23:50:55 +0000 (18:50 -0500)]
AMDGPU: Don't insert pointer bitcasts for printf lowering

Cleanup leftover typed pointer handling.

21 months ago[flang][MSVC] Disable test on Windows
Peter Klausler [Sun, 29 Jan 2023 01:25:50 +0000 (17:25 -0800)]
[flang][MSVC] Disable test on Windows

A test is crashing the compiler unexpectedly when built with MSVC;
disable it with an XFAIL until it can be analyzed further.

21 months ago[flang] Diagnose invalid initializations
Peter Klausler [Tue, 10 Jan 2023 22:30:27 +0000 (14:30 -0800)]
[flang] Diagnose invalid initializations

f18 current ignores attempts to initialize (with =expr) things
that are not objects, or allows meaningless initializations of
things that have mistakenly been promoted to be objects.
Fix by refusing to promote to objects names that have any
attributes that cannot be applied to objects, and then catch
data initializations of symbols that are not objects.

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

21 months agoAttributes: Check declarations for dereferenceable bytes
Matt Arsenault [Sat, 7 Jan 2023 21:42:12 +0000 (16:42 -0500)]
Attributes: Check declarations for dereferenceable bytes

This will allow tablegen to start directly marking intrinsics as
dereferenceable in a useful way. Not sure if callsites should override
or use the max.

21 months ago[Clang] Treat `std::forward_like` as builtin
Alexander Shaposhnikov [Sun, 29 Jan 2023 00:04:51 +0000 (00:04 +0000)]
[Clang] Treat `std::forward_like` as builtin

This diff extends D123345 by adding support for std::forward_like.

Test plan: ninja check-clang check-clang-tools check-llvm

Differential revision: https://reviews.llvm.org/D142430

21 months agoUse llvm::bit_ceil (NFC)
Kazu Hirata [Sun, 29 Jan 2023 00:13:09 +0000 (16:13 -0800)]
Use llvm::bit_ceil (NFC)

Note that:

  std::has_single_bit(X) ? X : llvm::NextPowerOf2(X);

is equivalent to:

  std::bit_ceil(X)

even for input 0.

21 months ago[OpenMP][NVPTX] Added `__tgt_rtl_launch_kernel` in old CUDA plugin
Shilei Tian [Sat, 28 Jan 2023 23:56:00 +0000 (18:56 -0500)]
[OpenMP][NVPTX] Added `__tgt_rtl_launch_kernel` in old CUDA plugin

Fix #60248.

Reviewed By: jhuber6

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

21 months ago[flang] Diagnose known out-of-range subscripts in more circumstances
Peter Klausler [Tue, 10 Jan 2023 20:23:57 +0000 (12:23 -0800)]
[flang] Diagnose known out-of-range subscripts in more circumstances

Semantics can catch out-of-range subscript values already when they
appear in DATA statement objects and constant folding of name constant
array indexing; this patch fills the gap by checking known constant
subscript values in other contexts.

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

21 months ago[ADT] Fix a comment typo
Kazu Hirata [Sat, 28 Jan 2023 23:24:36 +0000 (15:24 -0800)]
[ADT] Fix a comment typo

21 months agoUse llvm::byteswap instead of ByteSwap_{16,32,64} (NFC)
Kazu Hirata [Sat, 28 Jan 2023 23:22:37 +0000 (15:22 -0800)]
Use llvm::byteswap instead of ByteSwap_{16,32,64} (NFC)

21 months ago[llvm] Use llvm::bit_width (NFC)
Kazu Hirata [Sat, 28 Jan 2023 23:04:20 +0000 (15:04 -0800)]
[llvm] Use llvm::bit_width (NFC)

21 months ago[Target] Use llvm::Log2_{32,64} (NFC)
Kazu Hirata [Sat, 28 Jan 2023 23:04:18 +0000 (15:04 -0800)]
[Target] Use llvm::Log2_{32,64} (NFC)

21 months ago[SystemZ] Use llvm::bit_floor (NFC)
Kazu Hirata [Sat, 28 Jan 2023 23:04:16 +0000 (15:04 -0800)]
[SystemZ] Use llvm::bit_floor (NFC)

21 months agoRevert "[SCCP] Support NUW/NSW inference for all overflowing binary operators."
Florian Hahn [Sat, 28 Jan 2023 21:33:28 +0000 (21:33 +0000)]
Revert "[SCCP] Support NUW/NSW inference for all overflowing binary operators."

This reverts commit 024115ab14822a97c09adcd2545c14e78b843b36.

I suspect that this may be causing some buildbot bootstrapping failures.
Revert while I investigate.

21 months agoUse llvm::count{lr}_{zero,one} (NFC)
Kazu Hirata [Sat, 28 Jan 2023 20:41:19 +0000 (12:41 -0800)]
Use llvm::count{lr}_{zero,one} (NFC)

21 months ago[MLIR][OpenMP] Add conversion support from FIR to LLVM Dialect for OMP Target Data...
Akash Banerjee [Thu, 26 Jan 2023 14:40:33 +0000 (14:40 +0000)]
[MLIR][OpenMP] Add conversion support from FIR to LLVM Dialect for OMP Target Data directives

This enables conversion of OpenMP Target Data, Enter Data and Exit Data from FIR Dialect to LLVM IR Dialect.

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

21 months ago[RISCV] Simplify predicates with llvm::countr_zero (NFC)
Kazu Hirata [Sat, 28 Jan 2023 20:14:43 +0000 (12:14 -0800)]
[RISCV] Simplify predicates with llvm::countr_zero (NFC)

It takes less code (in C++ and the host assembly) to get rid of the
trailing zeros and compare against {3,5,9} than divide the immediate
by {3,5,9} and check to see if we have a power of 2.

21 months ago[CMake] Replace clang binary if using clang-bolt target
Amir Ayupov [Sat, 28 Jan 2023 19:49:58 +0000 (11:49 -0800)]
[CMake] Replace clang binary if using clang-bolt target

Instead of creating an extra clang-bolt binary and clang++-bolt symlink,
replace the original clang binary with BOLT-optimized one.

This fixes the issue with installing optimized binary as `install-clang`
target now copies the new version.

Reviewed By: phosek

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

21 months ago[RISCV] Use llvm::Log2_64 (NFC)
Kazu Hirata [Sat, 28 Jan 2023 19:33:02 +0000 (11:33 -0800)]
[RISCV] Use llvm::Log2_64 (NFC)

21 months ago[llvm] Use llvm::Log2_64 (NFC)
Kazu Hirata [Sat, 28 Jan 2023 19:20:47 +0000 (11:20 -0800)]
[llvm] Use llvm::Log2_64 (NFC)