Commit Graph

424452 Commits

Author SHA1 Message Date
Groverkss 8eebb47f97 [MLIR][Presburger] Update equality and subset checks asserts in IntegerRelation
This patch updates asserts in IntegerRelation::isEqual and
IntegerRelation::isCompatible to allow these functions when number of
local identifiers are different. This change is done to reflect the
algorithmic changes done before this patch.
2022-05-22 01:26:41 +05:30
Aaron Ballman df46fb4055 Test C DR conformance (part one of many)
This starts to fill out the C DR status page with information
determined from tests. It also starts to add some test coverage for the
DRs we can add tests for (some are difficult as not all C DRs involve
questions about code and some DRs are about the behavior of linking
multiple TUs together).

Note: there is currently no automation for filling out the HTML page
from test coverage like there is for the C++ DRs, but this commit
attempts to use a similar comment style in case we want to add such a
script in the future.
2022-05-21 15:02:46 -04:00
owenca 8bfccb963b [clang-format] Fix an infinite loop in parseJavaEnumBody()
Fixes #55623.
2022-05-21 10:33:59 -07:00
Lang Hames f3428dafdc [ORC] Add a ~ExectionSession destructor to verify that endSession was called.
Clients are required to call ExecutionSession::endSession before destroying the
ExecutionSession. Failure to do so can lead to memory leaks and other difficult
to debug issues. Enforcing this requirement by assertion makes it easy to spot
or debug situations where the contract was not followed.
2022-05-21 09:02:01 -07:00
Florian Hahn 3bebec6592
[VPlan] Model first exit values using VPLiveOut.
This patch introduces a new VPLiveOut subclass of VPUser  to model
 exit values explicitly. The initial version handles exit values that
are neither part of induction or reduction chains nor first order
recurrence phis.

Fixes #51366, #54867, #55167, #55459

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D123537
2022-05-21 16:01:38 +01:00
Florian Hahn a84896f270
[LV] Precommit test for PR55167.
Test for #55167.
2022-05-21 16:01:33 +01:00
David Green a86cfaea54 [ARM] Add register-mask for tail returns
The TC_RETURN/TCRETURNdi under Arm does not currently add the
register-mask operand when tail folding, which leads to the register
(like LR) not being 'used' by the return. This changes the code to
unconditionally set the register mask on the call, as opposed to
skipping it for tail calls.

I don't believe this will currently alter any codegen, but should glue
things together better post-frame lowering. It matches the AArch64 code
better.

Differential Revision: https://reviews.llvm.org/D125906
2022-05-21 15:28:24 +01:00
Nikita Popov c8b675eaa1 [SCEV] Use umin_seq for BECount of multi-exit loops
When computing the BECount for multi-exit loops, we need to combine
individual exit counts using umin_seq rather than umin. This is
because an earlier exit may exit on the first iteration, in which
case later exit expressions will not be evaluated and could be
poisonous. We cannot propagate potential poison values from later
exits.

In particular, this avoids the introduction of "branch on poison"
UB when optimizing multi-exit loops.

Differential Revision: https://reviews.llvm.org/D124910
2022-05-21 15:48:14 +02:00
Benjamin Kramer 295d032762 [mlir] Move diagnostic handlers instead of copying
This also allows using unique_ptr instead of shared_ptr for the CAPI
user data. NFCI.
2022-05-21 13:25:24 +02:00
Benjamin Kramer c312f02594 [STLExtras] Make indexed_accessor_range operator== compatible with C++20
This would be ambigious with itself when C++20 tries to lookup the
reversed form. I didn't find a use in LLVM, but MLIR does a lot of
comparisons of ranges of different types.
2022-05-21 13:00:30 +02:00
Luboš Luňák 8ba1421432 [lldb] fix 'command container' help text 2022-05-21 12:26:42 +02:00
Simon Pilgrim f09a50cd97 [AMDGPU] Regenerate permute.ll test checks for future patch 2022-05-21 10:42:58 +01:00
Nikita Popov 6f0ca6fd23 [JumpThreading] Insert freeze when unfolding select
JumpThreading may convert selects into branch instructions,
in which case the condition needs to be frozen (as branch on
poison is immediate undefined behavior, unlike select on poison).

The necessary code for this is already in place, this just enables
the option.

Differential Revision: https://reviews.llvm.org/D125869
2022-05-21 11:24:27 +02:00
Paul Walker 216f546c84 [SVE] Refactor lowering for fixed length MGATHER/MSCATTER.
Lower fixed length MGATHER/MSCATTER operations to scalable vector
equivalents, which are then lowered to SVE specific nodes. This
two stage process is in preparation for making scalable vector
MGATHER/MSCATTER operations legal.

Differential Revision: https://reviews.llvm.org/D125192
2022-05-21 10:14:45 +01:00
Benjamin Kramer 86fd1c139f [bufferization] Simplify code. NFCI. 2022-05-21 10:58:57 +02:00
Craig Topper 003b95acf2 [LegalizeTypes] Remove double map lookup in DAGTypeLegalizer::PerformExpensiveChecks. NFC
Remove repeated checks for ResId being 0.
2022-05-21 00:06:59 -07:00
Craig Topper 66875dbcc0 [LegalizeTypes] Use SmallDenseMap::count instead of SmallDenseMap::find. NFC
It's more readable and more efficient.
2022-05-21 00:06:55 -07:00
Min-Yih Hsu f088b99eac [mlir][LLVMIR] Use the correct way to determine if it's a scalable vector
One of the ShuffleVectorOp::build functions checks if the incoming
vector operands is scalable vector by casting its type to
mlir::VectorType first. However, in some cases the operand is not
necessarily mlir::VectorType (e.g. it might be a LLVMVectorType).

This patch fixes this issue by using the dedicated
`LLVM::isScalableVectorType` function to determine if the incoming
vector is scalable vector or not.

Differential Revision: https://reviews.llvm.org/D125818
2022-05-20 21:45:50 -07:00
Min-Yih Hsu 3b91657c7b [mlir][LLVMIR] Add support for translating from some simple LLVM instructions
Add support for translating from llvm::Select, llvm::FNeg, and llvm::Unreachable.
This patch also cleans up (NFC) the opcode map for simple instructions and
adds `// clang-format off/on` comments to prevent those lines from being
churned by clang-format between commits.

Differential Revision: https://reviews.llvm.org/D125817
2022-05-20 21:45:50 -07:00
Lang Hames 55287840fe [ORC][examples] Fix off-by-one error when handling null terminators.
LLVMCreateMemoryBufferWithMemoryRange checks for a null terminator after the
given range, so we need to pass the length of the module string (excluding the
null terminator).
2022-05-20 19:33:49 -07:00
Lang Hames 7581f138d5 [ORC][examples] Add missing EPCIndirectionUtils::cleanup call.
Clients are required to make this call prior to destroying the object. Adding
the missing call fixes an assertion that was triggering at program termination
time in the LLJITWithExecutorProcessControl example.
2022-05-20 19:33:39 -07:00
Lang Hames 441f691b37 [ORC] Remove usused Error variable.
This was left in by accident, and caused unchecked-error assertions
during program termination in BuildingAJIT-Ch4.
2022-05-20 19:33:07 -07:00
Matthias Springer ffdbecccaf [mlir][bufferization] Add bufferization.alloc_tensor op
This change adds a new op `alloc_tensor` to the bufferization dialect. During bufferization, this op is always lowered to a buffer allocation (unless it is "eliminated" by a pre-processing pass). It is useful to have such an op in tensor land, because it allows users to model tensor SSA use-def chains (which drive bufferization decisions) and because tensor SSA use-def chains can be analyzed by One-Shot Bufferize, while memref values cannot.

This change also replaces all uses of linalg.init_tensor in bufferization-related code with bufferization.alloc_tensor.

linalg.init_tensor and bufferization.alloc_tensor are similar, but the purpose of the former one is just to carry a shape. It does not indicate a memory allocation.

linalg.init_tensor is not suitable for modelling SSA use-def chains for bufferization purposes, because linalg.init_tensor is marked as not having side effects (in contrast to alloc_tensor). As such, it is legal to move linalg.init_tensor ops around/CSE them/etc. This is not desirable for alloc_tensor; it represents an explicit buffer allocation while still in tensor land and such allocations should not suddenly disappear or get moved around when running the canonicalizer/CSE/etc.

BEGIN_PUBLIC
No public commit message needed for presubmit.
END_PUBLIC

Differential Revision: https://reviews.llvm.org/D126003
2022-05-21 02:47:32 +02:00
Sam Clegg 4f6ac96926 [lld][WebAssemlby] Add TLS test to lld/test/wasm/data-segments.ll. NFC
Differential Revision: https://reviews.llvm.org/D126104
2022-05-20 17:44:05 -07:00
Paul Kirth d6a3c8ca18 Revert "tsan: add lock free stack pattern test"
This reverts commit 5deca650fd.
2022-05-21 00:12:06 +00:00
Paul Kirth f1d197f1a8 Revert "Mark new TSan test as unsupported on PPC."
This reverts commit b517d679dd.
2022-05-21 00:11:50 +00:00
Eugene Zhulenev 705f048cbb [mlir] MemRefToLLVM: convert memref.view operations for empty memrefs
Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D126094
2022-05-20 16:43:54 -07:00
NAKAMURA Takumi 8801a5d185 SystemZAsmPrinter.cpp: Fix a warning. [-Wunused-variable]
This could be rewritten as `!ZFL->hasFP(*MF) || FrameReg < 16`
but I thought better to clarify it is `AllocaReg`.
2022-05-21 07:54:09 +09:00
Ahmed Bougacha 362b4066f0 [ObjCARC] Drop nullary clang.arc.attachedcall bundles in autoupgrade.
In certain use-cases, these can be emitted by old compilers, but the
operand is now always required.  These are only used for optimizations,
so it's safe to drop them if they happen to have the now-invalid format.
The semantically-required call is already a separate instruction.

Differential Revision: https://reviews.llvm.org/D123811
2022-05-20 15:27:29 -07:00
Dan Gohman 59726668f1 [WebAssembly] Strip TLS when "atomics" is not enabled
With f3b4f99007, the exclusive source of
truth for whether threads are supported is the -matomics flag.
Accordingly, strip TLS flags when -matomic is not specified, even if
bulk-memory is specified and it would theoretically be supportable.
This allows the backend to compile TLS variables when -mbulk-memory is
enabled but threads are not enabled.

Differential Revision: https://reviews.llvm.org/D125730
2022-05-20 15:18:19 -07:00
Jim Ingham b369762beb Convert the test file for TestIgnoredExceptions.py to the mach_vm API.
The previous version of this test uses mprotect, and that seemed to be
flakey on older systems.  I converted the test to use the underlying
mach_vm API's.  The test only runs on Darwin anyway, so this is not a
real limitation, and I'm hoping the lower level API's work more
consistently.
2022-05-20 15:16:24 -07:00
Alex Brachet 190b0f42cf [lld-macho] Stop crash when emitting personalities with -dead_strip
The <internal> symbol was tripping an assertion in getVA() because it
was not marked as used. Per the comment above that symbols creation,
dead stripping has already occurred so marking this symbol as used is
accurate.

Fixes https://github.com/llvm/llvm-project/issues/55565

Differential revision: https://reviews.llvm.org/D126072
2022-05-20 21:40:47 +00:00
Bixia Zheng d390035b46 [mlir][sparse] Support more complex operations.
Add complex operations abs, neg, sin, log1p, sub and div.

Add test cases.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126027
2022-05-20 14:39:26 -07:00
Shilei Tian ecf5b78053 [NVPTX] Enable AtomicExpandPass for NVPTX
This patch enables `AtomicExpandPass` for NVPTX.

Depend on D125652.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D125639
2022-05-20 17:25:28 -04:00
Shilei Tian ff60a0a364 [LLVM] Add a check if should cast atomic operations to integer type
Currently for atomic load, store, and rmw instructions, as long as the
operand is floating-point value, they are casted to integer. Nowadays many
targets can actually support part of atomic operations with floating-point
operands. For example, NVPTX supports atomic load and store of floating-point
values. This patch adds a series interface functions `shouldCastAtomicXXXInIR`,
and the default implementations are same as what we currently do. Later for
targets can have their specialization.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D125652
2022-05-20 17:23:53 -04:00
Mitch Phillips de06626725 PPC+TSan whack-a-mole, round 3.
More details in https://reviews.llvm.org/D110552.

Last try until I revert the whole shenanigans.
2022-05-20 14:21:58 -07:00
Jonas Devlieghere d252d9231c
[lldb] Fix spurious assertion in PrintCommandOutput
When the string passed to PrintCommandOutput doesn't end with a newline,
`written` will exceed `size` and result in an lldbassert.

After 8e776bb660 we don't really need
written anymore and we can check whether `str` is empty instead. This
patch simplifies the code and removes the assert that's no longer
relevant.

Differential revision: https://reviews.llvm.org/D126081
2022-05-20 14:15:01 -07:00
Will Hawkins a3c3482ceb
[lldb] Consider binary as module of last resort
When setting an address breakpoint using a non-section address in lldb
before having ever run the program, the binary itself is not considered
a module. As a result, the breakpoint is unresolved (and never gets
resolved subsequently).

This patch changes that behavior: as a last resort, the binary is
considered as a module when resolving a non-section address breakpoint.

Differential revision: https://reviews.llvm.org/D124731
2022-05-20 14:01:05 -07:00
Mitch Phillips bd62b70b51 Add 'ppc' as a target (for both 32- and 64-bit ppc).
Needed for a TSan test that won't pass on PPC. Relevant information is
in https://reviews.llvm.org/D110552.
2022-05-20 13:56:25 -07:00
Michael Kruse acec07005e [OpenMP] Fix partial unrolling off-by-one.
Even though the comment description is ".unroll_inner.iv < NumIterations", the code emitted a BO_LE ('<=') operator for the inner loop that is to be unrolled. This lead to one additional copy of the body code in a partially unrolled. It only manifests when the unrolled loop is consumed by another loop-associated construct. Fix by using the BO_LT operator instead.

The condition for the outer loop and the corresponding code for tiling correctly used BO_LT already.

Fixes #55236
2022-05-20 15:19:52 -05:00
Aaron Ballman ade5b55af5 Add a page to track C defect report status
We currently have a page for tracking defects against the C++ standard,
but we don't have the same information for the C standard. This starts
us down the path of being able to track that in a way our users can see.

There are *a lot* of entries marked as "Unknown". As we validate
Clang's behavior for a given DR by adding a test case for it, we can
slowly begin to improve this page over time.

This page is now linked from the existing C status page, which was
updated slightly as a result of these changes as well.

Note, unlike with the C++ defect report page, this content is not auto-
generated from a source document and is not automatically updated from
test comments. It may be worthwhile to automate the updates based on
our test coverage, but that can happen later.
2022-05-20 16:07:48 -04:00
Mitch Phillips b517d679dd Mark new TSan test as unsupported on PPC.
Notably fails under PPC. For now, just exclude it. More details in the
original Phabricator review, https://reviews.llvm.org/D110552.
2022-05-20 13:06:44 -07:00
Balazs Benics 6fa82e344c [clang-tidy] modernize-deprecated-headers should ignore system headers
The end-user has no way of 'fixing' bugs in the system library anyway.
Let's suppress these as well.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D125770
2022-05-20 21:41:25 +02:00
Balazs Benics 0606467ea1 [clang-tidy] Introduce the WarnIntoHeaders option to modernize-deprecated-headers
Unfortunately, we must restrict the checker to warn for deprecated headers
only if the header is included directly from a c++ source file.

For header files, we cannot know if the project has a C source file
that also directly/indirectly includes the offending header file
otherwise. Thus, it's better to be on the safe side and suppress those
reports.

One can opt-in the old behavior, emitting diagnostics into header files,
if one explicitly sets the WarnIntoHeaders=true, in which case nothing
will be changed.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D125769
2022-05-20 21:41:25 +02:00
Joseph Huber 20ec4161d7 [Libomptarget] Add branch prediction intrinsic to state check
Summary:
We usually used the `OMP_LIKELY` and `OMP_UNLIKELY` macros to add branch
prediction intrinsics to help the optimizer ignore unlikely loops. This
wasn't applied to this one loop so add that in.
2022-05-20 15:38:54 -04:00
Balazs Benics 665bfbb98d Reland "[clang-tidy] modernize-deprecated-headers check should respect extern "C" blocks""
This partially reverts commit e8cae48702.
Changes since that commit:
 - Use `SourceManager::isBeforeInTranslationUnit` instead of the fancy
   decomposed decl logarithmic search.
 - Add a test for including a system header containing a deprecated
   include.
 - Add `REQUIRES: system-linux` clause to the test.

Reviewed By: LegalizeAdulthood, whisperity

Differential Revision: https://reviews.llvm.org/D125209
2022-05-20 21:12:39 +02:00
Zequan Wu 9886046289 [CodeView] Combine variable def ranges that are continuous.
It saves about 1.13% size for chrome.dll.pdb on chrome official build.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D125721
2022-05-20 12:12:14 -07:00
Bill Wendling d497129f9b [AArch64] Use proper instruction mnemonics for FPRs
The FPR128 regs need MOVIv2d_ns and SVE regs need DUP_ZI_D.

Differential Revision: https://reviews.llvm.org/D126083
2022-05-20 12:02:26 -07:00
Alexander Shaposhnikov 9398caf399 Recommit "[ConstantRange] Improve the implementation of binaryOr"
This recommits https://reviews.llvm.org/rG6990e7477d24ff585ae86549f5280f0be65422a6
as the problematic test has been updated updated in
https://reviews.llvm.org/rG3bd112c720dc614a59e3f34ebf9b45075037bfa0.
2022-05-20 18:39:58 +00:00
Jim Ingham 9385a6d6ea Add some diagnostics to diagnose bot-only failures for TestIgnoredExceptions.py
The test for commit bff4673b41 is failing on the
GreenDragon bot but none of us can repro the failure locally.  Adding some logging
to the test failure to help diagnose the issue.
2022-05-20 11:38:37 -07:00