Stella Stamenova [Tue, 29 Jun 2021 19:09:56 +0000 (12:09 -0700)]
Revert D104488 and friends since it broke the windows bot
Reverts commits:
"Fix failing tests after https://reviews.llvm.org/D104488."
"Fix buildbot failure after https://reviews.llvm.org/D104488."
"Create synthetic symbol names on demand to improve memory consumption and startup times."
This series of commits broke the windows lldb bot and then failed to fix all of the failing tests.
Eugene Zhulenev [Tue, 29 Jun 2021 19:56:15 +0000 (12:56 -0700)]
[mlir:Async] Change async-parallel-for block size/count calculation
Depends On D105037
Avoid creating too many tasks when the number of workers is large.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D105126
Eugene Zhulenev [Tue, 29 Jun 2021 19:12:15 +0000 (12:12 -0700)]
[mlir:Async] Add an async reference counting pass based on the user defined policy
Depends On D104999
Automatic reference counting based on the liveness analysis can add a lot of reference counting overhead at runtime. If the IR is known to be constrained to few particular "shapes", it's much more efficient to provide a custom reference counting policy that will specify where it is required to update the async value reference count.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D105037
Nicolas Vasilache [Tue, 29 Jun 2021 15:39:14 +0000 (15:39 +0000)]
[mlir][Linalg] Add a ComprehensiveModuleBufferizePass and support for CallOp analysis(9/n)
This revision adds the minimal plumbing to create a simple ComprehensiveModuleBufferizePass that can behave conservatively in the presence of CallOps.
A topological sort of caller/callee is performed and, if the call-graph is cycle-free, analysis can proceed.
Differential revision: https://reviews.llvm.org/D104859
Stefan Pintilie [Tue, 29 Jun 2021 19:01:48 +0000 (14:01 -0500)]
[Clang] Add option to handle behaviour of vector bool/vector pixel.
Added the option `-altivec-src-compat=[mixed,gcc,xl]`. The default at this time is `mixed`.
The default behavior for clang is for all vector compares to return a scalar unless the vectors being
compared are vector bool or vector pixel. In that case the compare returns a
vector. With the gcc case all vector compares return vectors and in the xl case
all vector compares return scalars.
This patch does not change the default behavior of clang.
This option will be used in future patches to implement behaviour compatibility for the vector bool/pixel types.
Reviewed By: bmahjour
Differential Revision: https://reviews.llvm.org/D103615
Leonard Chan [Wed, 23 Jun 2021 23:12:52 +0000 (16:12 -0700)]
[NFC][compiler-rt][hwasan] Re-use ring buffer size calculation
Users can call HwasanThreadList::GetRingBufferSize rather than RingBufferSize
to prevent having to do the calculation in RingBufferSize. This will be useful
for Fuchsia where we plan to initialize the stack ring buffer separately from
the rest of thread initialization.
Differential Revision: https://reviews.llvm.org/D104823
Fangrui Song [Tue, 29 Jun 2021 18:56:26 +0000 (11:56 -0700)]
[llvm-readobj] Make -s and -t match llvm-readelf
llvm-readobj is an internal testing tool for binary formats. Its output and
command line options do not need to be stable. It isn't supposed to be part of a
build process.
llvm-readelf was created as a user-facing utility and its interface intends to
be compatible with GNU readelf (unless there are good reasons not to).
The two tools have mostly compatible options. -s and -t are noticeable
exceptions due to history. I think the cost of keeping the inconsistency
overweighs the little history-compatible benefit and hinders transition from
cl::opt to OptTable, so let's change it.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D105055
Leonard Chan [Wed, 23 Jun 2021 23:18:44 +0000 (16:18 -0700)]
[NFC][compiler-rt][hwasan] Move GetCurrentThread to hwasan.cpp
We can reuse the same implementation for getting the current thread on fuchsia.
Differential Revision: https://reviews.llvm.org/D104824
Fangrui Song [Tue, 29 Jun 2021 18:50:31 +0000 (11:50 -0700)]
[test] Change -t to --syms and -s to -S for llvm-readobj RUN lines
-s and -t will be changed to improve consistency with llvm-readelf.
The inconsistency issue regularly contributes to confusion using the two tools.
Nikita Popov [Tue, 29 Jun 2021 18:29:10 +0000 (20:29 +0200)]
[SanitizerCoverage] Fix global type check with opaque pointers
The code was previously relying on the fact that an incorrectly
typed global would result in the insertion of a BitCast constant
expression. With opaque pointers, this is no longer the case, so
we should check the type explicitly.
Fangrui Song [Tue, 29 Jun 2021 18:23:30 +0000 (11:23 -0700)]
[llvm-objcopy][MachO] Support ARM64_RELOC_ADDEND
An ARM64_RELOC_ADDEND relocation reuses the symbol field for the addend value.
We should pass through such relocations.
Reviewed By: alexander-shaposhnikov
Differential Revision: https://reviews.llvm.org/D104967
Jacob Hegna [Tue, 29 Jun 2021 18:14:24 +0000 (18:14 +0000)]
[NFC] clang-format on InlineCost.cpp and InlineAdvisor.h.
Nikita Popov [Fri, 25 Jun 2021 20:14:37 +0000 (22:14 +0200)]
[OpaquePtr] Support forward references in textual IR
Currently, LLParser will create a Function/GlobalVariable forward
reference based on the desired pointer type and then modify it when
it is declared. With opaque pointers, we generally do not know the
correct type to use until we see the declaration.
Solve this by creating the forward reference with a dummy type, and
then performing a RAUW with the correct Function/GlobalVariable when
it is declared. The approach is adopted from
https://github.com/TNorthover/llvm-project/commit/
b5b55963f62038319fa7a8b1b232226ba1d8ef3c.
This results in a change to the use list order, which is why we see
test changes on some module passes that are not stable under use list
reordering.
Differential Revision: https://reviews.llvm.org/D104950
Craig Topper [Tue, 29 Jun 2021 17:38:47 +0000 (10:38 -0700)]
[LegalizeTypes][VE] Don't Expand BITREVERSE/BSWAP during type legalization promotion if they will be promoted for NVT in op legalization.
We were trying to expand these if they were going to be expanded
in op legalization so that we generated the minimum number of
operations. We failed to take into account that NVT could be
promoted to another legal type in op legalization.
Hoping this fixes the issue on the VE target reported as a follow
up to D96681. The check line changes were taken from before
1e46b6f4012399a2fef5fbbb4ed06fc919835414 so this patch does
appear to improve some cases that had previously regressed.
Jonas Devlieghere [Tue, 29 Jun 2021 17:56:01 +0000 (10:56 -0700)]
[lldb] Check for the mangled symbol name for objc_copyRealizedClassList_nolock
When we check whether the Objective-C SPI is available, we need to check
for the mangled symbol name. Unlike `objc_copyRealizedClassList`, which
is C exported, the `nolock` variant is not.
Differential revision: https://reviews.llvm.org/D105136
Louis Dionne [Tue, 29 Jun 2021 17:52:26 +0000 (13:52 -0400)]
[libc++] NFC: Fix return-by-const-value and pass-by-const-value typos
While we can debate on the value of passing by const value, there is no
arguing that it's confusing to do so in some circumstances, such as when
marking a pointer parameter as being const (did you mean a pointer-to-const?).
This commit fixes a few issues along those lines.
Nick Desaulniers [Tue, 29 Jun 2021 17:31:58 +0000 (10:31 -0700)]
[Inline] prevent inlining on noprofile mismatch
Similar to
commit
bc044a88ee3c ("[Inline] prevent inlining on stack protector mismatch")
The noprofile function attribute is meant to prevent compiler
instrumentation from being inserted into a function. Inlining may defeat
the developer's intent. If the caller and callee don't either BOTH have
the attribute or BOTH lack the attribute, suppress inline substitution.
This matches behavior being proposed in GCC:
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573511.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223
Add LangRef entry for noprofile fn attr, similar to text added in D93422
and D104944.
Reviewed By: MaskRay, melver, phosek
Differential Revision: https://reviews.llvm.org/D104810
Melanie Blower [Tue, 29 Jun 2021 15:44:49 +0000 (11:44 -0400)]
[clang][PATCH][nfc] Refactor TargetInfo::adjust to pass DiagnosticsEngine to allow diagnostics on target-unsupported options
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D104729
Akira Hatanaka [Wed, 3 Mar 2021 00:48:09 +0000 (16:48 -0800)]
[ObjC][ARC] Don't add operand bundle clang.arc.attachedcall to a call if
the call already has the operand bundle
This bug was causing the call to `replaceAllUsesWith` to crash because
the old call instruction and the new call instruction were the same.
rdar://
74957948
Differential Revision: https://reviews.llvm.org/D97824
Alexey Bataev [Mon, 28 Jun 2021 19:21:19 +0000 (12:21 -0700)]
[INSTCOMBINE] Transform reduction(shuffle V, poison, unique_mask) to reduction(V).
After SLP + LTO we may have have reduction(shuffle V, poison,
mask). This can be simplified to just reduction(V) if the mask is only
for single vector and just all elements from this vector are permuted,
without reusing, replacing with undefs and/or other values, etc.
Differential Revision: https://reviews.llvm.org/D105053
Michael Kruse [Tue, 29 Jun 2021 16:57:52 +0000 (16:57 +0000)]
[Flang][test] Fix Windows buildbot after D104930.
Add
REQUIRES: shell
to the unpack.f90 test that executes a UNIX shell script.
Raphael Isemann [Tue, 29 Jun 2021 17:00:30 +0000 (19:00 +0200)]
[lldb] Skip TestPairFromStdModule for now
I didn't get around to fix this change and the original commit itself seems
fine, so this looks like an existing LLDB/Clang bug that was just uncovered
by this change. Skipping while I'm investigating.
Craig Topper [Tue, 29 Jun 2021 06:09:58 +0000 (23:09 -0700)]
[RISCV] Protect the SHL/SRA/SRL handlers in LowerOperation against being called for an illegal i32 shift amount.
It seems it is possible for DAG combine to create a shl with an
i64 result type and an i32 shift amount. This is ok before type
legalization since the type don't need to match in SelectionDAG.
This results in type legalization calling LowerOperation to
legalize just the amount. We weren't expecting this so we
asserted for not finding a fixed vector shift.
To fix this, I've added a check for the fixed vector case and
returned SDValue() to get the default type legalizer. I've
factored all shifts together and added a fixed vector specific
handler to avoid repeating similar code for each in
LowerOperation.
The particular case I found was exposed by D104581, but the bad
shift is created after that patch triggers.
Arthur O'Dwyer [Wed, 26 May 2021 12:59:16 +0000 (08:59 -0400)]
[libc++] Update ABI docs. NFCI.
Differential Revision: https://reviews.llvm.org/D103160
Eugene Zhulenev [Tue, 29 Jun 2021 16:30:54 +0000 (09:30 -0700)]
[mlir:Async] Fix a bug in automatic refence counting around function calls
Depends On D104998
Function calls "transfer ownership" to the callee and it puts additional constraints on the reference counting optimization pass
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D104999
Eugene Zhulenev [Sun, 27 Jun 2021 21:25:50 +0000 (14:25 -0700)]
[mlir:Async] Convert AsyncParallelFor pass to ModuleOp pass
Depends On D104891
Outlining scf.parallel body as a function requires async-parallel-for pass to be a ModuleOp pass
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D104998
Eugene Zhulenev [Mon, 28 Jun 2021 00:44:31 +0000 (17:44 -0700)]
[mlir:Async] Remove async operations if it is statically known that the parallel operation has a single compute block
Depends On D104850
Add a test that verifies that canonicalization removes all async overheads if it is statically known that the scf.parallel operation will be computed using a single block.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D104891
gbreynoo [Tue, 29 Jun 2021 16:18:32 +0000 (17:18 +0100)]
[llvm-objdump] Add --no-print-imm-hex to the command guide
The option --no-print-imm-hex was not included in the command guide for
llvm-objdump but appears in the help text. This commit adds it to the
command guide.
Differential Revision: https://reviews.llvm.org/D104717
gbreynoo [Tue, 29 Jun 2021 16:03:21 +0000 (17:03 +0100)]
[llvm-objdump] Add testing for --print-imm-hex, --headers, --section-headers and --private-headers
llvm-objdump had some missing coverage that is fixed by this change:
- A test specifically for --print-imm-hex, and coverage of --no-print-imm-hex
- section-headers.test checks the aliases --headers or --section-headers
- A test for the use of --private-headers for ELF that checks the output
- A test for ELF program headers
Differential Revision: https://reviews.llvm.org/D103974
Piotr Sobczak [Tue, 29 Jun 2021 10:35:34 +0000 (12:35 +0200)]
[AMDGPU] Fix 224-bit spills
Related to D104622.
Differential Revision: https://reviews.llvm.org/D105109
David Green [Tue, 29 Jun 2021 15:51:47 +0000 (16:51 +0100)]
[ARM] Extra test for gep immediate costs. NFC
LLVM GN Syncbot [Tue, 29 Jun 2021 15:41:00 +0000 (15:41 +0000)]
[gn build] Port
d03aa7d6b66f
Louis Dionne [Tue, 29 Jun 2021 15:33:16 +0000 (11:33 -0400)]
[libc++] NFCI: Remove __functional/search.h
The __search helper function was once split into __functional for circular
dependency reasons, however this is not an issue anymore now that we have
finer grained headers.
Eugene Zhulenev [Sat, 26 Jun 2021 14:34:43 +0000 (07:34 -0700)]
[perf] Fix a data race in the PerfJITEventListener
Concurrent JIT compilation + PerfJITEventListener triggers tsan error
Reviewed By: cota
Differential Revision: https://reviews.llvm.org/D104977
Florian Hahn [Tue, 29 Jun 2021 15:04:35 +0000 (16:04 +0100)]
[SCCP] Extend tests added
1092357ccdc9 in with UREM/SREM by 0.
Add additional coverage for computing UREM/SREM C, 0.
Philip Reames [Tue, 29 Jun 2021 14:54:53 +0000 (07:54 -0700)]
[LV] Fix bug when unrolling (only) a loop with non-latch exit
If we unroll a loop in the vectorizer (without vectorizing), and the cost model requires a epilogue be generated for correctness, the code generation must actually do so.
The included test case on an unmodified opt will access memory one past the expected bound. As a result, this patch is fixing a latent miscompile.
Differential Revision: https://reviews.llvm.org/D103700
Pratyush Das [Tue, 29 Jun 2021 13:50:04 +0000 (13:50 +0000)]
Print default template argument if manually specified in typedef declaration.
If a default template type argument is manually specified to be of the default
type, then it is committed when printing the template.
Differential revision: https://reviews.llvm.org/D103040
Louis Dionne [Tue, 1 Jun 2021 21:16:11 +0000 (17:16 -0400)]
[libc++] Serialize Lit parameters to make them available to from-scratch configs
Before this patch, Lit parameters that were set as a result of CMake
options were not made available to from-scratch configs. This patch
serializes those parameters into the generated lit config file so that
they are available to all configs.
Differential Revision: https://reviews.llvm.org/D105047
Louis Dionne [Tue, 22 Jun 2021 17:43:48 +0000 (13:43 -0400)]
[libc++] NFCI: Remove code duplication and obsolete declarations in wrap_iter
Differential Revision: https://reviews.llvm.org/D105040
Jeremy Morse [Tue, 29 Jun 2021 14:40:43 +0000 (15:40 +0100)]
Catch an extremely obvious memory leak, thanks asan
https://lab.llvm.org/buildbot/#/builders/5/builds/9208
(dbg-phis-merging-in-ldv.mir and dbg-phis-with-loops.mir in the asan
check stage)
Alex Zinenko [Tue, 29 Jun 2021 14:44:16 +0000 (16:44 +0200)]
[mlir] silence -Wunused-variable in Linalg comprehensive bufferize
Johannes Doerfert [Tue, 29 Jun 2021 14:34:53 +0000 (09:34 -0500)]
Revert "[OpenMP] Add Two-level Distributed Barrier"
This reverts commit
25073a4ecfc9b2e3cb76776185e63bfdb094cd98.
This breaks non-x86 OpenMP builds for a while now. Until a solution is
ready to be upstreamed we revert the feature and unblock those builds.
See:
https://reviews.llvm.org/rG25073a4ecfc9b2e3cb76776185e63bfdb094cd98#1005821
and
https://reviews.llvm.org/rG25073a4ecfc9b2e3cb76776185e63bfdb094cd98#1005821
The currently proposed fix (D104788) seems not to be ready yet:
https://reviews.llvm.org/D104788#2841928
Johannes Doerfert [Tue, 29 Jun 2021 14:33:31 +0000 (09:33 -0500)]
Revert "[omp] Fix build without ITT after D103121 changes"
This reverts commit
eab1fd389b61d236bf8df4d09f62dd18253a10bc.
This commit fixed a problem with
25073a4ecfc9 (D103121) which is the one
we actually need to revert to unblock non-X86 builds of OpenMP. Can be
reapplied, or merged into, D103121 as it goes in again.
Johannes Doerfert [Sat, 26 Jun 2021 18:20:28 +0000 (13:20 -0500)]
[Attributor][NFCI] Make the state of AAValueSimplify explicit
As we have done with other states we want the AAValueSimplify state to
be explicit to use it more easily in our helpers.
Johannes Doerfert [Sat, 26 Jun 2021 18:10:13 +0000 (13:10 -0500)]
[Attributor][NFCI] Remove unneeded namespace
Johannes Doerfert [Thu, 10 Jun 2021 22:13:22 +0000 (17:13 -0500)]
[Attributor] Teach AAPotentialValues about constant select conditions
There was a TODO but now we actually check if the select condition is
assumed constant and only look at the relevant operand.
Johannes Doerfert [Sat, 26 Jun 2021 00:19:19 +0000 (19:19 -0500)]
[Attributor][NFC] Clang format
Johannes Doerfert [Thu, 24 Jun 2021 17:04:46 +0000 (12:04 -0500)]
[InstCombine] Gracefully handle an alloca outside the alloca-AS
While we might eventually want to disallow allocas that do not have the
alloca-AS set, it seems undesirable to crash on them. Add a cast when
required so that we can support such allocas (at least here).
Differential Revision: https://reviews.llvm.org/D104866
Balazs Benics [Tue, 29 Jun 2021 14:35:07 +0000 (16:35 +0200)]
[analyzer] Make CheckerManager::hasPathSensitiveCheckers() complete again
It turns out that the CheckerManager::hasPathSensitiveCheckers() missed
checking for the BeginFunctionCheckers.
It seems like other callbacks are also missing:
- ObjCMessageNilCheckers
- BeginFunctionCheckers
- NewAllocatorCheckers
- PointerEscapeCheckers
- EndOfTranslationUnitCheckers
In this patch, I wanted to use a fold-expression, but until C++17
arrives we are left with the old-school method.
When I tried to write a unittest I observed an interesting behavior. I
subscribed only to the BeginFunction event, it was not fired.
However, when I also defined the PreCall with an empty handler, suddenly
both fired.
I could add this test demonstrating the issue, but I don't think it
would serve much value in a long run. I don't expect regressions for
this.
However, I think it would be great to enforce the completeness of this
list in a runtime check.
I could not come up with a solution for this though.
PS: Thank you @Szelethus for helping me debugging this.
Differential Revision: https://reviews.llvm.org/D105101
Reviewed by: vsavchenko
David Sherwood [Tue, 29 Jun 2021 14:20:11 +0000 (15:20 +0100)]
Revert "[NFC] Remove shadowed variable in InnerLoopVectorizer::createInductionVariable"
This reverts commit
9dde51416209a5552156384b9c2b08b676818d70.
Dylan Fleming [Tue, 29 Jun 2021 13:00:49 +0000 (14:00 +0100)]
[SVE] Added CodeGen support for inserting an element into a predicate vector
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D104722
Jeremy Morse [Tue, 29 Jun 2021 12:48:49 +0000 (13:48 +0100)]
[DebugInstrRef][3/3] Follow DBG_PHI instructions through LiveDebugValues
This patch reads machine value numbers from DBG_PHI instructions (marking
where SSA PHIs used to be), and matches them up with DBG_INSTR_REF
instructions that refer to them. Essentially they are two separate parts of
a DBG_VALUE: the place to read the value (register and program position),
and where the variable is assigned that value.
Sometimes these DBG_PHIs can be duplicated, usually by tail duplication.
This corresponds to the SSA structure of the program being destroyed, and
the original PHI being split. When this happens: run LLVMs standard
SSAUpdater utility, to work out what values should appear in which blocks.
The majority of this patch is boilerplate to make use of SSAUpdater.
If there are any additional PHIs on the path between multiple DBG_PHIs and
their using DBG_INSTR_REF, their existance is validated, just in case a
value gets clobbered along the way (see dbg-phis-with-loops.mir for
several examples).
Differential Revision: https://reviews.llvm.org/D86814
Ben Shi [Tue, 29 Jun 2021 13:44:50 +0000 (21:44 +0800)]
[AVR] Fix a bug in prologue of ISR
The r1 register should be cleared in prologue of ISR as it is used
as constant zero.
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D99467
Simon Pilgrim [Tue, 29 Jun 2021 13:36:20 +0000 (14:36 +0100)]
[X86] Add cmov i33 sgt test case
Suggested on D101074 - add a 'icmp sgt i64 %0, -
2147483649' comparison that can fold to 'icmp sge i64 %0, -
2147483648' on D101074 allowing i32 immediate folding
David Sherwood [Tue, 29 Jun 2021 13:28:49 +0000 (14:28 +0100)]
[NFC] Remove shadowed variable in InnerLoopVectorizer::createInductionVariable
Avoid creating a IRBuilder stack variable with the same name as the
class member.
Nicolas Vasilache [Thu, 24 Jun 2021 13:58:57 +0000 (13:58 +0000)]
[mlir][Linalg] NFC - Drop AliasInfo::existsNonDominatingRead
The case where a non-dominating read can be found is captured by slightly generalizing `AliasInfo::wouldCreaateReadAfterWriteInterference`.
This simplification will make it easier to implement bufferization across function call.
APIs are also simplified were possible.
Differential revision: https://reviews.llvm.org/D104845
Nico Weber [Tue, 29 Jun 2021 13:21:33 +0000 (09:21 -0400)]
[lld/mac] Make symbol table order deterministic
SymtabSection::emitStabs() writes the symbol table in the order
of externalSymbols, which has the order of symtab->getSymbols(),
which is just the order symbols are added to the symbol table.
In practice, symbols in the symbol files of input .o files are
sorted, but since that's not guaranteed we sort them in
ObjFile::parseSymbols(). To make sure several symbols with the same
address keep the order they're in the input file, we have to use
stable_sort().
In practice, std::sort() on already-sorted inputs won't change the order
of just adjacent elements, and while in theory std::sort() could use a
random pivot, in practice the code should be deterministic as it was
previously too.
But now lld/test/MachO/stabs.s passes with LLVM_ENABLE_EXPENSIVE_CHECKS=ON
(the last test that was failing with that set).
Fixes a regression from D99972.
While here, remove an empty section in stabs.s and move
.subsections_via_symbols to the end where it usually is (this part no
behavior change).
Differential Revision: https://reviews.llvm.org/D105071
Tim Northover [Tue, 29 Jun 2021 13:19:01 +0000 (14:19 +0100)]
ARM: fix vacuously true assertion to actually check what it should. NFC.
Florian Hahn [Tue, 29 Jun 2021 13:11:46 +0000 (14:11 +0100)]
[SCCP] Add tests with urem/srem with 2 constant operands.
Reduced test case for PR49731.
David Sherwood [Tue, 29 Jun 2021 12:47:00 +0000 (13:47 +0100)]
Revert "[NFC] Remove shadowed variable in InnerLoopVectorizer::createInductionVariable"
This reverts commit
dcfc2c3fac980b137415c17f2f19c06c3e2bd7fb.
Felipe de Azevedo Piovezan [Tue, 29 Jun 2021 12:57:16 +0000 (14:57 +0200)]
[mlir] Add support for LLVM's dso_local attr
This patch brings support for setting runtime preemption specifiers of
LLVM's GlobalValues. In LLVM semantics, if the `dso_local` attribute
is not explicitly requested, then it is inferred based on linkage and
visibility. We model this same behavior with a UnitAttribute: if it is
present, then we explicitly request the GlobalValue to marked as
`dso_local`, otherwise we rely on the GlobalValue itself to make this
decision.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D104983
Alex Zinenko [Tue, 29 Jun 2021 12:13:01 +0000 (14:13 +0200)]
[mlir] Remove SDBM
This data structure and algorithm collection is no longer in use.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D105102
Florian Hahn [Tue, 29 Jun 2021 10:54:52 +0000 (11:54 +0100)]
[LV] Fix crash when target instruction for sinking is dead.
This patch fixes a crash when the target instruction for sinking is
dead. In that case, no recipe is created and trying to get the recipe
for it results in a crash. To ensure all sink targets are alive, find &
use the first previous alive instruction.
Note that the case where the sink source is dead is already handled.
Found by
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35320
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D104603
Alexey Bataev [Tue, 29 Jun 2021 12:25:44 +0000 (05:25 -0700)]
[InstCombine]Add a test for reductions after shuffles, NFC.
Florian Mayer [Mon, 21 Jun 2021 18:55:31 +0000 (19:55 +0100)]
[hwasan] Display causes in order of probability.
A heap or global buffer that is far away from the faulting address is
unlikely to be the cause, especially if there is a potential
use-after-free as well, so we want to show it after the other
causes.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D104781
Florian Mayer [Tue, 29 Jun 2021 10:56:19 +0000 (11:56 +0100)]
Revert "[hwasan] print exact mismatch offset for short granules."
Broke x86 LAM bot.
This reverts commit
2a60ab76a796637d49bf1c7191f5b5a0c92f81bc.
David Sherwood [Thu, 17 Jun 2021 08:48:30 +0000 (09:48 +0100)]
[LoopVectorize] Add support for scalable vectorization of invariant stores
Previously in setCostBasedWideningDecision if we encountered an
invariant store we just assumed that we could scalarize the store
and called getUniformMemOpCost to get the associated cost.
However, for scalable vectors this is not an option because it is
not currently possibly to scalarize the store. At the moment we
crash in VPReplicateRecipe::execute when trying to scalarize the
store.
Therefore, I have changed setCostBasedWideningDecision so that if
we are storing a scalable vector out to a uniform address and the
target supports scatter instructions, then we should use those
instead.
Tests have been added here:
Transforms/LoopVectorize/AArch64/sve-inv-store.ll
Differential Revision: https://reviews.llvm.org/D104624
Butygin [Sat, 26 Jun 2021 10:05:29 +0000 (13:05 +0300)]
[mlir] Add MemoryEffects::Allocate to memref::CloneOp
Without it BufferDeallocationPass process only CloneOps created during pass itself and ignore all CloneOps that were already present in IR.
For our specific usecase:
```
func @dealloc_existing_clones(%arg0: memref<?x?xf64>, %arg1: memref<?x?xf64>) -> memref<?x?xf64> {
return %arg0 : memref<?x?xf64>
}
```
Input arguments will be freed immediately after return from function and we want to prolong lifetime for the returned argument.
To achieve this we explicitly add clones to all input memrefs and expect that BufferDeallocationPass will add correct deallocs to them (unnessesary clone+dealloc pairs will be canonicalized away later).
Differential Revision: https://reviews.llvm.org/D104973
Roman Lebedev [Tue, 29 Jun 2021 10:25:32 +0000 (13:25 +0300)]
[NFC][InstCombine] foldAggregateConstructionIntoAggregateReuse(): cast to Instruction eagerly
In all of these, the value must be an instruction for us to succeed anyway,
so change it to maybe hopefully make further changes more straight-forward.
Chia-hung Duan [Tue, 29 Jun 2021 10:03:30 +0000 (18:03 +0800)]
[mlir-reduce] Add doc for usage of mlir-reduce
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D103683
David Green [Tue, 29 Jun 2021 10:03:19 +0000 (11:03 +0100)]
[ARM] Fold extract of ARM_BUILD_VECTOR
This adds a small fold for extract (ARM_BUILD_VECTOR) to fold to the
original node. This can help simplify the resulting codegen in some
cases.
Differential Revision: https://reviews.llvm.org/D104860
Valeriy Savchenko [Tue, 29 Jun 2021 09:59:41 +0000 (12:59 +0300)]
[analyzer] Fix SValTest for LocAsInt test
LLVM GN Syncbot [Tue, 29 Jun 2021 09:44:27 +0000 (09:44 +0000)]
[gn build] Port
9b02a9b40150
LLVM GN Syncbot [Tue, 29 Jun 2021 09:44:26 +0000 (09:44 +0000)]
[gn build] Port
159024ce2315
Valeriy Savchenko [Fri, 18 Jun 2021 11:16:18 +0000 (14:16 +0300)]
[analyzer] Implement getType for SVal
This commit adds a function to the top-class of SVal hierarchy to
provide type information about the value. That can be extremely
useful when this is the only piece of information that the user is
actually caring about.
Additionally, this commit introduces a testing framework for writing
unit-tests for symbolic values.
Differential Revision: https://reviews.llvm.org/D104550
Ole Strohm [Wed, 23 Jun 2021 09:52:58 +0000 (10:52 +0100)]
[OpenCL] Fix qualifiers check on binding references to temporaries
Fix the qualifiers check from PR49733.
Fixes: PR49733
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D103962
Med Ismail Bennani [Mon, 28 Jun 2021 19:27:55 +0000 (19:27 +0000)]
[lldb/Interpreter] Fix session-save-on-quit when using ^D
Previously, when `interpreter.save-session-on-quit` was enabled, lldb
would save the session transcript only when running the `quit` command.
This patch changes that so the transcripts are saved when the debugger
object is destroyed if the setting is enabled.
rdar://
72902650
Differential Revision: https://reviews.llvm.org/D105038
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Mon, 28 Jun 2021 17:41:26 +0000 (17:41 +0000)]
[lldb/Interpreter] Add setting to set session transcript save directory
This patch introduces a new interpreter setting
`interpreter.save-session-directory` so the user can specify a directory
where the session transcripts will be saved.
If not set, the session transcript are saved on a temporary file.
rdar://
72902842
Differential Revision: https://reviews.llvm.org/D105030
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Tianqing Wang [Tue, 29 Jun 2021 08:06:45 +0000 (16:06 +0800)]
[X86] Add a test to reveal a bug in CMOV conversion.
CMOV conversion first rewrites all CMOVs with memory load to branches.
Then runs a second pass to convert other CMOVs in loops if profitable.
But the first pass doesn't add new basic blocks to MachineLoopInfo,
CMOVs in these blocks are ignored in the subsequent pass.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D104692
Bruno De Fraine [Tue, 29 Jun 2021 07:46:27 +0000 (09:46 +0200)]
PR50767: clear non-distinct debuginfo for function with nodebug definition after undecorated declaration
Fix suggested by Yuanfang Chen:
Non-distinct debuginfo is attached to the function due to the undecorated declaration. Later, when seeing the function definition and `nodebug` attribute, the non-distinct debuginfo should be cleared.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D104777
Diana Picus [Fri, 11 Jun 2021 08:05:30 +0000 (08:05 +0000)]
[flang] Add runtime interface for SYSTEM_CLOCK
SYSTEM_CLOCK may take up to 3 optional parameters, all of which are
INTENT(OUT). The COUNT and COUNT_MAX parameters are integer scalars,
while COUNT_RATE may be a real or integer scalar.
This patch breaks up the interface into 3 different functions, one for
each parameter. All 3 return integers. It is up to lowering to convert
the results to the preferred type.
Differential Revision: https://reviews.llvm.org/D104851
Florian Hahn [Tue, 29 Jun 2021 07:56:50 +0000 (08:56 +0100)]
[BasicAA] Be more careful with modulo ops on VariableGEPIndex.
(V * Scale) % X may not produce the same result for any possible value
of V, e.g. if the multiplication overflows. This means we currently
incorrectly determine NoAlias in some cases.
This patch updates LinearExpression to track whether the expression
has NSW and uses that to adjust the scale used for alias checks.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D99424
Soham Dixit [Tue, 29 Jun 2021 08:18:21 +0000 (09:18 +0100)]
[DebugInfo] Bug 41152 - Improve dumping of empty location expressions
Fixes PR41152 (https://bugs.llvm.org/show_bug.cgi?id=41152).
Reviewed by: jhenderson, dblaikie, SouraVX
Differential Revision: https://reviews.llvm.org/D103502
Alexander Shaposhnikov [Tue, 29 Jun 2021 08:18:48 +0000 (01:18 -0700)]
Revert "[llvm-objcopy][MachO] Minor code cleanup"
This reverts commit
c94cf97b53566a26245c54ea0c41b0dc83daf8a0
since it appears to have broken linaro-clang-armv7-quick build bot
and needs further investigation.
David Sherwood [Mon, 28 Jun 2021 15:40:19 +0000 (16:40 +0100)]
[NFC] Remove shadowed variable in InnerLoopVectorizer::createInductionVariable
Avoid creating a IRBuilder stack variable with the same name as the
class member.
Tianqing Wang [Tue, 29 Jun 2021 07:34:30 +0000 (15:34 +0800)]
[X86] Add -mgeneral-regs-only support.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D103943
Tobias Gysi [Tue, 29 Jun 2021 06:54:39 +0000 (06:54 +0000)]
[mlir][linalg] All StructuredOp parameters are inputs or outputs.
Adapt the StructuredOp verifier to ensure all operands are either in the input or the output group. The change is possible after adding support for scalar input operands (https://reviews.llvm.org/D104220).
Differential Revision: https://reviews.llvm.org/D104783
Alexander Belyaev [Tue, 29 Jun 2021 06:55:25 +0000 (08:55 +0200)]
Revert "[mlir] Skip scalar operands when tiling to linalg.tiled_loop."
This reverts commit
69046b4a79e2670053362112aa467f89faf9e53e. It did not
really break anything, but it was decided to allow scalars and other
non-shaped operands for tiled_loop.
Siva Chandra [Tue, 29 Jun 2021 05:24:00 +0000 (22:24 -0700)]
[libc][Obvious] Fix typo in implementation of aarch64 clearExcept.
Instead of reading and updating the status word, control word was being
updated.
David Blaikie [Tue, 29 Jun 2021 05:55:55 +0000 (22:55 -0700)]
Revert "[Clang] Add option to handle behaviour of vector bool/vector pixel."
This reverts commit
c3fe847f9d90de5a6a76fd1d5f5823ab4719accc.
Tests fail in non-asserts builds because they assume named IR, by the
looks of it (testing for the "entry" label, for instance). I don't know
enough about the update_cc_test_checks.py stuff to know how to manually
fix these tests, so reverting for now.
Alexander Shaposhnikov [Tue, 29 Jun 2021 05:50:39 +0000 (22:50 -0700)]
[llvm-objcopy][MachO] Minor code cleanup
Remove unnecessary template in MachOReader.cpp. NFC.
Xiang1 Zhang [Wed, 23 Jun 2021 05:54:10 +0000 (13:54 +0800)]
[X86] Zero some outputs of Kelocker intrinsics in error case
Reviewed By: WangPengfei
Differential Revision: https://reviews.llvm.org/D104766
Ben Shi [Tue, 29 Jun 2021 03:15:00 +0000 (11:15 +0800)]
[AVR][clang] Fix wrong calling convention in functions return struct type
According to AVR ABI (https://gcc.gnu.org/wiki/avr-gcc), returned struct value
within size 1-8 bytes should be returned directly (via register r18-r25), while
larger ones should be returned via an implicit struct pointer argument.
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D99237
Kai Luo [Tue, 29 Jun 2021 03:13:55 +0000 (03:13 +0000)]
[AIX][compiler-rt] Deliver libatomic.a at top level library directory
Install libatomic.a in top level library directory so that compiler can find it in search directories.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D104908
Greg Clayton [Tue, 29 Jun 2021 02:59:24 +0000 (19:59 -0700)]
Fix failing tests after https://reviews.llvm.org/D104488.
Synthetic names no longer have the shared library name appended to the end.
Michael Liao [Tue, 29 Jun 2021 02:48:26 +0000 (22:48 -0400)]
Fix `-Wunused-variable` warning. NFC.
Michael Liao [Wed, 26 May 2021 00:21:21 +0000 (20:21 -0400)]
[MIRParser] Add machine metadata.
- Add standalone metadata parsing support so that machine metadata nodes
could be populated before and accessed during MIR is parsed.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D103282
Xun Li [Tue, 29 Jun 2021 02:28:27 +0000 (19:28 -0700)]
[Coroutines] Remove CoroElide from O0 pipeline
CoroElide pass works only when a post-split coroutine is inlined into another post-split coroutine.
In O0, there is no inlining after CoroSplit, and hence no CoroElide can happen.
It's useless to put CoroElide pass in the O0 pipeline and it will never be triggered (unless I miss anything).
Differential Revision: https://reviews.llvm.org/D105066
Leonard Grey [Tue, 29 Jun 2021 02:22:21 +0000 (22:22 -0400)]
[lld-macho] Preserve alignment for non-deduplicated cstrings
Fixes PR50637.
Downstream bug: https://crbug.com/1218958
Currently, we split __cstring along symbol boundaries with .subsections_via_symbols
when not deduplicating, and along null bytes when deduplicating. This change splits
along null bytes unconditionally, and preserves original alignment in the non-
deduplicated case.
Removing subsections-section-relocs.s because with this change, __cstring
is never reordered based on the order file.
Differential Revision: https://reviews.llvm.org/D104919
harsh-nod [Tue, 29 Jun 2021 01:40:49 +0000 (18:40 -0700)]
[mlir][vector] Order parallel indices before transposing the input in multireductions
The current code does not preserve the order of the parallel
dimensions when doing multi-reductions and thus we can end
up in scenarios where the result shape does not match the
desired shape after reduction.
This patch fixes that by ensuring that the parallel indices
are in order and then concatenates them to the reduction dimensions
so that the reduction dimensions are innermost.
Differential Revision: https://reviews.llvm.org/D104884