Commit Graph

471972 Commits

Author SHA1 Message Date
Luke Lau
b0af89cbda [emacs] Add regexps for defuns
Previously `M-x mark-defun` and friends wouldn't work properly, and would
highlight something at the top of the buffer. This adds a regexp for top-level
functions so the defun functions should work as expected, and also adds a
regexp for extracting their name so which-function-mode should work now too.

Reviewed By: goldstein.w.n

Differential Revision: https://reviews.llvm.org/D158196
2023-08-21 10:43:41 +01:00
Andrzej Warzynski
b16a7581ff [flang][driver] Disable Clang options in Flang
Restore the desired setting that was reverted in

  https://reviews.llvm.org/D158289.

This is to be merged once Fortran tests in llvm-test-suite are updated
accordingly:

  https://reviews.llvm.org/D158308.

Differential Revision: https://reviews.llvm.org/D158307
2023-08-21 09:27:07 +00:00
LLVM GN Syncbot
ab45b4fef7 [gn build] Port 5f2a7fa67e 2023-08-21 09:19:01 +00:00
Diana Picus
26dc284498 [AMDGPU] ISel for amdgpu_cs_chain[_preserve] functions
Lower formal arguments and returns for functions with the
`amdgpu_cs_chain` and `amdgpu_cs_chain_preserve` calling conventions:

* Put `inreg` arguments into SGPRs, starting at s0, and other arguments
into VGPRs, starting at v8. No arguments should end up on the stack, if
we don't have enough registers we should error out.

* Lower the return (which is always void) as an S_ENDPGM.

* Set the ScratchRSrc register to s48:51, as described in the docs.

* Set the SP to s32, matching amdgpu_gfx. This might be revisited in a
future patch.

Differential Revision: https://reviews.llvm.org/D153517
2023-08-21 11:16:17 +02:00
Alexey Lapshin
5f2a7fa67e [Reland][Reland][DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel.
This patch is extracted from D96035, it adds support for the existing
DWARFLinker functionality. What is not supported yet:

1. Types deduplication(--odr mode).
2. Modules deduplication.
3. Generation of index tables.

Reland2: temporarily disabled call to "--linker llvm" for tls-variable.test
and location-expression.test as it does not work properly on bigendian
architecture.

Differential Revision: https://reviews.llvm.org/D153268
2023-08-21 11:09:18 +02:00
Podchishchaeva, Mariya
91088978d7 [clang] Report missing designated initializers in C++
Prior to this change clang didn't emit missing-field-initializers
warning for designated initializers. The comments say that it is done to
match gcc behavior. However, gcc behaves so only for C. For C++ warnings
are emitted.

Fixes https://github.com/llvm/llvm-project/issues/56628

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D157879
2023-08-21 02:05:34 -07:00
Tuan Chuong Goh
a40c984976 [AArch64][GlobalISel] Support more legal types for EXTEND
Expand (s/z/any)ext instructions to be compatible with more
types for GlobalISel.
This patch mainly focuses on 64-bit and 128-bit vectors with
element size of powers of 2.
It also notably handles larger than legal vectors.

Differential Revision: https://reviews.llvm.org/D157113
2023-08-21 09:51:17 +01:00
LLVM GN Syncbot
b064a2ca18 [gn build] Port fab91e9509 2023-08-21 08:42:40 +00:00
LLVM GN Syncbot
94e14b975b [gn build] Port 23c8d38258 2023-08-21 08:42:39 +00:00
Nikita Popov
fab91e9509 Revert "[Reland][DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel."
This reverts commit 0229dd0626.

This introduces two test failures on s390x.

tools/dsymutil/X86/location-expression.test:

    warning: cann't load line table.
    note: while processing CU1
    /builddir/build/BUILD/llvm-18.0.0.src/test/tools/dsymutil/X86/location-expression.test:20:10: error: CHECK: expected string not found in input
    # CHECK: DW_AT_name{{.*}}"CU1"
             ^
    <stdin>:34:32: note: scanning from here
    0x0000000b: DW_TAG_compile_unit [1] *
                                   ^
    <stdin>:37:2: note: possible intended match here
     DW_AT_name [DW_FORM_strp] ( .debug_str[0x09000000] = )
     ^

tools/dsymutil/X86/tls-variable.test:

    warning: cann't load line table.
    note: while processing CU1
    /builddir/build/BUILD/llvm-18.0.0.src/test/tools/dsymutil/X86/tls-variable.test:19:10: error: CHECK: expected string not found in input
    # CHECK: DW_AT_name{{.*}}"CU1"
             ^
    <stdin>:26:32: note: scanning from here
    0x0000000b: DW_TAG_compile_unit
                                   ^
    <stdin>:29:2: note: possible intended match here
     DW_AT_name ()
     ^
2023-08-21 10:39:25 +02:00
Job Noorman
23c8d38258 [BOLT] Calculate input to output address map using BOLTLinker
BOLT uses MCAsmLayout to calculate the output values of basic blocks.
This means output values are calculated based on a pre-linking state and
any changes to symbol values during linking will cause incorrect values
to be used.

This issue was first addressed in D154604 by adding all basic block
symbols to the symbol table for the linker to resolve them. However, the
runtime overhead of handling this huge symbol table turned out to be
prohibitively large.

This patch solves the issue in a different way. First, a temporary
section containing [input address, output symbol] pairs is emitted to the
intermediary object file. The linker will resolve all these references
so we end up with a section of [input address, output address] pairs.
This section is then parsed and used to:
- Replace BinaryBasicBlock::OffsetTranslationTable
- Replace BinaryFunction::InputOffsetToAddressMap
- Update BinaryBasicBlock::OutputAddressRange

Note that the reason this is more performant than the previous attempt
is that these symbol references do not cause entries to be added to the
symbol table. Instead, section-relative references are used for the
relocations.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D155604
2023-08-21 10:36:20 +02:00
Simon Tatham
b09c575975 [AArch64] Add Defs=[NZCV] to MTE loop pseudos.
The `STGloop` family of pseudo-instructions all expand to a loop which
iterates over a region of memory setting all its MTE tags to a given
value. The loop writes to the flags in order to check termination. But
the unexpanded pseudo-instructions were not marked as modifying the
flags. Therefore it was possible for one to end up in a location where
the flags were live, and then the loop would corrupt them.

We spotted the effect of this in a libc++ test involving a lot of
complicated inlining, and haven't been able to construct a smaller
test case that demonstrates actual incorrect output code. So my test
here is just checking that `implicit-def $nzcv` shows up on the
pseudo-instructions as they're output from isel.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D158262
2023-08-21 09:17:25 +01:00
David Spickett
7549cde6bd [lldb][debugserver] Fix build after libcxx removed generic char_traits implementation
Which was done in https://reviews.llvm.org/D157058. This follows the fix
for lldb-server in https://reviews.llvm.org/D157589.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D158391
2023-08-21 07:50:03 +00:00
Adrian Kuegel
45325a2de9 [mlir][Bazel] Add missing dependencies after 14de5a2a4f 2023-08-21 09:48:44 +02:00
David Spickett
48aeca0480 [flang] Run pic-flags.f90 test in more places
83a06997c6 broke this test but
we only saw the failure on a subset of the flang bots because
it requires 3 target backends, and most of ours only enable AArch64.

Use %if to run as much of the test as we can with the targets
we have.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D158264
2023-08-21 07:41:57 +00:00
Andrzej Warzynski
3758aed31a [flang][driver] Mark -Wl as visible in Flang
Differential Revision: https://reviews.llvm.org/D158309
2023-08-21 07:06:11 +00:00
Serge Pavlov
73e5a70e67 [clang] Run test for concrete target
The test clang/test/SemaCXX/template-64605.cpp uses pragma FENV_ACCESS,
which is not supported on all targets. Restrict it to x86_64 only.
2023-08-21 13:23:06 +07:00
Jannik Silvanus
6f4a6e1db7 [Docs] Fix typo in opaque pointers doc 2023-08-21 08:19:11 +02:00
Kazu Hirata
134115618a [CodeGen] Use isAllOnesConstant and isNullConstant (NFC) 2023-08-20 22:56:40 -07:00
Serge Pavlov
0baf85c331 [clang] Set FP options in Sema when instantiating CompoundStmt
When an expression is instantiated, TreeTransform skips ImplicitCastExpr
nodes, assuming they are recreated when the instantiated expression is
built. It breaks functions that use non-default floating-point options,
because they are kept in these ImplicitCastExprs. In this case the
recreated ImplicitCastExpr takes FP options from the current Sema state
and not from AST node.

To fix this issue the FP options in Sema object are set when a compound
statement is cloned in TreeTransform.

This change fixes https://github.com/llvm/llvm-project/issues/64605
([Regression 16 -> 17] Template instantiation ignores FENV_ACCESS being
ON for both definition and instantiation).

Differential Revision: https://reviews.llvm.org/D158158
2023-08-21 12:36:41 +07:00
Carlos Alberto Enciso
bf69217bae [instcombine] Sunk instructions with invalid source location.
When the 'int Four = Two;' is sunk into the 'case 0:' block,
the debug value for 'Three' is set incorrectly to 'poison'.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D158171
2023-08-21 06:24:21 +01:00
Kazu Hirata
6f31908d20 [StaticAnalyzer] Modernize InvalidationInfo (NFC) 2023-08-20 22:08:04 -07:00
Kazu Hirata
848be08865 [StaticAnalyzer] Modernize DeleteBugVisitor (NFC) 2023-08-20 22:08:02 -07:00
Kazu Hirata
760e0c3537 [StaticAnalyzer] Modernize CFNumberChecker (NFC) 2023-08-20 22:08:01 -07:00
Kazu Hirata
9b987e0896 [Sema] Modernize ShadowMapEntry (NFC) 2023-08-20 22:07:59 -07:00
Kazu Hirata
abed823dfe [Sema] Modernize UsageInfo (NFC) 2023-08-20 22:07:58 -07:00
Senran Zhang
cd7280b6e6 [TableGen] Fix wrong lex result on 64-bit integer boundaries
Binary and decimal values were reconginzed by strtoll, which returns
error when the msb is 1, and the error was ignored, resulting to wrong
results.

This patch fixes the issue.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D157079
2023-08-20 21:46:36 -07:00
Nimish Mishra
2c3ded64bb [flang][OpenMP] Support for common block in copyin clause
This patch adds lowering support for threadprivate
variables encapsulated in a common block and
marked inside a copyin clause.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D157083
2023-08-21 10:01:57 +05:30
Fangrui Song
41e71f500d [GlobalISel] Remove unneeded empty check. NFC 2023-08-20 21:11:13 -07:00
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