Commit Graph

471943 Commits

Author SHA1 Message Date
Piyou Chen
4b60e1e821 [RISCV] Add function that check extension name with version
Check whether a extension string with version is valid, and get the targetfeature from it.

New functions be used in RISCVISAInfo for https://reviews.llvm.org/D151730.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D152423
2023-08-20 21:06:57 -07:00
Yuanjing Hong
dc10bd43a1 [clangd] don't add inlay hint for dependent type in structured binding
Currently clangd will display useless inlay hint for dependent type in
structured binding, e.g.

```
template <class T>
void foobar(T arg) {
  auto [a/*: <dependent type>*/, b/*: <dependent type>*/] = arg;
}
```

Differential Revision: https://reviews.llvm.org/D157956
2023-08-21 11:10:40 +08:00
chenli
0c76f46ca6 [LoongArch] Add testcases of LSX intrinsics with immediates
The testcases mainly cover three situations:
- the arguments which should be immediates are non immediates.
- the immediate is out of upper limit of the argument type.
- the immediate is out of lower limit of the argument type.

Depends on D155829

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D157570
2023-08-21 11:04:19 +08:00
Neumann Hon
43207225b6 Revert "[SystemZ][z/OS] Fix the entry point marker for leaf functions"
This reverts commit 8af297bbb8.

Testcase LLVM :: MC/GOFF/ppa1.ll needs to be updated to account for this.
2023-08-20 22:04:02 -04:00
Jim Lin
01da5b9438 [RISCV] Remove trailing whitespace. NFC. 2023-08-21 10:01:13 +08:00
Neumann Hon
8af297bbb8 [SystemZ][z/OS] Fix the entry point marker for leaf functions
The function emitFunctionEntryLabel does not look at whether or not a function is a leaf when setting the entry flags,
and instead blindly marks all functions as non-leaf routines. Change it to check if a function is a leaf function and
mark it accordingly.
2023-08-20 21:53:13 -04:00
Michał Górny
7ed0f5b6de [lit] Use raw strings for backslash escapes to fix SyntaxWarnings
Use raw strings instead of regular strings when escapes are used for
regex matches or arbitrary letters rather than C-style characters.
This fixes `SyntaxWarning`s:

```
TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c'
  """
TestRunner.py:1566: SyntaxWarning: invalid escape sequence '\s'
  match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
```

Differential Revision: https://reviews.llvm.org/D158356
2023-08-21 03:51:10 +02:00
Kai Sasaki
14de5a2a4f
[mlir][complex] Initial support for FastMath flag when converting to LLVM
This change contains the initial support of FastMath flag in complex dialect. Similar to what we did in [Arith dialect](https://reviews.llvm.org/rGb56e65d31825fe4a1ae02fdcbad58bb7993d63a7), `fastmath` attributes in the complex dialect are directly mapped to the corresponding LLVM fastmath flags.

In this diff,

- Definition of FastMathAttr as a custom attribute in the Complex dialect that inherits from the EnumAttr class.
- Definition of ComplexFastMathInterface, which is an interface that is implemented by operations that have a complex::fastmath attribute.
- Declaration of a default-valued fastmath attribute for unary and arithmetic operations in the Complex dialect.
- Conversion code to lower arithmetic fastmath flags to LLVM fastmath flags

NOT in this diff (but planned and progressively implemented):

- Documentation of flag meanings
- Support the fastmath flag conversion to Arith dialect
- Folding/rewrite implementations that are enabled by fastmath flags (although it's the original motivation to support the flag)

RFC: https://discourse.llvm.org/t/rfc-fastmath-flags-support-in-complex-dialect/71981

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D156310
2023-08-21 10:41:55 +09:00
Freddy Ye
6acff5390d [X86] Support -march=gracemont
gracemont has some different tuning features from alderlake.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D158046
2023-08-21 08:49:01 +08:00
Nathan Sidwell
a695be7c28 [llvm][NFC] Refactor AutoUpgrade case 'w'
Check for 'wasm.' prefix before proceeding, and a bit of common handling
for some of the intrinsics therein.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D158370
2023-08-20 19:15:04 -04:00
Mehdi Amini
87a14216cd Fix MLIR build failure: error: no member named 'getValue' in 'mlir::OptionalParseResult'
Fix #63072
2023-08-20 13:27:10 -07:00
Mehdi Amini
ad83164e6d Revert "Fix MLIR build failure: error: no member named 'getValue' in 'mlir::OptionalParseResult'"
This reverts commit d151aa4a0f.

A bot is broken
2023-08-20 13:22:26 -07:00
Mehdi Amini
d151aa4a0f Fix MLIR build failure: error: no member named 'getValue' in 'mlir::OptionalParseResult'
Fix #63072
2023-08-20 13:18:49 -07:00
Florian Hahn
56f5738d85
[LV] Move induction ::execute impls to VPlanRecipes.cpp (NFC).
All dependencies on code from LoopVectorize.cpp have been
removed/refactored. Move the ::execute implementations to other recipe
definitions in VPlanRecipes.cpp
2023-08-20 21:00:05 +01:00
Rahman Lavaee
69e47deca9 [Propeller] Deprecate Codegen paths for SHT_LLVM_BB_ADDR_MAP version 1.
This patch removes the `getBBIDOrNumber` which was introduced to allow emitting version 1.

Reviewed By: shenhan

Differential Revision: https://reviews.llvm.org/D158299
2023-08-20 18:29:47 +00:00
Ivan Butygin
0db1ae3ed1 [mlir][CFGToSCF] Visit subregions in CFGToSCF pass
This is useful when user already have partially-scf'ed IR or other ops with nested regions (e.g. linalg.generic).

Also, improve error message and pass docs.

Differential Revision: https://reviews.llvm.org/D158349
2023-08-20 19:29:51 +02:00
Kazu Hirata
4d434f7696 [Sema] Modernize Usage (NFC) 2023-08-20 09:43:04 -07:00
Kazu Hirata
c6bcdc42c1 [CodeGen] Modernize GuardInfo (NFC) 2023-08-20 09:43:02 -07:00
Kazu Hirata
477457c3a7 [CodeGen] Modernize NullReturnState (NFC) 2023-08-20 09:43:01 -07:00
Kazu Hirata
f01f2de540 [CodeGen] Modernize CallArgList (NFC) 2023-08-20 09:42:59 -07:00
Kazu Hirata
7a6806073d [AST] Modernize ExternalLayout (NFC) 2023-08-20 09:42:57 -07:00
Kazu Hirata
bd31c36fd0 [AST] Modernize FunctionTypeDepthState (NFC) 2023-08-20 09:42:56 -07:00
Nathan Sidwell
326280d965 [llvm][NFC] Refactor AutoUpgrade dbg case
Consume the dbg. prefix before looking further. Also merge the matched
path.

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

Reviewed By: nikic
2023-08-20 12:09:46 -04:00
Sameer Sahasrabuddhe
ef38e6d97f [GlobalISel] introduce MIFlag::NoConvergent
Some opcodes in MIR are defined to be convergent by the target by setting
IsConvergent in the corresponding TD file. For example, in AMDGPU, the opcodes
G_SI_CALL and G_INTRINSIC* are marked as convergent. But this is too
conservative, since calls to functions that do not execute convergent operations
should not be marked convergent. This information is available in LLVM IR.

The new flag MIFlag::NoConvergent now allows the IR translator to mark an
instruction as not performing any convergent operations. It is relevant only on
occurrences of opcodes that are marked isConvergent in the target.

Differential Revision: https://reviews.llvm.org/D157475
2023-08-20 21:14:46 +05:30
Nathan Sidwell
d6a1388d6f [llvm][NFC] Refactor AutoUpdater case 'e'
It is more efficient to gate on the prefix before checking for the
individual cases. Also, the regexps weren't consistent about escaping '.'.

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

Reviewed By: arsenm
2023-08-20 11:27:29 -04:00
Mathieu Fehr
1295a351bd [mlir][irdl] Support variadicity check in operations
This patch adds support for loading IRDL operations that are
using optional or variadics operands and results.

If an operation declares more than one optional/variadic operand
or result, then it requires the segment sizes in the attribute
dictionary, and otherwise it is computed using the number of
operands or results.

Currently, a variadic operand or result definiton expects all
operands and results in that definition to have the same type.
This restriction will be removed in a following patch.

Depends on D153983

Reviewed By: Mogball, unterumarmung

Differential Revision: https://reviews.llvm.org/D154073
2023-08-20 17:21:59 +01:00
Mathieu Fehr
00aa1a8c3d Revert "[mlir][irdl] Support variadicity check in operations"
This reverts commit 62b2b39992.

This is the error reported by the buildbot:
 /home/buildbots/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/IRDL/IRDLLoading.cpp:97:22: error: no member named 'reduce' in namespace 'std'
  int32_t sum = std::reduce(denseSegmentSizes.asArrayRef().begin(),

Full details are available at:
    https://lab.llvm.org/buildbot#builders/21/builds/78689
2023-08-20 16:57:40 +01:00
Aaron Ballman
c4e4b64c12 [docs] Update the static analyzer bug reporting page
I happened to notice this page (https://clang-analyzer.llvm.org/filing_bugs.html)
was a bit stale, so I've updated and simplified it a bit.

* The page is now explicitly in UTF-8 (NFC)
* We no longer talk about Bugzilla and Apple's bug reporting tools, but
instead link to GitHub's issues page
* We now link to the general LLVM documentation on how to submit a bug

Differential Revision: https://reviews.llvm.org/D158360
2023-08-20 10:49:29 -04:00
Mathieu Fehr
62b2b39992 [mlir][irdl] Support variadicity check in operations
This patch adds support for loading IRDL operations that are
using optional or variadics operands and results.

If an operation declares more than one optional/variadic operand
or result, then it requires the segment sizes in the attribute
dictionary, and otherwise it is computed using the number of
operands or results.

Currently, a variadic operand or result definiton expects all
operands and results in that definition to have the same type.
This restriction will be removed in a following patch.

Depends on D153983

Reviewed By: Mogball, unterumarmung

Differential Revision: https://reviews.llvm.org/D154073
2023-08-20 16:39:30 +01:00
Nico Weber
3d22dac6c3 Revert "[clang][test] Refine clang machine-function-split tests."
This reverts commit b9d079d618.
Breaks tests on Windows, see https://reviews.llvm.org/D157565#4600939
2023-08-20 10:38:29 -04:00
Simon Pilgrim
2c090e9e67 [X86] Add test case for Issue #64655 2023-08-20 15:34:47 +01:00
Simon Pilgrim
9405b67a9e [X86] Add test coverage for PR33879 (Issue #33226)
Ensure we only use the eflags results from shift instructions when it won't cause stalls

shift by variable causes stalls as it has to preserve eflags when the shift amount was zero, so we're better off using a separate test
2023-08-20 15:32:46 +01:00
Mark de Wever
71a7192d69 [libc++][doc] Marks LLVM-17 release notes as final.
Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D158340
2023-08-20 15:47:41 +02:00
Simon Pilgrim
95865e5138 [DAG] SimplifyDemandedBits - if we're only demanding the signbit, a SMIN/SMAX node can be simplified to a OR/AND node respectively.
Alive2: https://alive2.llvm.org/ce/z/MehvFB

REAPPLIED from 54d663d589 with fix for using the correct DemandedBits mask.
2023-08-20 14:20:49 +01:00
Simon Pilgrim
ca10a6caee [X86] Add test coverage for min/max signbit simplification
If we're only demanding the signbit from a min/max then we can simplify this to a logic op
2023-08-20 14:20:49 +01:00
yrong
96377e5cc1 [libc++][expected] Implement LWG3836
Implement LWG3836 (https://wg21.link/LWG3836)
`std::expected<bool, E1>` conversion constructor `expected(const expected<U, G>&)` should take precedence over `expected(U&&)` with operator `bool`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D155701
2023-08-20 20:18:09 +08:00
Timm Bäder
b1aa7cd8a9 [clang][Sema][NFC] Make some locals const in getUndefinedButUsed() 2023-08-20 13:55:25 +02:00
Timm Bäder
6dfe55569d [clang][Interp] Rework initializers
Before this patch, we had visitRecordInitializer() and
visitArrayInitializer(), which were different from the regular visit()
in that they expected a pointer on the top of the stack, which they
initialized. For example, visitArrayInitializer handled InitListExprs by
looping over the members and initializing the elements of that pointer.

However, this had a few corner cases and problems. For example, in
visitLambdaExpr() (a lambda is always of record type), it was not clear
whether we should always create a new local variable to save the lambda
to, or not. This is why https://reviews.llvm.org/D153616 changed
things around.

This patch changes the visiting functions to:

 - visit(): Always leaves a new value on the stack. If the expression
   can be mapped to a primitive type, it's just visited and the value is
   put on the stack. If it's of composite type, this function will
   create a local variable for the expression value and call
   visitInitializer(). The pointer to the local variable will stay on
   the stack.

 - visitInitializer(): Visits the given expression, assuming there is a
   pointer on top of the stack that will be initialized by it.

 - discard(): Visit the expression for side-effects, but don't leave a
   value on the stack.

It also adds an additional Initializing flag to differentiate between the initializing and non-initializing case.

Differential Revision: https://reviews.llvm.org/D156027
2023-08-20 13:33:08 +02:00
Sergei Barannikov
0e79111e4d [AVR][BPF][Lanai][Xtensa] Replace OperandMatchResultTy with ParseStatus (NFC)
ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:
```
  return Error(L, "msg");
```
when with MatchOperandResultTy it had to be:
```
  Error(L, "msg");
  return MatchOperand_ParseFail;
```
It also has more appropriate name since parse* methods are not only for
parsing operands.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D158275
2023-08-20 14:20:28 +03:00
Filipp Zhinkin
08d0b558f5 [SwiftError] Use IMPLICIT_DEF as a definition for unreachable VReg uses
SwiftErrorValueTracking creates vregs at swifterror use sites and then
connects it with appropriate definitions after instruction selection.
To propagate swifterror values SwiftErrorValueTracking::propagateVRegs
iterates over basic blocks in RPO, but some vregs previously created
at use sites may be located in blocks that became unreachable after
instruction selection. Because of that there will no definition for
such vregs and that may cause issues down the pipeline.

To ensure that all vregs created by the SwiftErrorValueTracking will
be defined propagateVRegs was updated to insert IMPLICIT_DEF at the
beginning of unreachable blocks containing swifterror uses.

Related issue: https://github.com/llvm/llvm-project/issues/59751

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D141053
2023-08-20 13:00:31 +02:00
Simon Pilgrim
1b95661616 [AArch64] Regenerate sve-fixed-length-fp-minmax.ll
Should remove the D158053 diffs
2023-08-20 11:46:44 +01:00
Timm Bäder
39236e9c60 [clang][Interp] Fix lifetime diagnostics for dead records
This used to crash the interpreter, either because we ran into the
assertion in CheckMutable() or because we accessed a Descriptor* pointer
preceding the field of a record. Those are preceded by an
InlineDescriptor though.

Differential Revision: https://reviews.llvm.org/D152132
2023-08-20 11:38:29 +02:00
Timm Bäder
8a58f0d370 [clang][Interp] Handle global composite temporaries
We only did this for primitive temporaries.

Unfortunately, the existing Pointer::toAPValue() won't do here, since
we're expected to set an rvalue on the LifetimeExtendedTemporaryDecl.

Differential Revision: https://reviews.llvm.org/D144457
2023-08-20 11:15:17 +02:00
Timm Bäder
ebbedc46f1 [clang][Sema][NFC] Remove TileLoc parameter from getDestructorName()
It's unused.
2023-08-20 11:02:12 +02:00
Timm Bäder
e1dfbc4e24 [clang][Sema][NFC] Modernize ActOnCallExpr 2023-08-20 10:37:58 +02:00
Qihan Cai
fe42682e78 [RISCV][NFC] Rename CVROR, NFC
Previous commit on ALU made an error by changing CV_ROR to CVROR. Revert it.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D158261
2023-08-20 16:36:03 +10:00
Craig Topper
d6cd49dd9a [RISCV][GISel] Add legalizer tests for G_SEXT/ZEXT from s32 to s64 for rv64. 2023-08-19 21:28:48 -07:00
Aiden Grossman
8b6f09e257 Revert "[clang][X86] Add __cpuidex function to cpuid.h"
This reverts commit 58696d2f5b.

Accidentally had this in my branch for my structural hash patch.
2023-08-19 17:18:10 -07:00
Aiden Grossman
64da0be1fc Reland "[NFCi][MergeFunctions] Consolidate Hashing Functions"
This is a reland of 28134a29fd which was
reverted due to behavioral differences between 32 and 64 bit builds that
have since been fixed.

Differential Revision: https://reviews.llvm.org/D158217
2023-08-19 17:14:08 -07:00
Aiden Grossman
58696d2f5b [clang][X86] Add __cpuidex function to cpuid.h
MSVC has a __cpuidex function implemented to call the underlying cpuid
instruction which accepts a leaf, subleaf, and data array that the output
data is written into. This patch adds this functionality into clang
under the cpuid.h header. This also makes clang match GCC's behavior.
GCC has had __cpuidex in its cpuid.h since 2020.
2023-08-19 17:12:23 -07:00