LLVM GN Syncbot [Tue, 1 Jun 2021 19:37:29 +0000 (19:37 +0000)]
[gn build] Port
5671ff20d92b
zoecarver [Fri, 30 Apr 2021 22:24:28 +0000 (15:24 -0700)]
[libcxx] Implement view.interface.
This will unblock work on ranges::view. Based on D101396.
Refs http://eel.is/c++draft/view.interface.
Differential Revision: https://reviews.llvm.org/D101737
Nico Weber [Mon, 31 May 2021 18:59:48 +0000 (14:59 -0400)]
[lld/mac] Don't load DylibFiles from the DylibFile constructor
loadDylib() keeps a name->DylibFile cache, but it only writes
to the cache once the DylibFile constructor has completed.
So dylib loads done recursively from the DylibFile constructor
wouldn't use the cache.
Now, we load additional dylibs after writing to the cache,
which means the cache now gets used for dylibs loaded because
they're referenced from other dylibs.
Related to PR49514 and PR50101, but no dramatic behavior change in itself.
(Technically we no longer crash when a tbd file reexports itself,
but that doesn't happen in practice. We now accept it silently instead
of crashing; ld64 has a diag for the reexport cycle.)
Differential Revision: https://reviews.llvm.org/D103423
Nico Weber [Tue, 1 Jun 2021 10:55:36 +0000 (06:55 -0400)]
[lld/mac] Don't write mtimes to N_OSO entries if ZERO_AR_DATE is set.
This is important for build determinism. This matches ld64.
Differential Revision: https://reviews.llvm.org/D103446
madhur13490 [Tue, 1 Jun 2021 19:18:26 +0000 (00:48 +0530)]
[AMDGPU][NFC] Remove author's name from codebase
This must have made to code by accident.
Differential Revision: https://reviews.llvm.org/D103484
Harald van Dijk [Tue, 1 Jun 2021 19:21:04 +0000 (20:21 +0100)]
[SLPVectorizer] Ignore unreachable blocks
As the existing test unreachable.ll shows, we should be doing more
work to avoid entering unreachable blocks: we should not stop
vectorization just because a PHI incoming value from an unreachable
block cannot be vectorized. We know that particular value will never
be used so we can just replace it with poison.
Peyton, Jonathan L [Thu, 20 May 2021 18:50:03 +0000 (13:50 -0500)]
[OpenMP] Add L2-Tile equivalence for KNL
When on KNL and L2 or Tile layer is detected, manually add
the corresponding layer which is equivalent.
Differential Revision: https://reviews.llvm.org/D102865
David Goldman [Fri, 30 Apr 2021 16:14:32 +0000 (12:14 -0400)]
[clang] RecursiveASTVisitor visits ObjCPropertyRefExpr's class receiver
We now make up a TypeLoc for the class receiver to simplify visiting,
notably for indexing, availability, and clangd.
Differential Revision: https://reviews.llvm.org/D101645
Valentin Clement [Tue, 1 Jun 2021 18:36:58 +0000 (14:36 -0400)]
[flang][openacc] Enforce restriction on attach and detach variables
Each var argument to an attach or detach clause must be a
Fortran variable or array with the pointer or allocatable attribute.
This patch enforce this restruction.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D103279
Lang Hames [Mon, 31 May 2021 22:50:26 +0000 (15:50 -0700)]
[ORC-RT] Add WrapperFunctionResult, Simple Packed Serialization (SPS) system.
WrapperFunctionResult is a C++ wrapper for __orc_rt_CWrapperFunctionResult
that automatically manages the underlying struct.
The Simple Packed Serialization (SPS) utilities support a simple serialization
scheme for wrapper function argument and result buffers:
Primitive typess (bool, char, int8_t, and uint8_t, int16_t, uint16_t, int32_t,
uint32_t, int64_t, uint64_t) are serialized in little-endian form.
SPSTuples are serialized by serializing each of the tuple members in order
without padding.
SPSSequences are serialized by serializing a sequence length (as a uint64_t)
followed by each of the elements of the sequence in order without padding.
Serialization/deserialization always involves a pair of SPS type tag (a tag
representing the serialized format to use, e.g. uint32_t, or
SPSTuple<bool, SPSString>) and a concrete type to be serialized from or
deserialized to (uint32_t, std::pair<bool, std::string>). Serialization for new
types can be implemented by specializing the SPSSerializationTraits type.
Lang Hames [Mon, 31 May 2021 22:37:00 +0000 (15:37 -0700)]
[ORC-RT] Rename C-API functions to use __orc_rt_ prefix (instead of OrcRT).
This matches the C++ namespace name, and is consistent with other C linkage
functions (e.g. __orc_rt_jit_dispatch).
Lang Hames [Mon, 31 May 2021 22:25:13 +0000 (15:25 -0700)]
[ORC-RT] Add equality/inequality comparison to string_view.
Hansang Bae [Tue, 1 Jun 2021 14:31:27 +0000 (09:31 -0500)]
[OpenMP] Define named constants for interop's foreign runtime ID
Also added missing Fortran definitions for interop support.
Differential Revision: https://reviews.llvm.org/D102883
Aaron Ballman [Tue, 1 Jun 2021 18:05:26 +0000 (14:05 -0400)]
Fix a git apply that went bad somehow.
When applying the changes in
8edd3464afbff65d7d5945b3a8b20009d6ff5deb,
it seems that this bit got merged incorrectly and no test coverage
caught the issue. This fixes the diagnostic and adds a test.
Jessica Paquette [Wed, 24 Mar 2021 17:52:21 +0000 (10:52 -0700)]
[GlobalISel][AArch64] Combine and (lshr x, cst), mask -> ubfx x, cst, width
Also add a target hook which allows us to get around custom legalization on
AArch64.
Differential Revision: https://reviews.llvm.org/D99283
Louis Dionne [Tue, 1 Jun 2021 17:49:53 +0000 (13:49 -0400)]
[libc++] Temporary hack to unbreak CI
Until I figure out what the issue is with this test on AppleClang (and
in particular which change caused it), I want to avoid all CI being broken.
David Goldman [Mon, 19 Apr 2021 20:38:37 +0000 (16:38 -0400)]
[clangd][ObjC] Fix issue completing a method decl by name
When completing an Objective-C method declaration by name, we need to
preserve the leading text as a `qualifier` so we insert it properly
before the first typed text chunk.
Differential Revision: https://reviews.llvm.org/D100798
Guozhi Wei [Tue, 1 Jun 2021 17:31:30 +0000 (10:31 -0700)]
[X86FixupLEAs] Transform the sequence LEA/SUB to SUB/SUB
This patch transforms the sequence
lea (reg1, reg2), reg3
sub reg3, reg4
to two sub instructions
sub reg1, reg4
sub reg2, reg4
Similar optimization can also be applied to LEA/ADD sequence.
The modifications to TwoAddressInstructionPass is to ensure the operands of ADD
instruction has expected order (the dest register of LEA should be src register of ADD).
Differential Revision: https://reviews.llvm.org/D101970
Nikita Popov [Tue, 1 Jun 2021 17:18:19 +0000 (19:18 +0200)]
[MLIR] Add missing APSInt.h include
Since
fd7e309e02fd226b0390888388ed732608e52c73 this is no longer
pulled in indirectly through DenseMapInfo.h.
Jonas Paulsson [Tue, 1 Jun 2021 16:24:06 +0000 (18:24 +0200)]
[SystemZ] Return true from hasBitPreservingFPLogic().
This is currently NFC on benchmarks and tests.
Review: Ulrich Weigand
Eli Friedman [Fri, 21 May 2021 23:58:36 +0000 (16:58 -0700)]
[polly] Fix SCEVLoopAddRecRewriter to avoid invalid AddRecs.
When we're remapping an AddRec, the AddRec constructed by a partial
rewrite might not make sense. This triggers an assertion complaining
it's not loop-invariant.
Instead of constructing the partially rewritten AddRec, just skip
straight to calling evaluateAtIteration.
Testcase was automatically reduced using llvm-reduce, so it's a little
messy, but hopefully makes sense.
Differential Revision: https://reviews.llvm.org/D102959
Nikita Popov [Mon, 31 May 2021 16:49:34 +0000 (18:49 +0200)]
[ADT] Move DenseMapInfo for APInt into APInt.h (PR50527)
As suggested in https://bugs.llvm.org/show_bug.cgi?id=50527, this
moves the DenseMapInfo for APInt and APSInt into the respective
headers, removing the need to include APInt.h and APSInt.h from
DenseMapInfo.h.
We could probably do the same from StringRef and ArrayRef as well.
Differential Revision: https://reviews.llvm.org/D103422
Craig Topper [Tue, 1 Jun 2021 16:09:01 +0000 (09:09 -0700)]
[RISCV] Remove earlyclobber from vnsrl/vnsra/vnclip(u) when the source and dest are a single vector register.
This guarantees they meet this overlap exception:
"The destination EEW is smaller than the source EEW and the overlap
is in the lowest-numbered part of the source register group"
Being a single register guarantees the overlap is always in the
lowerst-number part of the group.
Reviewed By: frasercrmck, khchen
Differential Revision: https://reviews.llvm.org/D103351
Craig Topper [Tue, 1 Jun 2021 15:50:18 +0000 (08:50 -0700)]
[RISCV] Remove earlyclobber from compares with LMUL<=1.
Compares are considered a narrowing operation for register overlap.
I believe for LMUL<=1 they meet this exception to allow overlap
"The destination EEW is smaller than the source EEW and the overlap is in the
lowest-numbered part of the source register group"
Both the result and the sources will occupy a single register for
LMUL<=1 so the overlap would always be in the "lowest-numbered part".
Reviewed By: frasercrmck, HsiangKai
Differential Revision: https://reviews.llvm.org/D103336
Raphael Isemann [Tue, 1 Jun 2021 15:58:12 +0000 (17:58 +0200)]
[lldb][NFC] Use Language plugins in Mangled::GuessLanguage
This removes the direct dependency to the ObjC and C++ plugins.
Reviewed By: bulbazord
Differential Revision: https://reviews.llvm.org/D103158
Raphael Isemann [Tue, 1 Jun 2021 15:50:26 +0000 (17:50 +0200)]
[lldb] Remove SBCommandReturnObject::ref
This function was added in D67589 and returns an internal CommandReturnObject
which isn't allowed in the SB API. This patch just makes it private as all uses
of this function are inside SBCommandReturnObject.
Reviewed By: jankratochvil
Differential Revision: https://reviews.llvm.org/D103390
Sanjay Patel [Tue, 1 Jun 2021 12:58:55 +0000 (08:58 -0400)]
[x86] add test for sext-of-setcc; NFC
Xun Li [Tue, 1 Jun 2021 15:12:18 +0000 (08:12 -0700)]
Simplify coro-zero-alloca.ll
D101841 added this test. It appears to generate different outcome on different platforms.
Make it to only call -coro-split instead of entire O2 pipeline to simplify the test flow.
Hope this will make the test more robust.
Reviewed By: djtodoro
Differential Revision: https://reviews.llvm.org/D103418
Alexey Bataev [Fri, 21 May 2021 13:29:23 +0000 (06:29 -0700)]
[SLP]Better detection of perfect/shuffles matches for gather nodes.
Implemented better scheme for perfect/shuffled matches of the gather
nodes which allows to fix the performance regressions introduced by
earlier patches. Starting detecting matches for broadcast nodes and
extractelement gathering.
Differential Revision: https://reviews.llvm.org/D102920
gbreynoo [Tue, 1 Jun 2021 13:57:00 +0000 (14:57 +0100)]
[llvm-dwarfdump][test] Add missing dedicated tests for some options
This change adds tests specifically for --parent-recurse-depth, --quiet
and -o. The test for -o found a typo in an error message which is also
fixed in this change.
Differential Revision: https://reviews.llvm.org/D103250
Louis Dionne [Mon, 31 May 2021 20:18:30 +0000 (16:18 -0400)]
[clang][Parse] Add parsing support for C++ attributes on using-declarations
This is a re-application of dc67299 which was reverted in
f63adf5b because
it broke the build. The issue should now be fixed.
Attribution note: The original author of this patch is Erik Pilkington.
I'm only trying to land it after rebasing.
Differential Revision: https://reviews.llvm.org/D91630
Ole Strohm [Tue, 1 Jun 2021 12:01:47 +0000 (13:01 +0100)]
[OpenCL] Fix ICE with invalid use of half
Because half is limited to the `cl_khr_fp16` extension being enabled,
`DefaultLvalueConversion` can fail when it's not enabled.
The original assumption that it will never fail is therefore wrong now.
Fixes: PR47976
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D103175
Pushpinder Singh [Tue, 1 Jun 2021 09:23:10 +0000 (09:23 +0000)]
[AMDGPU][Libomptarget] Remove g_atmi_machine global
Turns out the only purpose of this class was verify if device ID
was in range or not which could be done easily by using g_atl_machine.
Still getting rid of g_atl_machine is pending which would be done in
a later patch.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D103443
Daniil Seredkin [Tue, 1 Jun 2021 12:31:23 +0000 (08:31 -0400)]
[InstCombine] Relax constraints of uses for exp(X) * exp(Y) -> exp(X + Y)
InstCombine didn't perform the transformations when fmul's operands were
the same instruction because it required to have one use for each of them
which is false in the case. This patch fixes this + adds tests for them
and introduces a new function isOnlyUserOfAnyOperand to check these cases
in a single place.
This patch is a result of discussion in D102574.
Differential Revision: https://reviews.llvm.org/D102698
Evgeny Leviant [Tue, 1 Jun 2021 12:26:51 +0000 (15:26 +0300)]
[compiler-rt] Fix compilation when multiple architectures can be targeted
When toolchain can supports all of arm, armhf and armv6m architectures compiler-rt
libraries won't compile because architecture specific flags are appended to single
BUILTIN_CFLAGS variable.
Differential revision: https://reviews.llvm.org/D103363
Florian Hahn [Tue, 1 Jun 2021 11:20:46 +0000 (12:20 +0100)]
[LoopDeletion] Consider infinite loops alive, unless mustprogress.
The current loop or any of its sub-loops may be infinite. Unless the
function or the loops are marked as mustprogress, this in itself makes
the loop *not* dead.
This patch moves the logic to check whether the current loop is finite
or mustprogress to `isLoopDead` and also extends it to check the
sub-loops. This should fix PR50511.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D103382
Sanjay Patel [Tue, 1 Jun 2021 11:51:58 +0000 (07:51 -0400)]
[SDAG] add helper function for sext-of-setcc folds; NFC
Try to make this easier to read as noted in D103280
Tres Popp [Tue, 1 Jun 2021 10:17:33 +0000 (12:17 +0200)]
[mlir] Use interfaces in MathToLibm
Previously, this assumed use of ModuleOp and FuncOp. There is no need to
restrict this, and using interfaces allows these patterns to be used
during dialect conversion to LLVM.
Some assertions were removed due to inconsistent implementation of
FunctionLikeOps.
Differential Revision: https://reviews.llvm.org/D103447
Tobias Gysi [Tue, 1 Jun 2021 10:55:08 +0000 (10:55 +0000)]
[mlir][linalg] Fix signed/unsigned comparison warnings (NFC).
Fix signedness warnings in Utils.cpp and LinalgInterfaces.cpp.
Florian Hahn [Tue, 1 Jun 2021 09:20:42 +0000 (10:20 +0100)]
[VectorCombine] Freeze index unless it is known to be non-poison.
If the index itself is already poison, the poison propagates through
instructions clamping the index to a valid range. This still causes
introducing a load of poison, as flagged by Alive2 and pointed out
at
575e2aff5574.
This patch updates the code to freeze the index, unless it is proven to
not be poison.
Reviewed By: nlopes
Differential Revision: https://reviews.llvm.org/D103378
Fraser Cormack [Thu, 13 May 2021 16:34:41 +0000 (17:34 +0100)]
[RISCV] Support vector types in combination with fastcc
This patch extends the RISC-V lowering of the 'fastcc' calling
convention to vector types, both fixed-length and scalable. Without this
patch, any function passing or returning vector types by value would
throw a compiler error.
Vectors are handled in 'fastcc' much as they are in the default calling
convention, the noticeable difference being the extended set of scalar
GPR registers that can be used to pass vectors indirectly.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D102505
Andy Wingo [Wed, 21 Apr 2021 13:41:48 +0000 (15:41 +0200)]
[WebAssembly][CodeGen] IR support for WebAssembly local variables
This patch adds TargetStackID::WasmLocal. This stack holds locations of
values that are only addressable by name -- not via a pointer to memory.
For the WebAssembly target, these objects are lowered to WebAssembly
local variables, which are managed by the WebAssembly run-time and are
not addressable by linear memory.
For the WebAssembly target IR indicates that an AllocaInst should be put
on TargetStackID::WasmLocal by putting it in the non-integral address
space WASM_ADDRESS_SPACE_WASM_VAR, with value 1. SROA will mostly lift
these allocations to SSA locals, but any alloca that reaches instruction
selection (usually in non-optimized builds) will be assigned the new
TargetStackID there. Loads and stores to those values are transformed
to new WebAssemblyISD::LOCAL_GET / WebAssemblyISD::LOCAL_SET nodes,
which then lower to the type-specific LOCAL_GET_I32 etc instructions via
tablegen patterns.
Differential Revision: https://reviews.llvm.org/D101140
Florian Hahn [Sun, 30 May 2021 11:45:55 +0000 (12:45 +0100)]
[VectorCombine] Add tests with multiple noundef indices for scalarization.
Douglas Yung [Tue, 1 Jun 2021 09:01:01 +0000 (02:01 -0700)]
Mark test as requiring asserts.
Tobias Gysi [Tue, 1 Jun 2021 08:43:43 +0000 (08:43 +0000)]
[mlir][linalg] Cleanup LinalgOp usage in dependence analysis (NFC).
Replace the uses of deprecated Structured Op Interface methods in DependenceAnalysis.cpp and DependenceAnalysis.h. This patch is based on https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D103411
Tobias Gysi [Tue, 1 Jun 2021 08:20:58 +0000 (08:20 +0000)]
[mlir][linalg] Cleanup LinalgOp usage in fusion (NFC).
Replace the uses of deprecated Structured Op Interface methods in Fusion.cpp. This patch is based on https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D103437
Tobias Gysi [Tue, 1 Jun 2021 08:10:59 +0000 (08:10 +0000)]
[mlir][linalg] Cleanup LinalgOp usage in tiling (NFC).
Replace the uses of deprecated Structured Op Interface methods in Tiling.cpp and Utils.cpp. This patch is based on https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D103438
Yang Fan [Tue, 1 Jun 2021 08:15:09 +0000 (16:15 +0800)]
[clangd] Fix -Wunused-variable warning (NFC)
GCC warning:
```
/llvm-project/clang-tools-extra/clangd/InlayHints.cpp: In member function ‘bool clang::clangd::InlayHintVisitor::VisitVarDecl(clang::VarDecl*)’:
/llvm-project/clang-tools-extra/clangd/InlayHints.cpp:81:15: warning: unused variable ‘AT’ [-Wunused-variable]
81 | if (auto *AT = D->getType()->getContainedAutoType()) {
| ^~
```
Tobias Gysi [Tue, 1 Jun 2021 07:48:03 +0000 (07:48 +0000)]
[mlir][linalg] Cleanup LinalgOp usage in vectorization (NFC).
Replace the uses of deprecated Structured Op Interface methods in Vectorization.cpp. This patch is based on https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D103410
Roman Lebedev [Tue, 1 Jun 2021 07:46:05 +0000 (10:46 +0300)]
[X86] AMD Zen 3 has fast variable per-lane shuffles
... but lane-crossing shuffles are slow.
Roman Lebedev [Tue, 1 Jun 2021 07:39:36 +0000 (10:39 +0300)]
[X86] Split FeatureFastVariableShuffle tuning into Lane-Crossing and Per-Lane variants
Currently, X86 backend only has a global one-size-fits-all `FeatureFastVariableShuffle` feature,
which controls profitability of both the cross-lane and per-lane variable shuffles.
I guess, this has been fine so far.
But at least on AMD Zen 3, while per-line variable shuffles (e.g. `VPSHUFB`)
are as fast as as shuffles with fixed/immediate mask,
while lane-crossing shuffles, e.g. `VPERMPS` is performing worse.
So to get the benefits of variable-mask shuffles, but not the drawbacks of lane-crossing shuffles,
as suggested by @RKSimon, split the feature flag into two.
Differential Revision: https://reviews.llvm.org/D103274
Martin Storsjö [Fri, 28 May 2021 09:57:21 +0000 (09:57 +0000)]
[libcxx] [test] Fix the _supportsVerify check on Windows by fixing quoting
The pipes.quote function quotes using single quotes, the same goes
for the newer shlex.quote (which is the preferred form in Python 3).
This isn't suitable for quoting in command lines on Windows (and the
documentation for shlex.quote even says it's only usable for Unix
shells).
In general, the python subprocess.list2cmdline function should do
proper quoting for the platform's current shell. However, it doesn't
quote the ';' char, which we pass within some arguments to run.py.
Therefore use the custom reimplementation from lit.TestRunner which
is amended to quote ';' too.
The fact that arguemnts were quoted with single quotes didn't matter
for command lines that were executed by either bash or the lit internal
shell, but if executing things directly using subprocess.call, as in
_supportsVerify, the quoted path to %{cxx} fails to be resolved by the
Windows shell.
This unlocks 114 tests that previously were skipped on Windows.
Differential Revision: https://reviews.llvm.org/D103310
Nathan Ridge [Sun, 9 May 2021 06:59:57 +0000 (02:59 -0400)]
[clangd] Type hints for variables with 'auto' type
Differential Revision: https://reviews.llvm.org/D102148
Serge Pavlov [Tue, 1 Jun 2021 05:30:17 +0000 (12:30 +0700)]
[PowerPC] Split tests for constrained intrinsics
The test CodeGen/PowerPC/vector-constrained-fp-intrinsics.ll checks code
generation for constrained floating point intrinsics. Many test cases in
it were implemented using operations on constants. Constant folding of
constrained intrinsics would make these test cases almost useless,
because they would check only constant loading.
To keep the tests useful, operations on constants were replaced with
operations on function parameters.
Differential Revision: https://reviews.llvm.org/D103259
Max Kazantsev [Tue, 1 Jun 2021 04:11:15 +0000 (11:11 +0700)]
[Test] Add one more loop deletion irreducible CFG test
Lewuathe [Tue, 1 Jun 2021 03:47:42 +0000 (03:47 +0000)]
Fix invalid math formulas in quantization doc
A single backslash is not properly escaped in the web documentation. We can make sure to escape for rendering subscripts.
Additionally, it also fixed the mal-formed equations in //"Affine to fixed point"// and //"Fixed point to affine"// sections. With this fix, the page is rendered as follows.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D101252
Nathan Chancellor [Tue, 1 Jun 2021 03:11:46 +0000 (20:11 -0700)]
Revert "[InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210)"
This reverts commit
4f2fd3818b0eb26806f366bc37369349aeedcaf9.
The Linux kernel fails to build after this commit. See
https://reviews.llvm.org/D99481 for a reproducer.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Arthur Eubanks [Mon, 31 May 2021 23:11:03 +0000 (16:11 -0700)]
[OpaquePtr] Remove some uses of PointerType::getElementType()
Albion Fung [Mon, 31 May 2021 20:58:05 +0000 (15:58 -0500)]
[PowerPC] Improve f32 to i32 bitcast code gen
The code gen for f32 to i32 bitcast is not currently the most efficient;
this patch removes some unneccessary instructions gerneated.
Differential revision: https://reviews.llvm.org/D100782
Bjorn Pettersson [Mon, 31 May 2021 20:35:09 +0000 (22:35 +0200)]
[HIP] Relax checks in hip-include-path.hip test case again
The tightened checks from commit
722c39fef5ab6 did not work
fully for buildbots using symlinks in repo paths. This patch
is not fully reverting
722c39fef5ab6, as we still match that
there is a "/lib" somewhere in the path before "/clang/".
So this is once again a bit fragile in case someone would put
their repo in a base directory, for example, named
"/scratch/lib/foo/clang/llvm-project/". But it is atleast a
bit better than the original checks (avoiding the problem that
commit
722c39fef5ab6 was solving).
Congzhe Cao [Mon, 31 May 2021 20:11:04 +0000 (16:11 -0400)]
[LoopInterhcange] Handle movement of reduction phis appropriately
This patch fixes pr43326 and pr48212.
Currently when we move reduction phis to the right place,
loop interchange assumes the first phi in loop headers is
an induction phi, skips the first phi and assumes the rest
of phis are candidate reduction phis to move. However, it
may not always be the case.
This patch loops over all phis in loop headers and considers
a phi node as a candidate reduction phi to move only when it
is indeed a reduction phi across outer and inner loop.
Reviewed By: Whitney
Differential Revision: https://reviews.llvm.org/D102743
Florian Hahn [Mon, 31 May 2021 19:23:43 +0000 (20:23 +0100)]
[LoopDeletion] Add additional test cases with more nested loops.
Also remove mustprogress function attribute from one of the tests
Extends test coverage for D103382.
Martin Storsjö [Mon, 31 May 2021 08:35:01 +0000 (08:35 +0000)]
[libcxx] [test] Fix the include_as_c.sh.cpp test in MSVC configurations
Avoid including a header that is known not to work with clang in MSVC
mode when compiling as C.
(Alternatively, this could be something like "XFAIL: clang && msvc",
but I think it's more useful to actually check the rest of the test
instead of expecting the whole test to fail.)
Differential Revision: https://reviews.llvm.org/D103400
Martin Storsjö [Mon, 31 May 2021 10:01:59 +0000 (10:01 +0000)]
[libcxx] [test] Remove an incorrect TEST_HAS_ALIGNED_ALLOC define from test_macros.h
This was added inconsistently in
19fd9039ca242f408493b5c662f9d908eab8555e; Windows doesn't have the
aligned_alloc function (neither MSVC nor MinGW toolchains) and we don't
define _LIBCPP_HAS_ALIGNED_ALLOC while building libcxx.
Differential Revision: https://reviews.llvm.org/D103399
Martin Storsjö [Mon, 31 May 2021 09:32:51 +0000 (09:32 +0000)]
[libcxx] Define LIBCPP_HAS_TIMESPEC_GET for MSVC configurations
This define was out of sync with the corresponding define in tests, it
was added inconsistently in
171c77b7dad4a050aca23ff7ca1b75f87560fefb.
Modern MSVC environments do have these typedefs and functions.
Differential Revision: https://reviews.llvm.org/D103398
Martin Storsjö [Fri, 28 May 2021 09:55:44 +0000 (09:55 +0000)]
[libcxx] [test] Don't look for the literal spelling __mbstate_t in warnings
While the code uses the type name `std::mbstate_t`, the warning message
mentions the original underlying type, which is a C library internal
type name.
On Windows this type is called `_Mbstatet` instead of `__mbstate_t`. Use
expect-warning-re to avoid spelling out the literal name of the type.
Due to issues with the detection of the clang-verify feature, these
tests have been skipped in the Windows CI configuration so far.
Differential Revision: https://reviews.llvm.org/D103309
Florian Hahn [Mon, 31 May 2021 11:06:28 +0000 (12:06 +0100)]
[LV] Try to sink users recursively for first-order recurrences.
Update isFirstOrderRecurrence to explore all uses of a recurrence phi
and check if we can sink them. If there are multiple users to sink, they
are all mapped to the previous instruction.
Fixes PR44286 (and another PR or two).
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D84951
Andi Drebes [Mon, 31 May 2021 17:14:48 +0000 (22:44 +0530)]
[MLIR] Add dialect prefix to all operations from Math
Prefix all operations from the ODS of the `Math` dialect with `Math_`
in order to avoid name clashes when including `MathOps.td` in other
TableGen files (e.g., for `FloatUnaryOp`, which also exists in
`Standard`).
Reviewed By: jpienaar, mehdi_amini
Differential Revision: https://reviews.llvm.org/D103248
Qiu Chaofan [Mon, 31 May 2021 17:15:49 +0000 (01:15 +0800)]
[PowerPC] Fix x86 vector intrinsics wrapper compilation under C++
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D103386
Nico Weber [Mon, 31 May 2021 17:17:10 +0000 (13:17 -0400)]
[gn build] make libunwind build on macOS
Christopher Di Bella [Fri, 28 May 2021 17:53:54 +0000 (17:53 +0000)]
[libcxx][nfc] moves std `advance`, `next`, and `prev` into their headers
Differential Revision: https://reviews.llvm.org/D103329
Andi Drebes [Mon, 31 May 2021 15:53:32 +0000 (21:23 +0530)]
[MLIR] Specify namespace for standard dialect using cppNamespace field
The `::mlir` namespace for operations from standard is currently
defined by enclosing the header file generated from the ODS in
`Ops.td` in a namespace in `Ops.h`. However, when referencing
operations from `Ops.td` in other TableGen files, this causes the
generated C++ code to refer to classes from the global namespace
instead of `::mlir`.
By defining the namespace through the `cppNamespace` field for
`StandardOps_Dialect` directly in `Ops.td` instead, the ODS
becomes reusable in other TableGen files through simple
inclusion.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D103234
Arthur Eubanks [Thu, 27 May 2021 03:32:04 +0000 (20:32 -0700)]
[OpaquePtr] Clean up some uses of Type::getPointerElementType()
These depend on pointee types.
Abbas Sabra [Mon, 31 May 2021 08:38:17 +0000 (10:38 +0200)]
Re-commit [clang] Add support for the "abstract" contextual keyword of MSVC
https://docs.microsoft.com/en-us/cpp/extensions/abstract-cpp-component-extensions?view=msvc-160
Note: like the already supported "sealed" keyword, the "abstract"
keyword is supported by MSVC by default.
This re-commits
818338add77411f5e9713247ea66142f332ef350 with added
initialization of Parser::Ident_abstract.
Differential revision: https://reviews.llvm.org/D102517
Harald van Dijk [Mon, 31 May 2021 16:36:57 +0000 (12:36 -0400)]
[libc++] [test] Fix a few tests for 32-bit x86
Fixes bug https://llvm.org/PR48939.
Differential Revision: https://reviews.llvm.org/D102359
Arthur Eubanks [Mon, 31 May 2021 16:00:33 +0000 (09:00 -0700)]
[test] Properly match parameter/argument ABI attributes
These were found with D103412.
Andrea Di Biagio [Mon, 31 May 2021 15:39:35 +0000 (16:39 +0100)]
[MCA][NFCI] Minor changes to InstrBuilder and Instruction.
This is based on the assumption that most simulated instructions don't define
more than one or two registers. This is true for example on x86, where
most instruction definitions don't declare more than one register write.
The default code region size has been increased from 8 to 16. This is based on
the assumption that, for small microbenchmarks, the typical code snippet size is
often less than 16 instructions.
mca::Instruction now uses bitfields to pack flags.
No functional change intended.
Arthur Eubanks [Mon, 31 May 2021 16:02:07 +0000 (09:02 -0700)]
[test] Fix addr-label.ll after D99707
Needs REQUIRES.
Louis Dionne [Thu, 27 May 2021 16:56:12 +0000 (12:56 -0400)]
[libc++] Update all the pre-defined iterator types for C++20
Make sure we provide the correct It::difference_type member and update
the tests and synopses to be accurate.
Supersedes D102657 and D103101 (thanks to the original authors).
Differential Revision: https://reviews.llvm.org/D103273
Arthur Eubanks [Thu, 1 Apr 2021 06:12:36 +0000 (23:12 -0700)]
Remove "Rewrite Symbols" from codegen pipeline
It breaks up the function pass manager in the codegen pipeline.
With empty parameters, it looks at the -mllvm flag -rewrite-map-file.
This is likely not in use.
Add a check that we only have one function pass manager in the codegen
pipeline.
Some tests relied on the fact that we had a module pass somewhere in the
codegen pipeline.
addr-label.ll crashes on ARM due to this change. This is because a
ARMConstantPoolConstant containing a BasicBlock to represent a
blockaddress may hold an invalid pointer to a BasicBlock if the
blockaddress is invalidated by its BasicBlock getting removed. In that
case all referencing blockaddresses are RAUW a constant int. Making
ARMConstantPoolConstant::CVal a WeakVH fixes the crash, but I'm not sure
that's the right fix. As a workaround, create a barrier right before
ISel so that IR optimizations can't happen while a
ARMConstantPoolConstant has been created.
Reviewed By: rnk, MaskRay, compnerd
Differential Revision: https://reviews.llvm.org/D99707
Arthur O'Dwyer [Sat, 29 May 2021 17:09:07 +0000 (13:09 -0400)]
[libc++] Avoid `result_type` and `unary/binary_function` in <valarray>.
Give each of the relevant functional operators a `__result_type`
instead, so that we can keep using those typedefs in <valarray>
even when the public binder typedefs are removed in C++20.
Differential Revision: https://reviews.llvm.org/D103371
Anirudh Prasad [Mon, 31 May 2021 15:26:26 +0000 (11:26 -0400)]
[AsmParser][SystemZ][z/OS] Introducing HLASM Parser support to AsmParser - Part 2
- This patch is the second (and hopefully final) part of providing HLASM syntax for inline asm statements for z/OS to LLVM (continuing on from https://reviews.llvm.org/D98276)
- This second part deals with providing label support
- As mentioned in https://reviews.llvm.org/D98276, if the first token is not a space we process the first token as a label, and the remaining tokens as a possible machine instruction
- To achieve this, a new `parseAsHLASMLabel` function is introduced. This function processes the first token, validates whether it is an "acceptable" label according to HLASM standards, and then emits it
- After handling and emitting the label, call the `parseAsMachineInstruction` instruction to process the remaining tokens as a machine instruction.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D103320
Daniil Fukalov [Wed, 12 May 2021 19:43:16 +0000 (22:43 +0300)]
[NFC] MemoryDependenceAnalysis cleanup.
1. Removed redundant includes,
2. Removed never defined and used `releaseMemory()`.
3. Fixed member functions names first letter case.
4. Renamed duplicate (in nested struct `NonLocalPointerInfo`) name
`NonLocalDeps` to `NonLocalDepsMap`.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D102358
Tobias Gysi [Mon, 31 May 2021 13:30:56 +0000 (13:30 +0000)]
[mlir][linalg] Cleanup LinalgOp usage in verification (NFC).
Replace the uses of deprecated Structured Op Interface methods in LinalgInterfaces.cpp. This patch is based on https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D103404
Mikhail Goncharov [Mon, 31 May 2021 13:33:15 +0000 (15:33 +0200)]
Revert "[clang] Add support for the "abstract" contextual keyword of MSVC"
This reverts commit
818338add77411f5e9713247ea66142f332ef350.
Tests fail under sanitizer: https://lab.llvm.org/buildbot/#/builders/5/builds/8150
Tobias Gysi [Mon, 31 May 2021 12:46:32 +0000 (12:46 +0000)]
[mlir][linalg] Update Structured Op Interface (NFC).
Adding methods to access operand properties via OpOperands and mark outdated methods as deprecated.
Differential Revision: https://reviews.llvm.org/D103394
Sanjay Patel [Mon, 31 May 2021 12:53:09 +0000 (08:53 -0400)]
[SDAG] add check to sext-of-setcc fold to bypass changing a legal op
I accidentaly pushed a draft of D103280 that was discussed
during the review, but it was not supposed to be the final
version.
Rather than revert and recommit, I'm updating the existing
code. This way we have a record of the codegen diff that
would result if we decide to remove this predicate in the
future.
Nico Weber [Mon, 31 May 2021 12:53:07 +0000 (08:53 -0400)]
[libunwind] fix -Wc++98-compat-extra-semi without _LIBUNWIND_HIDE_SYMBOLS
Frederik Gossen [Mon, 31 May 2021 11:51:20 +0000 (13:51 +0200)]
[MLIR][Shape] Remove duplicate operands of `shape.assuming_all` op
Differential Revision: https://reviews.llvm.org/D103403
Roman Lebedev [Mon, 31 May 2021 11:38:26 +0000 (14:38 +0300)]
[NFC] ScalarEvolution: apply SSO to the ExprValueMap value
ExprValueMap is a map from SCEV * to a set-vector of (Value *, ConstantInt *) pair,
and while the map itself will likely be big-ish (have many keys),
it is a reasonable assumption that each key will refer to a small-ish
number of pairs.
In particular looking at n=512 case from
https://bugs.llvm.org/show_bug.cgi?id=50384,
the small-size of 4 appears to be the sweet spot,
it results in the least allocations while minimizing memory footprint.
```
$ for i in $(ls heaptrack.opt.*.gz); do echo $i; heaptrack_print $i | tail -n 6; echo ""; done
heaptrack.opt.0-orig.gz
total runtime: 14.32s.
calls to allocation functions: 8222442 (574192/s)
temporary memory allocations: 2419000 (168924/s)
peak heap memory consumption: 190.98MB
peak RSS (including heaptrack overhead): 239.65MB
total memory leaked: 67.58KB
heaptrack.opt.1-n1.gz
total runtime: 13.72s.
calls to allocation functions: 7184188 (523705/s)
temporary memory allocations: 2419017 (176338/s)
peak heap memory consumption: 191.38MB
peak RSS (including heaptrack overhead): 239.64MB
total memory leaked: 67.58KB
heaptrack.opt.2-n2.gz
total runtime: 12.24s.
calls to allocation functions: 6146827 (502355/s)
temporary memory allocations: 2418997 (197695/s)
peak heap memory consumption: 163.31MB
peak RSS (including heaptrack overhead): 211.01MB
total memory leaked: 67.58KB
heaptrack.opt.3-n4.gz
total runtime: 12.28s.
calls to allocation functions: 6068532 (494260/s)
temporary memory allocations: 2418985 (197017/s)
peak heap memory consumption: 155.43MB
peak RSS (including heaptrack overhead): 201.77MB
total memory leaked: 67.58KB
heaptrack.opt.4-n8.gz
total runtime: 12.06s.
calls to allocation functions: 6068042 (503321/s)
temporary memory allocations: 2418992 (200646/s)
peak heap memory consumption: 166.03MB
peak RSS (including heaptrack overhead): 213.55MB
total memory leaked: 67.58KB
heaptrack.opt.5-n16.gz
total runtime: 12.14s.
calls to allocation functions: 6067993 (499958/s)
temporary memory allocations: 2418999 (199307/s)
peak heap memory consumption: 187.24MB
peak RSS (including heaptrack overhead): 233.69MB
total memory leaked: 67.58KB
```
While that test may be an edge worst-case scenario,
https://llvm-compile-time-tracker.com/compare.php?from=
dee85d47d9f15fc268f7b18f279dac2774836615&to=
98a57e31b1947d5bcdf4a5605ac2ab32b4bd5f63&stat=instructions
agrees that this also results in improvements in the usual situations.
Uday Bondhugula [Mon, 31 May 2021 12:27:22 +0000 (17:57 +0530)]
[MLIR] Fix warnings in AffineOps.cpp
Fix warnings in AffineOps.cpp.
Differential Revision: https://reviews.llvm.org/D103374
Pushpinder Singh [Mon, 31 May 2021 07:19:41 +0000 (07:19 +0000)]
[AMDGPU][Libomptarget][NFC] Split host and device malloc
This patch splits the code path for host and device malloc.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D103389
Alexey Lapshin [Thu, 27 May 2021 11:07:35 +0000 (14:07 +0300)]
[llvm-objcopy][NFC] Refactor CopyConfig structure - remove lazy options processing.
During reviewing D102277 it was decided to remove lazy options processing
from llvm-objcopy CopyConfig structure. This patch transforms processing of ELF
lazy options into the in-place processing.
Differential Revision: https://reviews.llvm.org/D103260
Mikhail Goncharov [Mon, 31 May 2021 11:29:33 +0000 (13:29 +0200)]
fix test for symlinked clang
c1ee4fb5af49a
Sanjay Patel [Mon, 31 May 2021 11:14:01 +0000 (07:14 -0400)]
[SDAG] try harder to fold casts into vector compare
sext (vsetcc X, Y) --> vsetcc (zext X), (zext Y) --
(when the zexts are free and a bunch of other conditions)
We have a couple of similar folds to this already for vector selects,
but this pattern slips through because it is only a setcc.
The tests are based on the motivating case from:
https://llvm.org/PR50055
...but we need extra logic to get that example, so I've left that as
a TODO for now.
Differential Revision: https://reviews.llvm.org/D103280
Juneyoung Lee [Mon, 31 May 2021 10:25:06 +0000 (19:25 +0900)]
fix broken clang tests after
7161bb87c914
Djordje Todorovic [Fri, 21 May 2021 12:29:23 +0000 (05:29 -0700)]
[LiveDebugVariables] Stop trimming locations of non-inlined vars
The D35953, D62650 and D73691 introduced trimming of variables locations
in LiveDebugVariables pass, since there are some cases where after
the virtregrewrite we have exploded number of DBG_VALUEs created for some
inlined variables. As it looks, all problematic cases were regarding
inlined variables, so it seems reasonable to stop trimming the location
ranges for non-inlined variables.
It has very good impact on the llvm-locstats report.
Differential Revision: https://reviews.llvm.org/D102917
Fraser Cormack [Thu, 27 May 2021 15:47:36 +0000 (16:47 +0100)]
[RISCV] Scale scalably-typed split argument offsets by VSCALE
This patch fixes a bug in lowering scalable-vector types in RISC-V's
main calling convention. When scalable-vector types are split and passed
indirectly, the target is responsible for scaling the offset --
initially set to the known-minimum store size -- by the scalable factor.
Before this we were issuing overlapping loads or stores to the different
parts, leading to incorrect codegen.
Credit to @HsiangKai for spotting this.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D103262
Juneyoung Lee [Mon, 31 May 2021 09:40:40 +0000 (18:40 +0900)]
[InsCombine] Fix a few remaining vec transforms to use poison instead of undef
This is a patch that replaces shufflevector and insertelement's placeholder value with poison.
Underlying motivation is to fix the semantics of shufflevector with undef mask to return poison instead
(D93818)
The consensus has been made in the late 2020 via mailing list as well as the thread in https://bugs.llvm.org/show_bug.cgi?id=44185 .
This patch is a simple syntactic change to the existing code, hence directly pushed as a commit.
David Green [Mon, 31 May 2021 09:22:37 +0000 (10:22 +0100)]
[DSE] Remove stores in the same loop iteration
DSE will currently only remove stores in the same block unless they can
be guaranteed to be loop invariant. This expands that to any stores that
are in the same Loop, at the same loop level. This should still account
for where AA/MSSA will not handle aliasing between loops, but allow the
dead stores to be removed where they overlap in the same loop iteration.
It requires adding loop info to DSE, but that looks fairly harmless.
The test case this helps is from code like this, which can come up in
certain matrix operations:
for(i=..)
dst[i] = 0;
for(j=..)
dst[i] += src[i*n+j];
After LICM, this becomes:
for(i=..)
dst[i] = 0;
sum = 0;
for(j=..)
sum += src[i*n+j];
dst[i] = sum;
The first store is dead, and with this patch is now removed.
Differntial Revision: https://reviews.llvm.org/D100464