Commit Graph

425060 Commits

Author SHA1 Message Date
Leonard Chan c8644ea88e [compiler-rt][lsan] Update CanBeAHeapPointer for AArch64
While attempting to get the 64-bit lsan allocator working for Fuchsia, I
noticed this function would incorrectly return false for pointers returned
by the 64-bit allocator. On AArch64, this function attempts to get the VMA
size dynamically by counting the number of leading zeros from the function
frame address. This will fail if the frame address is significantly below an
allocated pointer (that is, the frame address has more leading zeros than an
allocated pointer). This is possible on Fuchsia and linux (when not called
from the initial thread stack).

It seems the intended use of this function is to speed up pointer scanning by
filtering out addresses that user code might not be able to access. Other
platforms this check is done on seem to hardcode the VMA size/shift, so it
seems appropriate to do this for aarch64 as well. This implies pointers on
aarch64 where the VMA size is <64 will pass through, but bad pointers will
still be caught by subsequent scan checks.

This patch also renames the function to something more fitting of what it's
trying to do.

Differential Revision: https://reviews.llvm.org/D123814
2022-05-24 10:22:46 -07:00
Nathan Ridge 175833ed6f [clangd] Handle '--' in QueryDriverDatabase
Fixes https://github.com/clangd/clangd/issues/1100,
a regression from D116721.

Differential Revision: https://reviews.llvm.org/D126274
2022-05-24 13:10:41 -04:00
Paul Robinson 4a3e2aff5f Reland "[PS5] Verify defaults to -fno-stack-size-section"
This reverts commit efebb27b74.
Fixes typos (accidentally omitted %s from some RUN lines).
2022-05-24 10:09:39 -07:00
Stanislav Mekhanoshin 5df6669d45 [AMDGPU] Enforce alignment of image vaddr on gfx90a
Even though single address image instructions only use a single VGPR
HW accesses 4 or 5 which creates alignment requirement.

Fixes: SWDEV-316648

Differential Revision: https://reviews.llvm.org/D126009
2022-05-24 10:05:39 -07:00
Alex Lorenz ee8524087c [libclang] add supporting for indexing/visiting C++ concepts
This commit builds upon recently added indexing support for C++ concepts
from https://reviews.llvm.org/D124441 by extending libclang to
support indexing and visiting concepts, constraints and requires
expressions as well.

Differential Revision: https://reviews.llvm.org/D126031
2022-05-24 10:02:53 -07:00
Paul Robinson efebb27b74 Revert "[PS5] Verify defaults to -fno-stack-size-section"
This reverts commit 28432b0f65.

Caused some unexpected buildbot failures.
2022-05-24 10:00:33 -07:00
Chris Bieneman 11dd508bd4 NFC. Clang-formatting.
Since the rest of the DirectX backend is pretty well clang-format
clean, this file should be too.
2022-05-24 11:51:00 -05:00
Peter Klausler d90e866a19 [flang][runtime] INQUIRE(UNIT=666,NUMBER=n) must set n=666
Whether a unit number in an inquire-by-unit statement is valid or not,
it should be the value to which the NUMBER= variable is set, not -1.
-1 should be returned to NUMBER= only for an inquire-by-file statement
when the FILE= is not connected to any unit.

Differential Revision: https://reviews.llvm.org/D126145
2022-05-24 09:48:32 -07:00
Paul Robinson 28432b0f65 [PS5] Verify defaults to -fno-stack-size-section 2022-05-24 09:47:37 -07:00
Craig Topper 415b9f595d Recommit "[RISCV] Use selectShiftMaskXLen ComplexPattern for isel of rotates."
This reverts commit dfe513ae1b.

Tests have been changed to avoid the type legalization bug being
fixed in D126036.

Original commit message:
This will remove masks on the shift amount. We usually get this with
SimplifyDemandedBits in DAGCombine, but that's restricted to cases
where the AND has a single use. selectShiftMaskXLen does not have
that restriction.
2022-05-24 09:41:04 -07:00
Craig Topper cddeb78e8d [RISCV] Add test cases showing failure to remove mask on rotate amounts.
This is similar to tests I added in
e2f410feea that had to be reverted.

I've modified them to avoid the bug that is being fixed by D126036.
2022-05-24 09:41:00 -07:00
Nico Weber 1b976f2cb2 [gn build] Reformat all build files
Ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2022-05-24 12:16:55 -04:00
Peter Klausler 574f9dfee8 [flang] Extension: Accept Hollerith actual arguments as if they were BOZ
When a Hollerith (or short character) literal is presented as an actual
argument that corresponds to a dummy argument for which a BOZ literal
would be acceptable, treat the Hollerith as if it had been a BOZ
literal in the same way -- and with the same code -- as f18 already
does for the similar extension in DATA statements.

Differential Revision: https://reviews.llvm.org/D126144
2022-05-24 09:04:31 -07:00
Cyndy Ishida a1a14e817e [Clang] Avoid misleading 'conflicting types' diagnostic with no-prototype decls.
Clang has recently started diagnosing prototype redeclaration errors like [rG385e7df33046](https://reviews.llvm.org/rG385e7df33046d7292612ee1e3ac00a59d8bc0441)

This flagged legitimate issues in a codebase but was confusing to resolve because it actually conflicted with a function declaration from a system header and not from the one emitted with "note: ".

This patch updates the error handling to use the canonical declaration's source location instead to avoid misleading errors like the one described.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D126258
2022-05-24 08:43:31 -07:00
Nico Weber 154f93ca90 [gn build] (semi-automatically) port 0360b9f159 2022-05-24 11:41:28 -04:00
Louis Dionne 6325184049 [libc++][NFC] Whitespace refactoring of string.cpp for consistency and legibility 2022-05-24 11:32:00 -04:00
Louis Dionne dc8a9a03ec [libc++][NFC] Move definitions around in string.cpp to reduce _LIBCPP_HAS_NO_WIDE_CHARACTERS blocks 2022-05-24 11:32:00 -04:00
Mogball 96bbe1bd61 [mlir] Rename mlir::SmallVector -> llvm::SmallVector 2022-05-24 15:03:19 +00:00
Logan Chien 57d239e4ad [mlir] Breakdown diagnostic string literals
This commit breaks down diagnostic string literals so that the attribute
name and enumurator names can be shared with the stringify utility
function and the "expected ", " to be one of ", and ", " can be shared
between different enum-related diagnostic.

Differential Revision: https://reviews.llvm.org/D125938
2022-05-24 07:58:00 -07:00
Peter Klausler deb62f5ad6 [flang][runtime] Clean up asynchronous I/O APIs
Now that the requirements and implementation of asynchronous I/O are
better understood, adjust their I/O runtime APIs.  In particular:
1) Remove the BeginAsynchronousOutput/Input APIs; they're not needed,
   since any data transfer statement might have ASYNCHRONOUS= and
   (if ASYNCHRONOUS='YES') ID= control list specifiers that need to
   at least be checked.
2) Add implementations for BeginWait(All) to check for the error
   case of a bad unit number and nonzero ID=.
3) Rearrange and comment SetAsynchronous so that it's clear that
   it can be called for READ/WRITE as well as for OPEN.

The implementation remains completely synchronous, but should be conforming.
Where opportunities make sense for true asynchronous implementations of
some big block transfers without SIZE= in the future, we'll need to add
a GetAsynchronousId API to capture ID= on a READ or WRITE; add sourceFile
and sourceLine arguments to BeginWait(All) for good error reporting;
track pending operations in unit.h; and add code to force synchronization
to non-asynchronous I/O operations.

Lowering should call SetAsynchronous when ASYNCHRONOUS= appears as
a control list specifier.  It should also set ID=x variables to 0
until such time as we support asynchronous operations, if ever.
This patch only removes the removed APIs from lowering.

Differential Revision: https://reviews.llvm.org/D126143
2022-05-24 07:54:57 -07:00
Serge Pavlov 6fc0bc5b0f Fix behavior of is_fp_class on empty class set
The second argument to is_fp_class specifies the set of floating-point
class to test against. It can be zero, in this case the intrinsic is
expected to return zero value.

Differential Revision: https://reviews.llvm.org/D112025
2022-05-24 21:50:18 +07:00
Simon Pilgrim 11455e4758 [DAG] Unroll vectorized FPOW instructions before widening that will scalarize to libcalls anyway
Followup to D125988 - FPOW is similar to FREM and will most likely scalarize to libcalls, so unroll before widening to prevent use making additional libcalls with UNDEF args.
2022-05-24 15:44:53 +01:00
Hans Wennborg ebe2e4f5b7 [libcxx] Add sort.bench.cpp to libcxx/benchmarks/CMakeLists.txt
It was forgotten in D124740.

Differential revision: https://reviews.llvm.org/D126297
2022-05-24 16:39:02 +02:00
Sam Parker e0fe9785d3 [TypePromotion] Avoid unnecessary trunc zext pairs
Any zext 'sink' should already have an operand that is in the legal
value, so avoid using a trunc and just use the trunc operand instead.

Differential Revision: https://reviews.llvm.org/D118905
2022-05-24 15:34:36 +01:00
Thomas Raoux 89aaa2d033 [mlir][vector] Add new lowering mode to vector.contractionOp
Add lowering for cases where the reduction dimension is fully unrolled.
It is common to unroll the reduction dimension, therefore we would want
to lower the contractions to an elementwise vector op in this case.

Differential Revision: https://reviews.llvm.org/D126120
2022-05-24 14:19:08 +00:00
Simon Pilgrim 6c80267d0f [CostModel][X86] getScalarizationOverhead - improve extraction costs for > 128-bit vectors
We were using the default getScalarizationOverhead expansion for extraction costs, which adds up all the individual element extraction costs.

This is fine for 128-bit vectors, but for 256/512-bit vectors each element extraction also has to account for extracting the upper 128-bit subvector extraction before it can handle the element. For scalarization costs we only need to extract each demanded subvector once.

Differential Revision: https://reviews.llvm.org/D125527
2022-05-24 15:18:08 +01:00
Ivan Kosarev 1586e1dc95 [AMDGPU][MC][GFX11] Support base+soffset+offset SMEM loads.
Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D126207
2022-05-24 15:13:14 +01:00
Nikita Popov e6e0eb3bc8 [InstCombine] Strip bitcasts in GEP diff fold
Bitcasts were stripped in one case, but not the other. Of course,
this no longer really matters with opaque pointers, but as I went
through the trouble of tracking this down, we may as well remove
one typed vs opaque pointer optimization discrepancy.
2022-05-24 16:12:01 +02:00
Nikita Popov 3eab6c5911 [InstCombine] Add test for GEP difference with bitcasts (NFC) 2022-05-24 16:12:01 +02:00
Louis Dionne a9a6e20012 [libc++] Rename the generic-singlethreaded CI job to generic-no-threads for consistency 2022-05-24 09:58:57 -04:00
Nikita Popov b2a13d3e2d [InstCombine] Use IRBuilder in freeze pushing transform (PR55619)
Use IRBuilder so that the newly created freeze instructions
automatically gets inserted back into the IC worklist.

The changed worklist processing order leads to some cosmetic
differences in tests.

Fixes https://github.com/llvm/llvm-project/issues/55619.
2022-05-24 15:48:28 +02:00
Nikita Popov e7ddb4f6b4 [InstCombine] Add tests for freeze of load with metadata (NFC) 2022-05-24 15:17:39 +02:00
Sam McCall 0360b9f159 [pseudo] (trivial) bracket-matching
Error-tolerant bracket matching enables our error-tolerant parsing strategies.
The implementation here is *not* yet error tolerant: this patch sets up the APIs
and plumbing, and describes the planned approach.

Differential Revision: https://reviews.llvm.org/D125911
2022-05-24 15:13:36 +02:00
Joseph Huber f37101983f [OpenMP] Add `-Xoffload-linker` to forward input to the device linker
We use the clang-linker-wrapper to perform device linking of embedded
offloading object files. This is done by generating those jobs inside of
the linker-wrapper itself. This patch adds an argument in Clang and the
linker-wrapper that allows users to forward input to the device linking
phase. This can either be done for every device linker, or for a
specific target triple. We use the `-Xoffload-linker <arg>` and the
`-Xoffload-linker-<triple> <arg>` syntax to accomplish this.

Reviewed By: markdewing, tra

Differential Revision: https://reviews.llvm.org/D126226
2022-05-24 09:11:02 -04:00
Alexey Bataev f9c806ae5c [SLP][NFC]Make isFirstInsertElement a weak strict ordering comparator.
To be used correctly in a sort-like function, isFirstInsertElement
function must follow weak strict ordering rule, i.e.
isFirstInsertElement(IE1, IE1) should return false.
2022-05-24 06:02:42 -07:00
Nabeel Omer 8b5d9cbbfe [x86][DAG] Unroll vectorized FREMs that will become libcalls
Currently, two element vectors produced as the result of a binary op are
widened to four element vectors on x86 by
DAGTypeLegalizer::WidenVecRes_BinaryCanTrap. If the op still isn't legal
after widening it is unrolled into 4 scalar ops in SelectionDAG before
being converted into a libcall. This way we end up with 4 libcalls (two of
them on known undef elements) instead of the original two libcalls.

This patch modifies DAGTypeLegalizer::WidenVectorResult to ensure that if
it is known that a binary op will be tunred into a libcall, it is unrolled
instead of being widened. This prevents the creation of the extra scalar
instructions on known undef elements and (eventually) libacalls with known
undef parameters which would otherwise be created when the op gets expanded
post widening.

Differential Revision: https://reviews.llvm.org/D125988
2022-05-24 13:34:51 +01:00
Sylvestre Ledru 1e2b746390 Revert "[TableGen] Remove code beads"
It is breaking the build with:

/build/llvm-toolchain-snapshot-15~++20220524114008+96323c9f4c10/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp:478:10: fatal error: 'M68kGenMCCodeBeads.inc' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Remove the #include causes:
error: undefined reference to 'llvm::M68k::getMCInstrBeads(unsigned int)'

This reverts commit f50be3d218.
2022-05-24 14:17:49 +02:00
Ivan Kosarev be4eaf10ee [Clang][CodeGen] Fix the cmse-clear-return.c test.
Caught with D125604.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D126191
2022-05-24 12:49:42 +01:00
Kristof Beyls 8d29187506 Minutes for security group sync-ups have moved to Discourse. 2022-05-24 13:46:08 +02:00
Simon Pilgrim 96323c9f4c [X86] scalar_widen_div.ll - remove non-generated CHECKs
These were left over from when we converted to the update_llc_test_checks script and were just matching some asm/cfi directives - we have CHECK-LABEL to do this properly now.
2022-05-24 11:55:51 +01:00
Anastasia Stulova d61ded1034 [OpenCL] Make -cl-ext a driver option.
For generic targets such as SPIR-V clang sets all OpenCL
extensions/features as supported by default. However
concrete targets are unlikely to support all extensions
features, which creates a problem when such generic SPIR-V
binary is compiled for a specific target later on.

To allow compile time diagnostics for unsupported features
this flag is now being exposed in the clang driver.

Differential Revision: https://reviews.llvm.org/D125243
2022-05-24 11:34:19 +01:00
Max Kazantsev 143ca15106 Fix comment in test. NFC 2022-05-24 17:22:16 +07:00
Max Kazantsev 1968f765c3 [Test] Add LICM test for PR55672 showing problem with freeze instruction 2022-05-24 17:17:46 +07:00
Luo, Yuanke 3b1de7ab60 [X86][AMX] Reduce the compiling time for non-amx code.
Differential Revision: https://reviews.llvm.org/D126280
2022-05-24 18:02:51 +08:00
Simon Pilgrim 64186e9b35 [X86] Add test showing failure to expand <2 x float> fpow without widening to <4 x float>
Similar to D125988 (and I have a pending follow up patch to handle fpow).
2022-05-24 10:45:20 +01:00
Sheng f50be3d218 [TableGen] Remove code beads
Code beads is useless since the only user, M68k, has moved on to
a new encoding/decoding infrastructure.
2022-05-24 17:39:51 +08:00
Kito Cheng b166aa833e [RISCV][NFC] Change interface of RVVIntrinsic::getSuffixStr
This NFC patch is splited from D111617.

Using llvm::ArrayRef rather than llvm::SmallVector, ArrayRef is more generic
interface that could accept both llvm::ArrayRef and llvm::SmallVector.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D125893
2022-05-24 17:24:32 +08:00
Nikita Popov a7c079aaa2 [InstCombine] Support logical and in masked icmp fold
Most of the folds implemented in this function work fine with
logical operations. We only need to be careful for the cases that
work on non-constant masks, where the RHS operand shouldn't be
poison.

This is a conservative implementation that bails out of illegal
transforms, but we could also change these to insert freeze instead.
2022-05-24 11:16:33 +02:00
Nikita Popov 4aa32e1b17 [InstCombine] Add tests for masked icmps with bitwise+logical and (NFC) 2022-05-24 11:10:36 +02:00
Nikita Popov 5abaabed22 [InstCombine] Use m_APInt() in asymmetric masked icmp fold
This is mostly intended as code cleanup, but it does also add
support for splat vectors to this fold.
2022-05-24 10:57:28 +02:00