Denis Antrushin [Thu, 7 Jul 2022 07:18:06 +0000 (14:18 +0700)]
[IR][OpaquePointers] Properly print cmpxchg with pointer operands.
With opaque pointers address of pointer variable and its value have
same type (`ptr`). As a result, cmpxchg is printed without values
types in LLVM assembly and cannot be read back. Add AtomicCmpXchg
to the list of instructions which always have operand types printed.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D129276
Groverkss [Thu, 7 Jul 2022 13:51:52 +0000 (14:51 +0100)]
[MLIR][Presburger] Refactor division representation to DivisionRepr
This patch refactors existing implementations of division representation storage
into a new class, DivisionRepr. This refactoring is done so that the common
division utilities can be shared in an upcoming patch.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D129146
David Spickett [Thu, 7 Jul 2022 09:37:30 +0000 (09:37 +0000)]
[lldb][Windows] Fix memory region base addresses when a range is split
Previously we recorded AllocationBase as the base address of the region
we get from VirtualQueryEx. However, this is the base of the allocation,
which can later be split into more regions.
So you got stuff like:
[0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
[0x00007fff377c0000-0x00007fff37840000) r-x .text
[0x00007fff377c0000-0x00007fff37870000) r-- .rdata
Where all the base addresses were the same.
Instead, use BaseAddress as the base of the region. So we get:
[0x00007fff377c0000-0x00007fff377c1000) r-- PECOFF header
[0x00007fff377c1000-0x00007fff37840000) r-x .text
[0x00007fff37840000-0x00007fff37870000) r-- .rdata
https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-memory_basic_information
The added test checks for any overlapping regions which means
if we get the base or size wrong it'll fail. This logic
applies to any OS so the test isn't restricted to Windows.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D129272
Pavel Labath [Thu, 7 Jul 2022 13:04:41 +0000 (15:04 +0200)]
[lldb] Fixup TestLoadAfterAttach for 82ba3f4
After 82ba3f4, we (again) need to call lldb_enable_attach to be able to
attach to processes on linux. This was a new test, so it does not have
the necessary boilerplate.
Xiaodong Liu [Thu, 7 Jul 2022 12:57:23 +0000 (20:57 +0800)]
[ORC][MIPS} Correct template parameter for stubAndPointerRangesOk function on Mips
It might be an oversight that pass OrcAArch64 as template parameter to stubAndPointerRangesOk on MIps.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D129076
Haojian Wu [Thu, 7 Jul 2022 12:36:10 +0000 (14:36 +0200)]
[pseudo] NFC, fix the header guard for Language.h
Pavel Labath [Fri, 1 Jul 2022 12:32:50 +0000 (14:32 +0200)]
Recommit "[lldb/test] Don't use preexec_fn for launching inferiors"
This recommits
b15b1421, which reverted in was reverted in
f51c47d98 due to
failures on apple systems. The problem was that the patch introduced a race
where the debug server could start the attach process before the first process
(which isn't supposed to be attached to) was set up. This caused us to attach
to the wrong process.
The new version introduces additional synchronization to ensure that does not
happen.
Original commit message was:
As the documentation states, using this is not safe in multithreaded
programs, and I have traced it to a rare deadlock in some of the tests.
The reason this was introduced was to be able to attach to a program
from the very first instruction, where our usual mechanism of
synchronization -- waiting for a file to appear -- does not work.
However, this is only needed for a single test
(TestGdbRemoteAttachWait) so instead of doing this everywhere, I create
a bespoke solution for that single test. The solution basically
consists of outsourcing the preexec_fn code to a separate (and
single-threaded) shim process, which enables attaching and then executes
the real program.
This pattern could be generalized in case we needed to use it for other
tests, but I suspect that we will not be having many tests like this.
This effectively reverts commit
a997a1d7fbe229433fb458bb0035b32424ecf3bd.
Nicolai Hähnle [Tue, 5 Jul 2022 07:52:50 +0000 (09:52 +0200)]
Remove unnecessary includes of ManagedStatic.h
Differential Revision: https://reviews.llvm.org/D129115
Nicolai Hähnle [Mon, 4 Jul 2022 12:41:03 +0000 (14:41 +0200)]
llvm-c: Add LLVMDeleteInstruction to fix a test issue
Not deleting the loose instruction with metadata associated to it causes
an assertion when the LLVMContext is destroyed. This was previously
hidden by the fact that llvm-c-test does not call LLVMShutdown. The
planned removal of ManagedStatic exposed this issue.
Differential Revision: https://reviews.llvm.org/D129114
Tim Northover [Thu, 7 Jul 2022 12:25:24 +0000 (13:25 +0100)]
lld test fix: don't check the precise hex emitted as a comment.
It can vary depending on the platform, so as with the NO-FMA test just check
for "0x".
Tim Northover [Thu, 7 Jul 2022 12:01:02 +0000 (13:01 +0100)]
lld: fix test after x86 instruction comments now end in newline
Matthias Springer [Thu, 7 Jul 2022 11:35:36 +0000 (13:35 +0200)]
[mlir][bufferization][NFC] Move more unknown type conversion logic into BufferizationOptions
The `unknownTypeConversion` bufferization option (enum) is now a type converter function option. Some logic of `getMemRefType` is now handled by that function.
This change makes type conversion more controllable. Previously, there were only two options when generating memref types for non-bufferizable ops: Static identity layout or fully dynamic layout. With this change, users of One-Shot Bufferize can provide a function with custom logic.
Differential Revision: https://reviews.llvm.org/D129273
Tim Northover [Thu, 7 Jul 2022 11:03:47 +0000 (12:03 +0100)]
X86: add newline to end of FMA instruction comments.
The newline is used by Disassembler.cpp (`emitComments`) to work out how to
format them properly, and if there's no newline it goes into an infinite loop.
Unfortunately I couldn't get llvm-objdump to be affected, only the MacOS otool
utility which dlopens libLTO.
Michał Chojnowski [Thu, 7 Jul 2022 10:54:51 +0000 (13:54 +0300)]
[BOLT] Fix concurrent hash table modification in the instrumentation runtime
`__bolt_instr_data_dump()` does not lock the hash tables when iterating
over them, so the iteration can happen concurrently with a modification
done in another thread, when the table is in an inconsistent state. This
also has been observed in practice, when it caused a segmentation fault.
We fix this by locking hash tables during iteration. This is done by taking
the lock in `forEachElement()`.
The only other site of iteration, `resetCounters()`, has been correctly
locking the table even before this patch. This patch removes its `Lock`
because the lock is now taken in the inner `forEachElement()`.
Reviewed By: maksfb, yota9
Differential Revision: https://reviews.llvm.org/D129089
Alex Zinenko [Thu, 7 Jul 2022 11:11:34 +0000 (13:11 +0200)]
[mlir] Transform dialect: introduce merge_handles op
This Transform dialect op allows one to merge the lists of Payload IR
operations pointed to by several handles into a single list associated with one
handle. This is an important Transform dialect usability improvement for cases
where transformations may temporarily diverge for different groups of Payload
IR ops before converging back to the same script. Without this op, several
copies of the trailing transformations would have to be present in the
transformation script.
Depends On D129090
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D129110
Alex Zinenko [Thu, 7 Jul 2022 11:10:40 +0000 (13:10 +0200)]
[mlir] Structured transforms: introduce op splitting
Introduce a new transformation on structured ops that splits the iteration
space into two parts along the specified dimension. The index at which the
splitting happens may be static or dynamic. This transformation can be seen as
a rudimentary form of index-set splitting that only supports the splitting
along hyperplanes parallel to the iteration space hyperplanes, and is therefore
decomposable into per-dimension application.
It is a key low-level transformation that enables independent scheduling for
different parts of the iteration space of the same op, which hasn't been
possible previously. It may be used to implement, e.g., multi-sized tiling. In
future, peeling can be implemented as a combination of split-off amount
computation and splitting.
The transformation is conceptually close to tiling in its separation of the
iteration and data spaces, but cannot be currently implemented on top of
TilingInterface as the latter does not properly support `linalg.index`
offsetting.
Note that the transformation intentionally bypasses folding of
`tensor.extract_slice` operations when creating them as this folding was found
to prevent repeated splitting of the same operation because due to internal
assumptions about extract/insert_slice combination in dialect utilities.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D129090
Sven van Haastregt [Thu, 7 Jul 2022 11:05:24 +0000 (12:05 +0100)]
Fix use of uninitialized member in constructor
The constructor does `Saver(Alloc)`, so `Alloc` should be
initialized first. Move `Alloc` up in the declaration order.
Fixes a -Wuninitialized warning when building with GCC 12.1.
Reported-by: Mihail Atanassov <mihail.atanassov@arm.com>
Peter Waller [Tue, 5 Jul 2022 09:16:31 +0000 (09:16 +0000)]
[doc][ReleaseNotes] Document AArch64 SVE ABI fix from D127209
D127209 fixed LLVM to bring it in line with the AAPCS. The fix affects
functions where the first SVE parameter appears in the 9th or later
arguments, and the function does not return an SVE type.
Differential Revision: https://reviews.llvm.org/D129135
Markus Böck [Wed, 6 Jul 2022 15:39:18 +0000 (17:39 +0200)]
[mlir][ods] Replace redundant `Type` instances for interfaces
This patch makes use of TypeInterface implementing Type to remove instances of Type that simply checked whether a type implemented a given interface.
As part of this refactoring, some changes had to be done in the OpenMP Dialect files. In particular, they assumed that OpenMPOps.td to only ever include OpenMP TypeInterfaces, which did not hold anymore with a moved include in LLVMOpBase.td. For that reason, the type interface defintions were moved into a new file as is convention.
Differential Revision: https://reviews.llvm.org/D129210
Markus Böck [Wed, 6 Jul 2022 14:42:21 +0000 (16:42 +0200)]
[mlir][ods] Make Type- and AttrInterfaces also `Type`s and `Attr`s
By making TypeInterfaces and AttrInterfaces, Types and Attrs respectively it'd then be possible to use them anywhere where a Type or Attr may go. That is within the arguments and results of an Op definition, in a RewritePattern etc.
Prior to this change users had to separately define a Type or Attr, with a predicate to check whether a type or attribute implements a given interface. Such code will be redundant now.
Removing such occurrences in upstream dialects will be part of a separate patch.
As part of implementing this patch, slight refactoring had to be done. In particular, Interfaces cppClassName field was renamed to cppInterfaceName as it "clashed" with TypeConstraints cppClassName. In particular Interfaces cppClassName expected just the class name, without any namespaces, while TypeConstraints cppClassName expected a fully qualified class name.
Differential Revision: https://reviews.llvm.org/D129209
Bradley Smith [Wed, 29 Jun 2022 10:26:17 +0000 (10:26 +0000)]
[LegalizeTypes] Replace vecreduce_xor/or/and with vecreduce_add/umax/umin if not legal
This is done during type legalization since the target representation of
these nodes may not be valid until after type legalization, and after
type legalization the fact that these are dealing with i1 types may be
lost.
Differential Revision: https://reviews.llvm.org/D128996
Sander de Smalen [Thu, 7 Jul 2022 07:58:40 +0000 (07:58 +0000)]
[VectorCombine] Avoid creating shuffle for extract-extract pattern on scalable vector.
This addresses https://github.com/llvm/llvm-project/issues/56377
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D129136
Sander de Smalen [Thu, 7 Jul 2022 07:58:32 +0000 (07:58 +0000)]
[VectorCombine] NFC: rename test extract-cmp-binop.ll to extract-scalable.ll
Nikita Popov [Thu, 7 Jul 2022 08:31:53 +0000 (10:31 +0200)]
[GlobalsModRef] Don't override getModRefBehavior() for CallBase
BasicAA will already call getModRefBehavior() on the Function of
the CallBase if there are no operand bundles. This happens through
getBestAAResults(), i.e. it is a recursive call that will query
other AA providers, not just the BasicAA implementation.
As such, there is no need to reimplement the same functionality
in GlobalsModRef, a combination of BasicAA and GlobalsModRef already
handles it. This does mean that this no longer works under
-disable-basic-aa, but that's a testing only option.
Marek Kurdej [Mon, 4 Jul 2022 09:28:25 +0000 (11:28 +0200)]
[clang-format] Avoid crash in LevelIndentTracker.
Fixes https://github.com/llvm/llvm-project/issues/56352.
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D129064
Matthias Springer [Thu, 7 Jul 2022 07:01:50 +0000 (09:01 +0200)]
[mlir][vector][bufferize] Fix transfer_write dropping mask operand
Differential Revision: https://reviews.llvm.org/D129253
Sander de Smalen [Wed, 6 Jul 2022 16:14:51 +0000 (16:14 +0000)]
[AArch64][SME] Update load/store intrinsics to take predicate corresponding to element size.
Instead of using <vscale x 16 x i1> for all the loads/stores, we now use the appropriate
predicate type according to the element size, e.g.
ld1b uses <vscale x 16 x i1>
ld1w uses <vscale x 4 x i1>
ld1q uses <vscale x 1 x i1>
Reviewed By: kmclaughlin
Differential Revision: https://reviews.llvm.org/D129083
Sander de Smalen [Wed, 6 Jul 2022 16:14:38 +0000 (16:14 +0000)]
[AArc64] Legalisation of compares and truncates of nxv1i1 types.
Truncates and compares require some changes to generic legalisation functions
to use ElementCount instead of getNumElements.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D129082
Nikita Popov [Thu, 7 Jul 2022 07:35:01 +0000 (09:35 +0200)]
[LSR] Regenerate test checks (NFC)
Adrian Kuegel [Thu, 7 Jul 2022 06:31:43 +0000 (08:31 +0200)]
[llvm][Debuginfod][Bazel] Match dependencies in CMakeLists.txt.
Also update llvm-config.h and llvm-config.h.cmake to match
484b1aa611caa70c8a80b46060cc340bbeee8306
Differential Revision: https://reviews.llvm.org/D129252
Nikita Popov [Wed, 6 Jul 2022 14:15:34 +0000 (16:15 +0200)]
[BasicBlockUtils] Allow splitting predecessors with callbr terminators
SplitBlockPredecessors currently asserts if one of the predecessor
terminators is a callbr. This limitation was originally necessary,
because just like with indirectbr, it was not possible to replace
successors of a callbr. However, this is no longer the case since
D67252. As the requirement nowadays is that callbr must reference
all blockaddrs directly in the call arguments, and these get
automatically updated when setSuccessor() is called, we no longer
need this limitation.
The only thing we need to do here is use replaceSuccessorWith()
instead of replaceUsesOfWith(), because only the former does the
necessary blockaddr updating magic.
I believe there's other similar limitations that can be removed,
e.g. related to critical edge splitting.
Differential Revision: https://reviews.llvm.org/D129205
Chuanqi Xu [Thu, 7 Jul 2022 06:57:07 +0000 (14:57 +0800)]
[NFC] [Coroutines] Update the comments for lowering coro.save
The original comment is not right. We don't store 0 all the time.
serge-sans-paille [Wed, 6 Jul 2022 14:34:44 +0000 (10:34 -0400)]
[clang-tidy] Fix confusable identifier interaction with unavailable class def
Fix #56404
Mark de Wever [Tue, 28 Dec 2021 17:48:04 +0000 (18:48 +0100)]
[libc++[format][NFC] Removes dead code.
This removes a part of the now obsolete formater code.
The removal also removes the _v2 suffix where it's no longer needed.
Depends on D128785
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D128846
Mark de Wever [Tue, 28 Dec 2021 17:48:04 +0000 (18:48 +0100)]
[libc++][format] Improve floating-point formatters.
This changes the implementation of the formatter. Instead of inheriting
from a specialized parser all formatters will use the same generic
parser. This reduces the binary size.
The new parser contains some additional fields only used in the chrono
formatting. Since this doesn't change the size of the parser the fields
are in the generic parser. The parser is designed to fit in 128-bit,
making it cheap to pass by value.
The new format function is a const member function. This isn't required
by the Standard yet, but it will be after LWG-3636 is accepted.
Additionally P2286 adds a formattable concept which requires the member
function to be const qualified in C++23. This paper is likely to be
accepted in the 2022 July plenary.
This is based on D125606. That commit did the groundwork and did similar
changes for the string formatters.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D128785
Chuanqi Xu [Thu, 7 Jul 2022 03:48:34 +0000 (11:48 +0800)]
[NFC] make ASTContext:isSame* methods const
Florian Hahn [Thu, 7 Jul 2022 05:05:32 +0000 (22:05 -0700)]
[AArch64] Clean up vselect-ext.ll test, add tests with ne/ep preds.
Vitaly Buka [Thu, 7 Jul 2022 04:16:43 +0000 (21:16 -0700)]
[NFC][sanitizer] Format dn_expand interceptor
Noah Shutty [Thu, 7 Jul 2022 04:13:30 +0000 (04:13 +0000)]
[Debuginfod] Try to fix clang-ppc64le-rhel build
Luo, Yuanke [Thu, 7 Jul 2022 03:42:39 +0000 (11:42 +0800)]
[AArch64][GlobalISel] update the gisel test case
Florian Hahn [Thu, 7 Jul 2022 03:38:37 +0000 (20:38 -0700)]
[VPlan] Move remove dead recipes before merging regions.
This can enable additional region merging, while not losing
opportunities as region merging does not produce dead recipes.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D128831
Chuanqi Xu [Fri, 10 Jun 2022 08:48:01 +0000 (16:48 +0800)]
[Debug] [Coroutines] Get rid of DW_ATE_address
Closing https://github.com/llvm/llvm-project/issues/55916
This patch tries to get rid of DW_ATE_address and enhance the test
coverage.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D127625
Chuanqi Xu [Fri, 20 May 2022 07:30:16 +0000 (15:30 +0800)]
[Debug] [Coroutine] Adjust the scope and name for coroutine frame
Previously the scope of debug type of __coro_frame is limited in the
current function. It looked good at the first sight. But it prevent us
to print the type in splitted functions and other functions. Also the
debug type is different for different coroutine functions. So it makes
sense to rename the debug type to make it related to the function name.
After this patch, we could access the coroutine frame type in a function
by `function_name.coro_frame_ty`.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D127623
Neumann Hon [Thu, 7 Jul 2022 02:22:25 +0000 (22:22 -0400)]
[SystemZ] [z/OS] Use assignCalleeSavedSpillSlots() to mark handle special registers in CSR list instead of determineCalleeSave
This PR moves the handling of special registers that need to be saved/restored in the prolog/epilog respectively from determineCalleeSaves to assignCalleeSavedSpillSlots. The documentation of the parent function of assignCalleeSavedSpillSlots explicitly allows the modification of the CSI hence adding the special registers (the stack pointer register, the return address register, and the entry point register) to the CSI list at that stage should be permissible.
This cleans up the code a bit and makes it so that we do not have to place registers that are not actually considered CSRs by the spec in the CSR list, which is something of a hack.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D125044
jacquesguan [Tue, 5 Jul 2022 07:54:32 +0000 (15:54 +0800)]
[mlir][Math] Support fold PowFOp with constant dense.
This patch adds a conditional binary constant folder which allow to exit when the constants not meet the fold condition. And use it for PowFOp to make it able to fold the constant dense.
Differential Revision: https://reviews.llvm.org/D129108
Alex Brachet [Thu, 7 Jul 2022 02:07:17 +0000 (02:07 +0000)]
[libc][NFC] Make explicit casts
Peter Klausler [Fri, 1 Jul 2022 20:05:58 +0000 (13:05 -0700)]
[flang][runtime] Trim FORMATs echoed to error messages
Since dynamic FORMAT strings usually come from blank-padded fixed-length
CHARACTER variables, trim leading and trailing blanks from them when they
are echoed to error messages for better readability.
Differential Revision: https://reviews.llvm.org/D129024
Peter Klausler [Fri, 1 Jul 2022 18:49:55 +0000 (11:49 -0700)]
[flang] Avoid spurious warnings in pedantic mode from FORMAT items
In free form source, pedantic mode will elicit portability warnings
about missing spaces when a token string ends with a character that
can be in an identifier and there is no space between that last token
character and a following character that can also be part of an identifier.
This behavior doesn't really work well for the token strings that are
parsed for edit descriptors in FORMAT statements. For example, the
'F' in FORMAT(F7.3) is followed by a digit, but obviously no space is
necessary. Free form or not, FORMATs are their own odd little world.
This patch adds trailing blanks to these FORMAT edit descriptor token
parsers to disable the missing space check, and extends the documentation
for token string parsing to explain why this technique works.
Differential Revision: https://reviews.llvm.org/D129023
Vitaly Buka [Thu, 7 Jul 2022 01:39:52 +0000 (18:39 -0700)]
[sanitizer] Fix dn_expand test
res is not the size of expanded string.
Peter Klausler [Thu, 30 Jun 2022 22:27:28 +0000 (15:27 -0700)]
[flang] Add IsElementalProcedure() predicate
Replace most tests of the explicit Attr::ELEMENTAL symbol flag with
a new predicate IsElementalProcedure() that works correctly for alternate
ENTRY points and does the right thing for procedure interfaces that
reference elemental intrinsic functions like SIN() whose elemental
nature does not propagate.
Differential Revision: https://reviews.llvm.org/D129022
wren romano [Wed, 6 Jul 2022 22:42:53 +0000 (15:42 -0700)]
[mlir][tblgen] Reverting fatality of assemblyFormat with skipDefaultBuilders=1
Per @rriddle, we do not want to require `skipDefaultBuilders=0` per se; that is, even though the `assemblyFormat`-generated parser requires a builder with the same prototype as the default-builder, that prototype could instead be implemented via custom `builders`. This differential reduces the FatalError introduced in D128555 to a non-fatal Warning instead, so that users can still be informed of the error condition (rather than waiting for the C++ compiler to fail).
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D129234
Luo, Yuanke [Thu, 7 Jul 2022 01:01:13 +0000 (09:01 +0800)]
[AArch64][GlobalISel] update the test case with update_mir_test_checks.py
Vir Narula [Thu, 7 Jul 2022 00:42:00 +0000 (17:42 -0700)]
[GVN] Bug fix to reportMayClobberedLoad remark
Bug fix to avoid assert crashing when generating remarks for GVN crashing.
Intention of assert is correct but ignores edge case of instructions being equivalent.
Reduced input that causes crash when remarks are turned on:
```
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx12.0.0"
define ptr @ReplaceWithTidy(ptr %zz_hold) {
cond.end480.us:
%0 = load ptr, ptr null, align 8
store ptr %0, ptr %0, align 8
store ptr null, ptr %zz_hold, align 8
%1 = load ptr, ptr %0, align 8
store ptr %1, ptr null, align 8
ret ptr null
}
```
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D129235
Peter Klausler [Fri, 1 Jul 2022 18:46:58 +0000 (11:46 -0700)]
[flang][runtime] Fix directed UP/DOWN rounding edge case for Fw.d output
When Fw.d output editing takes place with directed rounding, make sure that
nonzero values that would normally be converted to zero round up (or down,
depending on the sign) to a scaled 1.
Differential Revision: https://reviews.llvm.org/D129021
Peter Klausler [Fri, 1 Jul 2022 18:43:30 +0000 (11:43 -0700)]
[flang] Cope with overflow in real MOD/MODULO
In folding and in the runtime library for real MOD/MODULO(A,P),
detect overflow from the division A/P and return a properly signed
zero result. (When A/P overflows and both A and P are finite numbers
with nonzero P, the quotient would be a large integer when rounded to
the precision of the floating-point representation.)
Differential Revision: https://reviews.llvm.org/D129020
Peter Klausler [Wed, 29 Jun 2022 00:48:15 +0000 (17:48 -0700)]
[flang][runtime] Make ENDFILE work after non-advancing READ
An ENDFILE statement executed when a non-advancing READ has
left the unit in the middle of a record must truncate the file
at that position.
Differential Revision: https://reviews.llvm.org/D129019
gonglingqin [Wed, 6 Jul 2022 10:02:45 +0000 (18:02 +0800)]
[LoongArch] Add codegen support for handling floating point immediates
Differential Revision: https://reviews.llvm.org/D128898
Nikolas Klauser [Wed, 6 Jul 2022 23:57:20 +0000 (01:57 +0200)]
[libc++] Fix a few things in RangesAlgorithms.csv
Noah Shutty [Wed, 6 Jul 2022 23:01:19 +0000 (23:01 +0000)]
[Debuginfod] Try to fix shared library build after
babef908cc1 (D114845) and
39ed08f8d452.
Florian Hahn [Wed, 6 Jul 2022 22:31:57 +0000 (15:31 -0700)]
[LV] Remove redundant checks from recurrence test.
The removed CHECK configurations are tested as well below, modulo the
dce/instcombine runs. This makes them redundant, and removing them
removes a substantial amount of uneeded checks.
NAKAMURA Takumi [Wed, 6 Jul 2022 22:03:16 +0000 (07:03 +0900)]
[Bazel] Fixup to llvmorg-15-init-15618-ge0b520865026, s/dxil/dx/
Philip Reames [Wed, 6 Jul 2022 21:46:52 +0000 (14:46 -0700)]
[RISCV] Add codegen coverage for get.active.lane.mask
Aart Bik [Fri, 1 Jul 2022 23:57:40 +0000 (16:57 -0700)]
[mlir][sparse] implement simple reshaping (expand/collapse)
The revision makes a start with implementing expand/collapse reshaping
for sparse tensors. When either source or destination is sparse, but
other is dense, the "cheap" dense reshape can be used prior to converting
from or to a sparse tensor.
Note1
sparse to sparse reshaping is still TBD.
Note2
in the long run, we may want to implement a "view" into a sparse tensor so that the operation remains cheap and does not require data shuffling
Reviewed By: wrengr
Differential Revision: https://reviews.llvm.org/D129031
Naje George [Thu, 30 Jun 2022 23:19:20 +0000 (16:19 -0700)]
[flang] Add semantics test for coshape function
Reviewed By: ktras
Differential Revision: https://reviews.llvm.org/D128957
Peiming Liu [Wed, 6 Jul 2022 18:26:01 +0000 (18:26 +0000)]
[mlir][sparse] fix windows build error
Silence warning from MSVC when handling ##__VA_ARGS
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D129227
Nico Weber [Wed, 6 Jul 2022 20:51:42 +0000 (22:51 +0200)]
Revert "[Clang] Add a warning on invalid UTF-8 in comments."
This reverts commit
4174f0ca618b467571b43cff12cbe4c4239670f8.
Also revert follow-up "[Clang] Fix invalid utf-8 detection"
This reverts commit
bf45e27a676d87944f1f13d5f0d0f39935fc4010.
The second commit broke tests, see comments on
https://reviews.llvm.org/D129223, and it sounds like the first
commit isn't valid without the second one. So reverting both for now.
Tobias Ribizel [Wed, 6 Jul 2022 20:09:15 +0000 (22:09 +0200)]
[clangd] add inlay hints for std::forward-ed parameter packs
This adds special-case treatment for parameter packs in
make_unique-like functions to forward parameter names to inlay hints.
The parameter packs are being resolved recursively by traversing the
function body of forwarding functions looking for expressions matching
the (std::forwarded) parameters expanded from a pack.
The implementation checks whether parameters are being passed by
(rvalue) reference or value and adds reference inlay hints accordingly.
The traversal has a limited recursion stack depth, and recursive calls
like std::make_tuple are cut off to avoid hinting duplicate parameter
names.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D124690
Louis Dionne [Wed, 6 Jul 2022 20:21:14 +0000 (16:21 -0400)]
[clang][NFC] Re-generate CommandLineReference.rst
Corentin Jabot [Wed, 6 Jul 2022 20:16:22 +0000 (22:16 +0200)]
[Clang] Fix invalid utf-8 detection
The length of valid codepoints was incorrectly
calculated which was not caught before because the
absence of tests for the valid codepoints scenario.
Differential Revision: https://reviews.llvm.org/D129223
Nico Weber [Wed, 6 Jul 2022 20:15:09 +0000 (22:15 +0200)]
try to fix build after
babef908cc1
Masoud Ataei [Wed, 6 Jul 2022 20:04:17 +0000 (13:04 -0700)]
Bringing back the test with the required target related to commit
96515df816ebc3af2a632669a26374745e98b0c5
Noah Shutty [Wed, 6 Jul 2022 20:02:03 +0000 (20:02 +0000)]
[llvm] [Debuginfod] DebuginfodCollection and DebuginfodServer for tracking local debuginfo.
This library implements the class `DebuginfodCollection`, which scans a set of directories for binaries, classifying them according to whether they contain debuginfo. This also provides the `DebuginfodServer`, an `HTTPServer` which serves debuginfod's `/debuginfo` and `/executable` endpoints. This is intended as the final new supporting library required for `llvm-debuginfod`.
As implemented here, `DebuginfodCollection` only finds ELF binaries and DWARF debuginfo. All other files are ignored. However, the class interface is format-agnostic. Generalizing to support other platforms will require refactoring of LLVM's object parsing libraries to eliminate use of `report_fatal_error` ([[ https://github.com/llvm/llvm-project/blob/main/llvm/lib/Object/WasmObjectFile.cpp#L74 | e.g. when reading WASM files ]]), so that the debuginfod daemon does not crash when it encounters a malformed file on the disk.
The `DebuginfodCollection` is tested by end-to-end tests of the debuginfod server (D114846).
Reviewed By: mysterymath
Differential Revision: https://reviews.llvm.org/D114845
Eli Friedman [Wed, 6 Jul 2022 19:56:47 +0000 (12:56 -0700)]
[AsmPrinter] Fix bit pattern for i1 vectors.
Vectors are defined to be tightly packed, regardless of the element
type. The AsmPrinter didn't realize this, and was allocating extra
padding.
Fixes https://github.com/llvm/llvm-project/issues/49286
Fixes https://github.com/llvm/llvm-project/issues/53246
Fixes https://github.com/llvm/llvm-project/issues/55522
Differential Revision: https://reviews.llvm.org/D129164
Masoud Ataei [Wed, 6 Jul 2022 19:41:13 +0000 (12:41 -0700)]
Removing this test temporarily beacuse of a failure in x86_64
LLVM GN Syncbot [Wed, 6 Jul 2022 19:34:19 +0000 (19:34 +0000)]
[gn build] Port
8366e21ef176
Nico Weber [Wed, 6 Jul 2022 19:33:45 +0000 (21:33 +0200)]
[gn build] (manually) port
9ee97ce3b8305c5
Louis Dionne [Thu, 9 Jun 2022 21:36:33 +0000 (17:36 -0400)]
[libc++] Use ABI tags instead of internal linkage to provide per-TU insulation
Instead of marking private symbols with internal_linkage (which leads to
one copy per translation unit -- rather wasteful), use an ABI tag that
gets rev'd with each libc++ version. That way, we know that we can't have
name collisions between implementation-detail functions across libc++
versions, so we'll never violate the ODR. However, within a single program,
each symbol still has a proper name with external linkage, which means
that the linker is free to deduplicate symbols even across TUs.
This actually means that we can guarantee that versions of libc++ can
be mixed within the same program without ever having to take a code size
hit, and without having to manually opt-in -- it should just work out of
the box.
Differential Revision: https://reviews.llvm.org/D127444
Nico Weber [Wed, 6 Jul 2022 19:23:17 +0000 (21:23 +0200)]
[gn build] (manually) port
484b1aa611ca
Nico Weber [Wed, 6 Jul 2022 19:19:59 +0000 (21:19 +0200)]
[gn build] (manually) port
e0b520865026
Corentin Jabot [Fri, 17 Jun 2022 14:23:41 +0000 (16:23 +0200)]
[Clang] Add a warning on invalid UTF-8 in comments.
Introduce an off-by default `-Winvalid-utf8` warning
that detects invalid UTF-8 code units sequences in comments.
Invalid UTF-8 in other places is already diagnosed,
as that cannot appear in identifiers and other grammar constructs.
The warning is off by default as its likely to be somewhat disruptive
otherwise.
This warning allows clang to conform to the yet-to be approved WG21
"P2295R5 Support for UTF-8 as a portable source file encoding"
paper.
Reviewed By: aaron.ballman, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D128059
Louis Dionne [Tue, 5 Jul 2022 22:53:33 +0000 (18:53 -0400)]
[clang] Correct the macOS version that supports aligned allocation
After checking the libc++abi.dylib shipped in macOS 10.13, I can confirm
that it contains the align_val_t variants of operator new and operator
delete. However, the libc++abi.dylib shipped on macOS 10.12 does not.
Differential Revision: https://reviews.llvm.org/D129198
Noah Shutty [Wed, 6 Jul 2022 18:50:55 +0000 (18:50 +0000)]
[llvm] [Debuginfod] Add HTTP Server to Debuginfod library.
This provides a minimal HTTP server interface and an implementation wrapping [[ https://github.com/yhirose/cpp-httplib | cpp-httplib ]] in the Debuginfod library. If the Curl HTTP client is available (D112753) the server is tested by pinging it with the client.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D114415
Mark de Wever [Sun, 3 Jul 2022 16:39:30 +0000 (18:39 +0200)]
[libc++] Improves pragma system_header test.
The number of spaces between `#` and `pragma` can differ due to
different indention levels in the preprocessor directives. Therefore
allow any number of spaces.
The test used to put an exclamation mark in its diagnostic. This adds
little benefit and only makes it harder to copy the offending filename.
As drive-by this exclamation mark has been removed.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D129047
Masoud Ataei [Wed, 6 Jul 2022 18:44:00 +0000 (11:44 -0700)]
[PowerPC] Fix the check for scalar MASS conversion
Proposing to move the check for scalar MASS conversion from constructor
of PPCTargetLowering to the lowerLibCallBase function which decides
about the lowering.
The Target machine option Options.PPCGenScalarMASSEntries is set in
PPCTargetMachine.cpp. But an object of the class PPCTargetLowering
is created in one of the included header files. So, the constructor will run
before setting PPCGenScalarMASSEntries to correct value. So, we cannot
check this option in the constructor.
Differential: https://reviews.llvm.org/D128653
Reviewer: @bmahjour
Noah Shutty [Wed, 6 Jul 2022 18:39:59 +0000 (18:39 +0000)]
[llvm] [Debuginfod] Add cpp-httplib optional dependency.
Adds optional dependency on cpp-httplib, a lightweight header-only HTTP server.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D113218
Aaron Ballman [Wed, 6 Jul 2022 18:33:37 +0000 (14:33 -0400)]
Update the status & add tests for some more C99 DRs
Chris Bieneman [Wed, 6 Jul 2022 17:18:09 +0000 (12:18 -0500)]
[NFC] [DirectX] Prefix for intrinsics should be dx
`dxil` is an architecture supported by the DirectX backend. These
intrinsics will likely be shared with other DirectX architectures like
`dxbc`. Using a common prefix `dx` will make it more intuitive.
Also the `dx` prefix is already set in the Triple, which causes
intrinsics described here to be unmatchable via the ClangBuiltin
mechanism.
Maksim Panchenko [Wed, 6 Jul 2022 02:55:26 +0000 (19:55 -0700)]
[BOLT] Add runtime functions required by freestanding environment
Compiler can generate calls to some functions implicitly, even under
constraints of freestanding environment. Make sure these functions are
available in our runtime objects.
Fixes test failures on some systems after https://reviews.llvm.org/D128960.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D129168
LLVM GN Syncbot [Wed, 6 Jul 2022 17:46:18 +0000 (17:46 +0000)]
[gn build] Port
f8cbe3cdf024
Corentin Jabot [Wed, 6 Jul 2022 17:45:12 +0000 (19:45 +0200)]
Revert "[Clang] Add a warning on invalid UTF-8 in comments."
Reverting while I investigate build failures
This reverts commit
e3dc56805f1029dd5959e4c69196a287961afb8d.
Peter Klausler [Fri, 1 Jul 2022 18:40:44 +0000 (11:40 -0700)]
[flang] Establish a single source of target information for semantics
Create a TargetCharacteristics class to centralize the few items of
target specific information that are relevant to semantics. Use the
new class for all target queries, including derived type component layout
modeling.
Future work will initialize this class with target information
provided or forwarded by the drivers, and use it to fold layout-dependent
intrinsic functions like TRANSFER().
Differential Revision: https://reviews.llvm.org/D129018
Updates: Attempts to work around build issues on Windows.
Wolfgang Pieb [Wed, 25 May 2022 17:14:10 +0000 (10:14 -0700)]
[Metadata] Utilize the resizing capability of MDNodes in Moduleflag processing.
This mostly affects PGO/LTO builds which use module flags describing the call
graph. Fixes Issue #51893.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D125999
Petr Hosek [Wed, 6 Jul 2022 17:08:26 +0000 (17:08 +0000)]
[CMake][Fuchsia] Install static libuwind
This can now be used with -static-libgcc.
Differential Revision: https://reviews.llvm.org/D129218
Jin Xin Ng [Wed, 1 Jun 2022 17:46:55 +0000 (10:46 -0700)]
[LTO][ELF] Add selective --save-temps= option
Allows specific “temps” to be saved, instead of the current all-or-nothing nature of --save-temps. Multiple of these “temps” can be saved by specifying the argument multiple times.
Differential Revision: https://reviews.llvm.org/D127778
Shilei Tian [Wed, 6 Jul 2022 17:05:00 +0000 (13:05 -0400)]
[Clang][OpenMP] Enable floating-point operation for `atomic compare` series
D127041 introduced the support for `fmax` and `fmin` such that we can also reprent
`atomic compare` and `atomic compare capture` with `atomicrmw` instruction. This
patch simply lifts the limitation we set before.
Depend on D127041.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D127042
Simon Pilgrim [Wed, 6 Jul 2022 17:00:21 +0000 (18:00 +0100)]
[X86] LowerShift - lower some shuffles directly to X86ISD::PSHUFLW nodes.
These are expected to lower to X86ISD::PSHUFLW but we were seeing some regressions in D129150 because it'd managed to exploit the masking of the shift amounts to create unintended clear masks instead.
Nikolas Klauser [Wed, 6 Jul 2022 12:03:00 +0000 (14:03 +0200)]
[libc++] Implement ranges::remove{, _if}
Reviewed By: var-const, #libc
Spies: huixie90, sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D128618
Philip Reames [Wed, 6 Jul 2022 16:26:10 +0000 (09:26 -0700)]
[RISCV] Autogen a vectorizer test for ease of update
Sam McCall [Wed, 6 Jul 2022 16:27:02 +0000 (18:27 +0200)]
[clangd] Fix missing key function in PreambleThrottler
Sander de Smalen [Wed, 6 Jul 2022 15:59:24 +0000 (15:59 +0000)]
[AArch64][SVE] Zero other lanes when doing OR reduction on unpacked predicate using ptest.
When the predicate vector is unpacked, we cannot assume anything about the
values in the other lanes. We have to make sure we use the correct
predicate where we know that the other lanes have been zeroed.
Reviewed By: RosieSumpter
Differential Revision: https://reviews.llvm.org/D129081