LLVM GN Syncbot [Fri, 30 Jun 2023 16:58:05 +0000 (16:58 +0000)]
[gn build] Port
62e4c22c95a9
Hamish Knight [Fri, 30 Jun 2023 16:46:52 +0000 (09:46 -0700)]
[clang] Fix ASTUnit working directory handling
Fix a couple of issues with the handling of the current working directory in ASTUnit:
- Use `createPhysicalFileSystem` instead of `getRealFileSystem` to avoid affecting the process' current working directory, and set it at the top of `ASTUnit::LoadFromCommandLine` such that the driver used for argument parsing and the ASTUnit share the same VFS. This ensures that '-working-directory' correctly sets the VFS working directory in addition to the FileManager working directory.
- Ensure we preserve the FileSystemOptions set on the FileManager when re-creating it (as `ASTUnit::Reparse` will clear the currently set FileManager).
rdar://
110697657
Reviewed By: bnbarham, benlangmuir
Differential Revision: https://reviews.llvm.org/D154134
Yaxun (Sam) Liu [Thu, 29 Jun 2023 20:02:13 +0000 (16:02 -0400)]
[HIP] Fix -mllvm option for device lld linker
currently clang passes -mllvm options to the device lld linker plugin
when compiling HIP. This is against default clang behavior
which is only passing -mllvm options to linker plugin specified through -Wl
options. This patch lets clang only pass -Xoffload-linker -mllvm= options
to device lld linker plugin.
Fixes: https://github.com/llvm/llvm-project/issues/63604
Reviewed by: Joseph Huber, Matt Arsenault
Differential Revision: https://reviews.llvm.org/D154145
Matt Arsenault [Tue, 13 Jun 2023 14:05:44 +0000 (10:05 -0400)]
clang: Add start of header test for __clang_hip_libdevice_declares
It was shockingly difficult to get identical checks out of the 3
languages. The visibility, dso_local and fp-contract settings seem to
differ unless I force every test function to
static. update_cc_test_checks also isn't smart enough when the
attribute groups slightly differ.
Matt Arsenault [Wed, 28 Jun 2023 12:57:19 +0000 (08:57 -0400)]
Verifier: Verify absolute_symbol metadata
This is the same as !range except for one edge case.
Matt Arsenault [Wed, 28 Jun 2023 13:14:06 +0000 (09:14 -0400)]
Verifier: Fix assertion on range metadata with equal bounds
This only worked if the same values were the min or max. We also seem
to be missing proper assembler tests for this.
Matt Arsenault [Mon, 19 Jun 2023 22:03:33 +0000 (18:03 -0400)]
Analysis: Fix assertion when load alignment exceeds address space size
Apparently the maximum alignment no longer fits in 32-bits now, which
overflows a 32-bit offset and would fail on the isPowerOf2 assert.
Joseph Huber [Thu, 29 Jun 2023 16:23:47 +0000 (11:23 -0500)]
[libc] Make the RPC server target always available
This patch makes sure that we always build the RPC server. The proposed
used for this is to begin integrating this server implementation into
`libomptarget`. That requires that we build this server ahead of time
when using a `LLVM_ENABLE_PROJECTS` build. Make a few tweaks to ensure
that the GCC compiler which may be used for this build doesn't complain.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D154105
Joseph Huber [Fri, 30 Jun 2023 14:48:13 +0000 (09:48 -0500)]
[libc] Add other RPC callback methods to the RPC server
This patch adds the other two methods to the server so the external
users can use the interface through the obfuscated interface.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D154224
Amir Ayupov [Fri, 30 Jun 2023 16:14:58 +0000 (09:14 -0700)]
Reland "[BOLT][Instrumentation] Don't share counters when using append-pid"
This reverts commit
c15e9b6814e53bccb0194268a826c1213a84b395.
The issue appears unrelated as the crash happened in the BOLTed binary, not
instrumented binary.
Fangrui Song [Fri, 30 Jun 2023 16:13:19 +0000 (09:13 -0700)]
MachineFunction: -fsanitize={function,kcfi}: ensure 4-byte alignment
Fix https://github.com/llvm/llvm-project/issues/63579
```
% cat a.c
void foo() {}
% clang --target=arm-none-eabi -mthumb -mno-unaligned-access -fsanitize=kcfi a.c -S -o - | grep p2align
.p2align 1
% clang --target=armv6m-none-eabi -fsanitize=function a.c -S -o - | grep p2align
.p2align 1
```
Ensure that -fsanitize={function,kcfi} instrumented functions are aligned by at
least 4, so that loading the type hash before the function label will not cause
a misaligned access. This is especially important for -mno-unaligned-access
configurations that don't set `setMinFunctionAlignment` to 4 or greater.
With this patch, the generated assembly for the examples above will contain `.p2align 2`
before the type hash.
If `__attribute__((aligned(N)))` or `-falign-functions=N` is specified, the
larger alignment will be used.
Reviewed By: simon_tatham, samitolvanen
Differential Revision: https://reviews.llvm.org/D154125
Yuanfang Chen [Fri, 30 Jun 2023 16:09:31 +0000 (09:09 -0700)]
[clang] Update cxx_status for
632dd6a4ca0036009f
missed this after rebase
Artem Belevich [Thu, 29 Jun 2023 16:31:31 +0000 (09:31 -0700)]
[NVPTX] added a hidden option to control NVPTXLowerUnreachable pass.
We've ran into an issue where the pass breaks a handful of our internal tests
and need a way to temporarily disable the pass while we're investigating.
Differential Revision: https://reviews.llvm.org/D154106
Ivan Kosarev [Fri, 30 Jun 2023 15:43:02 +0000 (16:43 +0100)]
[AMDGPU][Codegen] Clean up legalizeOpWithMove().
The removed logic was added in
<https://reviews.llvm.org/rG0c93c9ecee0624f8469f5a971a09fbc9e9cc1061>,
but now doesn't seem to be needed.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D154220
Alex Bradbury [Fri, 30 Jun 2023 15:39:15 +0000 (16:39 +0100)]
[RISCV] Custom lower FP_TO_FP16 and FP16_TO_FP to correct ABI of of libcall
As introduced in D99148, RISC-V uses the softPromoteHalf legalisation
for fp16 values without zfh, with logic ensuring that f16 values are
passed in lower bits of FPRs (see D98670) when F or D support is
present. This legalisation produces ISD::FP_TO_FP16 and ISD::FP16_TO_FP
nodes which (as described in ISDOpcodes.h) provide a "semi-softened
interface for dealing with f16 (as an i16)". i.e. the return type of the
FP_TO_FP16 is an integer rather than a float (and the arg of FP16_TO_FP
is an integer). The remainder of the description focuses primarily on
FP_TO_FP16 for ease of explanation.
FP_TO_FP16 is lowered to a libcall to `__truncsfhf2 (float)` or
`__truncdfhf2 (double)`. As of D92241, `_Float16` is used as the return
type of these libcalls if the host compiler accepts `_Float16` in a test
input (i.e. dst_t is set to `_Float16`). `_Float16` is enabled for the
RISC-V target as of D105001 and so the return value should be passed in
an FPR on hard float ABIs.
This patch fixes the ABI issue in what appears to be a minimally
invasive way - leaving the softPromoteHalf logic undisturbed, and
lowering FP_TO_FP16 to an f32-returning libcall, converting its result
to an XLen integer value.
As can be seen in the test changes, the custom lowering for FP16_TO_FP
means the libcall is no longer tail-callable.
Although this patch fixes the issue, there are two open items:
* Redundant fmv.x.w and fmv.w.x pairs are now somtimes produced during
lowering (not a correctness issue).
* Now coverage for STRICT variants of FP16 conversion opcodes.
Differential Revision: https://reviews.llvm.org/D151284
Alex Bradbury [Fri, 30 Jun 2023 15:30:15 +0000 (16:30 +0100)]
[RISCV][test] Add additional RUN lines to half-convert.ll in preparation for D151824
There wasn't previous coverage for rv32id-ilp32, rv64id-lp64,
rv32id-ilp32d, or rv64id-lp64d. This is needed as D151284 fixes a bug
related to the ABI used for libcalls for fp<->fp16 conversion when hard
FP support is present.
Ivan Kosarev [Fri, 30 Jun 2023 15:28:40 +0000 (16:28 +0100)]
[AMDGPU][AsmParser][NFC] Simplify parsing of sopp_brtarget operands.
Also refine the definitions while there.
Part of <https://github.com/llvm/llvm-project/issues/62629>.
Reviewed By: mbrkusanin
Differential Revision: https://reviews.llvm.org/D154061
Paul Robinson [Wed, 28 Jun 2023 18:25:03 +0000 (11:25 -0700)]
[Headers][doc] Add load/store/cmp/cvt intrinsic descriptions to avx2intrin.h
Differential Revision: https://reviews.llvm.org/D153993
Florian Hahn [Fri, 30 Jun 2023 15:28:37 +0000 (16:28 +0100)]
[ConstraintElim] Add phi tests with multiple GEP indices.
Extra tests for D152730.
Markus Böck [Fri, 30 Jun 2023 15:28:15 +0000 (17:28 +0200)]
[mlir][NFC] Fully qualify TableGen generated code handling properties
This makes it possible to compile the TableGen generated files without having to use `using namespace mlir;` or being in the `mlir` namespace.
Donát Nagy [Tue, 27 Jun 2023 15:49:44 +0000 (17:49 +0200)]
[analyzer][NFC] Fix dangling StringRef in barely used code
CheckerContext::getNoteTag has a shorthand version that takes a
plain 'StringRef Note' instead of a lambda that calculates the note.
The old implementation of this method was incorrect because it created a
lambda that captured the StringRef, which was dereferenced much later,
when the NoteTags were visited.
In the current codebase this does not cause errors because this method
is called only once, and there the `Note` argument is a string literal
that remains valid. However, I tried to use this method in a checker
that I was prototyping, and there it printed random memory junk (instead
of the message that I composed in a local variable).
Differential Revision: https://reviews.llvm.org/D153889
Fabio D'Urso [Fri, 30 Jun 2023 14:35:09 +0000 (16:35 +0200)]
[scudo] SizeClassAllocator64: dispatch all the classes in init()
This will make it easier to verify in a future patch that the ReservedMemory object has been fully dispatched.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D153019
Anna Thomas [Fri, 30 Jun 2023 14:21:16 +0000 (10:21 -0400)]
[Metarenamer] Introduce option to only change inst names
This is useful when needing to modify IR and test some optimizations on
them, while keeping BB names and function names intact. If
the IR uses ordered number naming (%1, %2, %3 etc), then we cannot just
remove or reorder specific instructions since the verifier expects the
numbers to be in order.
Akash Banerjee [Fri, 30 Jun 2023 15:03:57 +0000 (16:03 +0100)]
Reverting commit
0d8d718171192301f2beb10bd08ce62e70281a5e as it broke libomptarget tests
Ben Shi [Wed, 21 Jun 2023 10:05:24 +0000 (18:05 +0800)]
[CSKY] Optimize IR pattern icmp-select with INCT32/INCF32
Reviewed By: zixuan-wu
Differential Revision: https://reviews.llvm.org/D153436
Ben Shi [Tue, 20 Jun 2023 10:58:00 +0000 (18:58 +0800)]
[CSKY][test][NFC] Add tests of IR pattern icmp-select
These tests will be optimized with INCT32/INCF32/DECT32/DECF32
in the future.
Reviewed By: zixuan-wu
Differential Revision: https://reviews.llvm.org/D153434
ManuelJBrito [Thu, 29 Jun 2023 17:23:55 +0000 (18:23 +0100)]
[GVN] Add tests for PR63059 (NFC)
Besides the example from the issue, this adds some other related wrong transformations.
Differential Revision: https://reviews.llvm.org/D154103
Jan Sjodin [Thu, 29 Jun 2023 14:41:11 +0000 (10:41 -0400)]
[OpenMP][OpenMPIRBuilder] Migrate kernel launch code and host fallback code generation from Clang to the OpenMPIRBuilder
This patch refactors the code generation that emits the offloading kernel
launch and moves the core portion to the OpenMPIRBuilder so that it can be used
from flang in the future.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D151035
Christian Ulmann [Fri, 30 Jun 2023 14:19:31 +0000 (14:19 +0000)]
[mlir][LLVM] Add section attribute to LLVMFuncOp
This commit adds an optional section attribute to the `LLVMFuncOp` and
adds import and export functionality for it.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D154219
Donát Nagy [Fri, 30 Jun 2023 13:43:30 +0000 (15:43 +0200)]
[dataflow] Fix complie on gcc7 part 2
Change
c2bb68078eb9 triggered a bug in gcc7 by disabling a copy
constructor. Commit
2f7d30dee826 fixed one occurrence of this issue, but
after that the compilation still failed with another very similar error.
This commit eliminates this second compilation error, and ensures that
`ninja check-clang-analysis` can be successfully executed with gcc 7.5.
Matt Arsenault [Sun, 25 Jun 2023 12:55:52 +0000 (08:55 -0400)]
llvm-reduce: Fix not preserving uselistorder with bitcode
Fix accidentally passing pointer to bool argument This was supposed to
be writing bitcode with preserved uselistorder, but instead was only
enabling it with LTO module summaries.
Florian Hahn [Fri, 30 Jun 2023 14:16:23 +0000 (15:16 +0100)]
[ConstraintElim] Add extra tests and split up test file.
Extra tests for D152730, including more tests where the step GEP doesn't
use the phi and inbounds are missing.
Also split up test file to make it easier to verify for Alive2.
Akash Banerjee [Tue, 27 Jun 2023 12:50:17 +0000 (13:50 +0100)]
[OpenMP] Change clang emitTargetDataCalls to use OMPIRBuilder
This patch changes the emitTargetDataCalls function in clang to make use of the OpenMPIRBuilder::createTargetData function for Target Data directive code gen.
Depends on D146557
Differential Revision: https://reviews.llvm.org/D150860
Ulrich Weigand [Fri, 30 Jun 2023 14:02:56 +0000 (16:02 +0200)]
[SystemZ] Improve error messages for unsupported relocations
In the SystemZMCObjectWriter, we currently just abort in case
some unsupported relocation in requested. However, as this
situation can be triggered by invalid (inline) assembler input,
we should really get a regular error message instead.
Nikita Popov [Fri, 30 Jun 2023 13:52:55 +0000 (15:52 +0200)]
[Attributor] Convert test to opaque pointers (NFC)
The loads and stores of the global are now optimized, as the relevant
parts of the function signatures match.
Simon Pilgrim [Fri, 30 Jun 2023 13:42:38 +0000 (14:42 +0100)]
[DAG] Fold (*ext (*_extend_vector_inreg x)) -> (*_extend_vector_inreg x)
LLVM GN Syncbot [Fri, 30 Jun 2023 13:26:44 +0000 (13:26 +0000)]
[gn build] Port
f13e1a65cabb
Nikita Popov [Wed, 28 Jun 2023 09:58:16 +0000 (11:58 +0200)]
[SimplifyCFG] Allow dropping block that only contains ephemeral values
Perform the TryToSimplifyUncondBranchFromEmptyBlock() transform if
the block is empty except for ephemeral values. The ephemeral values
will be dropped in that case.
This makes sure that assumes don't block this transforms, as reported
in https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609.
Differential Revision: https://reviews.llvm.org/D153966
Louis Dionne [Thu, 29 Jun 2023 22:09:58 +0000 (18:09 -0400)]
[libc++] Revert __uninitialized_buffer changes
This patch reverts the following commits:
015cd317eaed28a923d14a33c9d6739012a688be (add missing HIDE_FROM_ABI)
420a204d52205f1277a8d5df3dbafac6082e02e2 (add _LIBCPP_NO_CFI)
31eeba3f7c0e2ef4a21c07da9326a4ae1a8de7e2 (add __uninitialized_buffer)
It also reverts a small part of
b935ab8e747cf52ff12471879460206a9f433eea
which is required to make the stable_partition.pass.cpp test pass on GCC.
Some issues were pointed out in https://reviews.llvm.org/D152208 and
in https://reviews.llvm.org/D154017, so I am reverting this patch
until we have time to weigh the various solutions and get consensus
on the design of the API.
Differential Revision: https://reviews.llvm.org/D154161
Matt Arsenault [Fri, 30 Jun 2023 13:13:44 +0000 (09:13 -0400)]
DAG: Really fix patch split
Phoebe Wang [Fri, 30 Jun 2023 13:07:20 +0000 (21:07 +0800)]
[X86][FP16] Pre-commit test to show a mis-combination
Matt Arsenault [Fri, 30 Jun 2023 13:04:00 +0000 (09:04 -0400)]
Reapply "clang: Use new frexp intrinsic for builtins and add f16 version"
This reverts commit
0c545a441285a73e00b859dd52f1a85cb9eeeefc.
ARM libcall expansion was fixed in
160d7227e043cd8f491cb706916da953cabfd905
Matt Arsenault [Fri, 30 Jun 2023 13:07:09 +0000 (09:07 -0400)]
DAG: Fix broken patch split
Matt Arsenault [Fri, 30 Jun 2023 12:17:11 +0000 (08:17 -0400)]
DAG: Fix libcall expansion for frexp on ARM
The ExpandLibcallResult result was a bitcast and not the direct call
result, so we couldn't find the chain. Use the new separate chain
return value instead.
Matt Arsenault [Fri, 30 Jun 2023 12:11:12 +0000 (08:11 -0400)]
DAG: Return the chain from ExpandLibCall
If the libcall expansion requires use of the inserted call's result
chain, it's unreliable to query it from the main result. The call
lowering may have added additional casts or other obscuring operations
we don't want to parse through.
Guillaume Chatelet [Fri, 30 Jun 2023 12:55:54 +0000 (12:55 +0000)]
[libc] Improve memcmp latency and codegen
This is based on ideas from @nafi to:
- use a branchless version of 'cmp' for 'uint32_t',
- completely resolve the lexicographic comparison through vector
operations when wide types are available. We also get rid of byte
reloads and serializing '__builtin_ctzll'.
I did not include the suggestion to replace comparisons of 'uint16_t'
with two 'uint8_t' as it did not seem to help the codegen. This can
be revisited in sub-sequent patches.
The code been rewritten to reduce nested function calls, making the
job of the inliner easier and preventing harmful code duplication.
Reviewed By: nafi3000
Differential Revision: https://reviews.llvm.org/D148717
Jacek Caban [Fri, 7 Apr 2023 21:31:16 +0000 (23:31 +0200)]
[llvm-readobj] Add support for dumping CHPE metadata.
CHPE metadata is used by ARM64EC/ARM64X PE files to provide metadata for
emulator/loader. Most of this metadata will need to be generated by LLD.
Differential Revision: https://reviews.llvm.org/D149089
Victor Perez [Wed, 28 Jun 2023 08:18:20 +0000 (09:18 +0100)]
[mlir][spirv] Allow custom mangling of SPIRV built-in global variables
The SPIR-V spec does not specify the mangling for these variables, so
the conversion to SPIR-V should be flexible enough to allow adding a
custom prefix and suffix to the core name.
Differential Revision: https://reviews.llvm.org/D153951
Signed-off-by: Victor Perez <victor.perez@codeplay.com>
Sean Perry [Fri, 30 Jun 2023 12:04:43 +0000 (08:04 -0400)]
[SystemZ][z/OS] Add required options/macro/etc for z/os compilation step
Add the required options and macros to the compilation step for z/os.
Reviewed By: abhina.sreeskantharajan, fanbo-meng
Differential Revision: https://reviews.llvm.org/D153582
Matthias Springer [Fri, 30 Jun 2023 10:44:48 +0000 (12:44 +0200)]
[mlir][tensor] More static padding sizes for PadOp
Improve `tensor::createPadHighOp`: more static padding sizes when possible.
Differential Revision: https://reviews.llvm.org/D154200
Matthias Springer [Fri, 30 Jun 2023 10:44:33 +0000 (12:44 +0200)]
[mlir][Affine] Delete duplicate code: `applyMapToValues`
The same functionality is provided by `makeComposedFoldedAffineApply`.
Differential Revision: https://reviews.llvm.org/D154199
Matthias Springer [Fri, 30 Jun 2023 10:44:18 +0000 (12:44 +0200)]
[mlir][NFC] Clean up builder usage around constants/non-foldable ops
* Use `create` instead of `createOrFold` for constant ops. Constants cannot be folded any further.
* Use `create` instead of `createOrFold` for ops that do not have a folder.
* Use C++ op builders that take an `int` instead of creating a `ConstantIndexOp`.
* Create `tensor::DimOp` instead of `linalg::createOrFoldDimOp` when it is certain that the operand is a tensor.
Differential Revision: https://reviews.llvm.org/D154196
Jingu Kang [Fri, 30 Jun 2023 11:34:21 +0000 (12:34 +0100)]
[tests] precommit test for MachineLICM subloops
Hans Wennborg [Fri, 30 Jun 2023 11:14:17 +0000 (13:14 +0200)]
Revert "clang: Use new frexp intrinsic for builtins and add f16 version"
This caused asserts in some Android and Windows builds:
SelectionDAGNodes.h:1138: llvm::SDValue::SDValue(SDNode *, unsigned int):
Assertion `(!Node || !ResNo || ResNo < Node->getNumValues()) && "Invalid result number for the given node!"' failed.
See comment on https://github.com/llvm/llvm-project/commit/
85bdea023f5116f789095b606554739403042a21
Also revert "HIP: Use frexp builtins in math headers"
which seems to depend on this change.
This reverts commit
85bdea023f5116f789095b606554739403042a21.
This reverts commit
bf8e92c0e792cbe3c9cc50607a1e33c6912ffd0e.
David Green [Fri, 30 Jun 2023 11:25:07 +0000 (12:25 +0100)]
[AArch64] Fold tree of offset loads combine
This attempts to fold trees of add(ext(load p), shl(ext(load p+4)) into a
single load of twice the size, that we extract the bottom part and top part so
that the shl can start to use a shll2 instruction. The two loads in that
example can also be larger trees of instructions, which are identical except
for the leaves which are all loads offset from the LHS, including buildvectors
of multiple loads. For example:
sub(zext(buildvec(load p+4, load q+4)), zext(buildvec(load r+4, load s+4)))
Whilst it can be common for the larger loads to replace LDP instructions (which
doesn't gain anything on its own), the larger loads in buildvectors can help
create more efficient code, and prevent the need for ld1 lane inserts which can
be more expensive than continuous loads.
This creates a fairly niche, fairly large combine that attempts to be fairly
general where it is beneficial. It helps some SLP vectorized code to avoid the
use of the more expensive ld1 lane inserting loads.
Differential Revision: https://reviews.llvm.org/D153972
David Green [Fri, 30 Jun 2023 10:21:26 +0000 (11:21 +0100)]
[AArch64] Codegen tests for fold from D153972. NFC
Florian Hahn [Fri, 30 Jun 2023 11:17:56 +0000 (12:17 +0100)]
[LV] Add additional tests with dead vector epilogues.
Keith Walker [Thu, 22 Jun 2023 13:53:13 +0000 (14:53 +0100)]
[ARM] armv6m eXecute Only (XO) long branch Thunk
This patch adds a thunk for Thumb long branch on V6-M for eXecute Only.
Note that there is currently no support for a position independant and
eXecute Only V6-M long branch thunk
Differential Revision: https://reviews.llvm.org/D153772
David Green [Fri, 30 Jun 2023 10:13:39 +0000 (11:13 +0100)]
[DAG][AArch64] Fold shuffle_vector<4,5,6,7> to extract_subvector
During legalization, we can end up with shuffles that are identity masks, so
act like extract_subvector, but do not simplify to extract_subvector. This
adjusts the profitability heuristic in foldExtractSubvectorFromShuffleVector to
allow identity vectors that do not start at element 0. Undef masks elements are
excluded as it can be more useful to keep the undef elements.
Differential Revision: https://reviews.llvm.org/D153504
Nikita Popov [Fri, 30 Jun 2023 09:27:44 +0000 (11:27 +0200)]
Revert "Reland [SLP] Provide an universal interface for FixedVectorType::get. NFC."
This reverts commit
19b1d3bd7eeecbeb1e45045960faf325c7bc5c64.
Both the commit and the review are missing a patch description.
Guray Ozen [Thu, 29 Jun 2023 12:49:19 +0000 (14:49 +0200)]
Add [mlir][nvvm] `mbarrier.test.wait`
This work adds `mbarrier.test.wait` and `mbarrier.test.wait.shared` Ops in NVVM dialect. Since they are already implemented in the LLVM kernel, it only calls createIntrinsicCall.
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D154076
Guray Ozen [Thu, 29 Jun 2023 10:09:31 +0000 (12:09 +0200)]
[mlir] Add result to mbarrier.arrive
`mbarrier.arrive` returns token. This PR adds result to these ops.
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D154059
David Spickett [Thu, 22 Jun 2023 09:15:34 +0000 (09:15 +0000)]
[lldb] Check that qLaunchGDBServer packet does not return an error
While looking at https://github.com/llvm/llvm-project/issues/61955
I noticed that when we send qLaunchGDBServer we check that we got a response
but not what kind of response it was.
I think this was why the bug reporter saw:
(lldb) run
error: invalid host:port specification: '[192.168.64.2]'
The missing port is because we went down a path we only should have
chosen if the operation succeeded. Since we didn't check, we went ahead
with an empty port number.
To test this I've done the following:
* Make a temporary copy of lldb-server.
* Run that as a platform.
* Remove the copy.
* Attempt to create and run a target.
This fails because the running lldb-server will try to invoke itself
and it no longer exists.
Reviewed By: jasonmolenda
Differential Revision: https://reviews.llvm.org/D153513
Timm Bäder [Fri, 30 Jun 2023 06:26:36 +0000 (08:26 +0200)]
[clang][Interp][NFC] Add type checks to InterpStack::peek()
Timm Bäder [Tue, 27 Jun 2023 09:33:22 +0000 (11:33 +0200)]
[clang][Diagnostics] Fix diagnostic line numbers
The first line of the code snippet we print is potentially lower than
the caret line, so handle that case.
Fixes #63524
Differential Revision: https://reviews.llvm.org/D153849
Mariya Podchishchaeva [Fri, 30 Jun 2023 08:21:43 +0000 (04:21 -0400)]
[clang] Do not discard cleanups while processing immediate invocation
Since an immediate invocation is a full expression itself - it requires
an additional ExprWithCleanups node, but it can participate to a bigger
full expression which actually requires cleanups to be run after.
Thanks @ilya-biryukov for helping reducing the reproducer and confirming
that the analysis is correct.
Fixes https://github.com/llvm/llvm-project/issues/60709
Reviewed By: ilya-biryukov
Differential Revision: https://reviews.llvm.org/D153962
Haojian Wu [Fri, 30 Jun 2023 08:28:01 +0000 (10:28 +0200)]
[clang] NFC, replace llvm::writeFileAtomically with llvm::writeToOutput API inGlobalModuleIndex.cpp
We're in favor of writeToOutput.
Balázs Kéri [Fri, 30 Jun 2023 07:40:30 +0000 (09:40 +0200)]
[clang][analyzer] No end-of-file when seek to file begin.
If `fseek` is used with 0 position and SEEK_SET it sets the position
to the start of the file. This should not cause FEOF (end of file) error.
The case of an empty file is not handled for simplification.
It is not exactly defined in what cases `fseek` produces the different
error states. Normally feof should not happen at all because it is
possible to set the position after the end of file, but previous tests
showed that still feof (and any other error cases) can happen.
Reviewed By: donat.nagy
Differential Revision: https://reviews.llvm.org/D153363
Haojian Wu [Fri, 30 Jun 2023 08:17:10 +0000 (10:17 +0200)]
[clang] NFC, replace llvm::writeFileAtomically with llvm::writeToOutput
API in ASTUnit.cpp
writeFileAtomically is going to be deprecated, in favor of
writeToOutput.
Denis Revunov [Thu, 29 Jun 2023 21:14:45 +0000 (00:14 +0300)]
Reland [BOLT][Instrumentation] Add mmap return value assertions
In a very rare case that mmap call fails, we'll at least get a message
instead of segfault.
Reviewed By: rafauler, Amir
Differential Revision: https://reviews.llvm.org/D154056
Denis Revunov [Thu, 29 Jun 2023 08:57:48 +0000 (11:57 +0300)]
Reland [BOLT][Instrumentation][NFC] define and use mmap flags
Reviewed By: rafauler, Amir
Differential Revision: https://reviews.llvm.org/D154056
Haojian Wu [Fri, 30 Jun 2023 07:52:24 +0000 (09:52 +0200)]
[clangd] Replace writeFileAtomically with writeToOutput, NFC
We're going to deprecate the writeFileAtomically API, in favour of
writeToOutput.
Sameer Sahasrabuddhe [Fri, 30 Jun 2023 07:40:44 +0000 (13:10 +0530)]
Revert "[AMDGPU] Mark mbcnt as convergent"
This reverts commit
37114036aa57e53217a57afacd7f47b36114edfb.
The output of mbcnt does not depend on other active lanes, and hence it is not
convergent. The original change was made as a possible fix for
https://github.com/ROCm-Developer-Tools/HIP/issues/3172
But changing mbcnt does not fix that issue.
Reviewed By: ruiling, foad, yaxunl
Differential Revision: https://reviews.llvm.org/D153953
OverMighty [Fri, 30 Jun 2023 07:34:20 +0000 (08:34 +0100)]
[AArch64] Add patterns for scalar FMUL, FMULX
Scalar FMUL, FMULX instructions perform better or the same compared to indexed
FMUL, FMULX.
For example, the Arm Cortex-A55 Software Optimization Guide lists the following
instructions with a throughput of 2 IPC:
- "FP multiply" FMUL
- "ASIMD FP multiply" FMULX
whereas it lists the following with a throughput of 1 IPC:
- "ASIMD FP multiply, by element" FMUL, FMULX
The Arm Cortex-A510 Software Optimization Guide, however, does not separately
list "by element" variants of the "ASIMD FP multiply" instructions, which are
listed with the same throughput as the non-ASIMD ones.
Fixes #60817.
Differential Revision: https://reviews.llvm.org/D153207
Jean Perier [Fri, 30 Jun 2023 06:48:42 +0000 (08:48 +0200)]
[flang][hlfir] Codegen of hlfir.region_assign where LHS conflicts
When the analysis of hlfir.region_assign determined that the LHS region
evaluation may be impacted by the assignment effects, all LHS must be
fully evaluated and saved before any assignment is done.
This patch adds TemporaryStorage variants to save address, including
vector subscripted entities addresses whose shape must be saved.
It uses the DescriptorStack runtime to deal with complex cases inside
forall. For the sake of simplicity, this is also used for vector
subscripted LHS outside of foralls (each element address is saved as
a descriptor on this stack. This is a bit suboptimal, but it is a safe
start that will work with all kinds of type (polymorphic, PDTs...)
without further work). Another approach would be to saved only the
values that are conflicting in the LHS computation, but this would
require a much more complex analysis of the LHS region DAG.
Differential Revision: https://reviews.llvm.org/D154057
Haojian Wu [Fri, 23 Jun 2023 18:01:31 +0000 (20:01 +0200)]
[Support] Don't set "all_exe" mode by default for file written by llvm::writeToOutput
Differential Revision: https://reviews.llvm.org/D153652
Freddy Ye [Fri, 30 Jun 2023 07:15:37 +0000 (15:15 +0800)]
[NFC][X86] Add missing CPUID related changes for AMX-COMPLEX.
Aart Bik [Fri, 30 Jun 2023 03:13:33 +0000 (20:13 -0700)]
[mlir][affinexpr] add parseAffineExpr to parser API
Similar to AffineMap and IntegerSet parsing, this change makes the more fine-grained AffineExpr available for general parsing, using a preset symbol set to recognize variables.
Motivation:
The AffineExpr parser will be used by the new sparse tensor encoding surface syntax. Originally, we planned to duplicate the affine parser completely, but that would be a terrible waste of a good thing. With this minor API change, we prepare the way for the sparse tensor dialect (and others) to reuse the AffineExpr parser outside the context of a more restricted AffineMap parser.
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D154177
Chuanqi Xu [Fri, 30 Jun 2023 05:59:39 +0000 (13:59 +0800)]
[Coroutines] Don't transform cmpinst prematurely in simplifyTerminatorLeadingToRet
Previously, we would try to transform cmpinst in
simplifyTerminatorLeadingToRet if we found it was a constant. However,
this is incorrect.
Since the resolved constants in simplifyTerminatorLeadingToRet are not
truely constants. They are basically constants along cerntain code
paths.
In this way, it is clearly incorrect to transform the compare
instruction to a constant.
It will cause confusing miscompilations. This patch tries to fix this.
Han-Kuan Chen [Thu, 29 Jun 2023 17:07:02 +0000 (10:07 -0700)]
Reland [SLP] Provide an universal interface for FixedVectorType::get. NFC.
Differential Revision: https://reviews.llvm.org/D154114
Freddy Ye [Fri, 30 Jun 2023 06:14:31 +0000 (14:14 +0800)]
[NFC][X86] Correct tests with wrong locations before.
Johannes Doerfert [Fri, 30 Jun 2023 05:07:14 +0000 (22:07 -0700)]
[Attributor][NFCI] Remove the (already "unused") ModuleSlice
At some point we alloed the CGSCC traversal to look at the entire module
slice (see definition below). However, we don't allow that anymore,
mostly for compile time and complexity reasons. Consequently, there is
no need to build the ModuleSlice as we can replacve it with the SCC
wherever it was still used.
Johannes Doerfert [Fri, 30 Jun 2023 04:52:03 +0000 (21:52 -0700)]
[Attributor][NFCI] Avoid creating unnecessary AAs
If the IR has a boolean attribute, or the function is not IPO amendable,
we can avoid creating AAs that would just be forced into a trivial
fixpoint anyway. Since we check boolean IR attributes via
`AA::hasAssumedIRAttr`, we don't need AAs even if they would be fixed
optimistic right away. The only change is in the dependency graph
ordering as we move AAs around to simplify the code flow. There is no
reason for the order we seed AAs, so this order is just as fine.
Galina Kistanova [Fri, 30 Jun 2023 06:06:38 +0000 (23:06 -0700)]
lit::max-failures.py is flaky and hangs randomly on multi-core systems.
Amir Ayupov [Fri, 30 Jun 2023 05:21:44 +0000 (22:21 -0700)]
[BOLT][NFC] Simplify postProcessJumpTables
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D154115
Carlos Alberto Enciso [Fri, 30 Jun 2023 05:09:44 +0000 (06:09 +0100)]
[loop-deletion] Overly defensive with undef-ing dbg.values.
Explicitly inserting undef is overly defensive. Any values computed
nside the loop that are referenced by dbg.values should naturally
become undef when the loop is deleted, and all other values that
are loop invariant must be preserved.
Reviewed By: scott.linder
Differential Revision: https://reviews.llvm.org/D153539
Freddy Ye [Fri, 30 Jun 2023 05:17:22 +0000 (13:17 +0800)]
[x86] Add missing FeatureCMOV in frontend targets.
The missing info is gathered from X86.td.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D154181
Amir Aupov [Fri, 30 Jun 2023 05:11:17 +0000 (22:11 -0700)]
Revert "[BOLT][Instrumentation][NFC] define and use mmap flags"
This reverts commit
f0b45fba4b64ab0b5d6c50d978e02f0d12d4d070.
The stack broke https://lab.llvm.org/buildbot/#/builders/252.
Amir Aupov [Fri, 30 Jun 2023 05:10:31 +0000 (22:10 -0700)]
Revert "[BOLT][Instrumentation] Add mmap return value assertions"
This reverts commit
8f7c53ef81c17ae9d773818181d04ef1c3890912.
The stack broke https://lab.llvm.org/buildbot/#/builders/252.
Aart Bik [Fri, 30 Jun 2023 03:54:51 +0000 (20:54 -0700)]
[NFC] cleanup of parser
This revision fixes a typo, where printIntegerSet() was used where it should have been parseIntegerSet().It also removes a dangling getDimsAndSymbolSSAIds() declaration that is never used.
Differential Revision: https://reviews.llvm.org/D154179
Arthur Eubanks [Fri, 30 Jun 2023 04:45:24 +0000 (21:45 -0700)]
Revert "[SLP] Provide an universal interface for FixedVectorType::get. NFC."
This reverts commit
fcd58ea50c218b61a58d6815b9d15bad7dbc75a3.
Causes crashes, see comments on D154114.
Ian Douglas Scott [Fri, 30 Jun 2023 03:53:22 +0000 (20:53 -0700)]
[M68k][MC] Add support for 32 bit register-register multiply/divide
Previously when targeting 68020+, instruction selection attempted to
emit a 32-bit register-register multiplication, but failed at instruction
selection. With this, it succeeds.
Differential Revision: https://reviews.llvm.org/D152120
Arthur Eubanks [Fri, 30 Jun 2023 04:24:04 +0000 (21:24 -0700)]
[gn build] Port
b5270ba20dc3
Arthur Eubanks [Fri, 30 Jun 2023 04:24:03 +0000 (21:24 -0700)]
[gn build] Port
853b2a84cb99
Arthur Eubanks [Fri, 30 Jun 2023 04:19:07 +0000 (21:19 -0700)]
Revert "[MC,x86-32] Remove a gold<2.34 workaround"
This reverts commit
a699921baa91e6c2979ec0f0482430c57f51761d.
Seems to cause miscompiles (https://crbug.com/1459232), following up with author.
Craig Topper [Fri, 30 Jun 2023 03:58:55 +0000 (20:58 -0700)]
[RISCV] Mark zvkn* and zvks* extensions as enabled when all their subextensions are.
These extensions don't contain any instructions on their own, they
are just aliases for a set of extensions. We should set the preprocessor
define anytime all the sub-extensions are supported.
Reviewed By: kito-cheng, eopXD
Differential Revision: https://reviews.llvm.org/D154171
Ben Shi [Tue, 20 Jun 2023 10:00:56 +0000 (18:00 +0800)]
[CSKY] Optimize subtraction with SUBI32/SUBI16
Reviewed By: zixuan-wu
Differential Revision: https://reviews.llvm.org/D153326
V Donaldson [Fri, 30 Jun 2023 03:23:56 +0000 (20:23 -0700)]
[flang] Reinstate class query test
Remove kind=10 test variant, which is not universally supported.
wanglei [Tue, 11 Apr 2023 03:48:42 +0000 (11:48 +0800)]
[LoongArch] Reuse LoongArchRegWithSubRegs class to shorten some code in LoongArchRegisterInfo.td. NFC
wangpc [Fri, 30 Jun 2023 03:01:58 +0000 (11:01 +0800)]
[RISCV][NFC] Replace Join with !interleave
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D153940