Commit Graph

460191 Commits

Author SHA1 Message Date
Mark de Wever
e8e8707b4a Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
Unfortunatly not all buildbots are updated.

This reverts commit ffb807ab53.
2023-05-06 17:03:56 +02:00
Simon Pilgrim
8f82d8ee76 [DAG] visitSUBSAT - fold subsat(x,y) -> sub(x,y) if it never overflows 2023-05-06 15:55:04 +01:00
Simon Pilgrim
05a57fd18c [X86] Add tests showing failure to simplify ssubsat/usubsat to sub 2023-05-06 15:55:04 +01:00
Simon Pilgrim
08c1150d4c [DAG] Add computeOverflowForSignedSub/computeOverflowForUnsignedSub/computeOverflowForSub
Match the addition variants (although computeOverflowForUnsignedSub is really just a placeholder), and use this in DAGCombiner::visitSUBO
2023-05-06 15:55:04 +01:00
Jay Foad
3551e0f345 [RegisterCoalescer] Fix problem with IMPLICIT_DEF live-in to an invoke
Give up on erasing an IMPLICIT_DEF if it might be live-in to a call
instruction in a basic block with EH pad successors. This fixes a
liveness bug that will be diagnosed by MachineVerifer when D149947
lands.

Differential Revision: https://reviews.llvm.org/D149954
2023-05-06 15:16:54 +01:00
Jay Foad
226ff45214 [X86] Generate checks for 2012-01-10-UndefExceptionEdge
Also add -verify-machineinstrs to make it easier to catch a
MachineVerifier failure introduced by D149947.

Differential Revision: https://reviews.llvm.org/D149953
2023-05-06 15:16:54 +01:00
Jay Foad
caf22ec64a [UpdateTestChecks] More support for X86 exception handling
Differential Revision: https://reviews.llvm.org/D149971
2023-05-06 15:16:54 +01:00
Michael Liao
7a23e6b380 [GlobalISel] Fix typo. NFC 2023-05-06 10:07:49 -04:00
Simon Pilgrim
3fb067f7ba [DAG] visitADDSAT - fold saddsat(x,y) -> add(x,y) if it never overflows
Extend existing uaddsat(x,y) fold
2023-05-06 14:18:23 +01:00
Simon Pilgrim
489e728672 [DAG] computeOverflowForSignedAdd - fix typo in comment. NFC. 2023-05-06 14:18:22 +01:00
Alexey Lapshin
6ab43f9b87 [Support] Add PerThreadBumpPtrAllocator class.
PerThreadBumpPtrAllocator allows separating allocations by thread id.
That makes allocations race free. It is possible because
ThreadPoolExecutor class creates threads, keeps them until
the destructor of ThreadPoolExecutor is called, and assigns ids
to the threads. Thus PerThreadBumpPtrAllocator should be used with only
threads created by ThreadPoolExecutor. This allocator is useful when
thread safe BumpPtrAllocator is needed.

Reviewed By: MaskRay, dexonsmith, andrewng

Differential Revision: https://reviews.llvm.org/D142318
2023-05-06 14:35:26 +02:00
Simon Pilgrim
7395f6ae78 [DAG] Add computeOverflowForSignedAdd and computeOverflowForAdd wrapper
Add basic computeOverflowForSignedAdd helper to recognise that sadd overflow can't occur if both operands have more that one sign bit.

Add computeOverflowForAdd wrapper that calls computeOverflowForSignedAdd/computeOverflowForUnsignedAdd depending on the IsSigned argument, and use this in DAGCombiner::visitADDO
2023-05-06 13:33:14 +01:00
Simon Pilgrim
5e029f0142 [X86] xaluo.ll - add test coverage showing the failure to recognise when saddo/ssubo will not overflow
sadd/ssub with both operands with more than one sign bit will not overflow

Alive2: https://alive2.llvm.org/ce/z/a8HmNp
2023-05-06 13:33:14 +01:00
Simon Pilgrim
d24c179682 [X86] Regenerate xaluo.ll with common CHECK prefix 2023-05-06 13:33:14 +01:00
Piotr Zegar
1c28205262 [clang-tidy] Optimize performance of RenamerClangTidyCheck
Refactor RenamerClangTidyCheck to achieve better performance
by removing object copies, duplicated function calls and by
using RecursiveASTVisitor.

Measured -72% execution time on bugprone-reserved-identifier.

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D149723
2023-05-06 12:23:06 +00:00
Piotr Zegar
c3d16514d0 [clang][NFC] Optimize clang::ASTNodeKind::isBaseOf
Create dedicated isBaseOf method without calculating
distance.

Tested on RISCVISelDAGToDAG.cpp with:
clang-tidy --checks=*,-bugprone-unchecked-optional-access

Amount of CPU cycles for isBaseOf reduced by ~15% (according to perf).

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D149518
2023-05-06 12:22:28 +00:00
Mark de Wever
7e6bcb35a8 [libc++][format] Fixes vector<bool> requirements.
Makes sure the formatter for the vector<bool>::reference is enabled
when only the header <vector> is included. Before this change it
required <vector> and <format> to be included. This violated the
requirements in the Standard.

Fixes: https://llvm.org/PR61314

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D149543
2023-05-06 14:00:29 +02:00
Florian Hahn
7b7be685d4 [VPlan] Use operands directly in VPInstructionsToVPRecipes (NFC).
New that def-use chains are modeled directly in VPlan, we can simply use
the operands of the recipe we are replacing. There is no need to use the
operands of the underlying instruction to look up a VPValue.
2023-05-06 12:36:00 +01:00
Chris Cotter
5902bb9584 [clang-tidy] Implement cppcoreguidelines F.19
Warns when a function accepting a forwarding reference does anything besides
forwarding (with std::forward) the parameter in the body of the function.

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D146921
2023-05-06 10:49:23 +00:00
Wang, Xin10
c719a19158 [NFC]adjust identaion and update comments in X86InstrArithmeic.td
After https://reviews.llvm.org/D144154, I introduce some identation issues,
and some comments are not that precise.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D150025
2023-05-06 06:15:34 -04:00
Mark de Wever
ffb807ab53 Reland "[CMake] Bumps minimum version to 3.20.0."
All build bots should be updated now.

This reverts commit 44d38022ab.
2023-05-06 11:43:02 +02:00
Florian Hahn
01fa764c9a [VPlan] Assert instead of check if VF is vector when widening GEPs(NFC)
VPWidenGEPRecipe should not be generated for scalar VFs. Replace
check with an assert.
2023-05-06 09:25:56 +01:00
Vitaly Buka
bb13ed231a Revert "[2a/3][ASan][libcxx] std::deque annotations"
https://lab.llvm.org/buildbot/#/builders/168/builds/13310
https://lab.llvm.org/buildbot/#/builders/239/builds/2107

This reverts commit 9a5f283139.
2023-05-06 00:23:27 -07:00
Kazu Hirata
283427afd4 [clang-tidy] Modernize Handler (NFC) 2023-05-06 00:02:56 -07:00
Kazu Hirata
2b60bd5141 [Vectorize] Use Densemap::contains (NFC) 2023-05-06 00:02:54 -07:00
Kazu Hirata
38d8b1f2b4 [clangd] Replace None with std::nullopt in comments (NFC)
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
2023-05-06 00:02:53 -07:00
Caroline Tice
5326c9e480 Revert "Give NullabilityKind a printing operator<<"
This reverts commit 0a532207b8.

This breaks several of our tests. Have given reproducers to author.
Reverting this until author can fix the issue.
2023-05-05 23:37:30 -07:00
Weining Lu
040a41a852 [LoongArch] Provide basic TargetTransformInfo implementation
This patch only provides basic LoongArchTTIImpl, and more hooks
will be added to provide TTI machinery for LoongArch soon.

Reviewed By: SixWeining, xen0n

Differential Revision: https://reviews.llvm.org/D147524
2023-05-06 11:38:33 +08:00
Chuanqi Xu
5b388f86aa [C++20] [Modules] Don't check input files for C++20 Modules
Close https://github.com/llvm/llvm-project/issues/62269

Currently, the compiler will emit errors when we compile C++20 modules
if the referenced files changed or got removed. This is because we reuse
the existing logic from Clang implicit modules. It is helpful for clang
implicit modules since it is implicit and we want to be sure things
don't go wrong. But it is not necessary for C++20 modules. The C++20
modules is explicit and it is build systems' responsibility to maintain
the dependencies. So the check in the compiler side may be an overkill.
2023-05-06 11:17:15 +08:00
NAKAMURA Takumi
a29a97d76b Fix a warning in D149117 [-Wunused-but-set-variable] 2023-05-06 11:30:04 +09:00
wanglei
2285bc0489 [gn] Move LoongArch target from llvm_all_experimental_targets to llvm_all_stable_targets
Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D147701
2023-05-06 10:21:19 +08:00
Manna, Soumi
babe8629d7 [NFC][Clang] Fix static analyzer tool remarks about large copies by values in Format.cpp file
Reported by Static Analyzer Tool, Coverity:

Inside "Format.cpp" file, in clang::format::internal::reformat(clang::format::FormatStyle const &, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus *)::[lambda(clang::format::Environment const &) (instance 4)]::operator ()(clang::format::Environment const &): A very large function call parameter exceeding the high threshold is passed by value.

pass_by_value: Capturing variable S of type clang::format::FormatStyle (size 808 bytes) by value, which exceeds the high threshold of 512 bytes

This patch uses original code but with an init capture that does a move instead of a copy.

Reviewed By: tahonermann, erichkeane, MyDeveloperDay, owenpan, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D149647
2023-05-05 18:55:49 -07:00
walter erquinigo
9f5ef42cbd [LLDB] Add minimal support for the new Mojo language
Modular just announced a new language called Mojo. This patch adds an entry in the language list in LLDB for minimal support (e.g. being able to create a TypeSystem for this language). We will later add debug info entries when the language matures.
2023-05-05 20:35:19 -05:00
Teresa Johnson
a28261c711 [MemProf] Create single version of helper function (NFC)
Small clean up to keep a single version of getAllocTypeAttributeString
which was duplicated locally.
2023-05-05 18:31:35 -07:00
Joseph Huber
023bfc196b [libc][docs] Fix incorrect CMake argument in GPU documentation
Summary;
This was changed a long time ago to drop the `LLVM_` prefix.

Differential Revision: https://reviews.llvm.org/D150012
2023-05-05 20:16:47 -05:00
William Huang
4357824c63 [llvm-profdata] ProfileReader cleanup - preparation for MD5 refactoring
Cleanup profile reader classes to prepare for complex refactoring as propsed in D147740 (Use MD5 as key for profile map). Change is too complicated so I am cleaning up the reader implementation first with these goals.
-  Reduce duplicated/similar logic
-  Reduce virtual functions, changing them to non-virtual
-  Reduce unnecessry checks, indirections, and dead writes.

This is patch 1/n. This patch refactors NameTable

Explaining several decisions here

1. useMD5() means whether  names of the profiles (the ProfileMap) are represented as MD5. It is NOT whether the input profile format is MD5. This function is an interface for IPO passes to decide whether to match function names or function MD5. There are two motives here:
(a) Eventually we want to use MD5 to represent all function contexts because it is much faster to use it as a key for lookup tables (prototype implementation D147740), so in compilation mode we call setProfileUseMD5() to force use MD5. While in tools mode (llvm-profdata) we want to keep the function name info if it's in the input profile.
(b) We also propose to allow multiple name tables and profile sections in ExtBinary format, and it could consist of name tables with or without using MD5, in this case MD5 prevails and other name tables are converted to MD5.

2. MD5 handling logic is pushed up to BinaryReader base class, because this trades a non-devirtualized virtual function call with a predictable branch. ReadStringFromTable() accounts for >5% time when loading a full 1 GB profile, it should not be virtual.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D148868
2023-05-06 00:21:03 +00:00
Mehdi Amini
c5fefbc8db Fix MLIR Linalg Python test after adopting properties in f6ac7e3c6d 2023-05-05 17:15:48 -07:00
Vitaly Buka
22aa493ad2 [test][sanitizer] Add feature for "any" GLIBC
"any" is actualy any resonably recent GLIBC.
2023-05-05 17:12:17 -07:00
Vitaly Buka
74937f2404 [test][sanitizer] Add tests for join variants 2023-05-05 17:12:17 -07:00
Mehdi Amini
f6ac7e3c6d Adopt Properties to store operations inherent Attributes in the Linalg dialect
This is part of an on-going migration to adopt Properties inside MLIR.

Differential Revision: https://reviews.llvm.org/D148299
2023-05-05 16:58:20 -07:00
Mehdi Amini
ab2e224e19 Fix UB passing nullptr to an EmptyProperties class when building OpAdaptor
A new forwarding constructor is introduced on the adaptor to take directly
an OpaqueProperties object and do the nullptr checking and casting to avoid
the boilerplate at callsites.

Differential Revision: https://reviews.llvm.org/D150003
2023-05-05 16:50:52 -07:00
Sergei Barannikov
4c9f1584ce Add -misc-use-anonymous-namespace to .clang-tidy
This is at odds with the coding standard.
Quoting https://llvm.org/docs/CodingStandards.html#anonymous-namespaces
> Because of this, we have a simple guideline: make anonymous namespaces
> as small as possible, and only use them for class declarations.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D149664
2023-05-06 02:33:20 +03:00
Teresa Johnson
cfad2d3a3d [MemProf] Context disambiguation cloning pass [patch 4/4]
Applies ThinLTO cloning decisions made during the thin link and
recorded in the summary index to the IR during the ThinLTO backend.

Depends on D141077.

Differential Revision: https://reviews.llvm.org/D149117
2023-05-05 16:26:32 -07:00
AdityaK
8f0eee16d9 Remove unused basic_android_tree/mipsel-linux-android
Reviewers: danalbert, enh, pirama, srhines

Differential Revision: https://reviews.llvm.org/D149980
2023-05-05 15:50:22 -07:00
Fangrui Song
8afd831b45 ms inline asm: recognize case-insensitive JMP and CALL as TargetLowering::C_Address
In a `__asm` block, a symbol reference is usually a memory constraint
(indirect TargetLowering::C_Memory) [LOOP]. CALL and JUMP instructions are special
that `__asm call k` can be an address constraint, if `k` is a function.

Clang always gives us indirect TargetLowering::C_Memory and need to convert it
to direct TargetLowering::C_Address. D133914 implements this conversion, but
does not consider JMP or case-insensitive CALL. This patch implements the missing
cases, so that `__asm jmp k` (`jmp ${0:P}`) will correctly lower to `jmp _k`
instead of `jmp dword ptr [_k]`.

(`__asm call k` lowered to `call dword ptr ${0:P}` and is fixed by D149695 to
lower to `call ${0:P}` instead.)

[LOOP]: Some instructions like LOOP{,E,NE} and Jcc always use an address
constraint (`loop _k` instead of `loop dword ptr [_k]`).

After this patch and D149579, all the following cases will be correct.
```
int k(int);
int (*kptr)(int);
...
__asm call k; // correct without this patch
__asm CALL k; // correct, but needs this patch to be compatible with D149579
__asm jmp k;  // correct, but needs this patch to be compatible with D149579
__asm call kptr; // will be fixed by D149579.  "Broken case" in clang/test/CodeGen/ms-inline-asm-functions.c
__asm jmp kptr;  // will be fixed by this patch and D149579
```

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D149920
2023-05-05 15:32:32 -07:00
Alex Langford
dc91a55b2c [lldb] Fix fallout from e9eaf7b430
Minor logic mistake. This caused TestObjCClassMethod to fail.
2023-05-05 14:56:49 -07:00
Vitaly Buka
c3a46fe9c1 [test][lsan] Remove std::vector from test 2023-05-05 14:48:57 -07:00
Vitaly Buka
43de9cbec9 [test][lsan] For thread args/result leak 2023-05-05 14:48:13 -07:00
Jonas Devlieghere
81f9c4323b [lldb] Migrate to GetPropertyAtIndexAs for ArchSpec (NFC)
Use the templated GetPropertyAtIndexAs helper for ArchSpec.
2023-05-05 14:43:59 -07:00
Jonas Devlieghere
0f9c08f1b2 [lldb] Migrate to GetPropertyAtIndexAs for LanguageType (NFC)
Use the templated GetPropertyAtIndexAs helper for LanguageType.
2023-05-05 14:43:58 -07:00