Commit Graph

427648 Commits

Author SHA1 Message Date
Tom Stellard 7dbb366129 HowToReleaseLLVM: Add description of the bug triage process
Reviewed By: andreil99

Differential Revision: https://reviews.llvm.org/D126985
2022-06-21 22:18:35 -07:00
Ruiling Song 4dcb42fae5 AMDGPU: Skip unexpected CFG in SIOptimizeVGPRLiveRange
There are some cases that we use si_if/si_else in unatural way.
Just skip them.

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

Reviewed by: critson

Differential Revision: https://reviews.llvm.org/D128193
2022-06-22 12:49:41 +08:00
chenglin.bi 810b5c471f [NewGVN] add context instruction for SimplifyQuery
NewGVN will find operator from other context. ValueTracking currently doesn't have a way to run completely without context instruction.
So it will use operator itself as conext instruction.
If the operator in another branch will never be executed but it has an assume, it may caused value tracking use the assume to do wrong simpilfy.

It would be better to make these simplification queries not use context at all, but that would require some API changes.
For now we just use the orignial instruction as context instruction to fix the issue.

Fix #56039

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D127942
2022-06-22 12:25:24 +08:00
Serguei Katkov 8f891b7c39 [LoopVectorize] Uninitialized phi node leads to a crash in SSAUpdater.
createInductionResumeValues creates a phi node placeholder
without filling incoming values. Then it generates the incoming values.

It includes triggering of SCEV expander which may invoke SSAUpdater.
SSAUpdater has an optimization to detect number of predecessors
basing on incoming values if there is phi node.
In case phi node is not filled with incoming values - the number of predecessors
is detected as 0 and this leads to segmentation fault.

In other words SSAUpdater expects that phi is in good shape while
LoopVectorizer breaks this requirement.

The fix is just prepare all incoming values first and then build a phi node.

Reviewed By: fhahn
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D128033
2022-06-22 10:49:27 +07:00
Michał Górny 5e9aed1be5 [lldb] [test] Mark TestNonStop as LLGS-specific
Thanks for Med Ismail Bennani for reporting the debugserver failures.
2022-06-22 05:36:30 +02:00
Joseph Huber 3351ae61d9 [Libomptarget] Remove duplicate data environment exit
Summary:
This patch removes a duplicated exit from the OpenMP data envrionment.
We already have an RAII method that guards this environment so it is
unnecessary.
2022-06-21 22:35:32 -04:00
Johannes Doerfert b7cc3b10c5 [Attributor][FIX] Avoid empty bin in AAPointerInfo
This avoid creating empty bins in AAPointerInfo which can lead to
segfaults. Also ensure we do not try to translate from callee to caller
except if we really take the argument state and move it to the call site
argument state.

Fixes: https://github.com/llvm/llvm-project/issues/55726
2022-06-21 21:30:57 -05:00
Johannes Doerfert 083010312a [Attributor] Ensure to use the proper liveness AA
When determining liveness via Attributor::isAssumedDead(...) we might
end up without a liveness AA or with one pointing into another function.
Neither is helpful and we will avoid both from now on.

Reapplied after fixing the ASAN error which caused the revert:
db68a25ca9
2022-06-21 21:28:26 -05:00
Fangrui Song 20b2d3260d [lld-macho] Work around odr-use of const non-inline static data member to fix -O0 build after D128298
```
ld.lld: error: undefined symbol: lld::macho::CodeSignatureSection::blockSize
>>> referenced by SyntheticSections.cpp:1253 (/home/maskray/llvm/lld/MachO/SyntheticSections.cpp:1253)
>>>               tools/lld/MachO/CMakeFiles/lldMachO.dir/SyntheticSections.cpp.o:(lld::macho::CodeSignatureSection::writeHashes(unsigned char*) const::$_7::operator()(unsigned long) const)
```
2022-06-21 19:22:28 -07:00
Jonas Devlieghere c866f8544c
[lldb] Add a setting to specify the preferred dynamic class info extractor o
Add a setting to configure how LLDB parses dynamic Objective-C class
metadata. By default LLDB will choose the most appropriate method for
the target OS.

Differential revision: https://reviews.llvm.org/D128312
2022-06-21 18:51:39 -07:00
Jonas Devlieghere c08f61b45e
[lldb] Instantiate lazily named classes on macOS Ventura.
Recent revisions of the Objective-C runtime changed
objc_debug_class_getNameRaw() in a way that no longer triggers lazy
names to be instantiated. This has the unintended side-effect of making
generic bridged Swift classes, such as _SwiftDeferredNSDictionary<U,V>
to become invisible to the Objective-C runtime.

This patch detects this situation and forces the names to be
instantiated by calling class_getName() and discarding the result before
calling objc_debug_class_getNameRaw() again.

Many thanks to Mike Ash for outlining the solution and Adrian for
authoring the downstream patch.

rdar://95245318

Differential revision: https://reviews.llvm.org/D128306
2022-06-21 18:51:38 -07:00
Vasileios Porpodas 7a9ad25769 Recommit "[SLP][X86] Improve reordering to consider alternate instruction bundles"
This reverts commit 6d6268dcbf.

Review: https://reviews.llvm.org/D125712
2022-06-21 18:35:29 -07:00
lewuathe ce07b95610 [mlir][math] Support vector type by erf and round libm lowering
erf and round op are able to lowered to libm supporting vector type as other math operations.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D127934
2022-06-22 09:42:41 +09:00
Nico Weber 0baf13e282 [lld/mac] Parallelize code signature computation
According to ministat, this is a small but measurable speedup
(using the repro in PR56121):

    N           Min           Max        Median           Avg        Stddev
x  10     3.7439518     3.7783802     3.7730219     3.7655502   0.012375226
+  10     3.6149218      3.692198     3.6519327     3.6502951   0.025905601
Difference at 95.0% confidence
	-0.115255 +/- 0.0190746
	-3.06078% +/- 0.506554%
	(Student's t, pooled s = 0.0203008)

(Without 858e8b17f7, this change here to use parallelFor is an 18% speedup,
and doing 858e8b17f7 on top of this change is just a 2.55% +/- 0.58% win.
Doing both results in a total speedup of 20.85% +/- 0.44%.)

Differential Revision: https://reviews.llvm.org/D128298
2022-06-21 20:41:35 -04:00
Vasileios Porpodas 6d6268dcbf Revert "[SLP][X86] Improve reordering to consider alternate instruction bundles"
This reverts commit 6f88acf410.
2022-06-21 17:07:21 -07:00
Vasileios Porpodas 6f88acf410 [SLP][X86] Improve reordering to consider alternate instruction bundles
During the reordering transformation we should try to avoid reordering bundles
like fadd,fsub because this may block them being matched into a single vector
instruction in x86.
We do this by checking if a TreeEntry is such a pattern and adding it to the
list of TreeEntries with orders that need to be considered.

Differential Revision: https://reviews.llvm.org/D125712
2022-06-21 16:44:48 -07:00
Paul Walker 696169a35d [SVE] Add isel patterns that match "FpImm - A" to the immediate form of FSUBR.
Differential Revision: https://reviews.llvm.org/D128200
2022-06-22 00:11:24 +01:00
Paul Walker 84f486cfab [NFC][SVE] Simplify SUBR_ZI isel patterns.
Differential Revision: https://reviews.llvm.org/D128199
2022-06-22 00:05:18 +01:00
Paul Walker 7b285ae0e8 [SVE] Lower "unpredicated" sabd/uabd intrinsics to ISD::ABDS/U.
This enables an existing transformation that when combined with an
add will emit saba/uaba instructions.

Differential Revision: https://reviews.llvm.org/D128198
2022-06-22 00:02:51 +01:00
Daniel Bertalan 5792797c5b Reland "[lld-macho] Show source information for undefined references"
The error used to look like this:

  ld64.lld: error: undefined symbol: _foo
  >>> referenced by /path/to/bar.o:(symbol _baz+0x4)

If DWARF line information is available, we now show where in the source
the references are coming from:

  ld64.lld: error: unreferenced symbol: _foo
  >>> referenced by: bar.cpp:42 (/path/to/bar.cpp:42)
  >>>                /path/to/bar.o:(symbol _baz+0x4)

The reland is identical to the first time this landed. The fix was in D128294.
This reverts commit 0cc7ad4175.

Differential Revision: https://reviews.llvm.org/D128184
2022-06-21 18:50:06 -04:00
Aart Bik fde04aee33 [mlir][sparse] refine bufferization allocation lowering
Marking bufferization allocation operation as invalid
during sparse lowering is too strict, since dense and
sparse allocation can co-exist. This revision refines
the lowering with a dynamic type check.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D128305
2022-06-21 15:17:25 -07:00
LLVM GN Syncbot 8b8d126598 [gn build] Port 79fbee3cc5 2022-06-21 21:53:32 +00:00
Anubhab Ghosh 79fbee3cc5 Re-apply "[JITLink][Orc] Add MemoryMapper interface with InProcess implementation"
[JITLink][Orc] Add MemoryMapper interface with InProcess implementation

MemoryMapper class takes care of cross-process and in-process address space
reservation, mapping, transferring content and applying protections.

Implementations of this class can support different ways to do this such
as using shared memory, transferring memory contents over EPC or just
mapping memory in the same process (InProcessMemoryMapper).

The original patch landed with commit 6ede652050
It was reverted temporarily in commit 6a4056ab2a

Reviewed By: sgraenitz, lhames

Differential Revision: https://reviews.llvm.org/D127491
2022-06-21 23:53:16 +02:00
Philip Reames 235ba26dd6 [RISCV] Add cost model test coverage for loads and stores (both fixed and scalable) 2022-06-21 14:43:23 -07:00
Vasileios Porpodas 085f59a826 [SLP][NFC] Precommit test for a followup patch that improves reordering for addsubs
Differential Revision: https://reviews.llvm.org/D126091
2022-06-21 14:34:55 -07:00
Florian Hahn c259a2b94f
[ConstraintElimination] Add tests for transferring info between systems. 2022-06-21 23:34:03 +02:00
Martin Boehme 0d300da799 [Clang] Fix compile time regression caused by D126061.
As noted by @nikic, D126061 causes a compile time regression of about
0.5% on -O0 builds:

http://llvm-compile-time-tracker.com/compare.php?from=7acc88be0312c721bc082ed9934e381d297f4707&to=8c7b64b5ae2a09027c38db969a04fc9ddd0cd6bb&stat=instructions

This happens because, in a number of places, D126061 creates an
additional local variable of type `ParsedAttributes`. In the large
majority of cases, no attributes are added to this `ParsedAttributes`,
but it turns out that creating an empty `ParsedAttributes`, then
destroying it is a relatively expensive operation.

The reason for this is because `AttributePool` uses a `TinyPtrVector` as
its underlying vector class, and the technique that `TinyPtrVector`
employs to achieve its extreme memory frugality makes the `begin()` and
`end()` member functions relatively slow. The `ParsedAttributes`
destructor iterates over the attributes in its `AttributePool`, and this
is a relatively expensive operation because `TinyPtrVector`'s `begin()` and
`end()` are relatively slow.

The fix for this is to replace `TinyPtrVector` in `ParsedAttributes` and
`AttributePool` with `SmallVector`. `ParsedAttributes` and
`AttributePool` objects are only ever allocated on the stack (they're
not part of the AST), and only a small number of these objects are live
at any given time, so they don't need the extreme memory frugality of
`TinyPtrVector`.

I've confirmed with valgrind that this patch does not increase heap
memory usage, and it actually makes compiles slightly faster than they
were before D126061.

Here are instruction count measurements (obtained with callgrind)
running `clang -c MultiSource/Applications/JM/lencod/parsetcommon.c`
(a file from llvm-test-suite that exhibited a particularly large
compile-time regression):

7acc88be03
(baseline one commit before D126061 landed)
102,280,068 instructions

8c7b64b5ae
(the patch that landed D126061)
103,289,454 instructions
(+0.99% relative to baseline)

This patch applied onto
8c7b64b5ae
101,117,584 instructions
(-1.14% relative to baseline)

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D128097
2022-06-21 23:15:43 +02:00
Simon Pilgrim 1c2b756cd6 [DAG] visitTRUNCATE - move TRUNCATE(ADDE/ADDCARRY) folds to switch statement handling the other binops. NFC. 2022-06-21 22:07:41 +01:00
Craig Topper 0efbf5bfbb [RISCV] Move the passthru operand for RISCVISD::VRGATHER*_VL nodes. NFC
Put it before the VL instead of as the first operand. I want to add
passthru to more operands, but the commutable ones like VADD_VL
require the commutable operands to be operand 0 and 1. So we can't
have the passthru as operand 0 for those.
2022-06-21 14:01:02 -07:00
Philip Reames 8ae0664282 LoopVect, tests] Add some basic coverage for scalable costing of scatter/gather patterns on RISCV
This just adds some very basic vectorizer testing with both fixed and scalable vectorization enabled.
2022-06-21 13:54:53 -07:00
Philip Reames 2cf320d41e [LoopVect, tests] Add some basic coverage for scalable costing on RISCV
This just adds some very basic vectorizer testing with both fixed and scalable vectorization enabled.  For context, I just yesterday fixed a crash in costing of the splat_ptr example - see bbf3fd.
2022-06-21 13:35:38 -07:00
Arthur Eubanks c80b88ee29 [polly] #include <algorithm>
For the usage of std::max in the header.

Speculative fix for
https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8810806780048763729/overview
reported in https://reviews.llvm.org/D125263.
2022-06-21 13:27:55 -07:00
Simon Pilgrim 8cecb6be56 [DAG] Remove SelectionDAG::GetDemandedBits DemandedElts variant. NFC.
We're slowly removing SelectionDAG::GetDemandedBits and replacing it with SimplifyMultipleUseDemandedBits, we no longer have any uses for the vector demanded elt variant.
2022-06-21 21:23:10 +01:00
Xing Xue 8da2009608 [libc++abi][AIX] Use _LIBCXXABI_FUNC_VIS for exported routines
Summary:
This patch adds _LIBCXXABI_FUNC_VIS to the definitions of the personality and helper routines for the state table based EH, now that the support of the visibility attribute is being added to AIX Clang. Currently an export list is generated in the absence of the visibility attribute support downstream.

Reviewed by: MaskRay, daltenty

Differential Revision: https://reviews.llvm.org/D126915
2022-06-21 16:18:17 -04:00
Fangrui Song 07f21021e7 Revert "Revert "[CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux""
This reverts commit 90c9d41c8a.

Keeping arm* LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on is sufficient to work around
LLVM_ENABLE_RUNTIMES not working well with arm. It is more important for
LLVM_ENABLE_PROJECTS and LLVM_ENABLE_RUNTIMES to match in the file hierarchy.
2022-06-21 13:13:31 -07:00
Jason Molenda 1490f87154 Roll back Michał's changes to debugserver, not meant for there
Michał's change in https://reviews.llvm.org/D127193 did a search &
replace for a pattern that also appears in debugserver, but it
shouldn't be done there.
2022-06-21 12:57:42 -07:00
Florian Hahn 88ce403c6a
[LV] Add new block to place recurrence splice, if needed.
In some cases, a recurrence splice instructions needs to be inserted
between to regions, for example if the regions get re-arranged during
sinking.

Fixes #56146.
2022-06-21 21:54:37 +02:00
Daniel Bertalan 77b6efbd82 [ADT] [lld-macho] Check for end iterator deref in filter_iterator_base
If ld64.lld was supplied an object file that had a `__debug_abbrev` or
`__debug_str` section, but didn't have any compile unit DIEs in
`__debug_info`, it would dereference an iterator pointing to the empty
array of DIEs. This underlying issue started causing segmentation faults
when parsing for `__debug_info` was addded in D128184. That commit was
reverted, and this one fixes the invalid dereference to allow relanding
it.

This commit adds an assertion to `filter_iterator_base`'s dereference
operators to catch bugs like this one.

Ran check-llvm, check-clang and check-lld.

Differential Revision: https://reviews.llvm.org/D128294
2022-06-21 15:47:45 -04:00
Nico Weber 3ade3d3724 [lld/mac] Replace while loop with for loop
No behavior change. In preparation for using a parallelFor() here.

Differential Revision: https://reviews.llvm.org/D128295
2022-06-21 15:42:06 -04:00
Matt Arsenault 4cbbb35fcb AMDGPU: Regenerate test checks 2022-06-21 15:37:12 -04:00
Matt Arsenault d0d796a40a AMDGPU: Don't use branches to entry block in test
This created a weird loop making the tested registers live out of the
block, which I don't think is relevant to the purpose of the
tests. This caused regressions when the validity queries are changed
to use tests based whether the use instruction was a kill. If the
register was live out for the loop, it was still live.

I guess we could still do this in a narrow case where the value loops
back, but that's most a pointlessly complex case to handle.
2022-06-21 15:37:12 -04:00
Joe Nash 90254d524f [AMDGPU] gfx11 Remove SDWA from shuffle_vector ISel
gfx11 does not have SDWA

Reviewed By: #amdgpu, rampitec

Differential Revision: https://reviews.llvm.org/D128208
2022-06-21 14:55:00 -04:00
Craig Topper 0af19ef9ff [RISCV] Remove true_mask patterns for VRGATHERE16..
After adding it to the table so the post-isel peephole can handle it.
2022-06-21 11:59:37 -07:00
Craig Topper e50b141a13 [RISCV] Remove true_mask patterns for VRGATHER.
These can be handled by the post-isel peephole.
2022-06-21 11:59:37 -07:00
Nico Weber 858e8b17f7 [lld/mac] On Apple systems, call CC_SHA256 from libSystem
It's in libSystem, so it doesn't bring in any new deps, and it's
currently much faster than LLVM's current SHA256 implementation.

Makes linking (arm64) Chromium Framework with ld64.lld 17% faster.
See also PR56121.

No behavior change.

Differential Revision: https://reviews.llvm.org/D128290
2022-06-21 14:58:04 -04:00
Heejin Ahn 27e4afcea7 [DSE] Don't remove nounwind invokes
For non-mem-intrinsic and non-lifetime `CallBase`s, the current
`isRemovable` function only checks if the `CallBase` 1. has no uses 2.
will return 3. does not throw:
80fb782336/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp (L1017)

But we should also exclude invokes even in case they don't throw,
because they are terminators and thus cannot be removed. While it
doesn't seem to make much sense for `invoke`s to have an `nounwind`
target, this kind of code can be generated and is also valid bitcode.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128224
2022-06-21 11:54:09 -07:00
Haojian Wu 7b7166f1a2 Fix an unused-variable warning in release build, NFC. 2022-06-21 20:52:07 +02:00
Valentin Clement c67a87444f
[flang] Add more diagnostics to fir.coordinate_of
Add more diagnostics to fir.coordinate_of to provide better checking
that the IR is sane.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128255

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-21 20:43:22 +02:00
Nikolas Klauser 43913357b4 [libc++] Pass -fno-modules to clang-tidy instead of disabling it for the modules build
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D128053
2022-06-21 20:28:27 +02:00
Nikolas Klauser 26ac9cbf00 [libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used checks
Reviewed By: #libc, ldionne

Spies: aheejin, libcxx-commits, xazax.hun

Differential Revision: https://reviews.llvm.org/D127896
2022-06-21 20:25:04 +02:00