Fangrui Song [Fri, 3 Mar 2023 20:35:05 +0000 (12:35 -0800)]
[ELF] Mention section name for STT_SECTION in reportRangeError()
D73518 mentioned non-STT_SECTION symbol names. This patch extends the code to
handle STT_SECTION symbols, where we report the section name.
This change helps at least the following cases with very little code.
* Whether a out-of-range relocation is due to code or data.
* For a relocation in .debug_info, which referenced `.debug_*` section (due to DWARF32 limitation) causes the problem.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D145199
Jessica Clarke [Fri, 3 Mar 2023 20:19:15 +0000 (20:19 +0000)]
[RISCV][NFC] Add PIC RUN/CHECK lines for jumptable.ll test
The omission of checking our PIC jump table code generation is a bit of
an oversight, so belatedly add this coverage.
Jessica Clarke [Fri, 3 Mar 2023 20:18:18 +0000 (20:18 +0000)]
[RISCV][NFC] Unify CHECK lines for jumptable.ll @below_threshold test
These are all identical across XLEN and code model since they're not
using a jump table, so unify them rather than having multiple copies.
Jessica Clarke [Fri, 3 Mar 2023 20:14:31 +0000 (20:14 +0000)]
[RISCV][NFC] Add signext to jumptable.ll tests to avoid irrelevant sext.w
Sign-extending the input is irrelevant to the test in question, which
merely needs some arbitrary input to switch on. This also removes the
only difference between the RV32I and RV64I cases for @below_threshold
and will allow unifying them.
Amir Ayupov [Fri, 3 Mar 2023 19:58:59 +0000 (11:58 -0800)]
[BOLT][Instrumentation] Preserve red zone for functions with tail calls only
Allow a function with tail calls only to clobber its red zone.
Fixes https://github.com/llvm/llvm-project/issues/61114.
Reviewed By: #bolt, yota9
Differential Revision: https://reviews.llvm.org/D145202
Alex Brachet [Fri, 3 Mar 2023 19:51:46 +0000 (19:51 +0000)]
[libc] Fix strspn
Alex Brachet [Fri, 3 Mar 2023 19:45:03 +0000 (19:45 +0000)]
[llvm-driver] Allow llvm driver binary to be called anything
Florian Hahn [Fri, 3 Mar 2023 19:30:30 +0000 (20:30 +0100)]
[VPlan] Add test with intrinsic without side-effects (NFC).
Extra test coverage for mayHaveSideEffects for VPWidenCallRecipe.
Philip Reames [Fri, 3 Mar 2023 19:10:26 +0000 (11:10 -0800)]
[RISCV][llvm-tblgen] Support conditional definitions using !exists clauses
The core part of this change is an extension to the tablegen language to allow conditional definition of records using if-statements based on !exists conditions.
The RISCV td file change is mostly to illustrate the potential use of conditional definitions. I am deliberately not maximally simplifying in this change to make merging with downstream code (or simply rebasing while this on review) easier.
Some background to make the change understandable.
TableGen does not have an if statement internally. It has if expressions - in the form of TernInitOp with IF opcode - and foreach statements. It implements an if-statement as a foreach which iterates either 0 or 1 times.
Foreach nodes are then evaluated via unrolling inside the parser. Specifically, they are evaluated, at latest, when the outermost multiclass or loop containing them reaches end of scope. The unrolled statements remain (potentially) unresolved after unrolling, but the number of iterations must be known at this point.
An !exists clause can only evaluate at final evaluation. (Specifically, forward references to definitions are allowed - up to the end of the containing scope at least.) The existing code did not set the final flag on the resolver, and thus would leave the !exists clause in an unresolved state. This would then cause an error since we don't know how many iterations on which to unroll the (synthetic) foreach loop.
I chose to only finally-evaluate the condition of the if-expression. This allows us to pick an arm at scope exit without inhibiting definitions in the arm from having self references.
Differential Revision: https://reviews.llvm.org/D145108
Arthur Eubanks [Fri, 3 Mar 2023 17:43:53 +0000 (09:43 -0800)]
[test] Precommit test for D145210
Michael Jones [Thu, 2 Mar 2023 22:01:41 +0000 (14:01 -0800)]
[libc] move stdlib and stdio to new errno pattern
Fixes https://github.com/llvm/llvm-project/issues/61071
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145191
Vadim Paretsky [Fri, 3 Mar 2023 18:54:27 +0000 (10:54 -0800)]
[llvm-lib] update ReleaseNotes for llvm-lib's new support for generating
an import library from a definition file
Differential Revision:https://reviews.llvm.org/D145140
Jeffrey Tan [Fri, 3 Mar 2023 00:03:35 +0000 (16:03 -0800)]
Add HitCount into Breakpoint statistics
Turns out breakpoint statistics is missing hitCount.
This patches adds the hitCount field.
Differential Revision: https://reviews.llvm.org/D145203
Daniel Thornburgh [Fri, 17 Feb 2023 21:43:57 +0000 (13:43 -0800)]
[llvm-cov] Optionally fail on missing binary ID
This adds the --check-binary-id flag that makes sure that an object file
is available for every binary ID mentioned in the given profile. This
should help make the tool more robust in CI environments where it's
expected that coverage mappings should be available for every object
contributing to the profile.
Reviewed By: gulfem
Differential Revision: https://reviews.llvm.org/D144308
Jan Svoboda [Fri, 3 Mar 2023 18:22:25 +0000 (10:22 -0800)]
[clang][deps] Fix test failing on AIX
Introduced in
86405450, caused by AIX defaulting to `-fno-integrated-as`.
zhijian [Fri, 3 Mar 2023 18:18:58 +0000 (13:18 -0500)]
Remove extraneous characters when printing the timestamp for an XCOFF object file.
Summary:
The llvm-readobj prints extra characters for the timestamp when --file-headers is used with an XCOFF file. This change updates the format string used to print the time. In addition, the timestamp is printed in the local timezone, and a thread-safe call is used to convert the time.
Summit the patch on behalf of Stephen Peckham.
Reviewers: James Henderson, Digger Lin
Differential Revision: https://reviews.llvm.org/D144281
Daniel Thornburgh [Thu, 2 Mar 2023 19:53:09 +0000 (11:53 -0800)]
[Fuchsia] Add other necessary components to LLDB install.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D145187
Ragavan Dasarathan [Fri, 3 Mar 2023 18:01:31 +0000 (10:01 -0800)]
[Nomination] Adding Nvidia Compiler security representative to the LLVM security group.
I'm from Nvidia Corporation. I work primarily on the Security aspect of Compiler toolchains based out of LLVM. I would like to nominate myself to join the LLVM security group as a vendor contact representative of Nvidia.
According to the information on the website, https://llvm.org/docs/Security.html, I fall under the following category: Vendor contacts.
We are particularly interested in the following:
- Being aware of any security vulnerability that has been found in the compiler in a timely manner.
- Correctly reporting any vulnerabilities or other security issues we have found in the compiler stack.
- Discussing our use of static analysis / dynamic analysis / fuzzing / threat modelling with the committee and raising any concerns that have risen from said activities.
Looking forward to participating in further discussions and security sync ups with the rest of the committee
Please let me know if I need to provide any other information required for this nomination.
Thanks,
Ragavan
Reviewed By: ab, apilipenko, george.burgess.iv, kristof.beyls, mattdr, nikhgupt, probinson, peter.smith, pietroalbini
Differential Revision: https://reviews.llvm.org/D144585
Michael Buch [Fri, 3 Mar 2023 14:18:21 +0000 (14:18 +0000)]
[lldb][TypeSystemClang] Use the CXXFunctionPointerSummaryProvider for member-function pointers
With this patch member-function pointers are formatted using
`CXXFunctionPointerSummaryProvider`.
This turns,
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94
```
into
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94 (a.out`Foo::member_func() at main.cpp:3)
```
Differential Revision: https://reviews.llvm.org/D145242
Michael Buch [Fri, 3 Mar 2023 14:21:12 +0000 (14:21 +0000)]
[lldb][TypeSystemClang] Format pointers to member functions as eFormatHex
Before this patch, LLDB used to format pointers to members, such as,
```
void (Foo::*pointer_to_member_func)() = &Foo::member_func;
```
as `eFormatBytes`. E.g.,
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) $1 = 94 3f 00 00 01 00 00 00 00 00 00 00 00 00 00 00
```
This patch makes sure we format pointers to member functions the same
way we do regular function pointers.
After this patch we format member pointers as:
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94
```
Differential Revision: https://reviews.llvm.org/D145241
Michael Buch [Fri, 3 Mar 2023 14:04:05 +0000 (14:04 +0000)]
[lldb][TypeSystemClang][NFC] Factor out l/r-value reference logic for IsXXXType APIs
This will be useful as we add more `IsXXXType` APIs for different
function types.
Differential Revision: https://reviews.llvm.org/D145240
Michael Buch [Fri, 3 Mar 2023 17:41:30 +0000 (17:41 +0000)]
[lldb] Build fix: variable name typo
Build failure introduced in `
de10c1a824405833a0f49b22e7fa3f32a1393cc3`
Michael Buch [Fri, 3 Mar 2023 11:28:32 +0000 (11:28 +0000)]
[lldb] Ignore libcxx std::ranges global variables in frame var
The motivation is to avoid cluttering LLDB's global variable view for
std::ranges users.
Before:
```
(lldb) frame var -g
...
(const std::ranges::__end::__fn) std::__1::ranges::__cpo::end = {}
(const std::ranges::views::__all::__fn) std::__1::ranges::views::__cpo::all = {}
(const std::ranges::__begin::__fn) std::__1::ranges::__cpo::begin = {}
(const std::ranges::views::__take::__fn) std::__1::ranges::views::__cpo::take = {}
(const std::ranges::__max_element::__fn) std::__1::ranges::__cpo::max_element = {}
(const std::ranges::__size::__fn) std::__1::ranges::__cpo::size = {}
(const std::ranges::__data::__fn) std::__1::ranges::__cpo::data = {}
```
After this patch none of these __cpo variables would show up.
Differential Revision: https://reviews.llvm.org/D145245
Joshua Batista [Fri, 3 Mar 2023 00:21:01 +0000 (16:21 -0800)]
[HLSL] add max/min library functions
This change exposes the max and min library functions for HLSL, excluding long, and long long doubles.
The max / min functions are supported for all scalar, vector, and matrix types.
Long and long long double support is missing in this patch because those types
don't exist in HLSL.
The full documentation of the HLSL max / min functions are available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-max
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-min
Reviewed By: python3kgae
Differential Revision: https://reviews.llvm.org/D144309
Aaron Ballman [Fri, 3 Mar 2023 17:26:04 +0000 (12:26 -0500)]
Fix bots by adding a triple to the test
Resolves the issue found by:
https://lab.llvm.org/buildbot/#/builders/245/builds/5384
Maksim Panchenko [Wed, 1 Mar 2023 23:49:21 +0000 (15:49 -0800)]
[BOLT] Remove dependency on StringMap iteration order
Remove the usage of StringMap in places where the iteration order
affects the output since the iteration over StringMap is
non-deterministic.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D145194
Paul Walker [Fri, 3 Mar 2023 16:45:41 +0000 (16:45 +0000)]
Precommit tests for D145157.
Keith Smiley [Thu, 2 Mar 2023 23:05:19 +0000 (15:05 -0800)]
[lld-macho] Ignore -debug_variant flag
As far as I can tell all this flag does in ld64 is warn about cases
where you're building dylibs that are going to be part of the shared
cache, which I assume only apple is doing. Strangely I have seen this
flag being passed in the wild so this silences the warning about it.
Differential Revision: https://reviews.llvm.org/D145200
Aart Bik [Fri, 3 Mar 2023 01:37:43 +0000 (17:37 -0800)]
[mlir][vector] add support for printing f16 and bf16
Love or hate it, but the vector.print operation was the very
first operation that actually made "end-to-end" CHECK integration
testing possible for MLIR. This revision adds support for
the -until recently- less common but important floating-point
types f16 and bf16.
This will become useful for accelerator specific testing (e.g. NVidia GPUs)
Reviewed By: wrengr
Differential Revision: https://reviews.llvm.org/D145207
Aaron Ballman [Fri, 3 Mar 2023 16:56:22 +0000 (11:56 -0500)]
[C2x] Claim support for WG14 N2838
This paper clarifies that complete object types need to be smaller than
SIZE_MAX. We already conformed to that requirement, so this adds some
test coverage to prove it.
Archibald Elliott [Fri, 3 Feb 2023 14:48:05 +0000 (14:48 +0000)]
[NFC][TargetParser] Remove Unused Includes
Archibald Elliott [Fri, 3 Feb 2023 14:44:39 +0000 (14:44 +0000)]
[NFC][ARM][AArch64] Cleanup TargetParser includes
llvm/TargetParser/TargetParser.h now only includes AMDGPU-specific
functionality, the ARM- and AArch64-specific functionality is in other
headers.
Kiran Chandramohan [Fri, 3 Mar 2023 16:03:32 +0000 (16:03 +0000)]
[Flang][OpenMP] Fix unused variable warning/error
Kiran Chandramohan [Fri, 3 Mar 2023 13:57:41 +0000 (13:57 +0000)]
[Flang][OpenMP] NFC: Refactor privatization code in Lowering 1/n
The code for handing privatization code has grown in complexity.
This patch begins an effort to refactor and simplify the code.
The refactoring will hopefully will make it modular and
enable privatization to be invoked in different places. This
patch moves the privatization related code into a class called
dataSharingProcessor.
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D144766
Graham Hunter [Fri, 16 Sep 2022 14:23:18 +0000 (15:23 +0100)]
[LV] Allow scalarization of function calls when masking is required
This patch adds support for scalarizing calls to a function when
there is a vector variant that cannot be used, either because there
isn't a masked variant or because the cost model indicated a VF
without a masked variant was better.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D134422
Nikita Popov [Fri, 3 Mar 2023 15:07:43 +0000 (16:07 +0100)]
[ReplaceConstant] Extract code for expanding users of constant (NFC)
AMDGPU implements some handy code for expanding all constexpr
users of LDS globals. Extract the core logic into ReplaceConstant,
so that it can be reused elsewhere.
Archibald Elliott [Fri, 3 Mar 2023 13:17:00 +0000 (13:17 +0000)]
[NFCI][AArch64] Use DAG Helper Functions
This commit is a cleanup of a few things in the SelectionDAG
implementation:
- to have more places use `splitInt128`, rather than duplicating that
functionality when they are turning a 128-bit value into two 64-bit
values,
- to refactor `splitInt128` to use EXTRACT_ELEMENT which is for
splitting wide integers in two (rather than the equivalent with shifts
and truncs), and
- to use the concise helpers for INSERT_/EXTRACT_SUBREG in more places.
Alexey Bataev [Fri, 3 Mar 2023 14:09:47 +0000 (06:09 -0800)]
[SLP][NFC]Update the test to avoid dead code elimination, NFC.
Matthias Springer [Fri, 3 Mar 2023 14:00:15 +0000 (15:00 +0100)]
[mlir][IR] Hash result types in OperationFingerPrint
Result types were not considered in OperationFingerPrint. This can lead to missing IR dumps when running with `shouldPrintAfterOnlyOnChange` and false positives in D144552.
Differential Revision: https://reviews.llvm.org/D145152
Nikita Popov [Fri, 3 Mar 2023 14:03:51 +0000 (15:03 +0100)]
[SCEV] Fix control flow warning (NFC)
Nikita Popov [Fri, 3 Mar 2023 13:50:25 +0000 (14:50 +0100)]
[SCEV] Extract a helper to create a SCEV with new operands (NFC)
Nikita Popov [Fri, 3 Mar 2023 13:37:05 +0000 (14:37 +0100)]
[SCEV] Remove an unnecessary switch (NFC)
Just the scevUnconditionallyPropagatesPoisonFromOperands() check
is sufficient. Also rename the flag to be more in line with the
more general predicate.
Akash Banerjee [Fri, 3 Mar 2023 13:04:39 +0000 (13:04 +0000)]
[MLIR][OpenMP] Add Lowering support for OpenMP Target Data with region
This patch adds Fortran Lowering support for the OpenMP Target Data Op with associated region.
Differential Revision: https://reviews.llvm.org/D144013
Hristo Hristov [Fri, 3 Mar 2023 12:41:19 +0000 (13:41 +0100)]
[libc++][spaceship] Implement `operator<=>` for `forward_list`
Implemented `operator<=>` for `forward_list`
Reviewed By: #libc, philnik
Spies: philnik, libcxx-commits, yaxunl
Differential Revision: https://reviews.llvm.org/D145172
Hristo Hristov [Fri, 3 Mar 2023 12:35:07 +0000 (13:35 +0100)]
[libc++][spaceship] Implement `operator<=>` for `deque`
Based on https://reviews.llvm.org/D132312
Dependes on https://reviews.llvm.org/D132312
Reviewed By: #libc, Mordante, philnik
Spies: philnik, Mordante, yaxunl, libcxx-commits
Differential Revision: https://reviews.llvm.org/D144821
David Goldblatt [Fri, 3 Mar 2023 12:23:27 +0000 (13:23 +0100)]
[InstCombine] Simplify separate_storage assumptions
Before this change, we call getUnderlyingObject on each separate_storage
operand on every alias() call (potentially requiring lots of pointer
chasing). Instead, we rewrite the assumptions in instcombine to do this
pointer-chasing once.
We still leave the getUnderlyingObject calls in alias(), just expecting
them to be no-ops much of the time. This is relatively fast (just a
couple dyn_casts with no pointer chasing) and avoids making alias
analysis results depend on whether or not instcombine has been run.
Differential Revision: https://reviews.llvm.org/D144933
Dmitry Makogon [Fri, 3 Mar 2023 11:11:44 +0000 (18:11 +0700)]
[Test] Add more tests with min/max loop guards (NFC)
This adds more test cases with loop guards involving min/max
and which should be covered by ScalarEvolution::applyLoopGuards.
Dmitry Makogon [Fri, 3 Mar 2023 11:02:46 +0000 (18:02 +0700)]
[ScalarEvolution] Factor out RewriteMap utilities in applyLoopGuards (NFC)
This factors out two utilities used with RewriteMap in applyLoopGuards:
- AddRewrite, which puts a rewrite rule in the map and if needed registers
the rewrite in the list of rewritten expressions,
- GetMaybeRewritten, which checks whether an expression has already been
rewritten, and if so, returns the rewrite. Otherwise, returns the given
expression.
This may be needed when adding new rewrite rules as not to copy-paste this
code.
Mikael Holmen [Fri, 3 Mar 2023 12:07:22 +0000 (13:07 +0100)]
Revert "[ADCE] Only remove debug intrinsics if non debug instructions are removed"
This reverts commit
8aa9ab336889ae2eb8e4188036faeb151379ab7b.
Reverting due to compile-time regressions as pointed out in
https://reviews.llvm.org/D145051#4166656
E.g.
"In particular tramp3d-v4 with debuginfo regressed by 15%."
Jakub Chlanda [Fri, 3 Mar 2023 07:36:51 +0000 (08:36 +0100)]
[NVPTX] Add f16 and v2f16 ldg builtins
Adds f16 and v2f16 ldg builtins and relevant tests.
Differential Revision: https://reviews.llvm.org/D144961
Jay Foad [Fri, 3 Mar 2023 11:46:01 +0000 (11:46 +0000)]
[AMDGPU] Fix error message for illegal copy
Adrian Kuegel [Fri, 3 Mar 2023 11:41:02 +0000 (12:41 +0100)]
[mlir] Apply ClangTidy readability findings (NFC)
Jay Foad [Fri, 3 Mar 2023 11:03:51 +0000 (11:03 +0000)]
[AMDGPU] Add test case for AMDGPUInsertDelayAlu bug
luxufan [Fri, 3 Mar 2023 10:05:35 +0000 (18:05 +0800)]
[SimplifyCFG] Handle MD_noundef when hoisting common codes
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D144939
David Spickett [Fri, 3 Mar 2023 10:59:52 +0000 (10:59 +0000)]
Revert "[libcxx] Temporarily skip Arm configs"
This reverts commit
8a023fed2f848031769eae804e55eed719cdd12d.
The machine is back online.
Caroline Concatto [Wed, 1 Mar 2023 13:03:28 +0000 (13:03 +0000)]
[IR][Legalization] Promote illegal deinterleave and interleave vectors
To make legalization easier, the operands and outputs have the same size for
these ISD Nodes. When legalizing the results in PromoteIntegerResult the operands
are legalized to the same size as the outputs.
The ISD Node has two output/results, therefore the legalizing functions update
both results/outputs.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D144846
Sameer Sahasrabuddhe [Fri, 3 Mar 2023 07:13:14 +0000 (12:43 +0530)]
[llvm][Uniformity] correctly use a vector as a set by uniqifying elements
The search for temporal divergence needs to determine a dominance frontier
defined for a cycle. The implementation uses a temporary vector to store a set
of newly discovered successors. Failing to uniqify the elements in this vector
causes a very large regression in compile time due to an exponential number of
redundant visits.
This fixes github issue #61123
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D145216
Mariya Podchishchaeva [Fri, 3 Mar 2023 10:02:22 +0000 (05:02 -0500)]
[NFC] Refine tests by adding `:` to checks
The tests can fail if working directory where the tests were launched
has a `error` substring in its path.
Reviewed By: jhenderson, foad
Differential Revision: https://reviews.llvm.org/D144562
Mehdi Amini [Fri, 3 Mar 2023 10:14:17 +0000 (11:14 +0100)]
Fix crash in ConvertVectorToLLVM.cpp pattern
Fixes #61094
Chuanqi Xu [Fri, 3 Mar 2023 09:27:37 +0000 (17:27 +0800)]
Recommit [C++20] [Modules] Trying to compare the trailing require clause from the primary template function
Close https://github.com/llvm/llvm-project/issues/60890.
For the following example:
```
export module a;
export template<typename T>
struct a {
friend void aa(a) requires(true) {
}
};
```
```
export module b;
import a;
struct b {
a<int> m;
};
```
```
export module c;
import a;
struct c {
void f() const {
aa(a<int>());
}
};
```
```
import a;
import b;
import c;
void d() {
aa(a<int>());
}
```
The current clang will reject this incorrectly. The reason is that the
require clause will be replaced with the evaluated version
(https://github.com/llvm/llvm-project/blob/
efae3174f09560353fb0f3d528bcbffe060d5438/clang/lib/Sema/SemaConcept.cpp#L664-L665).
In module 'b', the friend function is instantiated but not used so the
require clause of the friend function is `(true)`. However, in module
'c', the friend function is used so the require clause is `true`. So
deserializer classify these two function to two different functions
instead of one. Then here is the bug report.
The proposed solution is to try to compare the trailing require clause
of the primary template when performing ODR checking.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D144626
David Spickett [Tue, 31 May 2022 10:10:12 +0000 (10:10 +0000)]
[libcxx] Temporarily skip Arm configs
The machine hosting these agents will be down
for maintenance today.
We (Linaro) will remove this once the agents are back online.
Douglas Yung [Fri, 3 Mar 2023 08:25:06 +0000 (00:25 -0800)]
Revert "Add the ability to segment GSYM files."
This reverts commit
fe758254181a824d73ad960b651b42f671f8936b.
This change was causing several buildbot failures:
- https://lab.llvm.org/buildbot/#/builders/38/builds/10105
- https://lab.llvm.org/buildbot/#/builders/192/builds/562
- https://lab.llvm.org/buildbot/#/builders/109/builds/58893
- https://lab.llvm.org/buildbot/#/builders/16/builds/44360
- https://lab.llvm.org/buildbot/#/builders/247/builds/2095
- https://lab.llvm.org/buildbot/#/builders/196/builds/27236
- https://lab.llvm.org/buildbot/#/builders/54/builds/3714
Balázs Kéri [Fri, 3 Mar 2023 07:46:06 +0000 (08:46 +0100)]
[clang][ASTImporter] Import TemplateName correctly
This is a fix for a problem when multiple template
specializations are created by ASTImporter for the
same specialization. The problem happens if a
TemplateName is imported that points to a template
delcaration (for a template template argument)
(specialization) that has multiple instances in the
declaration chain. If two TemplateName objects contain
different pointers to a template specialization,
these TemplateName objects will have different checksum
even if they point into the same declaration chain.
The problem is fixed if the canonical declaration is used.
Reviewed By: vabridgers, donat.nagy
Differential Revision: https://reviews.llvm.org/D144622
Kito Cheng [Fri, 3 Mar 2023 07:32:44 +0000 (15:32 +0800)]
[clang][RISCV] Enable -fasynchronous-unwind-tables by default on Linux
This could improve user experience for stack unwinding, and also this is
enabled by default by X86 and AArch64 and RISC-V GCC.
Reviewed By: luismarques, MaskRay
Differential Revision: https://reviews.llvm.org/D145164
Yuanfang Chen [Thu, 9 Jun 2022 19:48:23 +0000 (12:48 -0700)]
[CodeGen] guarantee templated static variables are initialized in the reverse instantiation order
Based on Richard's suggestion in D126341:
`If we can actually describe a rule that we provide for initialization
order of instantiated variables, and we can easily implement that rule
and be confident we won't want to substantially weaken it later, and we
can thereby assure our users that we will satisfy that rule, then I
think that could be interesting, but anything less than that doesn't
seem worthwhile to me.`
I'm giving it try here. IMHO the implementation is pretty simple and
does not change behavior for unrelated constructs like the timing when
instantiated variables are passed to CodeGen.
This is based on the same ordering guarantee needed for inline variables D127233.
To provide this guarantee, we also need to
emit DeferredDeclsToEmit in the DFS order. https://github.com/llvm/llvm-project/commit/
e5df59ff78faebd897e81907606ce6074aac0df6
originally supported this but it is not exactly DFS order for cases like
the one in cwg362. For the example of Fib<5>, it triggers the instantiation
of Fib<4> and Fib<3>. However, due to the way GlobalEagerInstantiationScope
is implemented, Fib<4> does not actually trigger Fib<3> instantiation
since it is already triggered by Fib<5>. This breaks the guarantee.
This patch makes sure DeferredDeclsToEmit is emitted in DFS order by moving
DeferredDeclsToEmit storage from the call stack to an explicit stack-like
data structure. Then the DFS order could be enforced.
Differential Revision: https://reviews.llvm.org/D127259
Craig Topper [Fri, 3 Mar 2023 07:22:56 +0000 (23:22 -0800)]
[TypePromotion] Deference pointer before printing it in a debug message.
Without deferencing it just prints the value of the pointer which
isn't meaningful. Dereferencing prints the operand.
Siva Chandra Reddy [Thu, 2 Mar 2023 05:53:38 +0000 (05:53 +0000)]
[libc] Make errno an entrypoint.
The entrypoint has been added to the various entrypoint lists. The libc
code style doc has been updated with information on how errno should be
set from the libc runtime code.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D145179
Mikael Holmen [Thu, 2 Mar 2023 05:16:41 +0000 (06:16 +0100)]
[ADCE] Only remove debug intrinsics if non debug instructions are removed
We now limit ADCE to only remove debug intrinsics if it does something else
that would invalidate cached analyses anyway.
As we've seen in
https://github.com/llvm/llvm-project/issues/58285
throwing away cached analysis info when only debug instructions are removed
can lead to different code when debug info is present or not present.
Differential Revision: https://reviews.llvm.org/D145051
Chuanqi Xu [Fri, 24 Feb 2023 08:41:52 +0000 (16:41 +0800)]
[C++20] [Modules] Deprecate to load C++20 Modules eagerly
Close https://github.com/llvm/llvm-project/issues/60824
The form -fmodule-file=<path-to-BMI> will load modules eagerly and the
form -fmodule-file=<module-name>=<path-to-BMI> will load modules lazily.
The inconsistency adds many additional burdens to the implementations.
And the inconsistency looks not helpful and necessary neither. So I want
to deprecate the form -fmodule-file=<path-to-BMI> for named modules.
This is pretty helpful for us (the developers).
Does this change make any regression from the perspective of the users?
To be honest, yes. But I think such regression is acceptable. Here is
the example:
```
// M.cppm
export module M;
export int m = 5;
// N.cpp
// import M; // woops, we forgot to import M.
int n = m;
```
In the original version, the compiler can diagnose the users to import
`M` since the compiler have already imported M. But in the later style,
the compiler can only say "unknown identifier `m`".
But I think such regression doesn't make a deal since it only works if
the user put `-fmodule-file=M.pcm` in the command line. But how can the
user put `-fmodule-file=M.pcm` in the command line without `import M;`?
Especially currently such options are generated by build systems. And
the build systems will only generate the command line from the source
file.
So I think this change is pretty pretty helpful for developers and
almost innocent for users and we should accept this one.
I'll add the release notes and edit the document after we land this.
Differential Revision: https://reviews.llvm.org/D144707
Greg Clayton [Thu, 9 Feb 2023 18:16:34 +0000 (10:16 -0800)]
Add the ability to segment GSYM files.
Some workflows can generate large GSYM files and sharding GSYM files into segments can help some performant workflows that can take advantage of smaller GSYM files. This patch add a new --segment-size option to llvm-gsymutil. This option can specify a rough size in bytes of how large each segment should be.
Segmented GSYM files contain only the strings and files that are needed for the FunctionInfo objects that are added to each shard. The output file path gets the first address of the first contained function info appended as a suffix to the filename. If a base address of an image is set in the GsymCreator, then all segments will use this same base address which allows lookups for symbolication to happen correctly when the image has been slid in memory.
Code has been addeed to refactor and re-use methods within the GsymCreator to allow for segments to be created easily and tested.
Example of segmenting GSYM files:
$ llvm-gsymutil --convert llvm-gsymutil.dSYM -o llvm-gsymutil.gsym --segment-size
10485760
$ ls -l llvm-gsymutil.gsym-*
-rw-r--r-- 1 gclayton staff
10485839 Feb 9 10:45 llvm-gsymutil.gsym-0x1000030c0
-rw-r--r-- 1 gclayton staff
10485765 Feb 9 10:45 llvm-gsymutil.gsym-0x100668888
-rw-r--r-- 1 gclayton staff
10485881 Feb 9 10:45 llvm-gsymutil.gsym-0x100c948b8
-rw-r--r-- 1 gclayton staff
10485954 Feb 9 10:45 llvm-gsymutil.gsym-0x101659e70
-rw-r--r-- 1 gclayton staff
10485792 Feb 9 10:45 llvm-gsymutil.gsym-0x1022b1dc0
-rw-r--r-- 1 gclayton staff
10485889 Feb 9 10:45 llvm-gsymutil.gsym-0x102a18b10
-rw-r--r-- 1 gclayton staff
10485893 Feb 9 10:45 llvm-gsymutil.gsym-0x1030b05d0
-rw-r--r-- 1 gclayton staff
10485802 Feb 9 10:45 llvm-gsymutil.gsym-0x1037caaac
-rw-r--r-- 1 gclayton staff
10485781 Feb 9 10:45 llvm-gsymutil.gsym-0x103e767a0
-rw-r--r-- 1 gclayton staff
10485832 Feb 9 10:45 llvm-gsymutil.gsym-0x10452d0d4
-rw-r--r-- 1 gclayton staff
10485782 Feb 9 10:45 llvm-gsymutil.gsym-0x104b93310
-rw-r--r-- 1 gclayton staff 6255785 Feb 9 10:45 llvm-gsymutil.gsym-0x10526bf34
Differential Revision: https://reviews.llvm.org/D143793
Ting Wang [Fri, 3 Mar 2023 04:04:19 +0000 (23:04 -0500)]
[PowerPC][NFC] cleanup isEligibleForTCO
The input parameter IsByValArg to isEligibleForTCO() is false in all
cases, so it is considered redundant and should be removed.
Reviewed By: shchenz
Differential Revision: https://reviews.llvm.org/D145028
Chuanqi Xu [Fri, 3 Mar 2023 03:11:31 +0000 (11:11 +0800)]
[C++20] [Modules] Make TheImplicitGlobalModuleFragment and TheExportedImplicitGlobalModuleFragment to be useable modules
The unexported language linkage become unvisible to the current module
unit after the previous commit
bf52ead24ca4. This patch fixes the issue.
Chuanqi Xu [Fri, 3 Mar 2023 02:31:48 +0000 (10:31 +0800)]
[C++20] [Modules] Support to export declarations in language linkage
Close https://github.com/llvm/llvm-project/issues/60405
See the discussion in the above link for the background.
What the patch does:
- Rename `Module::ModuleKind::GlobalModuleFragment` to
`Module::ModuleKind::ExplicitGlobalModuleFragment`.
- Add another module kind `ImplicitGlobalModuleFragment` to
`ModuleKind`.
- Create an implicit global module fragment for the language linkage
declarations inside a module purview.
- If the language linkage lives inside the scope of an export decl,
the created modules is marked as exported to outer modules.
- In fact, Sema will only create at most 2 implicit global module
fragments to avoid creating a lot of unnecessary modules in the edging
case.
Reviewed By: iains
Differential Revision: https://reviews.llvm.org/D144367
Konstantin Varlamov [Fri, 3 Mar 2023 01:35:03 +0000 (17:35 -0800)]
[libc++] Temporarily not use compiler intrinsics for some type traits in Objective-C++ mode.
Currently, there are bugs in Clang's intrinsics for type traits when
handling Objective-C++ `id` (e.g. in `add_pointer`). As a temporary
workaround, don't use these intrinsics in the Objective-C++ mode.
Differential Revision: https://reviews.llvm.org/D145186
Zixu Wang [Fri, 3 Mar 2023 00:23:57 +0000 (16:23 -0800)]
[NFC] Properly handle optional minor value for ArchInfo::Version
Use `value_or` instead of `value` for checking minor versions in
`ArchInfo::implies`.
Differential Revision: https://reviews.llvm.org/D145206
Vadim Paretsky (Intel Americas Inc) [Thu, 2 Mar 2023 23:46:13 +0000 (15:46 -0800)]
This check-in makes the following improvements to the OpenMP Windows build:
Only generate the second def file when necessary (native Windows import
library builds).
Properly clean up .def file artifacts.
Reduce the re-generated import library build artifacts to the minimum.
Refactor the import library related portions of the script for clarity.
Tested with MSVC and MinWG/gcc12.0
Differential Revision:https://reviews.llvm.org/D144419
Derek Schuff [Thu, 2 Mar 2023 23:28:56 +0000 (15:28 -0800)]
Revert "[WebAssembly] Implement build-id feature"
This reverts commit
41e31466af6a7feab82742bb01af43f4f3ae4ede
due to a build failure on Windows.
Peter Klausler [Fri, 17 Feb 2023 22:57:52 +0000 (14:57 -0800)]
[flang] Warn about inconsistent implicit interfaces
When a global procedure has no explicit interface, emit warnings
when its references are inconsistent implicit procedure interfaces.
Differential Revision: https://reviews.llvm.org/D145097
Alex Langford [Thu, 2 Mar 2023 23:12:23 +0000 (15:12 -0800)]
[llvm] Add missing header guards in LogicCombine.h and LogicalExpr.h
These files were added in
97dcbea63e11d566cff0cd3a758cf1114cf1f633 but
it looks like they are missing header guards. This breaks module builds.
Marco Elver [Thu, 2 Mar 2023 22:45:42 +0000 (23:45 +0100)]
[SelectionDAG] Fix missing lambda capture
Move MaxDepth into the lambda, since it is not needed outside. This
fixes some compilers that complain about missing capture:
error C3493: 'MaxDepth' cannot be implicitly captured because no
default capture mode has been specified
Fixes:
f693932fbea7 ("[SelectionDAG] Transitively copy NodeExtraInfo on RAUW")
Aditya Nandakumar [Thu, 2 Mar 2023 22:06:29 +0000 (14:06 -0800)]
[GISel][CSE][NFC]: Handle mutual recursion when inserting node
GISel's CSE mechanism lazily inserts instructions into the CSE List
to improve on efficiency as well as efficacy of CSE
(for allowing partially built instructions to be fully built).
There's unfortunately a mutual recursion via
`handleRecordedInsts -> handleRecordedInst -> insertNode-> handleRecordedInsts`.
So this change simply records that we're already draining this list so we can just bail out on the recursion.
No changes to codegen are expected as we're still draining/handling the temporary
list via pop_back and we should get the same sequence of instructions
whether we call pop_back in a loop at the top level or recursive.
https://reviews.llvm.org/D145006
reviewed by: dsanders
Raman Tenneti [Thu, 2 Mar 2023 22:24:42 +0000 (14:24 -0800)]
[libc][NFC] Switch use of errno in src/time and test/src/time to libc_errno.
Switch use of errno in src/time and test/src/time to libc_errno.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145192
Jason Molenda [Thu, 2 Mar 2023 22:36:37 +0000 (14:36 -0800)]
Revert "Add SBValue::GetValueAsAddress API for removing non-addressing metadata"
Revert while I investigate two CI bot failures;
the more important is the lldb-arm-ubuntu where
the FixAddress is removing the 0th bit so we're
adding the `actual=` decorator on a string pointer,
```
Got output:
(char *) strptr = 0x00400817 (actual=0x400816) ptr = [{ },{H}]
```
in TestDataFormatterSmartArray.py line 229.
This reverts commit
4d635be2dbadc77522eddc9668697385a3b9f8b4.
Philip Reames [Thu, 2 Mar 2023 22:16:19 +0000 (14:16 -0800)]
[ASAN] Autogen masked load/store test coverage [nfc]
I also removed two runlines which added no additional coverage. No test in the file has both loads and stores, thus the two configurations duplicate the disabled configuration.
Derek Schuff [Wed, 4 Aug 2021 21:05:40 +0000 (14:05 -0700)]
[WebAssembly] Implement build-id feature
Implement the --build-id flag similarly to ELF, and generate a build_id
section according to the WebAssembly tool convention specified in
https://github.com/WebAssembly/tool-conventions/pull/183
The default style ("fast" aka "tree") hashes the contents of the output
and (unlike ELF) generates a v5 UUID based on the hash (using a random
namespace).
It also supports generating a random v4 UUID, a sha1 hash,
and a user-specified string (as ELF does).
Differential Revision: https://reviews.llvm.org/D107662
Amara Emerson [Thu, 2 Mar 2023 21:49:00 +0000 (13:49 -0800)]
[AArch64] Fix crash in LowerBUILD_VECTOR trying to create invalid EXTRACT_SUBVECTOR.
rdar://
106096671
Differential Revision: https://reviews.llvm.org/D145185
Marco Elver [Mon, 27 Feb 2023 11:05:02 +0000 (12:05 +0100)]
[SelectionDAG] Transitively copy NodeExtraInfo on RAUW
During legalization of the SelectionDAG, some nodes are replaced with
arch-specific nodes. These may be complex nodes, where the root node no
longer corresponds to the node that should carry the extra info.
Fix the issue by copying extra info to the new node and all its new
transitive operands during RAUW. See code comments for more details.
This fixes the remaining pcsections-atomics.ll tests on X86.
v2: Optimize copyExtraInfo() deep copy. For now we assume that only
NodeExtraInfo that have PCSections set require deep copy. Furthermore,
limit the depth of graph search while pre-populating the visited set,
assuming the to-be-replaced subgraph 'From' has limited complexity. An
assertion catches if the maximum depth needs to be increased.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D144677
Peter Klausler [Sat, 25 Feb 2023 14:46:32 +0000 (06:46 -0800)]
[flang] Fix CONTIGUOUS attribute for construct entities
Currently, the selector of a construct entity (e.g., ASSOCIATE(x=>a(1:20)))
is inheriting the CONTIGUOUS attribute from its associated variable
even if it has subscripts that make it noncontiguous (a(1:20:2)).
Add construct entities to the dynamic contiguity predicate instead.
Differential Revision: https://reviews.llvm.org/D145114
Philip Reames [Thu, 2 Mar 2023 22:00:21 +0000 (14:00 -0800)]
[ASAN] Simplify masked load/store test [nfc]
Only use of the globals was to load a pointer, we can just pass in a pointer instead.
Michael Jones [Thu, 2 Mar 2023 22:03:03 +0000 (14:03 -0800)]
[libc][obvious] Fix errno includes in unistd
Minor typo swapped quotes for angle brackets. This patch moves
everything to quotes.
Differential Revision: https://reviews.llvm.org/D145188
Jordan Rupprecht [Thu, 2 Mar 2023 21:51:30 +0000 (13:51 -0800)]
[Linux] Add kernel.yama.ptrace_scope note when ptrace fails to attach.
A common reason for LLDB failing to attach to an already-running process on Linux is the Yama security module: https://www.kernel.org/doc/Documentation/security/Yama.txt. This patch adds an explaination and suggested fix when it detects that case happening.
This was previously proposed in D106226, but hasn't been updated in a while. The last request was to put the check in a target-specific location, which is the approach this patch takes. I believe Yama only exists on Linux, so it's put in that package.
This has no end-to-end test because I'm not sure how to set `ptrace_scope` in a test environment -- if there are suggestions on how to do that, I'd be happy to add it. (Also, setting it to `3` is comically irreversible). I tested this locally.
Reviewed By: DavidSpickett, labath
Differential Revision: https://reviews.llvm.org/D144904
Jan Svoboda [Wed, 1 Mar 2023 19:51:20 +0000 (11:51 -0800)]
[clang][deps] NFC: Simplify worker loop
This patch simplifies the loop inside each worker by extracting index retrieval into a lambda function.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D145101
Peter Klausler [Sat, 25 Feb 2023 01:36:15 +0000 (17:36 -0800)]
[flang] Move check for statement function in BLOCK construct
A BLOCK construct may not contain a statement function definition;
but it may of course contain an assignment statement with an array
element on its left-hand side that looks like a statement function
definition. These misparsed statement functions are converted
into assignment statements during semantics once it is clear what
they are. Move the C1107 check for a statement function definition
in a block construct into declaration checking, which is where it
probably should have been in the first place anyway.
Differential Revision: https://reviews.llvm.org/D145112
Jakub Kuderski [Thu, 2 Mar 2023 21:37:56 +0000 (16:37 -0500)]
[ADT] Clean up `enumerate` implementation. NFC.
* Remove unnecessary member functions.
* Fix code sample.
This is in preparation for landing future changes in https://reviews.llvm.org/D144503.
Reviewed By: zero9178
Differential Revision: https://reviews.llvm.org/D145025
Luís Marques [Thu, 2 Mar 2023 21:42:23 +0000 (21:42 +0000)]
Revert "[Support] Implement findModulesAndOffsets on Apple 64-bit platforms"
This reverts commit
b8b8aa6f06458212193c4202291c9f68364b2025.
It broke AIX.
Jan Svoboda [Wed, 1 Mar 2023 19:31:49 +0000 (11:31 -0800)]
[clang][deps] Preserve input ordering in the full output
This patch makes sure the ordering of TUs in the input CDB is preserved in the full output. Previously, the results were pushed into a global vector, potentially out-of-order and then sorted by the input file name. This is non-deterministic when the CDB contains multiple entries with the same input file. This patch fixes that by pre-allocating the output vector and writing directly to the position corresponding to the current input. This also eliminates one critical section.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D145098
Michael Jones [Thu, 2 Mar 2023 00:27:02 +0000 (16:27 -0800)]
[libc] disable integration tests when using gcc
The integration tests were failing to build under GCC due to missing
compile options for using LLVM's libc++ and compiler-rt.
This should unblock https://github.com/llvm/llvm-project/issues/60467
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D145128
Jason Molenda [Thu, 2 Mar 2023 21:28:34 +0000 (13:28 -0800)]
Add SBValue::GetValueAsAddress API for removing non-addressing metadata
On target where metadata is stored in bits that aren't used for
virtual addressing -- AArch64 Top Byte Ignore and pointer authentication
are two examples -- an SBValue object representing a pointer will
return the address with metadata for SBValue::GetValueAsUnsigned.
Users may want to get the virtual address without the metadata;
this new method gives them a way to do this.
Differential Revision: https://reviews.llvm.org/D142792
Kazu Hirata [Thu, 2 Mar 2023 21:19:42 +0000 (13:19 -0800)]
[mlir] Use std::optional instead of llvm::Optional (NFC)
Aart Bik [Thu, 2 Mar 2023 20:06:29 +0000 (12:06 -0800)]
[mlir][sparse] convenience util to test for "sparse" op
Reviewed By: cota
Differential Revision: https://reviews.llvm.org/D145176