Aiden Grossman [Sat, 20 May 2023 09:50:43 +0000 (09:50 +0000)]
[llvm-exegesis] Introduce SubprocessMemory Utility Class
This patch introduces the SubprocessMemory class to llvm-exegesis. This
class contains several utilities that are needed for managing memory to
set up an execution environment for memory annotations.
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D151022
Wang Rui [Mon, 26 Jun 2023 02:32:24 +0000 (10:32 +0800)]
[LoongArch] Optimize conditional selection of integer
This patch optimizes code generation by leveraging the zeroing behavior of the `maskeqz`/`masknez` instructions.
```
int sel(int a, int b)
{
return (a < b) ? a : 0;
}
```
```
slt $a1,$a0,$a1
masknez $a2,$r0,$a1
maskeqz $a0,$a0,$a1
or $a0,$a0,$a2
```
=>
```
slt $a1,$a0,$a1
maskeqz $a0,$a0,$a1
```
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D153193
Weining Lu [Mon, 26 Jun 2023 02:30:42 +0000 (10:30 +0800)]
Revert "[LoongArch] Optimize conditional selection of integer"
This reverts commit
3dd319ecf3be64598ea84d1730033854cade7123.
Sorry, I forgot to amend the author name and email when merging this
patch.
Aiden Grossman [Sat, 20 May 2023 09:23:27 +0000 (09:23 +0000)]
[llvm-exegesis] Introduce Subprocess Executor Mode
This patch introduces the subprocess executor mode. Currently, this new
mode doesn't do anything fancy, just executing the same code that the
inprocess executor would do, but within a subprocess. This sets up the
ability to add in many more memory-related features in the future.
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D151021
Younan Zhang [Sun, 25 Jun 2023 16:33:16 +0000 (00:33 +0800)]
[clang] Fix a crash on invalid destructor
This is a follow-up patch to D126194 in order to
fix https://github.com/llvm/llvm-project/issues/63503.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D153724
Jie Fu [Mon, 26 Jun 2023 00:59:37 +0000 (08:59 +0800)]
[SimplifyCFG] Remove unused variable 'Inc' (NFC)
/data/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6051:10: error: unused variable 'Inc' [-Werror,-Wunused-variable]
bool Inc, Wrapped = false;
^
1 error generated.
Aiden Grossman [Sun, 25 Jun 2023 23:46:22 +0000 (23:46 +0000)]
[llvm-exegesis] Add ability to assign perf counters to specific PID
This patch gives the ability to assign performance counters within
llvm-exegesis to a specific process by passing its PID. This is needed
later on for implementing a subprocess executor. Defaults to zero, the
current process, for the InProcessFunctionExecutorImpl.
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D151020
khei4 [Mon, 19 Jun 2023 03:57:29 +0000 (12:57 +0900)]
[SimplifyCFG] add nsw on BuildLookuptable LinearMap calculation
Differential Revision: https://reviews.llvm.org/D150943
khei4 [Mon, 19 Jun 2023 03:57:07 +0000 (12:57 +0900)]
[SimplifyCFG] precommit test for LinearMap nsw (NFC)
Differential Revision: https://reviews.llvm.org/D153238
Matt Arsenault [Sun, 25 Jun 2023 15:23:15 +0000 (11:23 -0400)]
RegAllocGreedy: Fix assert with remarks on unassigned subregisters
This tried to query the physical subregister on virtual registers
if they were left unassigned.
Matt Arsenault [Sun, 25 Jun 2023 21:16:10 +0000 (17:16 -0400)]
AMDGPU: Handle the easy parts of strict fptrunc
f64->f16 is hard. The expansion is all integer but we need
to raise exceptions. Also doesn't handle the illegal f16 targets.
Matt Arsenault [Sun, 25 Jun 2023 20:39:15 +0000 (16:39 -0400)]
AMDGPU: Handle constrained fpext
Amaury Séchet [Sun, 25 Jun 2023 22:56:42 +0000 (22:56 +0000)]
[NFC] Autogenerate CodeGen/AMDGPU/combine-reg-or-const.ll
Amaury Séchet [Sun, 25 Jun 2023 21:19:27 +0000 (21:19 +0000)]
[NFC] Autogenerate CodeGen/PowerPC/tail-dup-break-cfg.ll
Niwin Anto [Sun, 25 Jun 2023 21:39:56 +0000 (14:39 -0700)]
[AArch64][GlobalISel] IR translate support for a return instruction of type <1 x i8> or <1 x i16> when using GlobalISel.
Code generation for return instruction of type <1 x i8> or <1 x i16> when using GlobalISel causes internal compiler crash Could not handle ret ty.
Fixes: https://github.com/llvm/llvm-project/issues/58211
Differential Revision: https://reviews.llvm.org/D153300
Tobias Stadler [Sun, 25 Jun 2023 05:08:50 +0000 (22:08 -0700)]
[AArch64][GlobalISel] Select G_UADDE/G_SADDE/G_USUBE/G_SSUBE
This implements the remaining overflow generating instructions in the AArch64
GlobalISel selector. Now wide add/sub operations do not fallback to SelectionDAG
anymore. We make use of PostSelectOptimize to cleanup the hereby generated
flag-setting operations when the carry-out is unused. Since we do not fallback
anymore when selecting add/sub atomics on O0 some test changes were required
there.
Fixes: https://github.com/llvm/llvm-project/issues/59407
Differential Revision: https://reviews.llvm.org/D153164
Amaury Séchet [Sun, 25 Jun 2023 21:05:06 +0000 (21:05 +0000)]
[NFC] Autogenerate CodeGen/PowerPC/pr40922.ll
Piotr Zegar [Sun, 25 Jun 2023 19:40:52 +0000 (19:40 +0000)]
Revert "[clang-tidy] Add modernize-printf-to-std-print check"
This reverts commit
81418ada06abbeba9fd0ea17282cce542cd07706.
Mike Crowe [Sun, 25 Jun 2023 17:38:09 +0000 (17:38 +0000)]
[clang-tidy] Add modernize-printf-to-std-print check
Add FormatStringConverter utility class that is capable of converting
printf-style format strings into std::print-style format strings along
with recording a set of casts to wrap the arguments as required and
removing now-unnecessary calls to std::string::c_str() and
std::string::data()
Use FormatStringConverter to implement a new clang-tidy check that is
capable of converting calls to printf, fprintf, absl::PrintF,
absl::FPrintF, or any functions configured by an option to calls to
std::print and std::println, or other functions configured by options.
In other words, the check turns:
fprintf(stderr, "The %s is %3d\n", description.c_str(), value);
into:
std::println(stderr, "The {} is {:3}", description, value);
if it can.
std::print and std::println can do almost anything that standard printf
can, but the conversion has some some limitations that are described in
the documentation. If conversion is not possible then the call remains
unchanged.
Depends on D153716
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D149280
Mike Crowe [Sun, 25 Jun 2023 16:41:48 +0000 (16:41 +0000)]
[ASTMatchers] Add argumentCountAtLeast narrowing matcher
This will be used by the modernize-use-std-print clang-tidy check and
related checks later.
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D153716
Nico Weber [Sun, 25 Jun 2023 18:32:36 +0000 (14:32 -0400)]
Revert "[COFF] Support -gsplit-dwarf for COFF on Windows"
This reverts commit
3eee5aa528abd67bb6d057e25ce1980d0d38c445.
Breaks tests on mac, see https://reviews.llvm.org/D152785#4447118
Florian Hahn [Sun, 25 Jun 2023 16:07:21 +0000 (17:07 +0100)]
[ConstraintElim] Add tests with condition used in phi.
Add extra tests where conditions are used in phis for D153660.
Florian Hahn [Sun, 25 Jun 2023 15:58:44 +0000 (16:58 +0100)]
[ConstraintElim] Add uses to remark tests to make it more robust.
Add uses of conditions, so the test keeps testing what it is meant to
test after D153660.
Takuya Shimizu [Sun, 25 Jun 2023 15:27:15 +0000 (00:27 +0900)]
[clang][Diagnostics] Provide parameter source range to arity-mismatch notes
Consider the following piece of code:
```
void func( int aa,
int bb,
int cc) {}
void arity_mismatch() {
func(2, 4);
}
```
BEFORE:
```
source.cpp:6:3: error: no matching function for call to 'func'
6 | func(2, 4);
| ^~~~
source.cpp:1:6: note: candidate function not viable: requires 3 arguments, but 2 were provided
1 | void func( int aa,
| ^
```
AFTER:
```
source.cpp:6:3: error: no matching function for call to 'func'
6 | func(2, 4);
| ^~~~
source.cpp:1:6: note: candidate function not viable: requires 3 arguments, but 2 were provided
1 | void func( int aa,
| ^ ~~~~~~~
2 | int bb,
| ~~~~~~~
3 | int cc) {}
| ~~~~~~
```
Reviewed By: cjdb, aaron.ballman
Differential Revision: https://reviews.llvm.org/D153267
Elliot Goodrich [Sun, 25 Jun 2023 15:09:36 +0000 (16:09 +0100)]
Revert "[llvm] Move StringExtras.h include from Error.h to Error.cpp"
This reverts commit
2fa0dbd7bf353db98b27b56137cced0a67de2748.
Elliot Goodrich [Sat, 17 Jun 2023 12:18:23 +0000 (13:18 +0100)]
[llvm] Move StringExtras.h include from Error.h to Error.cpp
Move the implementation of the `toString` function from
`llvm/Support/Error.h` to the source file, which allows us to move
`#include "llvm/ADT/StringExtras.h"` to the source file as well.
As `Error.h` is present in a large number of translation units this
means we are unnecessarily bringing in the contents of
`StringExtras.h` - itself a large file with lots of includes - and
slowing down compilation.
Also move the `#include "llvm/ADT/SmallVector.h"` directive to the
source file as it's no longer needed, but this does not give as much of
a benefit.
This reduces the total number of preprocessing tokens across the LLVM
source files in lib from (roughly) 1,920,413,050 to 1,903,629,230 - a
reduction of ~0.87%. This should result in a small improvement in
compilation time.
Differential Revision: https://reviews.llvm.org/D153229
Elliot Goodrich [Sat, 17 Jun 2023 12:18:23 +0000 (13:18 +0100)]
[llvm] Add missing StringExtras.h includes
In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing includes that were previously included transitively
through this header.
Corentin Jabot [Sun, 25 Jun 2023 08:26:30 +0000 (10:26 +0200)]
[Clang][NFC] Add feature test macro checks for C++2c
Craig Topper [Sun, 25 Jun 2023 07:48:26 +0000 (00:48 -0700)]
[RISCV] Add missing Read classes to some compressed instructions.
Reviewed By: wangpc
Differential Revision: https://reviews.llvm.org/D153669
Craig Topper [Sun, 25 Jun 2023 07:47:56 +0000 (00:47 -0700)]
[RISCV] Add GPR bypasses for most scalar integer instructions to the SiFive7 scheduler model.
SiFive7's scalar execution consists of 4 stages AG, M1, M2, WB.
Most simple arithmetic and branch instructions can execute in
either AG or M2.
If the operands are ready, the instruction will execute in the AG
stage. Otherwise, it executes in the M2 stage. Everything is fully
bypassed, so dependent instructions should only see 1 cycle latency.
This patch adds ReadAdvances to pretend that these instructions
execute in the M2 ALU and reads their operands then. This allows
the scheduler to schedule dependent instructions back to back.
I've increased branch latency to 3 since they are also executed in both
stages. Still need to fix JALR, but I want to cleanup some scheduler
classes first.
Multiply, cpop and division instructions can only start in the AG stage.
Still need to do some work for FP instructions that produce integer results.
I've added an llvm-mca test that creates a long dependency chain.
The timeline view can show that things are bypassed. I
didn't check all permutations, but we have some variety.
Reviewed By: wangpc
Differential Revision: https://reviews.llvm.org/D153666
David Green [Sun, 25 Jun 2023 07:44:43 +0000 (08:44 +0100)]
[AArch64] Add SVE tests for double reducts of vector.reduce.fmaximum/fminimum. NFC
Now that the SVE parts are in, we can fill in the double reduction tests
without them causing problems.
Iain Sandoe [Mon, 12 Jun 2023 19:38:02 +0000 (20:38 +0100)]
[C++20][Modules] Complete implementation of module.import p7.
The following test fails to compile TU b.cpp because we are not making the transitively imported modules visible (per [module.import]/p7)
```
a.cppm:
export module a;
export int foo() {
return 42;
}
b.cppm:
export module b;
import a;
export int bar();
b.cpp:
module b;
int bar() {
return foo();
}
clang++ -c -std=c++2b -fmodule-output a.cppm
clang++ -c -std=c++2b -fmodule-output -fprebuilt-module-path=. b.cppm
clang++ -c -std=c++2b -fprebuilt-module-path=. b.cpp
b.cpp:4:12: error: declaration of 'foo' must be imported from module 'a' before it is required
return foo();
```
This is fixed by the following patch (which also addresses a FIXME in basic.def.odr/p6.cppm).
Differential Revision: https://reviews.llvm.org/D152746
Fangrui Song [Sun, 25 Jun 2023 05:44:06 +0000 (22:44 -0700)]
[BPF] Remove unused legacy passes after TargetMachine::adjustPassManager removal
D137796 made these passes unused.
`opt --bpf-ir-peephole` is specified in one test. Add a `registerPipelineParsingCallback`
so that we can use change the test to use `opt --passes=bpf-ir-peephole` instead.
Haohai Wen [Sun, 25 Jun 2023 03:54:23 +0000 (11:54 +0800)]
[COFF] Support -gsplit-dwarf for COFF on Windows
D152340 has split WinCOFFObjectWriter to WinCOFFWriter. This patch adds
another WinCOFFWriter as DwoWriter to write Dwo sections to dwo file.
Driver options are also updated accordingly to support -gsplit-dwarf in
CL mode.
e.g. $ clang-cl -c -gdwarf -gsplit-dwarf foo.c
Like what -gsplit-dwarf did in ELF, using this option will create DWARF object
(.dwo) file. DWARF debug info is split between COFF object and DWARF object
file. It can reduce the executable file size especially for large project.
Reviewed By: skan, MaskRay
Differential Revision: https://reviews.llvm.org/D152785
Vaibhav Thakkar [Sun, 25 Jun 2023 02:27:10 +0000 (19:27 -0700)]
[clang] Fix pretty-printing for variables declared in a for-loop condition
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D153699
Shao-Ce SUN [Sat, 24 Jun 2023 15:04:49 +0000 (23:04 +0800)]
[flang] Rename remaining `__Fortran_PPC_intrinsics` to `__ppc_intrinsics`
Reviewed By: kkwli0
Differential Revision: https://reviews.llvm.org/D153703
Amaury Séchet [Sun, 25 Jun 2023 01:27:29 +0000 (01:27 +0000)]
[NFC] Autogenerate CodeGen/PowerPC/select-i1-vs-i1.ll
Amaury Séchet [Sun, 25 Jun 2023 01:05:21 +0000 (01:05 +0000)]
[NFC] Autogenerate CodeGen/ARM/2013-07-29-vector-or-combine.ll
Amaury Séchet [Sun, 25 Jun 2023 01:02:49 +0000 (01:02 +0000)]
[NFC] Autogenerate CodeGen/ARM/2011-03-15-LdStMultipleBug.ll
Amaury Séchet [Sun, 25 Jun 2023 00:55:03 +0000 (00:55 +0000)]
[NFC] Autogenerate CodeGen/ARM/and-sext-combine.ll
Amaury Séchet [Sun, 25 Jun 2023 00:44:30 +0000 (00:44 +0000)]
[NFC] Autogenerate CodeGen/ARM/machine-cse-cmp.ll
Amaury Séchet [Sun, 25 Jun 2023 00:14:07 +0000 (00:14 +0000)]
[NFC] Autogenerate CodeGen/ARM/pr35103.ll
yronglin [Sun, 25 Jun 2023 00:14:55 +0000 (08:14 +0800)]
[libc++][ranges] Implement P2494R2 (Relaxing range adaptors to allow for move only types)
Implement P2494R2 `Relaxing range adaptors to allow for move only types`
https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2494r2.html#wording-ftm
According to the words in P2494R2, I haven't add new test for `drop_while_view`, `take_while_view` and `filter_view`, because these views has the requirement that the predicate is an `indirect_unary_predicate`, which requires that the predicate is `copy_constructible`, so they still can't accept move only types as predicate.
```
[P2483R0] also suggests future work to relax the requirements on the predicate types stored by standard views. This paper does not perform this relaxation, as the copy constructibility requirement is enshrined in the indirect callable concepts ([indirectcallable.indirectinvocable]). Thus, while this paper modifies the views that currently use copyable-box for user provided predicates, it only does so to apply the rename of the exposition-only type to movable-box; it does not change any of the constraints on those views. It does, however, relax the requirements on invocables accepted by the transform family of views, because those are not constrained using the indirect callable concepts.
```
Reviewed By: #libc, var-const
Differential Revision: https://reviews.llvm.org/D151629
Jacques Pienaar [Sun, 25 Jun 2023 00:03:37 +0000 (17:03 -0700)]
[mlir][polyapprox] Use llvm::numbers for constants.
Fixes windows build.
Dave Lee [Sat, 24 Jun 2023 22:00:38 +0000 (15:00 -0700)]
[lldb] Use LLDB_LOGF for printf format strings in AppleObjCDeclVendor.cpp
Fangrui Song [Sat, 24 Jun 2023 18:07:12 +0000 (11:07 -0700)]
[DWARF] Remove remnant .zdebug section recognition
There is a minor behavior difference that is not worth testing for the obsoleted
format. Previously, llvm-dwarfdump considers .zdebug_info as a debug section but
does not decompress it, leading to a warning when the content cannot be parsed.
Now llvm-dwarfdump just ignores the section without a warning.
Ian Anderson [Mon, 5 Jun 2023 22:08:54 +0000 (15:08 -0700)]
[libc++] Remove the type_traits includes from limits and new
type_traits is currently unable to include __type_traits/noexcept_move_assign_container.h, because it would cause several include cycles.
type_traits -> __type_traits/noexcept_move_assign_container.h -> __memory/allocator_traits.h -> __memory/construct_at.h -> new -> exception -> type_traits
type_traits -> __type_traits/noexcept_move_assign_container.h -> __memory/allocator_traits.h -> __memory/construct_at.h -> new -> type_traits
type_traits -> __type_traits/noexcept_move_assign_container.h -> __memory/allocator_traits.h -> limits -> type_traits
This is a problem for clang modules after the std mega module is broken up (D144322), because it becomes a module cycle which is a hard error.
Unconditionally remove the type_traits includes from limits and new in all versions, and also remove the exception include from new. (These are already removed in C++23.)
Reviewed By: ldionne, Mordante, #libc
Differential Revision: https://reviews.llvm.org/D153214
Fangrui Song [Sat, 24 Jun 2023 17:06:17 +0000 (10:06 -0700)]
[DWARF] Adjust warning condition for .dwo sections with relocations
D106624 added a .dwo warning (when there are relocations) that may fire for
non-debug sections, e.g. `.rodata.dwo` when there is a data symbol foo in
-fdata-sections mode. Adjust it to only warn for .debug sections.
While here, change the diagnostic to be more conventional
https://llvm.org/docs/CodingStandards.html#error-and-warning-messages and use
the relocated section name instead of the relocation section name.
This change does not handle `.zdebug` (support was mostly removed from LLVM) or
`__debug` (Mach-O, no DWO support).
Reviewed By: ayermolo, HaohaiWen
Differential Revision: https://reviews.llvm.org/D153602
Shao-Ce SUN [Sat, 24 Jun 2023 16:32:42 +0000 (00:32 +0800)]
[openmp] remove initializeRewriteSymbolsLegacyPassPass
Fix build error caused by D153679
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D153704
Piotr Fusik [Sat, 24 Jun 2023 16:27:06 +0000 (18:27 +0200)]
[libc++] Add noexcept clauses to swap per P0408R7 (Efficient Access to basic_stringbuf's Buffer)
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D153427
Thorsten Schütt [Sat, 24 Jun 2023 05:36:23 +0000 (07:36 +0200)]
[GlobalIsel][X86]] Legalize G_CONSTANT_FOLD_BARRIER
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D153684
Hristo Hristov [Mon, 19 Jun 2023 17:45:03 +0000 (20:45 +0300)]
[libc++][ranges] Addresses: LWG3719 - Directory iterators should be usable with default sentinel
Addresses: LWG3719 - Directory iterators should be usable with default sentinel
https://wg21.link/LWG3719
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D153299
Nathan James [Sat, 24 Jun 2023 14:18:20 +0000 (14:18 +0000)]
[clang-tidy] Fix false negative in readability-convert-member-functions-to-static
A nested class in a member function can erroneously confuse the check into
thinking that any CXXThisExpr found relate to the outer class, preventing any warnings.
Fix this by not traversing any nested classes.
Fixes https://github.com/llvm/llvm-project/issues/56765
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D130665
Kazu Hirata [Sat, 24 Jun 2023 14:33:54 +0000 (07:33 -0700)]
[CodeGen] Remove unused forward declaration Value
The last use was removed by:
commit
7d894374551f6d5787db0aef2da8dd6aefa616fb
Author: OCHyams <orlando.hyams@sony.com>
Date: Thu Mar 16 08:48:36 2023 +0000
Kazu Hirata [Sat, 24 Jun 2023 14:33:52 +0000 (07:33 -0700)]
[CodeGen] Remove unused forward declarations Instruction and Type
The last uses were removed by:
commit
79b3f0823e562fc652c3272b2ccfb99174445fa6
Author: Tim Northover <tnorthover@apple.com>
Date: Tue Feb 7 11:28:00 2023 +0000
Kazu Hirata [Sat, 24 Jun 2023 14:33:50 +0000 (07:33 -0700)]
[LegacyPM] Remove RewriteSymbolsLegacyPass
Differential Revision: https://reviews.llvm.org/D153679
Kazu Hirata [Sat, 24 Jun 2023 14:33:49 +0000 (07:33 -0700)]
[LegacyPM] Remove PlaceSafepointsLegacyPass
Differential Revision: https://reviews.llvm.org/D153678
Kazu Hirata [Sat, 24 Jun 2023 13:59:52 +0000 (06:59 -0700)]
[CodeGen] Remove unused forward declaration DominatorTree
The last use was removed by:
commit
73523021d0a97c150a76a5cf4a91e99cd03b9efb
Author: Chandler Carruth <chandlerc@gmail.com>
Date: Mon Jan 13 13:07:17 2014 +0000
Kazu Hirata [Sat, 24 Jun 2023 13:59:50 +0000 (06:59 -0700)]
[Analysis] Remove unused forward declaration PhiValues
The last use was removed by:
commit
243acd5dcbc637e477062877185ad76d8ff63d9d
Author: Nikita Popov <npopov@redhat.com>
Date: Fri Dec 9 15:29:35 2022 +0100
Kazu Hirata [Sat, 24 Jun 2023 13:59:49 +0000 (06:59 -0700)]
[Analysis] Remove unused forward declaration GetElementPtrInst
The last use was removed by:
commit
2d79b713663169b3732fcbdf56cac243b5c41e28
Author: Philip Reames <preames@rivosinc.com>
Date: Thu Apr 6 08:23:08 2023 -0700
Kazu Hirata [Sat, 24 Jun 2023 13:59:47 +0000 (06:59 -0700)]
[Analysis] Remove unused forward declaration BasicAAResult
The last use was removed by:
commit
f9b523ebc367f1535bf61797383471e567b24b75
Author: Kazu Hirata <kazu@google.com>
Date: Wed May 31 07:30:14 2023 -0700
LLVM GN Syncbot [Sat, 24 Jun 2023 11:01:56 +0000 (11:01 +0000)]
[gn build] Port
7f6e0052a97f
Piotr Zegar [Sat, 24 Jun 2023 10:59:30 +0000 (10:59 +0000)]
[clang-tidy] Add misc-header-include-cycle check
Check detects cyclic #include dependencies between user-defined headers.
Reviewed By: njames93
Differential Revision: https://reviews.llvm.org/D144828
David Green [Sat, 24 Jun 2023 10:12:58 +0000 (11:12 +0100)]
[AArch64] Add SVE lowering for vector.reduce.fminimum and fmaximum
Following what is already performed for vector.reduce.fmin/fmax, this adds
lowering for the new vector.reduce.fminimum/fmaximum nodes to the SVE fminv
and fmaxv instructions via the existing FMINV_PRED/FMAXV_PRED nodes.
Differential Revision: https://reviews.llvm.org/D153288
Piotr Zegar [Sat, 24 Jun 2023 08:41:52 +0000 (08:41 +0000)]
Revert "[clang-tidy] Add misc-header-include-cycle check"
This reverts commit
f3aa6cc0f5d56752242203c2a9231c1bc230c15e.
Piotr Zegar [Sat, 24 Jun 2023 07:01:32 +0000 (07:01 +0000)]
[clang-tidy] Add misc-header-include-cycle check
Check detects cyclic #include dependencies between user-defined headers.
Reviewed By: njames93
Differential Revision: https://reviews.llvm.org/D144828
Iain Sandoe [Wed, 14 Jun 2023 18:48:04 +0000 (19:48 +0100)]
[C++20][Modules] Implement P2615R1 revised export diagnostics.
It has been reported to that the current clang errors for, specifically,
static_assert in export contexts are a serious blocker to adoption of
modules in some cases.
There is also implementation divergence with GCC and MSVC allowing the
constructs mentioned below where clang currently rejects them with an
error.
The category of errors [for declarations in an exported context] is:
(unnamed, static_assert, empty and asm decls). These are now permitted
after P2615R1 which was approved by WG21 as a DR (and thus should be
applied to C++20 as well).
This patch removes these diagnostics and amends the testsuite accordingly.
Differential Revision: https://reviews.llvm.org/D152946
Johannes Doerfert [Sat, 24 Jun 2023 07:24:02 +0000 (00:24 -0700)]
[Attributor] Avoid more AAs through IR implication
Johannes Doerfert [Sat, 24 Jun 2023 07:25:22 +0000 (00:25 -0700)]
[Attributor] Avoid uninitialized memory read.
Kazu Hirata [Sat, 24 Jun 2023 07:00:06 +0000 (00:00 -0700)]
[Support] Remove countLeadingZeros, countPopulation, etc
These functions have been deprecated since:
commit
ec116ea684b43aadfdda03cea2c2a86423e3fc27
Author: Kazu Hirata <kazu@google.com>
Date: Sun Feb 12 12:11:51 2023 -0800
Differential Revision: https://reviews.llvm.org/D153686
Pedro Falcato [Sat, 24 Jun 2023 05:45:17 +0000 (22:45 -0700)]
[clang] Add -fcheck-new support
Add -fcheck-new and -fno-check-new, from GCC, which make the compiler
not assume pointers returned from operator new are non-null.
Fixes #16931.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D125272
Vitaly Buka [Sat, 24 Jun 2023 04:10:26 +0000 (21:10 -0700)]
[test][MSAN] Fix test by printing action before execution it
We expect log messages from enother thread triggered by actions.
Thorsten Schütt [Fri, 23 Jun 2023 16:36:59 +0000 (18:36 +0200)]
[GlobalIsel][X86] G_STORE extension
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D153643
Johannes Doerfert [Fri, 23 Jun 2023 22:00:48 +0000 (15:00 -0700)]
[Attributor][FIX] Do not ignore refinement for IPO
This is just a cleanup commit, a follow up will make this way more
structured.
Johannes Doerfert [Fri, 23 Jun 2023 20:08:57 +0000 (13:08 -0700)]
[Attributor] Avoid the type check in getCalledFunction
We now consistently use `CallBase::getCalledOperand` rather than
`getCalledFunction`, as we do not want the type checked performed by the
latter. This exposed various missing checks to handle mismatches
properly, but it is good to have them explicit now.
In a follow up we might want to flag certain calls as UB, but for now,
we allow everything to cut down on unexpected differences.
Kai Sasaki [Sat, 24 Jun 2023 02:43:40 +0000 (02:43 +0000)]
[mlir] Replace HTML escaped character
Youngsuk Kim [Sat, 24 Jun 2023 01:52:43 +0000 (21:52 -0400)]
[llvm] Replace use of Type::getPointerTo() (NFC)
Partial progress towards replacing in-tree uses of
`Type::getPointerTo()`.
If `getPointerTo()` is used solely to support an unnecessary bitcast,
remove the bitcast.
Reviewed By: barannikov88, nikic
Differential Revision: https://reviews.llvm.org/D153307
Mehdi Amini [Sat, 24 Jun 2023 01:15:47 +0000 (03:15 +0200)]
Improve fatal error message when handling promised interfaces
When initializing DialectInterfaceCollection, we wouldn't have the missing
interface name in the error.
Differential Revision: https://reviews.llvm.org/D153676
Mehdi Amini [Sat, 24 Jun 2023 01:46:10 +0000 (03:46 +0200)]
Add missing dependent dialects to AsyncToAsyncRuntimePass and GpuKernelOutliningPass
These aren't detected during testing most of the time because the way we
are setting up mlir-opt and the fact that we always use func.func: it'll
trigger the load of the InlinerInterface extension for the FuncDialect which
itself loads these dialects unconditionally.
Fangrui Song [Sat, 24 Jun 2023 01:44:31 +0000 (18:44 -0700)]
[XRay][AArch64] Add .size directive
Kazu Hirata [Sat, 24 Jun 2023 01:26:17 +0000 (18:26 -0700)]
[LegacyPM] Remove unused declarations createLowerMatrixIntrinsicsPass and createLowerMatrixIntrinsicsMinimalPass
The corresponding function definitions were removed by:
commit
2764322912c1fe767831ebfd195118e8534e21aa
Author: Kazu Hirata <kazu@google.com>
Date: Fri Jun 23 01:32:38 2023 -0700
Kazu Hirata [Sat, 24 Jun 2023 01:26:16 +0000 (18:26 -0700)]
[LegacyPM] Remove unused declaration initializeStripSymbolsPass
The corresponding function definition was removed by:
commit
15977742d3ebba05a33a8eac3201ebba9c9f10e3
Author: Arthur Eubanks <aeubanks@google.com>
Date: Tue Dec 20 13:36:20 2022 -0800
Kazu Hirata [Sat, 24 Jun 2023 01:26:14 +0000 (18:26 -0700)]
[LegacyPM] Remove unused declarations initializeCrossDSOCFIPass and initializeGlobalSplitPass
The corresponding function definitions were removed by:
commit
c8b8d6baddf9a744594a69e9fb266b724e2e99b2
Author: Arthur Eubanks <aeubanks@google.com>
Date: Thu Feb 9 17:22:56 2023 -0800
Kazu Hirata [Sat, 24 Jun 2023 01:26:12 +0000 (18:26 -0700)]
[LegacyPM] Remove unused declarations initializeCorrelatedValuePropagationPass and initializeJumpThreadingPass
The corresponding function definitions were removed by:
commit
7c3c981442b11153ac1a2be678db727ff715253b
Author: Arthur Eubanks <aeubanks@google.com>
Date: Wed Mar 8 15:07:17 2023 -0800
LLVM GN Syncbot [Sat, 24 Jun 2023 01:16:38 +0000 (01:16 +0000)]
[gn build] Port
6085eb308491
Alex Brachet [Sat, 24 Jun 2023 01:15:50 +0000 (01:15 +0000)]
Revert "Reland [llvm] Preliminary fat-lto-objects support"
This reverts commit
44265dc3554ef40920b587eeb787a400663af6c7.
varconst [Sat, 24 Jun 2023 01:10:03 +0000 (18:10 -0700)]
[libc++][NFC] Fix incorrect return type of `operator<=>` in `span` test code.
LLVM GN Syncbot [Sat, 24 Jun 2023 00:59:38 +0000 (00:59 +0000)]
[gn build] Port
c9a8a0e8a9b2
Douglas Yung [Sat, 24 Jun 2023 00:58:22 +0000 (17:58 -0700)]
Revert "[llvm-profdata] Refactoring Sample Profile Reader to increase FDO build speed using MD5 as key to Sample Profile map"
This reverts commit
31af18bccea95fe1ae8aa2c51cf7c8e92a1c208e.
This change is causing build failures on many Windows build bots:
https://lab.llvm.org/buildbot/#/builders/216/builds/22833
https://lab.llvm.org/buildbot/#/builders/123/builds/19602
https://lab.llvm.org/buildbot/#/builders/172/builds/28315
https://lab.llvm.org/buildbot/#/builders/119/builds/13870
https://lab.llvm.org/buildbot/#/builders/233/builds/794
https://lab.llvm.org/buildbot/#/builders/235/builds/387
https://lab.llvm.org/buildbot/#/builders/13/builds/36921
https://lab.llvm.org/buildbot/#/builders/127/builds/50510
Douglas Yung [Sat, 24 Jun 2023 00:57:37 +0000 (17:57 -0700)]
Revert "[llvm-profdata] Fix mixed-sign comparison warnings"
This reverts commit
a2e7f26160359ed3913badb5acdd05aa8c663b46.
The original patch (31af18b) will be reverted, so reverting this follow-up patch first.
Robert Suderman [Fri, 23 Jun 2023 23:54:48 +0000 (16:54 -0700)]
[mlir][math] Improved math.atan approximation
Used the cephes numerical approximation for `math.atan`. This is a
significant accuracy improvement over the previous taylor series
approximation.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D153656
Alex Bradbury [Sat, 24 Jun 2023 00:04:56 +0000 (17:04 -0700)]
Recommit "[RISCV] Implement support for bf16 truncate/extend on hard FP targets"
Without the changes from D153598.
Original commit message:
For the same reasons as D151284, this requires custom lowering of the
truncate libcall on hard float ABIs (the normal libcall code path is
used on soft ABIs).
The extend operation is implemented by a shift just as in the standard
legalisation, but needs to be custom lowered because i32 isn't a legal
type on RV64.
This patch aims to make the minimal changes that result in correct
codegen for the bfloat.ll tests.
Differential Revision: https://reviews.llvm.org/D151663
Craig Topper [Sat, 24 Jun 2023 00:01:28 +0000 (17:01 -0700)]
[RISCV] Use binary search on the extension tables in RISCVISAInfo.cpp. NFC
After D153170 the tables are now sorted by extension name so we can use that to
avoid a linear search.
Reviewed By: asb, MaskRay
Differential Revision: https://reviews.llvm.org/D153598
Craig Topper [Sat, 24 Jun 2023 00:00:11 +0000 (17:00 -0700)]
Revert "[RISCV] Implement support for bf16 truncate/extend on hard FP targets"
This was committed with D153598 merged into it. Reverting to recommit as separate patches.
This reverts commit
690b1c847f0b188202a86dc25a0a76fd8c4618f4.
Johannes Doerfert [Sat, 24 Jun 2023 00:06:47 +0000 (17:06 -0700)]
[Attributor][NFC] Avoid string concat for non-tracing runs
Johannes Doerfert [Tue, 20 Jun 2023 05:59:31 +0000 (22:59 -0700)]
[Attributor] Check IR attributes before creating new AAs
Instead of creating an AA for an IR attribute we can first check if it
is implied/known. If so, we can save the time to create the AA, figure
out it is implied, fix it, and later manifest it in the IR
(redundantly). Other IR attributes can be added to the list in
`AA::hasAssumedIRAttr` later on, for now we support 8 different ones.
Johannes Doerfert [Fri, 23 Jun 2023 02:21:02 +0000 (19:21 -0700)]
[Attributor][NFCI] Use pointers to pass around AAs
This will make it easier to create less trivial AAs in the future as we
can simply return `nullptr` rather than an AA with in invalid state.
LLVM GN Syncbot [Sat, 24 Jun 2023 00:07:35 +0000 (00:07 +0000)]
[gn build] Port
44265dc3554e
Teresa Johnson [Fri, 23 Jun 2023 18:01:22 +0000 (11:01 -0700)]
[LTO][GlobalDCE] Use pass parameter instead of module flag for LTO phase
D63932 added a module flag to indicate that we are executing the regular
LTO post merge pipeline, so that GlobalDCE could perform more aggressive
optimization for Dead Virtual Function Elimination. This caused issues
trying to reuse bitcode that had already been through the LTO pipeline
(see context in D139816).
Instead support this by passing down a parameter flag to the
GlobalDCEPass constructor, which is the more usual way for indicating
this information.
Most test changes are to remove incidental uses of this flag. Of the 2
real uses, llvm/test/LTO/ARM/lto-linking-metadata.ll is now obsolete and
removed in this patch, and the virtual-functions-visibility-post-lto.ll
test is updated to use the regular LTO default pipeline where this
parameter is set to true.
Differential Revision: https://reviews.llvm.org/D153655
Craig Topper [Fri, 23 Jun 2023 23:52:45 +0000 (16:52 -0700)]
[RISCV] Split ReadSFB into ReadSFBJmp and ReadSFBALU.
The operands may need to be available at different times.