Guillaume Chatelet [Tue, 14 Mar 2023 13:00:07 +0000 (13:00 +0000)]
Revert "[libc][NFC] Move memcmp implementations in subfolders"
this broke arm32 build bots
This reverts commit
7f20e2a8d2ba73a8b05742903f4ae42afec82bff.
Aaron Ballman [Tue, 14 Mar 2023 12:57:25 +0000 (08:57 -0400)]
Revert "Fix include order in CXType.cpp"
This reverts commit
4d55a0b512a17dfaa2461b8803d37b79f6c9691d.
The addition of clang_isBitFieldDecl is not needed because
clang_Cursor_isBitField already exists.
Adrian Kuegel [Tue, 14 Mar 2023 12:54:01 +0000 (13:54 +0100)]
Leandro Lupori [Fri, 3 Mar 2023 12:49:23 +0000 (12:49 +0000)]
[flang] Handle mismatches of procedure type args
Fortran allows type mismatch when passing actual arguments to
procedures and most cases were already being handled correctly by
Flang. However, conversion of data types to and from procedures and
conversion between procedures and char procedures were not always
handled properly. The missing cases were added and these
conversions are supported now.
Fixes #60550
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/
D145601
Timm Bäder [Thu, 9 Mar 2023 17:55:25 +0000 (18:55 +0100)]
[clang][sema][NFC] Make a few functions const
Differential Revision: https://reviews.llvm.org/
D145947
Adrian Kuegel [Tue, 14 Mar 2023 12:45:53 +0000 (13:45 +0100)]
Guillaume Chatelet [Tue, 14 Mar 2023 12:46:21 +0000 (12:46 +0000)]
[libc][NFC] Move memcmp implementations in subfolders
Alex Bradbury [Tue, 14 Mar 2023 12:46:13 +0000 (12:46 +0000)]
[RISCV] Reject 'g' with explicit version in parseArchString
There is no versioning scheme for the 'g' shorthand for imafd (or in
current ISA specs, imafd_zifencei_zicsr). As such, the only sensible
behaviour to me seems to be to reject a version for it.
Differential Revision: https://reviews.llvm.org/
D145954
Takuya Shimizu [Tue, 14 Mar 2023 12:43:35 +0000 (08:43 -0400)]
[clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute
This patch checks whether -Wunreachable-code-fallthrough is enabled
when clang encounters unreachable fallthrough attributes and, if so,
suppresses code will never be executed warning to avoid duplicate
warnings.
Fixes https://github.com/llvm/llvm-project/issues/60416
Differential Revision: https://reviews.llvm.org/
D145842
LiaoChunyu [Tue, 14 Mar 2023 11:44:26 +0000 (19:44 +0800)]
[RISCV] Return false from shouldFormOverflowOp when type is i8 and i16
i8 and i16 are not using overflow.
Reduce the number of zero extension instructions.
To reduce the uncertainty of the unknown,
most of the checks of the virtual function are kept
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D143646
Kadir Cetinkaya [Tue, 14 Mar 2023 09:13:28 +0000 (10:13 +0100)]
[clangd] Drop stale macro and mark ranges
I'll follow up with patching of those ranges, this is to stop bleeding
mentioned in https://github.com/clangd/clangd/issues/1537.
Differential Revision: https://reviews.llvm.org/
D146024
Haojian Wu [Tue, 14 Mar 2023 08:37:18 +0000 (09:37 +0100)]
Remove an extra `//` in the IWYU pragma for gtest-matchers.h
Differential Revision: https://reviews.llvm.org/
D146022
Nicholas Guy [Mon, 13 Mar 2023 14:46:30 +0000 (14:46 +0000)]
[Codegen][ARM][AArch64] Support symmetric operations on complex numbers
Differential Revision: https://reviews.llvm.org/
D142482
Nicholas Guy [Mon, 13 Mar 2023 14:44:57 +0000 (14:44 +0000)]
Cleanup of Complex Deinterleaving pass (NFCI)
Differential Revision: https://reviews.llvm.org/
D143177
Haojian Wu [Tue, 14 Mar 2023 08:34:39 +0000 (09:34 +0100)]
[Tooling/Inclusion] Index more sub std namespace symbols.
Fixes https://github.com/llvm/llvm-project/issues/61373
Differential Revision: https://reviews.llvm.org/
D146021
Nicolas Vasilache [Mon, 13 Mar 2023 20:33:15 +0000 (13:33 -0700)]
[mlir][GPUTransforms] NFC - Refactor GPUTransforms.cpp in preparation for improvements.
Depends on:
D145977
Differential Revision: https://reviews.llvm.org/
D145980
Kadir Cetinkaya [Fri, 24 Feb 2023 08:36:07 +0000 (09:36 +0100)]
[Support][MemBuffer] Prevent UB on empty StringRefs
Empty StringRefs are usually identified by their length being zero, and
sometimes they'll have Data==nullptr (e.g. default constructed, or derived from
an operation like split/copy and result turned out to be empty).
If such StringRef objects are passed to llvm::MemoryBuffer::getMemBufferCopy,
it'll result in UB as neither src nor dst can be null, even if size is zero.
This patch prevents that UB by not issuing a copy whenever StringRef is empty.
Differential Revision: https://reviews.llvm.org/
D144706
Nabeel Omer [Mon, 13 Mar 2023 16:17:03 +0000 (16:17 +0000)]
[X86] Fix encoding for ATOMIC_LOGIC_OP
Fixes PR#61384.
Differential Revision: https://reviews.llvm.org/
D145930
Nabeel Omer [Mon, 13 Mar 2023 16:08:42 +0000 (16:08 +0000)]
[X86] Add negative test for
D145930
This patch adds a negative test for the issue discovered in
D145930.
Differential Revision: https://reviews.llvm.org/
D145933
Nicolas Vasilache [Mon, 13 Mar 2023 19:35:14 +0000 (12:35 -0700)]
[mlir][Transform] NFC - Various API cleanups and use RewriterBase in lieu of PatternRewriter
Depends on:
D145685
Differential Revision: https://reviews.llvm.org/
D145977
Alex Bradbury [Tue, 14 Mar 2023 11:16:23 +0000 (11:16 +0000)]
[RISCV][test] Test case for regression when MachineOutliner and MachineCopyPropagation are both enabled
MachineCopyPropagation removes a register copy in the outlined function
as it doesn't see that it's live-out from the function.
Nicolas Vasilache [Mon, 13 Mar 2023 19:29:10 +0000 (12:29 -0700)]
[mlir][Affine] Add helper functions to allow reordering affine.apply operands and decompose the ops into smaller components
Care is taken to order operands from least hoistable to most hoistable and to process subexpressions in the same
order.
This allows exposing more oppportunities for licm, cse and strength reduction.
Such a step should typically be applied while we still have loops in the IR and just before lowering affine ops to arith.
This is because the affine.apply canonicalization currently tries to maximally compose chains of affine.apply operations
and could undo the effects of these decompositions.
Depends on:
D145784
Differential Revision: https://reviews.llvm.org/
D145685
Nikita Popov [Fri, 3 Mar 2023 15:22:41 +0000 (16:22 +0100)]
Reapply [LowerTypeTests] Avoid creation of select constant expression
Reapply with a fix for phi handling: For phis, we need to insert
into the incoming block, not above the phi. This is especially
tricky if there are multiple incoming values from the same
predecessor, because these must all use the same value.
-----
LowerTypeTests replaces weak declarations with an icmp+select
constant expressions. As this is not a relocatable expression,
it additionally promotes initializers using it to global ctors.
As part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179,
I would like to remove the select constant expression, of which LTT
is now the last user. This is a bit tricky, because we now need to
replace a constant with an instruction, which might require
converting intermediate constant expression users to instructions as
well.
We do this using the convertUsersOfConstantsToInstructions() helper.
However, it needs to be slightly extended to also support expansion
of ConstantAggregates. These are important in this context, because
the promotion of initializers to global ctors will produce stores
of such aggregates.
Differential Revision: https://reviews.llvm.org/
D145247
Luke Lau [Mon, 13 Mar 2023 18:12:12 +0000 (18:12 +0000)]
[RISCV][NFC] Share interleave mask checking logic
This adds two new methods to ShuffleVectorInst, isInterleave and
isInterleaveMask, so that the logic to check if a shuffle mask is an
interleave can be shared across the TTI, codegen and the interleaved
access pass.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D145971
pvanhout [Tue, 14 Mar 2023 10:48:40 +0000 (11:48 +0100)]
Revert "[DAG/AMDGPU] Use UniformityAnalysis in DAGISel"
This reverts commit
0022b5803fd4f5a4e9fcf233267c0ffa1b88f763.
Emilia Dreamer [Tue, 14 Mar 2023 10:48:05 +0000 (12:48 +0200)]
[clang-format] Treat &/&& as reference when followed by requires clause
Previously, the token annotator would get confused and annotate a member
function's ref qualifier as a binary operator, if said function also had
a requires clause after it.
This patch accounts for that, treating requires clauses more similarly
to `noexcept`, which also comes after the ref qualifier.
Fixes https://github.com/llvm/llvm-project/issues/61270
Reviewed By: HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/
D145656
Nicolas Vasilache [Mon, 13 Mar 2023 19:24:58 +0000 (12:24 -0700)]
[mlir][DialectUtils] Cleanup IndexingUtils and provide more affine variants while reusing implementations
Differential Revision: https://reviews.llvm.org/
D145784
Max Kazantsev [Tue, 14 Mar 2023 10:16:54 +0000 (17:16 +0700)]
[NFC] Drop NDEBUG around MSSA verification
Proposed on review of https://reviews.llvm.org/
D145894.
Max Kazantsev [Tue, 14 Mar 2023 10:13:59 +0000 (17:13 +0700)]
[IndVars] Option verify-indvars is broken (and always has been), delete it
This option is switched off by default, and it seems that it has never worked correctly.
What it basically does is: it remembers current BECount SCEV, and after all transforms
tries to validate some facts for it. However, between these two points this SCEV may
become invalid (e.g. because some SCEVUnknown it references may be deleted as dead
code). So basically it may work with broken pointers.
Besides, its implementation does strange things (e.g. forgetLoop) which are invasive and
may affect behavior in other parts of the system (specifically verification), concealing some
other problems. Another issue is that it may use SCEVCouldNotCompute object without
checking this.
The option is not used in any unit tests, and if switched on by default, the following tests
fail:
```
********************
Failed Tests (14):
LLVM :: Transforms/IndVarSimplify/2005-06-15-InstMoveCrash.ll
LLVM :: Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll
LLVM :: Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll
LLVM :: Transforms/IndVarSimplify/2009-05-24-useafterfree.ll
LLVM :: Transforms/IndVarSimplify/2011-10-27-lftrnull.ll
LLVM :: Transforms/IndVarSimplify/ARM/code-size.ll
LLVM :: Transforms/IndVarSimplify/X86/deterministic-scev-verify.ll
LLVM :: Transforms/IndVarSimplify/X86/pr57187.ll
LLVM :: Transforms/IndVarSimplify/X86/verify-scev.ll
LLVM :: Transforms/IndVarSimplify/bbi-63564.ll
LLVM :: Transforms/IndVarSimplify/invalidate-modified-lcssa-phi.ll
LLVM :: Transforms/IndVarSimplify/loop-predication.ll
LLVM :: Transforms/IndVarSimplify/post-inc-range.ll
LLVM :: Transforms/IndVarSimplify/turn-to-invariant.ll
********************
Unexpectedly Passed Tests (1):
LLVM :: Transforms/IndVarSimplify/pr55689.ll
```
None of these looks like real problems found by verification, these are
bugs in the verifying code itself (such as use of deleted SCEVs and
SCEVCouldNotCompute's).
I think it all gives enough justification for its removal.
https://github.com/llvm/llvm-project/issues/61302
Differential Revision: https://reviews.llvm.org/
D145894
Reviewed By: nikic
pvanhout [Tue, 14 Mar 2023 10:25:22 +0000 (11:25 +0100)]
[StructurizeCFG] Correctly depend on UniformityAnalysis
Small oversight in https://reviews.llvm.org/
D145688 - the pass' dependency was not updated to reflect the change to UA.
Also, change DivergenceAnalysis to UniformityAnalysis in a comment. That way, StructurizeCFG only refers to UA and not DA anymore.
pvanhout [Mon, 13 Mar 2023 10:33:15 +0000 (11:33 +0100)]
[DAG/AMDGPU] Use UniformityAnalysis in DAGISel
Switch DAGISel over to UniformityAnalysis, which was one of the last remaining users of the DivergenceAnalysis.
No explosions seen during internal testing so this looks like a smooth transition.
Reviewed By: sameerds
Differential Revision: https://reviews.llvm.org/
D145918
Matt Devereau [Tue, 7 Mar 2023 15:12:31 +0000 (15:12 +0000)]
[AArch64] Add svboolx2_t and svboolx4_t tuple types
https://reviews.llvm.org/
D145505
Max Kazantsev [Tue, 14 Mar 2023 10:09:50 +0000 (17:09 +0700)]
[TTI] Evaluate cost of experimental_widenable_condition as zero
This intrinsic is not supposed to live through lowering, eventually it should turn
into `true` constant and be optimized away.
Differential Revision: https://reviews.llvm.org/
D146027
Reviewed By: skatkov
Nikita Popov [Tue, 14 Mar 2023 10:04:54 +0000 (11:04 +0100)]
[SCEV] Rename ControlsExit -> ControlsOnlyExit (NFC)
As suggested in https://reviews.llvm.org/
D145510#
4192162.
Nikita Popov [Tue, 7 Mar 2023 14:42:16 +0000 (15:42 +0100)]
[SCEV] Fix finite loop non-strict predicate simplification (PR60944)
There are a number of issues with the current code for converting
ule -> ult (etc) predicates for comparisons controlling finite loops:
* It sets nowrap flags, which may only hold for that particular
comparison, not globally. (PR60944)
* It doesn't check that the RHS is invariant. (I'm not sure this
can cause practical issues independently of the previous point.)
* It runs before simplifications that may be more profitable. (PR54191)
This patch moves the handling for this into computeExitLimitFromICmp(),
because it is somewhat tightly coupled with assumptions in that code,
and addresses the aforementioned issues.
Fixes https://github.com/llvm/llvm-project/issues/60944.
Fixes https://github.com/llvm/llvm-project/issues/54191.
Differential Revision: https://reviews.llvm.org/
D145510
Nikita Popov [Tue, 14 Mar 2023 09:42:01 +0000 (10:42 +0100)]
[InstCombine] Regenerate test checks (NFC)
Nikita Popov [Tue, 14 Mar 2023 09:37:33 +0000 (10:37 +0100)]
[SCEV] Clarify ControlsExit comment (NFC)
ControlsExit implies a single exit branch.
Max Kazantsev [Tue, 14 Mar 2023 09:27:40 +0000 (16:27 +0700)]
[Test] Add missing REQUIRES: asserts in test
OCHyams [Tue, 14 Mar 2023 09:17:06 +0000 (09:17 +0000)]
[Assignment Tracking] getIntrinsicInstrCost: set dbg.assign cost to zero
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/
D144652
Pavel Kosov [Tue, 14 Mar 2023 09:12:35 +0000 (12:12 +0300)]
[LLVM][OHOS] Clang toolchain and targets
Add a clang part of OpenHarmony target
Related LLVM part:
D138202
~~~
Huawei RRI, OS Lab
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/
D145227
Maya Amrami [Thu, 9 Mar 2023 15:30:54 +0000 (17:30 +0200)]
[mlir] Move tosa.concat lowering from TosaToLinalg to TosaToTensor
tosa.concat is lowered to tensor.insert_slice thus it should be in
TosaToTensor rather than in TosaToLinalg.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/
D145952
OCHyams [Tue, 14 Mar 2023 08:17:19 +0000 (08:17 +0000)]
NFC Fix cost model checks in tests for debug intrinsics
These tests don't have a "Debug Info Version" module flag causing the debug
intrinsics to be dropped with a warning `warning: ignoring debug info with an
invalid version (0)`. The test passes because there are no CHECK lines for
these intrinsics. Fix the issue and auto-update the test checks.
Reviewed By: jryans
Differential Revision: https://reviews.llvm.org/
D145573
Jay Foad [Mon, 13 Mar 2023 14:05:17 +0000 (14:05 +0000)]
[AMDGPU] Fix .amdhsa_shared_vgpr_count error checking for GFX11
Differential Revision: https://reviews.llvm.org/
D145936
Max Kazantsev [Tue, 14 Mar 2023 08:49:25 +0000 (15:49 +0700)]
[Test] Add test showing difference in cost models for guards
Nikita Popov [Mon, 13 Mar 2023 10:18:57 +0000 (11:18 +0100)]
[IR] Allow !range on vector of integer instructions
Inspired by https://reviews.llvm.org/
D144467#
4188310, this allows
!range on vector of integer instructions, with the usual
element-wise interpretation, which is already used by various
analysis APIs that support vectors.
Differential Revision: https://reviews.llvm.org/
D145920
Kadir Cetinkaya [Tue, 14 Mar 2023 08:20:13 +0000 (09:20 +0100)]
[IncludeCleaner][NFC] Dont rely on implicit conversion of StringRef
Fixes https://github.com/llvm/llvm-project/issues/61221
Siva Chandra Reddy [Tue, 14 Mar 2023 07:23:07 +0000 (07:23 +0000)]
[bazel][libc] Add errno target to function_deps of tests.
Existing listings in normal deps have been removed.
Reviewed By: akuegel
Differential Revision: https://reviews.llvm.org/
D146014
Kazu Hirata [Tue, 14 Mar 2023 07:32:40 +0000 (00:32 -0700)]
[Analysis] Use *{Set,Map}::contains (NFC)
Kazu Hirata [Tue, 14 Mar 2023 07:24:30 +0000 (00:24 -0700)]
[Transforms] Use *{Set,Map}::contains (NFC)
Nathan Ridge [Fri, 27 Jan 2023 07:17:20 +0000 (02:17 -0500)]
[clang] Store the template param list of an explicit variable template specialization
VarTemplateSpecializationDecl does not store a template param list,
so the "template<>" needs to be stored in the ExtInfo.
Differential Revision: https://reviews.llvm.org/
D142692
Nathan Ridge [Tue, 21 Feb 2023 08:22:59 +0000 (03:22 -0500)]
[clangd] Fix a bug in TweakTest::decorate()
The second argument to string::substr() is a count,
not an end position.
Differential Revision: https://reviews.llvm.org/
D144453
Chuanqi Xu [Tue, 14 Mar 2023 06:20:44 +0000 (14:20 +0800)]
[C++20] [Modules] Profile TemplateName by canonical decl
Close https://github.com/llvm/llvm-project/issues/61317
The root cause of the problem is that we profile TemplateName by the
non-canonical decls so that the compiler thought they are two different
types. But this is not true. We fixed the issue after we profile the
template name by using the same name.
Siva Chandra [Tue, 14 Mar 2023 05:47:00 +0000 (05:47 +0000)]
[libc] Enable more functions on riscv64.
The list of headers has also been updated. Some duplicated entrypoints
have been removed.
Valentin Clement [Tue, 14 Mar 2023 05:31:27 +0000 (06:31 +0100)]
[flang] Use llvm.zext when converting from i1 -> iXX
CodeGen used llvm.sext when converting fir.convert %0 : (i1) -> iXX
where iXX is any integer. This leads to wrong values when the initial
i1 is equal to 1.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/
D145984
Jeff Bailey [Tue, 14 Mar 2023 05:31:01 +0000 (05:31 +0000)]
[libc] Update cross-compilation instructions
* Add various options so that it uses the build lld and compiler-rt
* Add instructions on how to use the newly built libc
* Remove trailing comments in code-block for cut and pastability
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/
D145878
Alex Brachet [Tue, 14 Mar 2023 05:17:54 +0000 (05:17 +0000)]
[Driver] Make -X default for baremetal riscv
Differential Revision: https://reviews.llvm.org/
D145725
Siva Chandra Reddy [Mon, 13 Mar 2023 22:05:03 +0000 (22:05 +0000)]
[libc] Make libc_errno point to internal errno for non-public builds.
The macro llvmlibc_errno has also been removed. This change completes
the switch to using a hermetic errno for unit tests.
Fixes #61037
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/
D146005
Siva Chandra Reddy [Tue, 14 Mar 2023 01:12:11 +0000 (01:12 +0000)]
[libc] Switch sys/stat implementations over to libc_errno.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/
D146004
sstwcw [Fri, 10 Mar 2023 15:12:13 +0000 (15:12 +0000)]
[clang-format] Recognize Verilog always blocks
The small `Coverage` test was added because we added the space rule
about 2 at signs along with the rule about only 1 of it. We have not
fully covered covergroup yet.
Reviewed By: MyDeveloperDay, owenpan
Differential Revision: https://reviews.llvm.org/
D145794
aabhinavg [Mon, 13 Mar 2023 06:22:00 +0000 (11:52 +0530)]
[Docs] Added llvm-mc documentation
Fix #61313
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/
D145844
Chen Zheng [Tue, 7 Mar 2023 02:31:32 +0000 (21:31 -0500)]
[PowerPC] remove side effect for some cases for saturate instructions
Fixes #60684
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/
D145353
Chen Zheng [Mon, 6 Mar 2023 05:28:39 +0000 (00:28 -0500)]
add testcases for
D145353; NFC
Siva Chandra Reddy [Tue, 14 Mar 2023 01:25:47 +0000 (01:25 +0000)]
[libc][NFC] Switch nanosleep_test and getcwd_test to libc_errno.
Siva Chandra Reddy [Tue, 14 Mar 2023 01:00:23 +0000 (01:00 +0000)]
[libc] Switch termios implementations to libc_errno.
chenglin.bi [Tue, 14 Mar 2023 00:59:53 +0000 (08:59 +0800)]
Revert "[LogicCombine 1/?] Implement a general way to simplify logical operations."
This reverts commit
97dcbea63e11d566cff0cd3a758cf1114cf1f633.
Jakub Kuderski [Tue, 14 Mar 2023 00:48:38 +0000 (20:48 -0400)]
[ADT][NFCI] Do not use non-const lvalue-refs with enumerate in llvm/
Replace references to `enumerate` results with either const lvalue
rerences or structured bindings. I did not use structured bindings
everywhere as it wasn't clear to me it would improve readability.
This is in preparation to the switch to `zip` semantics which won't
support non-const lvalue reference to elements:
https://reviews.llvm.org/
D144503.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/
D145987
Peter Klausler [Mon, 13 Mar 2023 18:02:32 +0000 (11:02 -0700)]
[flang] Accept non-interoperable LOGICAL scalar dummy arguments
Some Fortran compilers allow kinds of LOGICAL other than C_BOOL
for the types of dummy arguments to interoperable (BIND(C))
procedures. As any kind of LOGICAL can be converted to any
other without loss of information, this seems to be a useful
unambiguous extension that is attested in real codes; accept it
for scalars with a portability warning.
Differential Revision: https://reviews.llvm.org/
D145968
Siva Chandra Reddy [Mon, 13 Mar 2023 23:44:03 +0000 (23:44 +0000)]
[libc][NFC] Switch unistd.h tests to libc_errno.
David Blaikie [Tue, 14 Mar 2023 00:49:32 +0000 (00:49 +0000)]
llvm-symbolizer: Don't crash when referencing an invalid CU in a dwp file twice
Previously we'd stash a null pointer in a sorted vector of CUs - the
next time around, we'd try to do a binary search in that vector (sorting
on a key inside the objects pointed to by the elements of the vector)
which would deref null if we'd stashed a null in there previously.
As a reasonable, but not ideal, workaround - don't stash any result in
the vector - this means every query will produce a new warning
(resulting in duplicate warnings) but better than a crash.
Stashing null in the list could be workable if we also stashed the
offset in a pair - but then all the clients would need to be fixed up
(maybe using a filtering iterator) which seems like overkill for this
uncommon error case.
ziqingluo-90 [Tue, 14 Mar 2023 00:17:30 +0000 (17:17 -0700)]
[-Wunsafe-buffer-usage] Reducing non-determinism in diagnostics output stream
The -Wunsafe-buffer-usage analysis outputs diagnostics in the order of
pointer values to associated `VarDecl`s. This creates non-determinism
in the order of diagnostics in output since the order cannot be
guaranteed in pointer values. However, our fix-it tests were written
under the assumption that diagnostics are output in source location
order. This results in non-deterministic failures in our tests. This
patch fixes the problem by keeping analysis results sorted by source
locations.
Reviewed by: jkorous, NoQ
Differential revision: https://reviews.llvm.org/
D145993
Alex Langford [Tue, 14 Mar 2023 00:17:02 +0000 (17:17 -0700)]
[lldb] Remove MIPS Linux UnixSignals
MIPS Linux support was removed in
ce03a862372a6f36d2fcf80dc80052aa155fcae8
Siva Chandra Reddy [Mon, 13 Mar 2023 23:43:31 +0000 (23:43 +0000)]
[libc][NFC] Switch sys/*.h tests over to libc_errno.
Carl Ritson [Mon, 13 Mar 2023 23:42:22 +0000 (08:42 +0900)]
[IRLinker] Fix mapping of declaration metadata
Ensure metadata for declarations copied during materialization
is properly mapped if declarations do not become definitions.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/
D145318
Jacob Lambert [Sat, 11 Mar 2023 01:27:43 +0000 (17:27 -0800)]
Switch ABI references to env/environment
To be consistent with Triple.h, we update references to the
optional fourth triple field from ABI to env or enviornment
Differential Revision: https://reviews.llvm.org/
D145833
Ben Langmuir [Sat, 11 Mar 2023 05:21:09 +0000 (21:21 -0800)]
[clang][deps] Handle response files in dep scanner
Extract the code the driver uses to expand response files and reuse it
in the dependency scanner.
rdar://
106155880
Differential Revision: https://reviews.llvm.org/
D145838
Siva Chandra Reddy [Mon, 13 Mar 2023 22:46:19 +0000 (22:46 +0000)]
[libc][NFC] Switch mman.h tests to libc_errno and update Bazel build.
Siva Chandra Reddy [Mon, 13 Mar 2023 22:11:32 +0000 (22:11 +0000)]
[libc][NFC] Switch startup tests to libc_errno.
Siva Chandra Reddy [Mon, 13 Mar 2023 22:11:07 +0000 (22:11 +0000)]
[libc][NFC] Switch string and errno tests to libc_errno.
Siva Chandra Reddy [Mon, 13 Mar 2023 22:07:34 +0000 (22:07 +0000)]
[libc][NFC] Switch all uses of errno in math and math tests to libc_errno.
Philip Reames [Mon, 13 Mar 2023 22:10:13 +0000 (15:10 -0700)]
[RISCV] Improve SK_Reverse shuffle costs for fixed length vectors
As noted by @luke (https://reviews.llvm.org/
D145953#inline-
1409312), we were accounting for the cost of vector element size using vlenb whereas the expression can be constant folded for fixed length vectors.
Differential Revision: https://reviews.llvm.org/
D145973
Aiden Grossman [Mon, 13 Mar 2023 21:43:05 +0000 (21:43 +0000)]
[Propeller][ELF] Add Doxygen comment for decodeBBAddrMap
Adds a doxygen comment on decodeBBAddrMap specifying what it does as well
as some requirements that need to be met when calling it (especially
the condition of passing in a relocation section when the ELFFile is
relocatable).
Differential Revision: https://reviews.llvm.org/
D145989
Philip Reames [Mon, 13 Mar 2023 21:40:15 +0000 (14:40 -0700)]
[ASAN] Extract out a helper routine for foreach lane on vectors [nfc]
The new API matches a case we also need in MSAN. For the moment, I'm staging this as a local-to-ASAN commit, but I expect to move this to a shared location and reuse in the next day or two.
Jonas Devlieghere [Mon, 13 Mar 2023 21:39:10 +0000 (14:39 -0700)]
[lldb] Explicitly import json in TestSymbolFileJSON.py
The test was relying on the json module getting imported transitively by
one of its imported modules. Make this less brittle by importing it
explicitly.
Michal Paszkowski [Mon, 13 Mar 2023 21:26:04 +0000 (22:26 +0100)]
[SPIR-V] Promote arbitrary width ints to regular width
After this patch all arbitrary size integers (smaller than 64 bits) in
LLVM IR will be promoted to regular size type in SPIR-V (OpTypeInt
8/16/32/64).
Differential Revision: https://reviews.llvm.org/
D145137
Aiden Grossman [Sat, 25 Feb 2023 10:18:57 +0000 (10:18 +0000)]
[Propeller] Make decoding BBAddrMaps trace through relocations
Currently when using the LLVM tools (eg llvm-readobj, llvm-objdump) to
find information about basic block locations using the propeller tooling
in relocatable object files function addresses are not mapped properly
which causes problems. In llvm-readobj this means that incorrect
function names will be pulled. In llvm-objdum this means that most BBs
won't show up in the output if --symbolize-operands is used. This patch
changes the behavior of decodeBBAddrMap to trace through relocations
to get correct function addresses if it is going through a relocatable
object file. This fixes the behavior in both tools and also other
consumers of decodeBBAddrMap. Some helper functions have been added
in/refactoring done to aid in grabbing BB address map sections now that
in some cases both relocation and BB address map sections need to be
obtained at the same time.
Regression tests moved around/added.
Differential Revision: https://reviews.llvm.org/
D143841
Tue Ly [Mon, 13 Mar 2023 20:14:53 +0000 (16:14 -0400)]
[libc] Fix policy CMP0116 warnings for cmake 3.20 or above.
Warnings due to changes in behavior of cmake 3.20 or above. See
https://cmake.org/cmake/latest/policy/CMP0116.html
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/
D145983
Philip Reames [Mon, 13 Mar 2023 20:55:24 +0000 (13:55 -0700)]
[MSAN] Use TypeSize and related utilities [nfc-ish]
This is part of prework for supporting scalable vector types. This isn't NFC because it shifts the point of failure (i.e. which assert triggers first), but should be NFC for all non-scalable vector inputs.
David Tenty [Wed, 8 Mar 2023 20:48:44 +0000 (15:48 -0500)]
[clang][driver] accept maix32/maix64 gcc compat options
GCC on AIX primarily uses the -maix32 and -maix64 to select the bitmode
to target. In order to be compatible with existing build configurations,
clang should accept these options as well. In this patch we implement
these options for AIX targets.
Differential Revision: https://reviews.llvm.org/
D145610
Philip Reames [Mon, 13 Mar 2023 20:05:53 +0000 (13:05 -0700)]
[MSAN] Remove usage of FixedVectorType where trivial [nfc]
This is a prepass on generalizing for scalable vectors; I'm just picking off the easy bits.
Snehasish Kumar [Mon, 13 Mar 2023 20:08:41 +0000 (20:08 +0000)]
Revert "[memprof] Record BuildIDs in the raw profile."
This reverts commit
287177a47a396ca6cc0bef7696108cdaa0c68e5f.
Amir Ayupov [Mon, 6 Feb 2023 22:03:40 +0000 (14:03 -0800)]
[BOLT][NFC] Return instruction list from createInstrIncMemory
Leverage move semantics for `std::vector`.
This also makes it consistent with `createInstrumentationSnippet`.
Reviewed By: Elvina
Differential Revision: https://reviews.llvm.org/
D145465
Valentin Clement [Mon, 13 Mar 2023 13:08:20 +0000 (06:08 -0700)]
[flang] Handle parent component in user function argument for special cases
In some cases the argument is already handled by a fir.rebox operation. Just
adapat the type to match the parent component in that case.
Depends on
D145928
Differential Revision: https://reviews.llvm.org/
D145931
David Green [Mon, 13 Mar 2023 19:44:12 +0000 (19:44 +0000)]
[LV][VPlan] Fix printing TripCount liveins. NFC
The TripCount liveins would currently be printed as badref in the vplan as they
are not allocated slots in the VPSlotTracker. This patch allocates them a slot
and adds them to the printed Live-Ins. It also makes a minor adjustment to
printing of Live-ins to reduce the empty lines when multiple Live-ins are
present.
Differential Revision: https://reviews.llvm.org/
D145507
Valentin Clement [Mon, 13 Mar 2023 19:29:43 +0000 (20:29 +0100)]
[flang] Handle parent component in user function argument
When the argument is a parent component the box needs to
be updated to reflect the correct type. Use `updateBoxForParentComponent`
to update the argument accordingly.
Depends on
D145907
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/
D145928
Felipe de Azevedo Piovezan [Mon, 13 Mar 2023 14:44:13 +0000 (10:44 -0400)]
[AArchExpandPseudo] Preserve instruction debug number in expansions
This is an initial attempt at preserving debug information in the pseudo
instruction expansion of the AArch backend. In particular, we preserve
the instruction number required by the InstrRef implementation of live
debug values.
There are many other expansions that need to be considered, but the ones
addressed in this commit should be extremely common, as they handle most
arithmetic and logical instructions.
Differential Revision: https://reviews.llvm.org/
D145943
Snehasish Kumar [Tue, 28 Feb 2023 21:33:30 +0000 (21:33 +0000)]
[memprof] Record BuildIDs in the raw profile.
This patch adds support for recording BuildIds usng the sanitizer
ListOfModules API. We add another entry to the SegmentEntry struct and
change the memprof raw version.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/
D145190
Joseph Huber [Mon, 13 Mar 2023 19:16:13 +0000 (14:16 -0500)]
Revert "[Libomptarget] Use freestanding stdint.h header for DeviceRTL"
This patch breaks the handling of `printf` in the OpenMP library. Usiing
`-ffreestanding` prevents clang from emitting LLVM builtins, which we
use for OpenMP printing support. Shelve this until we have functioning
`printf` in the GPU `libc` and we can remove that code.
This reverts commit
a92eaa3ebee6ff85549e8f1c50da4958dbbdcb30.
Hassnaa Hamdi [Thu, 23 Feb 2023 16:13:16 +0000 (16:13 +0000)]
[AArch64][SVE]: custom lower AVGFloor/AVGCeil.
-Lower AVGFloor(A, B) to:
SRL(A) + SRL(B) + (A&B)&1.
-Lower AVGCeil(A, B) to:
SRL(A) + SRL(B) + (A|B)&1.
Differential Revision: https://reviews.llvm.org/
D143283
Joshua Cranmer [Mon, 13 Mar 2023 18:53:55 +0000 (14:53 -0400)]
[lldb] Fix lldb code for renaming of OpenCL AVC types.
Philip Reames [Mon, 13 Mar 2023 18:39:00 +0000 (11:39 -0700)]
[IRBuilder] Add utilities for materializing scalable values [nfc]
These idioms already appear a number of places in code, and upcoming changes to the various sanitizers continue to need more instances of the same patterns.
Differential Revision: https://reviews.llvm.org/
D145945