Commit Graph

475454 Commits

Author SHA1 Message Date
Pierre van Houtryve
fe2f67e4ba
[AMDGPU] Remove Code Object V2 (#65715)
Code Object V2 has been deprecated for more than a year now. We can
safely remove it from LLVM.

- [clang] Remove support for the `-mcode-object-version=2` option.
- [lld] Remove/refactor tests that were still using COV2
- [llvm] Update AMDGPUUsage.rst
- Code Object V2 docs are left for informational purposes because those
code objects may still be supported by the runtime/loaders for a while.
- [AMDGPU] Remove COV2 emission capabilities.
- [AMDGPU] Remove `MetadataStreamerYamlV2` which was only used by COV2
- [AMDGPU] Update all tests that were still using COV2 - They are either
deleted or ported directly to code object v4 (as v3 is also planned to
be removed soon).
2023-09-21 12:00:45 +02:00
Matthias Springer
315ddc5120
[mlir][linalg][NFC] Make LinalgOp inherit from DestinationStyleOpInterface (#66995)
Dependent interfaces have been added a while ago and these TODOs can be
addressed now.
2023-09-21 11:59:25 +02:00
Piyou Chen
13e9a56854 [RISCV] Add overlapping constraints label
The RISCV-V-Spec[1] describes which RVV instructions are allowed to overlap between source operands and destination operands. Currently, most of these instructions are constrained with early-clobber.

This patch labels these instructions with TargetOverlapConstraintType in pseudo to indicate that these instructions can overlap.

The value of TargetOverlapConstraintType is:

1 -> default
2 -> narrow case
3 -> widen case

This information is useful for future optimization passes.

[1] https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#52-vector-operands

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D157588
2023-09-21 02:39:10 -07:00
LLVM GN Syncbot
0ce4b86efd [gn build] Port a7b78cac9a 2023-09-21 09:32:49 +00:00
David Spickett
a7b78cac9a Revert "[lldb] Add 'modify' type watchpoints, make it default (#66308)"
This reverts commit 933ad5c897.

This caused 1 test failure and an unexpected pass on AArch64 Linux:
https://lab.llvm.org/buildbot/#/builders/96/builds/45765

Wasn't reported because the bot was already red at the time.
2023-09-21 09:30:07 +00:00
Brandon Wu
fe87d62c9e
[RISCV] Move sifive_files to riscv_files (#66872) 2023-09-21 17:26:18 +08:00
Igor Zhukov
910b76a002 [libc++] Implement LWG-3655: The INVOKE operation and union types
https://cplusplus.github.io/LWG/issue3655

Differential Revision: https://reviews.llvm.org/D144645
Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2023-09-21 05:23:41 -04:00
Mirko Brkušanin
923285b139
[AMDGPU] Add gfx1150 SALU Float instructions (#66884) 2023-09-21 11:22:15 +02:00
Guillaume Chatelet
270547f3bf
[libc][clang-tidy] Add llvm-header-guard to get consistant naming and prevent file copy/paste issues. (#66477) 2023-09-21 11:14:47 +02:00
Florian Hahn
1a9358c090
[LV] Relax over-strict assertion for reduction exit value selects.
After f108c6c, (mul x, 1) is simplified to x, which can cause the select
for the final reduction value when tail-folding to use the reduction
value for both options. Relax the assertion to make sure this case is
allowed.

Note that the reduction is now redundant itself and could be further
simplified.

Fixes #66895.
2023-09-21 10:12:29 +01:00
Louis Dionne
8bbcc6d548
[libc++] Add test coverage for unordered containers comparison (#66692)
This patch is a melting pot of changes picked up from
https://llvm.org/D61878. It adds a few tests checking corner cases of
unordered containers comparison and adds benchmarks for a few
unordered_set operations.
2023-09-21 05:11:49 -04:00
Louis Dionne
e46de4e54f
[runtimes] Fix link order of system librarires on Apple platforms (#66940)
On Apple platforms, we always support the -nostdlib++ flag. Hence, it is
not necessary to manually link against system libraries. In fact, doing
so causes us to link against libSystem explicitly, which messes up with
the order of libraries we should use. Indeed:

   Before patch, using the system unwinder (LIBCXXABI_USE_LLVM_UNWINDER = OFF)
   ===========================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         /usr/lib/libSystem.B.dylib
         @rpath/libc++abi.1.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

   After patch, using the system unwinder (LIBCXXABI_USE_LLVM_UNWINDER = OFF)
   ===========================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

   Before patch, with the LLVM unwinder (LIBCXXABI_USE_LLVM_UNWINDER = ON)
   =======================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         /usr/lib/libSystem.B.dylib
         @rpath/libc++abi.1.dylib
         @rpath/libunwind.1.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
         @rpath/libunwind.1.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

   After patch, with the LLVM unwinder (LIBCXXABI_USE_LLVM_UNWINDER = ON)
   ======================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         @rpath/libc++abi.1.dylib
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

As we can see, libSystem appears before the just-built libraries before
the patch, which causes the libunwind.dylib bundled in libSystem.dylib
to be used instead of the just-built libunwind.dylib.

We didn't notice the issue until recently when I tried to update the
macOS CI builders to macOS 13.5, where it is necessary to use the right
libunwind library (the exact reason still needs to be investigated).
2023-09-21 05:10:05 -04:00
Matthias Springer
3bd7a9b47b
[mlir][Interfaces] LoopLikeOpInterface: Add helpers to get region iter_args and inits (#66925)
`AffineForOp::getInitOperands` is renamed to `getInits` to be consistent
with MLIR operand getter naming conventions. ("get" + operand name)
2023-09-21 11:04:35 +02:00
David Spickett
604a231881 [clang][www] Change 'clang-test' to 'check-clang' on the hacking webpage
This change is https://reviews.llvm.org/D49549 ported to the monorepo layout.

Patch by Arnaud Coomans.

Patch title and message:
```
Change 'clang-test' to 'check-clang' on the hacking webpage

The command to run tests was previously changed from 'clang-test' to 'check-clang'; with 'clang-test' remaining available as a legacy alias (see git-svn-id: https://reviews.llvm.org/rC159483 91177308-0d34-0410-b5e6-96231b3b80d8).

This commit changes the www documentation accordingly.
```
2023-09-21 08:42:57 +00:00
Yingwei Zheng
1a73a6b80b
[InstCombine] Add pre-commit tests for PR66733. NFC. 2023-09-21 16:21:53 +08:00
Jevin Jiang
3d51b40c4a Fix induction variable type in scf.for py binding.
- make sure that the type of induction variable should be determined by the type of the lower bound type.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D159534
2023-09-21 08:07:26 +00:00
Nikita Popov
8362cae71b [SimpleLoopUnswitch] Fix exponential unswitch
When unswitching via invariant condition injection, we currently
mark the condition in the old loop, so that it does not get
unswitched again. However, if there are multiple branches for
which conditions can be injected, then we can do that for both
the old and new loop. This means that the number of unswitches
increases exponentially.

Change the handling to be more similar to partial unswitching,
where we instead mark the whole loop, rather than a single
condition. This means that we will only generate a linear number
of loops.

TBH I think even that is still highly undesirable, and we should
probably be unswitching all candidates at the same time, so that
we end up with only two loops. But at least this mitigates the
worst case.

The test case is a reduced variant that generates 1700 lines of IR
without this patch and 290 with it.

Fixes https://github.com/llvm/llvm-project/issues/66868.
2023-09-21 09:47:15 +02:00
Frederic Cambus
ca3ed7b2a0 [clang] Update Clang version from 17 to 18 in scan-build.1.
Similar to D110763.
2023-09-21 09:30:12 +02:00
Corentin Jabot
f7c4261ef2 [Docs] Add requirements.txt for sphinx and extension
This is in preparation towards the move from recommonmark to myst

See #65664
2023-09-21 09:19:06 +02:00
Nikita Popov
8b4e29b35d [X86] Add test for #66984 (NFC) 2023-09-21 09:14:10 +02:00
Sunrise
3542168be0
[clang][AST] fix lack comparison of declRefExpr in ASTStructuralEquivalence (#66041)
Fixed #66047
Before fix,the following testcase expected true.
```cpp
TEST_F(StructuralEquivalenceStmtTest, DeclRefENoEq) {
  std::string Prefix = "enum Test { AAA, BBB };";
  auto t = makeStmts(
      Prefix + "void foo(int i) {if (i > 0) {i = AAA;} else {i = BBB;}}",
      Prefix + "void foo(int i) {if (i > 0) {i = BBB;} else {i = AAA;}}",
      Lang_CXX03, ifStmt());
  EXPECT_FALSE(testStructuralMatch(t)); // EXPECT_TRUE
}
```
2023-09-21 14:55:19 +08:00
Job Noorman
dc925be68b
[BOLT][RISCV] Carry-over annotations when fixing calls (#66763)
`FixRISCVCallsPass` changes all different forms of calls to `PseudoCALL`
instructions. However, the original call's annotations were lost in the
process.

This patch fixes this by moving all annotations from the old to the new
call. `MCPlusBuilder::moveAnnotations` had to be made public for this.
2023-09-21 06:37:47 +00:00
Ben Barham
265d48a02d
Re-apply "[Parse] Split incremental-extensions" (#66446)
Re-applies #65683 with a fix to always run
`Actions.ActOnEndOfTranslationUnit` regardless of incremental
processing.
2023-09-20 23:35:34 -07:00
Congcong Cai
4bc4d51c18
[Demangle] demangle builtin type transformations (#65902)
Fixed: https://github.com/llvm/llvm-project/issues/62127
https://reviews.llvm.org/D116203 introduced several compiler builtin
equivalents of the unary type traits. In some cases (e.g. template)
those builtin will be dependent and need to be mangle.
This patch add the check for `u{builtin}I{type}E` to demangle it.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D148465
2023-09-21 14:23:58 +08:00
Pranav Taneja
6d9b96313d
[AMDGPU] [SIFrameLowering] Use LiveRegUnits instead of LivePhysRegs. 2023-09-21 11:49:46 +05:30
Fangrui Song
001af0f894 [MC] Actually make .pseudoprobe created sections deterministic
Fix a18ee8b7c9 to use a comparator
that actually works: assign an ordinal to registered section.
2023-09-20 22:41:28 -07:00
Vitaly Buka
08aeac0387 [NFC][hwasan] Store shadow bytes early (#66682) 2023-09-20 22:14:28 -07:00
Vitaly Buka
6d9857167a Revert "[NFC][hwasan] Store shadow bytes early (#66682)"
InvalidFreeReport prints invalid ptr/mem.

This reverts commit 7641c220a0.
2023-09-20 22:14:28 -07:00
Qizhi Hu
b8f056de02
[clang][AST][ASTImporter] improve AST comparasion on VarDecl & GotoStmt (#66976)
improve AST comparasion on VarDecl & GotoStmt:
  1. VarDecl should not be ignored,
  2. GotoStmt has no children, it should be handle explicitly.

Reviewed By: donat.nagy

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

Co-authored-by: huqizhi <836744285@qq.com>
2023-09-21 13:13:43 +08:00
Jason Molenda
1a784444b3 Temoprarily stop running this test on Intel macs
The test is expecting watchpoint hits that are valid on aarch64
systems but not on Intel.  I need to update this test to match the
actual behavior on Intel macs, and don't want the CI bots to stay
broken while I get that figured out.
2023-09-20 21:49:15 -07:00
HaohaiWen
954979d681 Reland [InlineCost] Enable the cost benefit analysis for Sample PGO (#66457)
Enables the cost-benefit-analysis-based inliner by default if we have
sample profile.

No extra fix is required.
2023-09-21 12:44:24 +08:00
Vitaly Buka
7641c220a0 [NFC][hwasan] Store shadow bytes early (#66682) 2023-09-20 21:26:20 -07:00
Vitaly Buka
ac750e237b [NFC][hwasan] Stored tail early (#66682) 2023-09-20 21:03:06 -07:00
Vitaly Buka
ddedad8070 [NFC][hwasan] Use stored chunk in TailOverwrittenReport (#66682) 2023-09-20 21:03:06 -07:00
Vitaly Buka
5cd0e5d047 [NFC][hwasan] Set more fields by value and make them const (#66682) 2023-09-20 21:03:06 -07:00
Vitaly Buka
58fdfe77ef [NFC][hwasan] More consts in BaseReport (#66682) 2023-09-20 20:56:21 -07:00
Andrew Gozillon
171d8c4028 [Flang][OpenMP][MLIR] Fix memory leak caused by D149368 causing sanitizer error and fix iterator invalidation error
This patch fixes two issues introduced by the D149368 patch, one is
a memory leak from using the removeFromParent rather
than eraseFromParent (the erase also had to be moved to not create
use after deletes).

And the other is a possible iterator invalidation bug, better to be safe
than sorry.
2023-09-20 22:28:11 -05:00
NAKAMURA Takumi
fd4bac49ab [Bazel] Follow up for ac182deee8 (D76445), RISCVGenGlobalISel.inc
RISCVGenGlobalISel.inc should be generated with RISCVGISel.td,
or generated binary would differ.

Unfortunately, buildkite didn't catch the issue.
2023-09-21 12:13:12 +09:00
Haohai Wen
486fc81583 Revert "[InlineCost] Enable the cost benefit analysis for Sample PGO (#66457)"
This reverts commit 2f2319cf24.
2023-09-21 10:30:39 +08:00
Craig Topper
cbd4596168 Recommmit "[RISCV] Improve contant materialization to end with 'not' if the cons… (#66950)"
With MC test updates.

Original commit message

We can invert the value and treat it as if it had leading zeroes.
2023-09-20 18:51:51 -07:00
Jan Svoboda
69074bf144 [clang] NFCI: Use FileEntryRef in FileManagerTest 2023-09-20 18:41:25 -07:00
Jan Svoboda
3de1e30c9a [clang] NFCI: Use FileEntryRef in SymbolCollector 2023-09-20 18:41:25 -07:00
HaohaiWen
2f2319cf24
[InlineCost] Enable the cost benefit analysis for Sample PGO (#66457)
Enables the cost-benefit-analysis-based inliner by default if we have
sample profile.
2023-09-21 09:21:55 +08:00
Fangrui Song
a18ee8b7c9 [MC] Make .pseudo_probe created sections deterministic after D91878
MCPseudoProbeSections::emit iterates over MCProbeDivisions and creates sections.
When the map key is MCSymbol *, the iteration order is not stable. The
underlying BumpPtrAllocator largely decreases the flakiness. That said, two
elements may sit in two different allocations from BumpPtrAllocator, with
an unpredictable order. Under tcmalloc,
llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll fails about 7 times per
1000 runs.
2023-09-20 18:11:14 -07:00
Matheus Izvekov
4914d33b6f
-fsanitize=function: Add a (bugged) test case for a sugared function type 2023-09-21 02:57:49 +02:00
Matheus Izvekov
2ed0453b10
-fsanitize=function: Add a MSVC test case 2023-09-21 02:56:57 +02:00
Fangrui Song
2147e9e09f [SystemZ] Fix IWYU
The file should include <map> instead of relying on the transitive include from
MC/MCPseudoProbe.h.
2023-09-20 17:54:32 -07:00
Jim Ingham
3c61e4bf28 Copy and paste error in a file header. 2023-09-20 17:43:44 -07:00
Jim Ingham
de94c109b6 The test: test_run_then_attach_wait_interrupt was flakey on Linux & Windows.
I changed the test so I could tell whether the problem was sometimes the
interrupt was failing, or maybe the was just racy.  It failed again, but
in the new failures we waited 20 seconds for the attach-wait to get interrupted
and that never happened.

So there seems to be some real raciness in the feature of interrupting an
attach-wait, but only on Linux & Windows.  The bug fix that this test was
testing was for a bug that would cause us to never try to interrupt in this
case.  So it looks like this test is uncovering some flakiness in the underlying
interrupt support when in this state.  That's a separate bug that needs fixing.

For now, I disabled the test except on macOS where it seems to run reliably.
2023-09-20 17:38:27 -07:00
Shoaib Meenai
61c5ad8857
[Sema] Fix fixit cast printing inside macros (#66853)
`Lexer::getLocForEndOfToken` is documented as returning an invalid
source location when the end of the token is inside a macro expansion.
We don't want that for this particular application, so just calculate
the end location directly instead.

Before this, format fix-its would omit the closing parenthesis (thus
producing invalid code) for macros, e.g.:

```
$ cat format.cpp
extern "C" int printf(const char *, ...);
enum class Foo { Bar };
#define LOG(...) printf(__VA_ARGS__)
void f(Foo foo) { LOG("%d\n", foo); }

$ clang -fsyntax-only format.cpp
format.cpp:4:29: warning: format specifies type 'int' but the argument has type 'Foo' [-Wformat]
    4 | void f(Foo f) { LOG("%d\n", f); }
      |                      ~~     ^
      |                             static_cast<int>(
format.cpp:3:25: note: expanded from macro 'LOG'
    3 | #define LOG(...) printf(__VA_ARGS__)
      |                         ^~~~~~~~~~~
1 warning generated.
```

We now emit a valid fix-it:

```
$ clang -fsyntax-only format.cpp
format.cpp:4:31: warning: format specifies type 'int' but the argument has type 'Foo' [-Wformat]
    4 | void f(Foo foo) { LOG("%d\n", foo); }
      |                        ~~     ^~~
      |                               static_cast<int>( )
format.cpp:3:25: note: expanded from macro 'LOG'
    3 | #define LOG(...) printf(__VA_ARGS__)
      |                         ^~~~~~~~~~~
1 warning generated.
```

Fixes https://github.com/llvm/llvm-project/issues/63462
2023-09-20 17:32:35 -07:00