Craig Topper [Thu, 18 May 2023 17:09:50 +0000 (10:09 -0700)]
[RISCV] Reduce dependency on RISCV::RVVBitsPerBlock for calculating vector size for -mrvv-vector-bits.
We can use the minimum value of the BuiltinType's ElementCount and
the element size.
This needs to be done to support LMUL!=1 types anyway.
I did have to make an ordering change in the error checks in
HandleRISCVRVVVectorBitsTypeAttr to check if the type is an RVV
VLS type before checking the size.
Siva Chandra Reddy [Thu, 18 May 2023 06:35:59 +0000 (06:35 +0000)]
[libc] Add a functioning realloc for hermetic tests.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D150846
Siva Chandra Reddy [Thu, 18 May 2023 08:19:24 +0000 (08:19 +0000)]
[libc] Extend IntegerToString to convert UInt* numbers to hex string.
This new functionality will help us avoid duplicated code in various
places in the testing infrastructure. Since the string representation
of the wide numbers is to be used by tests, to keep it simple, we
zero-pad the strings.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D150849
Dave Lee [Mon, 15 May 2023 21:36:17 +0000 (14:36 -0700)]
[lldb] Delay removal of persistent results
Follow up to "Suppress persistent result when running po" (D144044).
This change delays removal of the persistent result until after `Dump` has been called.
In doing so, the persistent result is available for the purpose of getting its object
description.
In the original change, the persistent result removal happens indirectly, by setting
`EvaluateExpressionOptions::SetSuppressPersistentResult`. In practice this has worked,
however this exposed a latent bug in swift-lldb. The subtlety, and the bug, depend on
when the persisteted result variable is removed.
When the result is removed via `SetSuppressPersistentResult`, it happens within the call
to `Target::EvaluateExpression`. That is, by the time the call returns, the persistent
result is already removed.
The issue occurs shortly thereafter, when `ValueObject::Dump` is called, it cannot make
use of the persistent result variable (instead it uses the `ValueObjectConstResult`). In
swift-lldb, this causes an additional expression evaluation to happen. It first tries an
expression that reference `$R0` etc, but that always fails because `$R0` is removed. The
fallback to this failure does work most of the time, but there's at least one bug
involving imported Clang types.
Differential Revision: https://reviews.llvm.org/D150619
Aaron Ballman [Thu, 18 May 2023 16:37:53 +0000 (12:37 -0400)]
Clean up Clang's index page slightly
Set the charset to UTF-8, link to the actual liscense we used,
claim support for targets LLVM supports instead of listing them
manually, and stop listing individual language standards we support.
Aaron Ballman [Thu, 18 May 2023 16:22:30 +0000 (12:22 -0400)]
Removed outdated information from Clang's webpage menu
This removes the link to Planet Clang as well as the LLVM coverage
reports, as neither has been actively worked on for several years.
Craig Topper [Thu, 18 May 2023 16:21:38 +0000 (09:21 -0700)]
[RISCV] Fix assertion when casting LMUL!=1 RVV types to GNU types with -mrvv-vector-bits.
We need to call isRVVVLSBuiltinType() before calling getRVVTypeSize().
Erich Keane [Thu, 18 May 2023 16:05:51 +0000 (09:05 -0700)]
Ensure comparison of constraints creates a code synth context
This is a regression from
6db007a0 that was reported in:
https://github.com/llvm/llvm-project/issues/62697
The assertion was because we require a code synthesis context for the
instantiation of templates, and this reproducer causes a comparison that
doesn't have a parent-template causing one to exists.
This patch fixes it by creating a ConstraintNormalization context.
Aaron Ballman [Thu, 18 May 2023 15:49:33 +0000 (11:49 -0400)]
Remove unreferenced files from Clang's website
None of these files are referenced by anything else on the website, and
the content for these files is quite dated or experiments that did not
pan out. I used a few search engines to see if others were linking to
this content (esp the libstdc++ patches) and did not find significant
evidence that they were.
Thomas Lively [Thu, 18 May 2023 15:24:58 +0000 (08:24 -0700)]
[WebAssembly] Add wasm_simd128.h intrinsics for relaxed SIMD
Add user-friendly intrinsic functions for all relaxed SIMD instructions
alongside the existing SIMD128 intrinsic functions in wasm_simd128.h. Test that
the new instrinsics lower to the expected instructions in the existing
cross-project-tests test file.
Reviewed By: aheejin, sbc100
Differential Revision: https://reviews.llvm.org/D150833
Louis Dionne [Wed, 17 May 2023 14:17:53 +0000 (07:17 -0700)]
[libc++] Avoid dereferencing a const iterator in std::sort
This is a workaround to provide a grace period for folks that were
broken by D147089. As a fly-by, also apply comments by Mark I had
somehow missed in the review.
Differential Revision: https://reviews.llvm.org/D150779
zhijian [Thu, 18 May 2023 15:22:35 +0000 (11:22 -0400)]
Summary:
Fixed a test case llvm\test\Object\bigarchive-malformed-header.test fail caused by windowi OS has 'llvm-ar.exe' instead of llvm-ar.
Mateja Marjanovic [Thu, 18 May 2023 14:15:57 +0000 (16:15 +0200)]
Revert "[AMDGPU] Trim zero components from buffer and image stores"
This reverts commit
3181a6e3e7dae9292782216a55c5e1f0583c1668.
zhijian [Thu, 18 May 2023 14:54:14 +0000 (10:54 -0400)]
[AIX] support 64bit global symbol table for big archive
Summary:
In big archive , there is 32bit global symbol table and 64 bit global symbol table. llvm-ar only support 32bit global symbol table this moment, we need to support the 64 bit global symbol table.
https://www.ibm.com/docs/en/aix/7.2?topic=formats-ar-file-format-big
Global Symbol Tables
Immediately following the member table, the archive file contains two global symbol tables. The first global symbol table locates 32-bit file members that define global symbols; the second global symbol table does the same for 64-bit file members. If the archive has no 32-bit or 64-bit file members, the respective global symbol table is omitted. The strip command can be used to delete one or both global symbol tables from the archive. The fl_gstoff field in the fixed-length header contains the offset to the 32-bit global symbol table, and the fl_gst64off contains the offset to the 64-bit global symbol table.
Reviewers: James Henderson,Stephen Peckham
Differential Revision: https://reviews.llvm.org/D142479
Amaury Séchet [Thu, 18 May 2023 14:44:53 +0000 (14:44 +0000)]
[NFC] Flatten the logic in RISCVTargetLowering::decomposeMulByConstant
Stefan Pintilie [Wed, 17 May 2023 14:36:23 +0000 (10:36 -0400)]
[PowerPC] Add DFP multiply and divide instructions.
This patch adds the DFP mul and div instructions. This includes both the
double and quad forms of the instructions as well as the record form.
Reviewed By: amyk
Differential Revision: https://reviews.llvm.org/D150787
Sergio Afonso [Mon, 10 Apr 2023 13:24:25 +0000 (14:24 +0100)]
[Flang][OpenMP][OMPIRBuilder] Add lowering of TargetOp for device codegen
This patch adds support in the `OpenMPIRBuilder` for generating working
device code for OpenMP target regions. It generates and handles the
result of a call to `__kmpc_target_init()` at the beginning of the
function resulting from outlining each target region, and it also
generates the matching `__kmpc_target_deinit()` call before returning.
It relies on the implementation of target region outlining for host
codegen to handle the production of the new function and the lowering of
its body based on the contents of the associated target region.
Depends on D147172
Differential Revision: https://reviews.llvm.org/D147940
Alex Bradbury [Thu, 18 May 2023 14:01:48 +0000 (15:01 +0100)]
[clang][RISCV] Set HasLegalHalfType to true if zhinx is enabled
Now that codegen support for zhinx in landed (D149811), we should set
HasLegalHalfType=true for zhinx (see D145071 for the patch doing this
for zfh).
Differential Revision: https://reviews.llvm.org/D150777
Sergei Barannikov [Wed, 17 May 2023 23:10:52 +0000 (02:10 +0300)]
[clang] Convert several tests to opaque pointers
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D150829
Erich Keane [Thu, 18 May 2023 13:23:24 +0000 (06:23 -0700)]
Revert "[clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables"
This reverts commit
0e167fc0a2147c9b673b8afd5fea001b0d127781.
This patch causes its assertion to fire when doing AST-dump, so
reverting so that the author has time to fix this.
Matt Arsenault [Thu, 18 May 2023 13:39:32 +0000 (14:39 +0100)]
ValueTracking: Check context instruction is in a function
Shengchen Kan [Thu, 18 May 2023 11:59:09 +0000 (19:59 +0800)]
[X86][MC] Add labels for BSF in the switch-cases of X86MCInstLower::Lower, NFCI
BSF is not special here and leaving it in default label looked weird.
Matt Arsenault [Thu, 18 May 2023 11:56:53 +0000 (12:56 +0100)]
Reapply "ValueTracking: Handle phi in computeKnownFPClass"
This reverts commit
e13f88d1ff5234946af6349a9a7cf56fcb6c040e.
Fix off by one recursion limit check.
Matt Arsenault [Thu, 18 May 2023 11:41:28 +0000 (12:41 +0100)]
EarlyCSE: Add regression test for computeKnownFPClass phi handling
This was reduced from the failure that caused the revert in
e13f88d1ff5234946af6349a9a7cf56fcb6c040e
Shengchen Kan [Thu, 18 May 2023 11:40:33 +0000 (19:40 +0800)]
[X86][MC] Move the code about fixed register encoding optimization to X86EncodingOptimization.cpp, NFCI
Matt Arsenault [Thu, 18 May 2023 11:16:04 +0000 (12:16 +0100)]
ValueTracking: Check instruction is in a parent in computeKnownFPClass
For some reason the inliner calls simplifyInstruction with disembodied
instructions. I consider this to be an API defect. Either the instruction
should always be inserted prior to simplification, or we at least
should pass in the new function for the context.
Ramkumar Ramachandra [Thu, 18 May 2023 09:22:14 +0000 (10:22 +0100)]
MachineTraceMetrics: modernize loops (NFC)
Differential Revision: https://reviews.llvm.org/D150854
Tom Eccles [Thu, 27 Apr 2023 09:53:54 +0000 (09:53 +0000)]
[flang][runtime] Add dynamically allocated temporary storage
These functions will be used as part of the HLFIR lowering for
forall/where. The contents of the API were requested by @jeanPerier.
The API is designed around that use case, assuming that the caller knows
through some side channel what size to allocate for boxes returned from
the pop() function.
Differential Revision: https://reviews.llvm.org/D150050
Tom Eccles [Tue, 25 Apr 2023 09:07:11 +0000 (09:07 +0000)]
[flang][hlfir] Add pass to inline elementals
Implement hlfir.elemental inlining as proposed in
flang/docs/HighLevelFIR.md.
This is a separate pass to make the code easier to understand. One
alternative would have been to modify the hlfir.elemental lowering in
the HLFIR bufferization pass.
Currently, a hlfir.elemental can only be inlined once; if there are
more uses, the existing bufferization is used instead.
Usage of mlir::applyPatternsAndFoldGreedily was suggested by @jeanPerier
Differential Revision: https://reviews.llvm.org/D149258
David Sherwood [Tue, 25 Apr 2023 08:46:41 +0000 (08:46 +0000)]
[AArch64][LoopVectorize] Enable tail-folding of simple loops on neoverse-v1
This patch enables the tail-folding of simple loops by default
when targeting the neoverse-v1 CPU. Simple loops exclude those
with recurrences or reductions or loops that are reversed.
New tests have been added here:
Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll
In terms of SPEC2017 only one benchmark is really affected when
building with "-Ofast -mcpu=neoverse-v1 -flto", which is
(+ faster, - slower):
525.x264: +7.0%
Differential Revision: https://reviews.llvm.org/D130618
Florian Hahn [Thu, 18 May 2023 10:35:17 +0000 (11:35 +0100)]
[LV] Add extra uniformity tests with UDIV and UREM.
Extra tests for D148841.
Shengchen Kan [Thu, 18 May 2023 10:30:54 +0000 (18:30 +0800)]
[X86][MC] Move encoding optimization for VCMP to X86::optimizeInstFromVEX3ToVEX2, NFCI
This is a follow-up for
c13ed1cc7578
Shengchen Kan [Thu, 18 May 2023 10:08:57 +0000 (18:08 +0800)]
[X86][MC] Simplify code for X86::optimizeInstFromVEX3ToVEX2
Shengchen Kan [Thu, 18 May 2023 09:26:00 +0000 (17:26 +0800)]
[X86][MC] Move the code about MOV encoding optimization to X86EncodingOptimization.cpp, NFCI
Balázs Kéri [Thu, 18 May 2023 09:16:17 +0000 (11:16 +0200)]
[clang][analyzer] Improve documentation of StdCLibraryFunctionArgs checker (NFC)
Documentation is made more exact, term "constraint" is removed entirely,
description of checker option is corrected.
Reviewed By: Szelethus, gamesh411
Differential Revision: https://reviews.llvm.org/D149447
OCHyams [Wed, 17 May 2023 17:15:57 +0000 (18:15 +0100)]
[DebugInfo][SelectionDAG] Do not drop dbg intrinsics with empty metadata locs
Without this patch SelectionDAG silently drops dbg.values using `!{}` operands.
Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value
This causes assignment-tracking to behaviour to match non-assignment-tracking
behaviour after a recent change (see D140990).
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D150767
Jay Foad [Tue, 16 May 2023 10:26:30 +0000 (11:26 +0100)]
[XCore] Use backwards scavenging in frame index elimination
This is preferred because it does not rely on accurate kill flags.
Differential Revision: https://reviews.llvm.org/D150673
Jay Foad [Mon, 15 May 2023 15:58:16 +0000 (16:58 +0100)]
[Lanai] Use backwards scavenging in frame index elimination
This is preferred because it does not rely on accurate kill flags.
Differential Revision: https://reviews.llvm.org/D150600
Jay Foad [Mon, 15 May 2023 15:52:59 +0000 (16:52 +0100)]
[ARC] Use backwards scavenging in frame index elimination
This is preferred because it does not rely on accurate kill flags.
Differential Revision: https://reviews.llvm.org/D150599
Matt Arsenault [Thu, 18 May 2023 08:42:54 +0000 (09:42 +0100)]
Revert "ValueTracking: Handle phi in computeKnownFPClass"
This reverts commit
cac9e427eb1ff3dabda8ac08968b998c3bc5ab47.
Causing crashes in lencod
Vitaly Buka [Sat, 13 May 2023 01:46:43 +0000 (18:46 -0700)]
[test][clang-repl] Disable test incompatible with msan
Matt Arsenault [Thu, 18 May 2023 08:22:54 +0000 (09:22 +0100)]
Revert "AMDGPU: Add baseline test for f16 fmed3 matching"
This reverts commit
b233eb70cd82ca3c320fac4bb8c2cccd1fe97696.
Vitaly Buka [Fri, 12 May 2023 22:35:28 +0000 (15:35 -0700)]
[AST] Initialized AutoTypeLocInfo::FoundDecl
Msan complains if getFoundDecl called before it's set.
This looks like data class, so I see no reason to keep
the single field uninitialized.
Vitaly Buka [Thu, 18 May 2023 08:18:01 +0000 (01:18 -0700)]
[NFC][AST] Align one line
Vitaly Buka [Fri, 12 May 2023 22:20:58 +0000 (15:20 -0700)]
[AST] Initialize local counter
I assume it's optional and ReadAST does not have to set the
counter on success.
Without the patch msan complains that we pass
uninitialized value into noundef parameters of setCounterValue.
Reviewed By: bnbarham, barannikov88
Differential Revision: https://reviews.llvm.org/D150492
Chuanqi Xu [Thu, 18 May 2023 08:11:20 +0000 (16:11 +0800)]
[C++20] [Modules] Emit an warning for experimental header units
Currently, the header units are rarely used and it is not well tested.
To avoid further misunderstandings, let's mark it as experimental and
emit a warning when users wants to import it.
This is discussed in modules developers meeting.
Vitaly Buka [Mon, 8 May 2023 19:42:50 +0000 (12:42 -0700)]
[LSAN] Use ThreadArgRetval in LSAN
Fixes false leaks on thread retval.
Reviewed By: thurston
Differential Revision: https://reviews.llvm.org/D150165
Vitaly Buka [Mon, 8 May 2023 07:50:26 +0000 (00:50 -0700)]
[ASAN] Use ThreadArgRetval in ASAN
Fixes false leaks on thread retval.
Reviewed By: thurston
Differential Revision: https://reviews.llvm.org/D150106
Vitaly Buka [Thu, 18 May 2023 07:53:53 +0000 (00:53 -0700)]
[NFC][HWASAN] Fix pthread_attr_getdetachstate use
Luckely of Linux PTHREAD_CREATE_DETACHED is 1.
Matt Arsenault [Fri, 5 May 2023 17:16:58 +0000 (13:16 -0400)]
AMDGPU: Fold fmed3 of fpext sources to f16 fmed3
InstCombine already does this for minnum/maxnum. If we
also apply this to fmed3, we don't need to explicitly
use 16-bit fmed3 if we're not sure the target
supports 16-bit instructions yet.
Matt Arsenault [Fri, 5 May 2023 16:15:23 +0000 (12:15 -0400)]
AMDGPU: Add baseline test for f16 fmed3 matching
Matt Arsenault [Tue, 9 May 2023 08:52:44 +0000 (09:52 +0100)]
GlobalISel: Refactor unary FP op constant folding
Fangrui Song [Thu, 18 May 2023 07:27:10 +0000 (00:27 -0700)]
[gcov] Make .gcno/.gcda paths absolute
This restores
737a452173a67f88d111f27b688bf3696c260db9 (2013) which was removed
by my
a07b135ce0c0111bd83450b5dc29ef0381cdbc39.
This behavior turns out to be depended on by `bazel coverage`.
Add a `PWD=/proc/self/cwd %clang -### -c --coverage %s -o foo/bar.o` test.
Vitaly Buka [Tue, 16 May 2023 17:54:41 +0000 (10:54 -0700)]
[LiveDebugValues] Initialized variable to avoid msan reports
Reproducible with =-1 and assert: https://reviews.llvm.org/P8309
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D150420
Wang, Xin10 [Thu, 18 May 2023 07:14:24 +0000 (03:14 -0400)]
[X86]Fix wrong asm match for MASKMOVDQU
Missing work for D150835, aside from VMASKMOVDQU, MASKMOVDQU will also be affected by D150436.
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D150844
Matt Arsenault [Sat, 29 Apr 2023 23:31:01 +0000 (19:31 -0400)]
ValueTracking: Handle phi in computeKnownFPClass
Doesn't try the all the tricks computeKnownBits does.
Matt Arsenault [Tue, 11 Apr 2023 18:56:50 +0000 (14:56 -0400)]
InstCombine: Pass all parameters to isKnownNeverNaN
Allows assume handling to work.
Matt Arsenault [Mon, 10 Apr 2023 15:00:21 +0000 (11:00 -0400)]
ValueTracking: Delete body of isKnownNeverNaN
This should now be redundant with the nan handling in computeKnownFPClass.
Matt Arsenault [Mon, 10 Apr 2023 13:58:22 +0000 (09:58 -0400)]
ValueTracking: Delete body of isKnownNeverInfinity
computeKnownFPClass should now handle infinity checks equally as
well as what this could do before so delete the redundant code.
Jianjian GUAN [Thu, 18 May 2023 03:07:01 +0000 (11:07 +0800)]
[RISCV][NFC] Simplify code.
Use AllVectors to replace !listconcat(AllIntegerVectors, AllFloatVectors).
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D150837
Craig Topper [Thu, 18 May 2023 06:32:31 +0000 (23:32 -0700)]
[RISCV] Replace 'sve' with 'rvv' in some test file names. NFC
Craig Topper [Thu, 18 May 2023 05:49:28 +0000 (22:49 -0700)]
[RISCV] Remove unneedded comment. NFC
This was copied from SVE, but is currently not applicable to RISC-V.
Aiden Grossman [Thu, 18 May 2023 05:37:48 +0000 (05:37 +0000)]
Revert "[clang][X86] Add __cpuidex function to cpuid.h"
This reverts commit
286cefcf35d0f55c57184c4219b95e82c96f1420.
Patch caused build failures for downstream projects on Windows due to
the fact that __cpuidex was added as a built in on Windows in D121653.
Reverting for now so that others aren't blocked and I can figure out a
proper solution.
Mehdi Amini [Thu, 18 May 2023 04:53:05 +0000 (21:53 -0700)]
Fix MLIR crash on 32 bits platforms
The properties size is compressed as a member of the Operation class
to assume a multiple of 8B is used for the storage. This matched the
natural alignment / padding on 64 bits platforms, however we need some
explicit padding on 32 bits platforms, llvm::TrailingObjects will
compress and misalign.
Fixes #62763
Amir Ayupov [Thu, 18 May 2023 04:51:33 +0000 (21:51 -0700)]
[BOLT][NFC] Add MCPlusBuilder defOperands/useOperands helpers
Make intent more explicit with the use of new helper methods.
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D150810
Carl Ritson [Thu, 18 May 2023 04:27:58 +0000 (13:27 +0900)]
[AMDGPU][Uniformity] V_MBCNT* is never uniform
Mark V_MBCNT instructions add thread/lane position so will never
be uniform.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D150759
Joshua Cao [Thu, 18 May 2023 03:40:40 +0000 (20:40 -0700)]
[SimpleLoopUnswitch] turnGuardIntoBranch use BB utils to update DT
turnGuardIntoBranch() can use splitBlockAndInsertIfThen to update the
DominatorTree rather than implementing it itself.
Craig Topper [Thu, 18 May 2023 04:31:51 +0000 (21:31 -0700)]
[RISCV] Use IRBuilder::CreateInsertVector/CreateExtractVector to simplify code. NFC
Reviewed By: eopXD
Differential Revision: https://reviews.llvm.org/D150690
Kazu Hirata [Thu, 18 May 2023 04:28:38 +0000 (21:28 -0700)]
[Utils] Use LLVMContext::MD_loop (NFC)
Kazu Hirata [Thu, 18 May 2023 04:06:29 +0000 (21:06 -0700)]
[SCCP] Remove unused forward declarations (NFC)
While we are at it, this patch removes unnecessary includes.
Kazu Hirata [Thu, 18 May 2023 03:49:31 +0000 (20:49 -0700)]
[IPO] Remove unused declaration RemoveUnusedGlobalValue
The corresponding function definition was removed by:
commit
9071393c18e5264e3bbf3ca3f3584fa5f45be6c2
Author: Jay Foad <jay.foad@amd.com>
Date: Thu Feb 17 14:17:36 2022 +0000
Wang, Xin10 [Thu, 18 May 2023 03:36:15 +0000 (23:36 -0400)]
[X86]Fix wrong asm match for VMASKMOVDQU
VMASKMOVDQU supports 32bit/64bit version in 64bitmode, previously we prefer to use VMASKMOVDQU64 in 64bitmode because the 32bit one need 0x67 prefix.
After D150436, asm match table changed a little, which makes in 64bit mode "vmaskmovdqu %xmm0, %xmm1" will match VMASKMOVDQU other than VMASKMOVDQU64, this patch correct the asm match order for this instruction.
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D150835
Kazu Hirata [Thu, 18 May 2023 03:32:37 +0000 (20:32 -0700)]
[TableGen] Remove unused getMinimalTypeForEnumBitfield
The last use was removed by:
commit
e98944ed47acd04279184343017aa2bf34999111
Author: Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Date: Mon Mar 11 17:04:35 2019 +0000
Shengchen Kan [Thu, 18 May 2023 03:09:57 +0000 (11:09 +0800)]
[X86][MC] Move the code about INC/DEC encoding optimization to X86EncodingOptimization.cpp, NFCI
Emilia Kond [Thu, 18 May 2023 02:50:10 +0000 (05:50 +0300)]
[clang-format] Ignore first token when finding MustBreak
When in ColumnLimit 0, the formatter looks for MustBreakBefore in the
line in order to check if a line is allowed to be merged onto one line.
However, since MustBreakBefore is really a property of the gap between
the token and the one previously, I belive the check is erroneous in
checking all the tokens in a line, since whether the previous line ended
with a forced line break should have no effect on whether the current
line is allowed to merge with the next one.
This patch changes the check to skip the first token in
`LineJoiner.containsMustBreak`.
This patch also changes a test, which is not ideal, but I believe the
test also suffered from this bug. The test case in question sets
AllowShortFunctionsOnASingleLine to "Empty", but the empty function in
said test case isn't merged to a single line, because of the very same
bug this patch fixes.
Fixes https://github.com/llvm/llvm-project/issues/62721
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D150614
Katherine Rasmussen [Wed, 17 May 2023 00:55:01 +0000 (17:55 -0700)]
[flang] Apply the check for the constraint `C1172` to more stmts
Apply the check for the constraint `C1172` to `unlock-stmt`,
`change-team-stmt`, `end-team-stmt`, and `critical-stmt`, which
all have `sync-stat-lists` and so `C1172` applies to them. Add
a test to check the `sync-stat-lists` for these 4 statements.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D150745
Jianjian GUAN [Wed, 17 May 2023 06:19:37 +0000 (14:19 +0800)]
[RISCV] Refactor predicates for rvv SDNode patterns.
This patch is similar to https://reviews.llvm.org/D150550, it adds accurate predicates for SDNode patterns depending on vector type.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D150754
Sergei Barannikov [Thu, 18 May 2023 01:28:31 +0000 (04:28 +0300)]
[clang][CodeGen] Reformat ABIInfo.h (NFC)
Preparatory change for D148094.
Alex Langford [Thu, 18 May 2023 00:33:13 +0000 (17:33 -0700)]
[lldb][NFCI] Qualify param type in SBDebugger::FindTargetWithProcessID
We should specify that this is the pid_t as defined in the lldb
namespace, not some other pid_t. This doesn't really affect builds but
it makes writing tooling against the SBAPI easier.
I have verified that this does not change the emitted mangled name and
does not break ABI.
wren romano [Wed, 17 May 2023 23:32:19 +0000 (16:32 -0700)]
[mlir][sparse] Fixing sparse_reshape.mlir integration test (followup to D150822)
For some reason, even though D150822 passed the buildbot, it failed to
catch this test
Reviewed By: anlunx
Differential Revision: https://reviews.llvm.org/D150830
Jan Svoboda [Wed, 17 May 2023 23:45:18 +0000 (16:45 -0700)]
[clang] NFC: Modernize Decl iteration via IdentifierResolver
Fangrui Song [Wed, 17 May 2023 23:09:12 +0000 (16:09 -0700)]
[gcov] Simplify cc1 options and remove CodeGenOptions EmitCovNotes/EmitCovArcs
After
a07b135ce0c0111bd83450b5dc29ef0381cdbc39, we always pass
-coverage-notes-file/-coverage-data-file for driver options
-ftest-coverage/-fprofile-arcs/--coverage. As a bonus, we can make the following
simplification to cc1 options:
* `-ftest-coverage -coverage-notes-file a.gcno` => `-coverage-notes-file a.gcno`
* `-fprofile-arcs -coverage-data-file a.gcda` => `-coverage-data-file a.gcda`
and remove EmitCovNotes/EmitCovArcs.
Joseph Huber [Tue, 16 May 2023 18:39:28 +0000 (13:39 -0500)]
[libc] Restrict access to the RPC Process internals
This patch changes the `Process` struct to only provide the functions
expected to be visible by the interface. So, now we only export the
open, reset, and size query functions. This prevents users of the
interface from messing with the internals of the process, so now the
only existing failure mode is mismatched send and recieve calls.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D150703
Joseph Huber [Wed, 17 May 2023 18:20:34 +0000 (13:20 -0500)]
[Clang] Remove direct linking of offloading runtimes from the arch tools
The tools `amdgpu-arch` and `nvptx-arch` are used to query the supported
GPUs on a system to implement features like `--offload-arch=native` as
well as generally being useful for setting up tests. However, we
currently directly link these if they are availible. This patch removes
this because it causes many problems on the user not having the libaries
present or misconfigured at build time. Since these are built
unconditionally we shoudl keep the dependencies away from clang.
Fixes https://github.com/llvm/llvm-project/issues/62784
Reviewed By: ye-luo
Differential Revision: https://reviews.llvm.org/D150807
CaprYang [Wed, 17 May 2023 20:39:36 +0000 (21:39 +0100)]
[InferAddressSpaces] Handle vector of pointers type & Support intrinsic masked gather/scatter
Matt Arsenault [Tue, 18 Apr 2023 02:14:36 +0000 (22:14 -0400)]
ValueTracking: Handle sign bit for fptrunc in computeKnownFPClass
Matt Arsenault [Sun, 9 Apr 2023 11:13:26 +0000 (07:13 -0400)]
ValueTracking: Implement computeKnownFPClass for various rounding intrinsics
Arthur Eubanks [Wed, 17 May 2023 22:33:03 +0000 (15:33 -0700)]
Revert "[Driver] Support multi /guard: options"
This reverts commit
3b6f7e45a20990fdbc2b43dc08457fc79d53bd39.
See comments on D150645.
wren romano [Wed, 17 May 2023 21:59:02 +0000 (14:59 -0700)]
[mlir][sparse] Fixing GPU tests (followup to D150330)
The GPU tests weren't updated when rebasing D150330, so this patch fixes that.
Reviewed By: anlunx
Differential Revision: https://reviews.llvm.org/D150822
Jennifer Yu [Wed, 10 May 2023 22:01:52 +0000 (15:01 -0700)]
Fix assertion when try is used inside catch(...) block
Current assert wiht /EHa:
A single unwind edge may only enter one EH pad
invoke void @llvm.seh.try.begin()
to label %invoke.cont1 unwind label %catch.dispatch2
Current IR:
%1 = catchpad within %0 [ptr null, i32 0, ptr null]
invoke void @llvm.seh.try.begin()
to label %invoke.cont5 unwind label %catch.dispatch2
The problem is the invoke to llvm.seh.try.begin() missing "funclet"
Accodring: https://llvm.org/docs/LangRef.html#ob-funclet
If any "funclet" EH pads have been entered but not exited (per the
description in the EH doc), it is undefined behavior to execute a
call or invoke.
To fix the problem, when emit seh_try_begin, call EmitSehTryScopeBegin,
instead of calling EmitRuntimeCallOrInvoke for proper "funclet"
gerenration.
Differential Revision: https://reviews.llvm.org/D150340
Arthur Eubanks [Wed, 17 May 2023 21:37:02 +0000 (14:37 -0700)]
[test] Minor changes to optnone-opt.ll
Test doesn't require asserts.
Remove a CHECK line in preparation for an upcoming change.
Alexander Shaposhnikov [Wed, 17 May 2023 21:02:02 +0000 (21:02 +0000)]
[Clang][Sema] Substitute constraints only for declarations with different lexical contexts
Substitute constraints only for declarations with different lexical contexts.
This results in avoiding the substitution of constraints during the redeclaration check
inside a class (and by product caching the wrong substitution result).
Test plan: ninja check-all
Differential revision: https://reviews.llvm.org/D150730
wren romano [Wed, 17 May 2023 20:09:53 +0000 (13:09 -0700)]
[mlir][sparse] Renaming the STEA field `dimLevelType` to `lvlTypes`
This commit is part of the migration of towards the new STEA syntax/design. In particular, this commit includes the following changes:
* Renaming compiler-internal functions/methods:
* `SparseTensorEncodingAttr::{getDimLevelType => getLvlTypes}`
* `Merger::{getDimLevelType => getLvlType}` (for consistency)
* `sparse_tensor::{getDimLevelType => buildLevelType}` (to help reduce confusion vs actual getter methods)
* Renaming external facets to match:
* the STEA parser and printer
* the C and Python bindings
* PyTACO
However, the actual renaming of the `DimLevelType` itself (along with all the "dlt" names) will be handled in a separate commit.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D150330
Siva Chandra Reddy [Tue, 16 May 2023 17:19:10 +0000 (17:19 +0000)]
[libc] Add a convenience CMake function `add_unittest_framework_library`.
This function is used to add unit test and hermetic test framework libraries.
It avoids the duplicated code to add compile options to each every test
framework libraries.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D150727
Mathieu Fehr [Wed, 8 Mar 2023 20:21:54 +0000 (21:21 +0100)]
[mlir][irdl] Add `irdl.any_of` operation
The `irdl.any_of` operation represent a constraint that is satisfied
if any of its subconstraint is satisfied.
For instance, in the following example:
```
%0 = irdl.is f32
%1 = irdl.is f64
%2 = irdl.any_of(f32, f64)
```
`%2` can only be satisfied by `f32` or `f64`.
Note that the verification algorithm required by `irdl.any_of` is
non-trivial, since we want that the order of arguments of
`irdl.any_of` to not matter. For this reason, our registration
algorithm fails if two constraints used by `any_of` might be
satisfied by the same `Attribute`. This is approximated by checking
the possible `Attribute` bases of each constraints.
Depends on D145734
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D145735
Alex Langford [Wed, 17 May 2023 20:22:24 +0000 (13:22 -0700)]
[lldb][NFCI] Clean up ThreadSafeDenseMap
- Change header guard after
147a61618989
- Fix file header
- Remove the `_MutexType` template parameter, I did not see this used
anywhere on llvm.org or on Apple's downstream forks.
Thurston Dang [Wed, 17 May 2023 18:56:52 +0000 (18:56 +0000)]
Revert 'hwasan: lay groundwork for importing subset of sanitizer_common interceptors [NFC]'
It was reported in https://reviews.llvm.org/D150708 that my patch has broken
stage2/hwasan check: https://lab.llvm.org/buildbot/#/builders/236/builds/4069
Reverting that patch (and the followup fixes) until I can investigate this further
Sergei Barannikov [Tue, 16 May 2023 11:09:51 +0000 (14:09 +0300)]
[clang] Convert remaining OpenMP tests to opaque pointers
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D150733
Alex Langford [Wed, 17 May 2023 19:50:36 +0000 (12:50 -0700)]
[lldb][NFCI] Move ThreadSafeDenseMap to Utility
This seems better suited for Utility than Core
Artem Belevich [Tue, 16 May 2023 19:30:22 +0000 (12:30 -0700)]
[CUDA] Relax restrictions on GPU-side variadic functions
Allow parsing GPU-side variadic functions when we're compiling with CUDA-9 or
newer. We still do not allow accessing variadic arguments.
CUDA-9 was the version which introduced PTX-6.0 which allows implementing
variadic functions, so older versions can't have variadics in principle.
This is required for dealing with headers in recent CUDA versions that rely on
variadic function declarations in some of the templated code in libcu++.
E.g. https://github.com/llvm/llvm-project/issues/58410
Differential Revision: https://reviews.llvm.org/D150718