Cheng Wang [Thu, 29 Oct 2020 11:10:44 +0000 (19:10 +0800)]
[libc] Fix typo in buildbot README.txt.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D90381
Jay Foad [Thu, 26 Nov 2020 16:48:14 +0000 (16:48 +0000)]
[LegacyPM] Avoid a redundant map lookup in setLastUser. NFC.
As a bonus this makes it (IMO) obvious that the iterator is not
invalidated, so remove the comment explaining that.
Jay Foad [Fri, 27 Nov 2020 10:03:05 +0000 (10:03 +0000)]
[LegacyPM] Remove unused undocumented parameter. NFC.
The Direction parameter to AnalysisResolver::getAnalysisIfAvailable has
never been documented or used for anything.
Raphael Isemann [Thu, 26 Nov 2020 17:02:25 +0000 (18:02 +0100)]
[ASTImporter] Import the default argument of NonTypeTemplateParmDecl
The test case isn't using the AST matchers for all checks as there doesn't seem to be support for
matching NonTypeTemplateParmDecl default arguments. Otherwise this is simply importing the
default arguments.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D92106
Richard Sandiford [Thu, 5 Mar 2020 19:23:35 +0000 (19:23 +0000)]
[SVE] Add a couple of extra sizeless type tests
This patch adds tests for things that happened to be fixed by previous
patches, but that should continue working if we do decide to treat
sizeless types as incomplete types.
Differential Revision: https://reviews.llvm.org/D79584
Cullen Rhodes [Tue, 24 Nov 2020 18:07:13 +0000 (18:07 +0000)]
[InstSimplify] Clarify use of FixedVectorType in SimplifySelectInst
Folding a select of vector constants that include undef elements only
applies to fixed vectors, but there's no earlier check the type is not
scalable so it crashes for scalable vectors. This adds a check so this
optimization is only attempted for fixed vectors.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D92046
Roman Lebedev [Fri, 27 Nov 2020 07:21:33 +0000 (10:21 +0300)]
Reland [SimplifyCFG] FoldBranchToCommonDest: lift use-restriction on bonus instructions
This was orginally committed in
2245fb8aaa1c1f85f53f7b19a1ee3ac69b1a1dfe.
but was immediately reverted in
f3abd54958ab90ba7c100d3fa936a3ce0dd2ad04
because of a PHI handling issue.
Original commit message:
1. It doesn't make sense to enforce that the bonus instruction
is only used once in it's basic block. What matters is
whether those user instructions fit within our budget, sure,
but that is another question.
2. It doesn't make sense to enforce that said bonus instructions
are only used within their basic block. Perhaps the branch
condition isn't using the value computed by said bonus instruction,
and said bonus instruction is simply being calculated
to be used in successors?
So iff we can clone bonus instructions, to lift these restrictions,
we just need to carefully update their external uses
to use the new cloned instructions.
Notably, this transform (even without this change) appears to be
poison-unsafe as per alive2, but is otherwise (including the patch) legal.
We don't introduce any new PHI nodes, but only "move" the instructions
around, i'm not really seeing much potential for extra cost modelling
for the transform, especially since now we allow at most one such
bonus instruction by default.
This causes the fold to fire +11.4% more (13216 -> 14725)
as of vanilla llvm test-suite + RawSpeed.
The motivational pattern is IEEE-754-2008 Binary16->Binary32
extension code:
https://github.com/darktable-org/rawspeed/blob/
ca57d77fb2ba81f21fc712cfac26e54f46406473/src/librawspeed/common/FloatingPoint.h#L115-L120
^ that should be a switch, but it is not now: https://godbolt.org/z/bvja5v
That being said, even thought this seemed like this would fix it: https://godbolt.org/z/xGq3TM
apparently that fold is happening somewhere else afterall,
so something else also has a similar 'artificial' restriction.
Roman Lebedev [Fri, 27 Nov 2020 08:47:41 +0000 (11:47 +0300)]
[NFC][SimplifyCFG] FoldBranchToCommonDest: add one more test with PHI
This is the problematic pattern i didn't think of,
that lead to revert of
2245fb8aaa1c1f85f53f7b19a1ee3ac69b1a1dfe
in
f3abd54958ab90ba7c100d3fa936a3ce0dd2ad04.
Frederik Gossen [Fri, 27 Nov 2020 09:06:29 +0000 (10:06 +0100)]
[MLIR][SCF] Find all innermost loops for parallel loop tiling
Overcome the assumption that parallel loops are only nested in other parallel
loops.
Differential Revision: https://reviews.llvm.org/D92188
Christian Sigg [Tue, 24 Nov 2020 21:07:34 +0000 (22:07 +0100)]
[mlir] Add gpu.allocate, gpu.deallocate ops with LLVM lowering to runtime function calls.
The ops are very similar to the std variants, but support async GPU execution.
gpu.alloc does not currently support an alignment attribute, and the new ops do not have
canonicalizers/folders like their std siblings do.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D91698
Wang, Pengfei [Fri, 27 Nov 2020 08:02:09 +0000 (16:02 +0800)]
[msan] Fix bugs when instrument x86.avx512*_cvt* intrinsics.
Scalar intrinsics x86.avx512*_cvt* have an extra rounding mode operand.
We can directly ignore it to reuse the SSE/AVX math.
This fix the bug https://bugs.llvm.org/show_bug.cgi?id=48298.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D92206
Nicolas Vasilache [Thu, 26 Nov 2020 15:58:34 +0000 (15:58 +0000)]
[mlir] Let ModuleTranslate propagate LLVM triple
This adds LLVM triple propagation and updates the test that did not check it properly.
Differential Revision: https://reviews.llvm.org/D92182
Cheng Wang [Fri, 27 Nov 2020 07:38:16 +0000 (15:38 +0800)]
[libc][Obvious] Fix typo in strnlen_test.cpp.
Markus Lavin [Fri, 27 Nov 2020 07:49:20 +0000 (08:49 +0100)]
Revert "[DebugInfo] Improve dbg preservation in LSR."
This reverts commit
06758c6a6135f59deec8e73d4fcb69946ab47f54.
Bug: https://bugs.llvm.org/show_bug.cgi?id=48166
Additional discussion in: https://reviews.llvm.org/D91711
Georgii Rymar [Wed, 25 Nov 2020 11:54:35 +0000 (14:54 +0300)]
[llvm-readelf/obj] - Stop calling `reportError` in `printArchSpecificInfo()`.
This is related to MIPS. Currently we might report an error and exit,
though there is no problem to report a warning and try to continue dumping
an object. The code uses `MipsGOTParser<ELFT> Parser`, which is isolated
in this method.
Differential revision: https://reviews.llvm.org/D92090
Craig Topper [Fri, 27 Nov 2020 06:31:13 +0000 (22:31 -0800)]
[RISCV] Don't remove (and X, 0xffffffff) from inputs when matching RISCVISD::DIVUW/REMUW to 64-bit DIVU/REMU.
These patterns are using zexti32 which matches either assertzexti32
or (and X, 0xffffffff). But if we match (and X, 0xffffffff) it will
remove the AND and the inputs may no longer have the zero bits
needed to guarantee the result has enough zeros.
This commit changes the patterns to only match assertzexti32.
I'm not sure how to test the broken case since the DIVUW/REMUW nodes
are created during type legalization, but type legalization won't
create an (and X, 0xfffffffff) directly on the inputs.
I've also changed the zexti32 on the root of the pattern to just
checking for AND. We were previously also matching assertzexti32,
but I doubt that pattern would ever occur.
Max Kazantsev [Fri, 27 Nov 2020 07:03:05 +0000 (14:03 +0700)]
[Test] Add some more tests showing how we fail to widen IV
Kazu Hirata [Fri, 27 Nov 2020 06:02:04 +0000 (22:02 -0800)]
[IR] Use llvm::is_contained and pred_size (NFC)
Max Kazantsev [Fri, 27 Nov 2020 04:19:54 +0000 (11:19 +0700)]
[IndVars] LCSSA Phi users should not prevent widening
When widening an IndVar that has LCSSA Phi users outside
the loop, we can safely widen it as usual and then truncate
the result outside the loop without hurting the performance.
Differential Revision: https://reviews.llvm.org/D91593
Reviewed By: skatkov
Kirill Bobyrev [Fri, 27 Nov 2020 02:59:24 +0000 (03:59 +0100)]
[clangd] Add support for within-file rename of complicated fields
This was originally a part of D71880 but is separated for simplicity and ease
of reviewing.
Fixes: https://github.com/clangd/clangd/issues/582
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D91952
QingShan Zhang [Fri, 27 Nov 2020 02:10:55 +0000 (02:10 +0000)]
[DAGCombine] Adding a hook to improve the precision of fsqrt if the input is denormal
For now, we will hardcode the result as 0.0 if the input is denormal or 0. That will
have the impact the precision. As the fsqrt added belong to the cold path of the
cmp+branch, it won't impact the performance for normal inputs for PowerPC, but improve
the precision if the input is denormal.
Reviewed By: Spatel
Differential Revision: https://reviews.llvm.org/D80974
Kazu Hirata [Fri, 27 Nov 2020 02:00:54 +0000 (18:00 -0800)]
[InlineCost] Fix indentation (NFC)
Juneyoung Lee [Thu, 26 Nov 2020 10:33:42 +0000 (19:33 +0900)]
[LangRef] Add poison constant
This patch adds a description about the newly added poison constant to LangRef.
Differential Revision: https://reviews.llvm.org/D92162
Craig Topper [Thu, 26 Nov 2020 23:08:54 +0000 (15:08 -0800)]
[RISCV] Add isel patterns to use SBSET for (1 << X) by using X0 as the input.
Sam McCall [Wed, 25 Nov 2020 16:18:00 +0000 (17:18 +0100)]
[clangd] Fix use of system-installed GRPC after
f726101b6240a6740b3c0926af759da5e7336f8a
We need a real target now, and it was only being created if grpc was
built from source or imported from homebrew.
Differential Revision: https://reviews.llvm.org/D92107
Nikita Popov [Sun, 22 Nov 2020 17:23:53 +0000 (18:23 +0100)]
[BasicAA] Fix BatchAA results for phi-phi assumptions
Add a flag that disables caching when computing aliasing results
potentially based on a phi-phi NoAlias assumption. We'll still
insert cache entries temporarily to catch infinite recursion,
but will drop them afterwards, so they won't persist in BatchAA.
Differential Revision: https://reviews.llvm.org/D91936
Arthur Eubanks [Thu, 26 Nov 2020 20:33:24 +0000 (12:33 -0800)]
[test] Fix runtime-pointer-checking-insert-typesize.ll under NPM
Also clean it up a bit.
Louis Dionne [Thu, 26 Nov 2020 20:14:02 +0000 (15:14 -0500)]
[libc++] Install missing package in the Dockerfile
python3-distutils is required to use `import distutils.spawn`, which is
required by the ABI list targets.
Roman Lebedev [Thu, 26 Nov 2020 20:11:26 +0000 (23:11 +0300)]
Revert "[SimplifyCFG] FoldBranchToCommonDest: lift use-restriction on bonus instructions"
Many bots are unhappy, at the very least missed a few codegen tests,
and possibly this has a logic hole inducing a miscompile
(will be really awesome to have ready reproducer..)
Need to investigate.
This reverts commit
2245fb8aaa1c1f85f53f7b19a1ee3ac69b1a1dfe.
Mariusz Ceier [Thu, 26 Nov 2020 20:03:22 +0000 (21:03 +0100)]
[llvmbuildectomy] Also include component groups in llvm-config --components list
Without this change mesa fails while looking for llvm components like amdgpu, engine or native:
Run-time dependency LLVM (modules: amdgpu(missing), bitreader, bitwriter, core, engine(missing), executionengine, instcombine, ipo, mcdisassembler, mcjit, native(missing), scalaropts, transformutils, coroutines)
Looking for a fallback subproject for the dependency llvm (modules: bitwriter, engine, mcdisassembler, mcjit, core, executionengine, scalaropts, transformutils, instcombine, amdgpu, native, bitreader, ipo)
This change adds component groups (like all-targets, engine, native, amdgpu) to the "all" component.
Differential Revision: https://reviews.llvm.org/D92158
Roman Lebedev [Thu, 26 Nov 2020 16:41:31 +0000 (19:41 +0300)]
[SimplifyCFG] FoldBranchToCommonDest: lift use-restriction on bonus instructions
1. It doesn't make sense to enforce that the bonus instruction
is only used once in it's basic block. What matters is
whether those user instructions fit within our budget, sure,
but that is another question.
2. It doesn't make sense to enforce that said bonus instructions
are only used within their basic block. Perhaps the branch
condition isn't using the value computed by said bonus instruction,
and said bonus instruction is simply being calculated
to be used in successors?
So iff we can clone bonus instructions, to lift these restrictions,
we just need to carefully update their external uses
to use the new cloned instructions.
Notably, this transform (even without this change) appears to be
poison-unsafe as per alive2, but is otherwise (including the patch) legal.
We don't introduce any new PHI nodes, but only "move" the instructions
around, i'm not really seeing much potential for extra cost modelling
for the transform, especially since now we allow at most one such
bonus instruction by default.
This causes the fold to fire +11.4% more (13216 -> 14725)
as of vanilla llvm test-suite + RawSpeed.
The motivational pattern is IEEE-754-2008 Binary16->Binary32
extension code:
https://github.com/darktable-org/rawspeed/blob/
ca57d77fb2ba81f21fc712cfac26e54f46406473/src/librawspeed/common/FloatingPoint.h#L115-L120
^ that should be a switch, but it is not now: https://godbolt.org/z/bvja5v
That being said, even thought this seemed like this would fix it: https://godbolt.org/z/xGq3TM
apparently that fold is happening somewhere else afterall,
so something else also has a similar 'artificial' restriction.
Roman Lebedev [Thu, 26 Nov 2020 12:21:56 +0000 (15:21 +0300)]
[NFC][SimplifyCFG] Add test coverage for FoldBranchToCommonDest xform with live-out bonus instuctions
The uses of the bonus instructions should not be preventing the transformation.
Roman Lebedev [Thu, 26 Nov 2020 11:58:28 +0000 (14:58 +0300)]
[NFC][SimplifyCFG] Add statistic to `FoldBranchToCommonDest()` fold
Louis Dionne [Thu, 26 Nov 2020 19:45:07 +0000 (14:45 -0500)]
[libc++] Remove ABI lists for previous releases
We don't actually update the ABI lists at every release -- it's too much
work, since we'd technically have to do it even for minor releases.
Furthermore, I don't think anybody uses those (I certainly don't rely
on them for anything).
Instead, it is better to rely on the ABI list changelog and the canonical
ABI list that we always keep up to date. If one wants to know what symbols
were shipped in a specific release, that can be discovered easily using
Git, which is a superior tool than keeping textual copies of old versions.
Louis Dionne [Thu, 26 Nov 2020 19:40:38 +0000 (14:40 -0500)]
[libc++] Fix the Homebrew tap to install Buildkite on macOS hosts
Adam Czachorowski [Thu, 26 Nov 2020 16:51:04 +0000 (17:51 +0100)]
[clangd] AddUsing: do not crash on non-namespace using decls.
Differential Revision: https://reviews.llvm.org/D92186
Simon Pilgrim [Thu, 26 Nov 2020 18:29:37 +0000 (18:29 +0000)]
[X86] Regenerate i64-to-float.ll tests with avx512 coverage
Rename prefix from X32 to X86 as we typically use X32 for gnux32 triples
Arthur Eubanks [Thu, 19 Nov 2020 17:37:40 +0000 (09:37 -0800)]
[BPF][NewPM] Port bpf-adjust-opt to NPM and add it to pipeline
Reviewed By: yonghong-song
Differential Revision: https://reviews.llvm.org/D91990
Nikita Popov [Tue, 17 Nov 2020 19:11:09 +0000 (20:11 +0100)]
[AA] Split up LocationSize::unknown()
Currently, we have some confusion in the codebase regarding the
meaning of LocationSize::unknown(): Some parts (including most of
BasicAA) assume that LocationSize::unknown() only allows accesses
after the base pointer. Some parts (various callers of AA) assume
that LocationSize::unknown() allows accesses both before and after
the base pointer (but within the underlying object).
This patch splits up LocationSize::unknown() into
LocationSize::afterPointer() and LocationSize::beforeOrAfterPointer()
to make this completely unambiguous. I tried my best to determine
which one is appropriate for all the existing uses.
The test changes in cs-cs.ll in particular illustrate a previously
clearly incorrect AA result: We were effectively assuming that
argmemonly functions were only allowed to access their arguments
after the passed pointer, but not before it. I'm pretty sure that
this was not intentional, and it's certainly not specified by
LangRef that way.
Differential Revision: https://reviews.llvm.org/D91649
Fangrui Song [Thu, 26 Nov 2020 17:13:08 +0000 (09:13 -0800)]
[MC] Set the unique id of .stack_sizes to the associated .text section's
Similar to D92113. Currently `clang -fstack-size-section -fno-unique-section-names`
sets the linked-to symbol to the first `.text`, which is:
* incorrect for COMDAT sections
* inferior for non-COMDAT sections in -ffunction-sections mode (poor --gc-sections: .stack_sizes cannot be separately discarded)
Note, if the section symbol can be referenced in more places (if the
function begin symbol does not apply), we probably should consider
defining a different BeginSymbol for sections with ",unique" linkage.
Reviewed By: grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D92151
Zarko Todorovski [Thu, 26 Nov 2020 16:15:00 +0000 (11:15 -0500)]
[AIX] Add support for non var_arg extended vector ABI calling convention on AIX
This patch enables passing non variadic vector type parameters on the caller and callee side and vector return on AIX that are passed in vector registers only.
So far, support is enabled for only the AIX extended Altivec ABI Calling convention.
Reviewed By: sfertile, DiggerLin
Differential Revision: https://reviews.llvm.org/D86476
Raphael Isemann [Thu, 26 Nov 2020 16:02:31 +0000 (17:02 +0100)]
[ASTImporter] Import the default argument of TemplateTypeParmDecl
The test case isn't using the AST matchers for all checks as there doesn't seem to be support for
matching TemplateTypeParmDecl default arguments. Otherwise this is simply importing the
default arguments.
Also updates several LLDB tests that now as intended omit the default template
arguments of several std templates.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D92103
Louis Dionne [Wed, 25 Nov 2020 21:42:42 +0000 (16:42 -0500)]
[libc++] Remove sysctl-based implementation of thread::hardware_concurrency()
Using sysctl requires including headers that are considered internal on
Linux, like <sys/sysctl.h> & friends. Instead, sysconf is defined by POSIX
(and we have a fallback for Windows), so all the systems we support should
be happy with just sysconf.
Differential Revision: https://reviews.llvm.org/D92135
Louis Dionne [Wed, 25 Nov 2020 21:17:23 +0000 (16:17 -0500)]
[libc++] Attempt to fix spurious modules-related failures in the CI
I'm not 100% sure what the issue actually is since I can't reproduce it
locally, however what I explain in the comment is my best attempt to
explain what's going on.
Differential Revision: https://reviews.llvm.org/D92131
Stephan Herhut [Thu, 26 Nov 2020 16:08:49 +0000 (17:08 +0100)]
[mlir][DialectConversion] Do not prematurely drop unused cast operations
The rewrite logic has an optimization to drop a cast operation after
rewriting block arguments if the cast operation has no users. This is
unsafe as there might be a pending rewrite that replaced the cast operation
itself and hence would trigger a second free.
Instead, do not remove the casts and leave it up to a later canonicalization
to do so.
Differential Revision: https://reviews.llvm.org/D92184
Alex Richardson [Thu, 26 Nov 2020 14:47:31 +0000 (14:47 +0000)]
[libc++] Fix two fr_FR locale tests on FreeBSD
FreeBSD's locale data uses the same U+2027 separator as Glibc 2.27 and newer.
Reviewed By: #libc, emaste, ldionne
Differential Revision: https://reviews.llvm.org/D91165
Simon Pilgrim [Thu, 26 Nov 2020 15:33:27 +0000 (15:33 +0000)]
[AArch64] Regenerate min/max tests and add vXi64 umin/umax test coverage
David Green [Thu, 26 Nov 2020 15:10:44 +0000 (15:10 +0000)]
[ARM] Cleanup for the MVETailPrediction pass
This strips out a lot of the code that should no longer be needed from
the MVETailPredictionPass, leaving the important part - find active lane
mask instructions and convert them to VCTP operations.
Differential Revision: https://reviews.llvm.org/D91866
Simon Pilgrim [Thu, 26 Nov 2020 15:07:45 +0000 (15:07 +0000)]
Revert rG12d59b696b330 "[DAG] Legalize umin(x,y) -> sub(x,usubsat(x,y)) and umax(x,y) -> add(x,usubsat(y,x)) iff usubsat is legal"
This reverts commit
12d59b696b33065e070d6ee7a55d2e8c019d138b.
Prematurely pushed this to trunk
Simon Pilgrim [Thu, 26 Nov 2020 14:47:06 +0000 (14:47 +0000)]
[DAG] Legalize umin(x,y) -> sub(x,usubsat(x,y)) and umax(x,y) -> add(x,usubsat(y,x)) iff usubsat is legal
If usubsat() is legal, this is likely to result in smaller codegen expansion than the default cmp+select codegen expansion.
Allows us to move the x86-specific lowering to the generic expansion code.
Benjamin Kramer [Thu, 26 Nov 2020 14:37:18 +0000 (15:37 +0100)]
Remove stray debug-only from test
Jan Svoboda [Tue, 24 Nov 2020 11:48:11 +0000 (12:48 +0100)]
[clang][cli] Port Target option flags to new option parsing system
Depends on D83697
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D83698
Robert Lougher [Wed, 25 Nov 2020 19:52:20 +0000 (19:52 +0000)]
[LiveDebugVariables] Strip all debug instructions from nodebug functions
A crash/assertion failure in the greedy register allocator was tracked
down to a debug instr being passed to LiveIntervals::getInstructionIndex.
Normally this should not occur as debug instructions are collected and
removed by LiveDebugVariables before RA, and reinserted afterwards.
However, when a function has no debug info, LiveDebugVariables simply
strips any debug values that are present as they're not needed (this
situation will occur when a function with debug info is inlined into a
nodebug function). The problem is, it only removes DBG_VALUE instructions,
leaving DBG_LABELs (the cause of the crash).
This patch updates the LiveDebugVariables nodebug path to remove all debug
instructions. The test case verifies that DBG_VALUE/DBG_LABEL instructions
are present, and that they are stripped.
When -experimental-debug-variable-locations is enabled, certain variable
locations are represented by DBG_INSTR_REF instead of DBG_VALUE. The test
case verifies that a DBG_INSTR_REF is emitted by the option, and that it
is also stripped.
Differential Revision: https://reviews.llvm.org/D92127
Raphael Isemann [Thu, 26 Nov 2020 12:38:49 +0000 (13:38 +0100)]
[ASTImporter] Import the default argument of TemplateTemplateParmDecl
Same idea as in D92103 and D92106, but I realised after creating those reviews that there are
also TemplateTemplateParmDecls that can have default arguments, so here's hopefully the
last patch for default template arguments.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D92119
Florian Hahn [Thu, 26 Nov 2020 13:50:24 +0000 (13:50 +0000)]
[VPlan] Turn VPReplicateRecipe into a VPValue.
Update VPReplicateRecipe to inherit from VPValue. This still does not
update scalarizeInstruction to set the result for the VPValue of
VPReplicateRecipe, because this first requires tracking scalar values in
VPTransformState.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D91500
Stephan Herhut [Thu, 26 Nov 2020 13:40:21 +0000 (14:40 +0100)]
[mlir][linalg] Mark linalg.yield as ReturnLike
This change is required so that bufferization can properly identify
the linalg.yield as a terminator with an associated parent op.
Differential Revision: https://reviews.llvm.org/D92173
David Stenberg [Thu, 26 Nov 2020 09:15:59 +0000 (10:15 +0100)]
[IndVarSimplify] Fix Modified status when handling dead PHI nodes
When bailing out in rewriteLoopExitValues() you could be left with PHI
nodes in the DeadInsts vector. Those would be not handled by the use of
RecursivelyDeleteTriviallyDeadInstructions() in IndVarSimplify. This
resulted in the IndVarSimplify pass returning an incorrect modified
status. This was caught by the expensive check introduced in D86589.
This patches changes IndVarSimplify so that it deletes those PHI nodes,
using RecursivelyDeleteDeadPHINode().
This fixes PR47486.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D91153
Sjoerd Meijer [Thu, 26 Nov 2020 13:03:37 +0000 (13:03 +0000)]
[AArch64][CostModel] Precommit some vector mul tests. NFC.
The cost-model is not getting the cost right for a mul with <2 x i64>
operands, i.e. we don't have a MUL.2d, and this is precommitting some
tests before adjusting this.
Kazushi (Jam) Marukawa [Mon, 23 Nov 2020 06:37:46 +0000 (15:37 +0900)]
[VE] Add comprehensive stackframe tests
Add comprehensive stackframe regression tests as a preparation of
VEFrameLowering.cpp optimizations.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D92170
Stephan Herhut [Thu, 26 Nov 2020 12:26:08 +0000 (13:26 +0100)]
[mlir][bufferize] Add argument materialization for bufferization
This enables partial bufferization that includes function signatures. To test this, this
change also makes the func-bufferize partial and adds a dedicated finalizing-bufferize pass.
Differential Revision: https://reviews.llvm.org/D92032
Aleksandr Platonov [Thu, 26 Nov 2020 11:58:22 +0000 (14:58 +0300)]
[clangd][query-driver] Extract target
In some cases system includes extractions is not enough, we also need target specific defines.
The problems appears when clang default target is not the same as toolchain's one (GCC cross-compiler, MinGW on Windows).
After this patch `query-driver` also extracts target and adds `--target=<extracted target>` compile option.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D92012
Simon Pilgrim [Thu, 26 Nov 2020 12:01:26 +0000 (12:01 +0000)]
[X86] Extend neg-abs test coverage
Add 32-bit tests and test i8/i16/i32/i64/i128 like we do for abs.ll
Florian Hahn [Wed, 25 Nov 2020 17:27:11 +0000 (17:27 +0000)]
[CostModel] Add basic implementation of getGatherScatterOpCost.
Add a basic implementation of getGatherScatterOpCost to BasicTTIImpl.
The implementation estimates the cost of scalarizing the loads/stores,
the cost of packing/extracting the individual lanes and the cost of
only selecting enabled lanes.
This more accurately reflects the current cost on targets like AArch64.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D91984
Hafiz Abid Qadeer [Thu, 26 Nov 2020 11:31:45 +0000 (11:31 +0000)]
[clang][Driver] Handle risvc in Baremetal.cpp.
I am working on a baremetal riscv toolchain using LLVM runtime and
LLD linker. Baremetal.cpp provides most of the things needed for such
toolchain. So I have modified it to also handle riscv64/32-unknown-elf
targets alongside arm-none-eabi.
Currently, targets like riscv64-unknown-elf are handled by RISCVToolChain
which mostly expects a gcc toolchain to be present. If you dont
want the dependency on gcc-toolchain/libgloss or want to use LLD, then
RISCVToolChain is not a good fit.
So in the toolchain selection code, I have made this dependency of
RISCVToolChain on gcc toolchain explicit. It is created if gcc-toolchain
option is present. Otherwise Baremetal toolchain is created. I will be
happy to hear if there is a better way to choose between these two
toolchains.
Reviewed By: jroelofs
Differential Revision: https://reviews.llvm.org/D91442
Marek Kurdej [Thu, 26 Nov 2020 11:40:50 +0000 (12:40 +0100)]
[libc++] Mark a few more tests as unsupported on gcc-8/9.
This will fix remaining failures on gcc-9 buildbot: http://lab.llvm.org:8011/#/builders/101.
gcc-8 and gcc-9 do not support constexpr destructors nor constexpr allocation.
Fix gcc warnings: -Wconversion, -Wpragmas.
Kerry McLaughlin [Thu, 26 Nov 2020 10:54:56 +0000 (10:54 +0000)]
[SVE][CodeGen] Extend isConstantSplatValue to support ISD::SPLAT_VECTOR
Updated the affected scalable_of_scalable tests in sve-gep.ll, as isConstantSplatValue now returns true in DAGCombiner::visitMUL and folds `(mul x, 1) -> x`
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D91363
Max Kazantsev [Thu, 26 Nov 2020 11:12:04 +0000 (18:12 +0700)]
Revert "Return "[SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond", 2nd try"
This reverts commit
f690986f314fbf3f4b3ca9ec0b87b95166008dc1.
Compile time then and again...
Simon Pilgrim [Thu, 26 Nov 2020 11:01:03 +0000 (11:01 +0000)]
[X86] Fix -DAG checks on gnux32 pic tests
Differential Revision: https://reviews.llvm.org/D91339
Max Kazantsev [Thu, 26 Nov 2020 10:30:44 +0000 (17:30 +0700)]
Return "[SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond", 2nd try
Reverted because the compile time impact is still too high.
isKnownViaNonRecursiveReasoning is used twice, we can do it just once.
Differential Revision: https://reviews.llvm.org/D92152
Max Kazantsev [Thu, 26 Nov 2020 10:27:42 +0000 (17:27 +0700)]
Revert "[SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond"
This reverts commit
3d4c0460ec6040fc071e56dc113afd181294591e.
Compile time impact is still high. Need to understand why.
Differential Revision: https://reviews.llvm.org/D92153
Georgii Rymar [Wed, 25 Nov 2020 10:58:40 +0000 (13:58 +0300)]
[llvm-readelf/obj] - Report a warning when the value of the DT_PLTREL dynamic tag is invalid.
We report an error for unknown `DT_PLTREL` values.
This switches the error to warning.
Differential revision: https://reviews.llvm.org/D92087
Max Kazantsev [Thu, 26 Nov 2020 09:59:39 +0000 (16:59 +0700)]
[SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond
Previously we tried to using isKnownPredicateAt, but it makes an
extra query to isKnownPredicate, which has negative impact on compile
time. Let's try to use more lightweight isBasicBlockEntryGuardedByCond.
Differential Revision: https://reviews.llvm.org/D92152
Craig Topper [Thu, 26 Nov 2020 10:02:38 +0000 (02:02 -0800)]
[RISCV] Add isel patterns for sbsetw/sbclrw/sbinvw with sext_inreg as the root.
This handles cases were the input isn't known to be sign extended.
Craig Topper [Thu, 26 Nov 2020 09:54:07 +0000 (01:54 -0800)]
[RISCV] Add test cases for missed opportunities to use sbsetw/sbclrw/sbinvw when the result isn't known to be sign extended.
If the input isn't sign extended, but the output of the or/xor/and
is used by a sign_inreg we can still use sbsetw/sbclrw/sbinvw.
Marek Kurdej [Thu, 26 Nov 2020 09:40:52 +0000 (10:40 +0100)]
[llvm-profgen] [docs] Fix invalid header. Add to ToC. NFC.
Max Kazantsev [Thu, 26 Nov 2020 09:42:43 +0000 (16:42 +0700)]
Revert "[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond"
This reverts commit
14f2ad0e3cc54d5eb254b545a469e8ffdb62b119.
Reverting to investigate compile time drop.
Differential Revision: https://reviews.llvm.org/D92152
Mark de Wever [Thu, 26 Nov 2020 09:37:04 +0000 (10:37 +0100)]
[NFC][libc++] Mark LWG3296 as complete.
I recalled Marshall had already made this change. The change is
committed in
e3f89a989a23b9bfcb9f9d01172cebb63db627e1.
Marek Kurdej [Thu, 26 Nov 2020 09:20:09 +0000 (10:20 +0100)]
[libc++] Fix gcc warning -Wsign-compare.
Marek Kurdej [Thu, 26 Nov 2020 09:07:16 +0000 (10:07 +0100)]
[libc++] [P0966] [C++20] Fix bug PR45368 by correctly implementing P0966: string::reserve should not shrink.
This patch fixes the implementation as well as the tests that didn't actually test the wanted behaviour.
You'll find all the details in the bug report.
It adds as well deprecation warning for reserve() (without argument) and adds a test.
http://wg21.link/P0966R1
https://bugs.llvm.org/show_bug.cgi?id=45368
https://reviews.llvm.org/D54992
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D91778
Jay Foad [Wed, 25 Nov 2020 11:51:23 +0000 (11:51 +0000)]
[AMDGPU] Introduce and use isGFX10Plus. NFC.
It's more future-proof to use isGFX10Plus from the start, on the
assumption that future architectures will be based on current
architectures.
Also make use of the existing isGFX9Plus in a few places.
Differential Revision: https://reviews.llvm.org/D92092
Marek Kurdej [Thu, 26 Nov 2020 08:03:50 +0000 (09:03 +0100)]
[libc++] [docs] Migrate C++ status pages to RestructuredText (RST).
Currently, papers and issues are in separate .csv files (that is easier to update), but I can put them inline.Transforming current html tables into rst are done by the script (attached to the patch FYI but I'll remove it before committing).
I'll of course update RST files before committing to match any modifications that may happen in master branch.
This patch moves the status pages in www/ to RST format in docs/.
It also does some other minor changes: fix copyright year and broken comment end, adds substitutions for coherence (and add colors, but that can be removed easily).
It adds as well redirects from old to new status pages.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D92076
Raphael Isemann [Thu, 26 Nov 2020 08:40:02 +0000 (09:40 +0100)]
[lldb] Fix TestThreadStepOut.py after "Flush local value map on every instruction"
After
cf1c774d6ace59c5adc9ab71b31e762c1be695b1, Clang seems to generate code
that is more similar to icc/Clang, so we can use the same line numbers for
all compilers in this test.
Nathan Ridge [Thu, 26 Nov 2020 02:31:09 +0000 (21:31 -0500)]
[clangd] Do not treat line as inactive if skipped range ends at character position 0
Fixes https://github.com/clangd/clangd/issues/602
Differential Revision: https://reviews.llvm.org/D92148
Zhengyang Liu [Thu, 26 Nov 2020 07:10:36 +0000 (00:10 -0700)]
Fix use-of-uninitialized-value in rG75f50e15bf8f
Differential Revision: https://reviews.llvm.org/D71126
Marek Kurdej [Thu, 26 Nov 2020 08:31:20 +0000 (09:31 +0100)]
[libc++] [www] Fix HTML. NFC.
Needed for a future automatic update to RST.
Martin Storsjö [Thu, 26 Nov 2020 08:09:32 +0000 (10:09 +0200)]
[OpenMP][OMPT] Fix building with OMPT disabled after
6d3b81664a4b79
Marek Kurdej [Thu, 26 Nov 2020 07:58:44 +0000 (08:58 +0100)]
[libc++] [libc++abi] Mark a few tests as unsupported/xfail on gcc-7/8/9.
This should make the builder http://lab.llvm.org:8011/#/builders/101/ happy.
It uses gcc-9 and not Tip-Of-Trunk as its name indicates BTW.
GCC-10 passes all these tests.
Fix gcc warnings: -Wsign-compare, -Wparentheses, -Wpragmas.
Reviewed By: ldionne, #libc, #libc_abi
Differential Revision: https://reviews.llvm.org/D92099
Kazu Hirata [Thu, 26 Nov 2020 07:52:52 +0000 (23:52 -0800)]
[Support] Use llvm::is_contained (NFC)
Georgii Rymar [Thu, 26 Nov 2020 07:22:29 +0000 (10:22 +0300)]
[llvm-readobj] - Fix a warning.
This addresses post review comment for D92018.
The warning was:
```
error: loop variable 'Note' is always a copy because the range of type 'iterator_range<llvm::object::ELFFile<llvm::object::ELFType<llvm::support::big, true> >::Elf_Note_Iterator>' (aka 'iterator_range<Elf_Note_Iterator_Impl<ELFType<(llvm::support::endianness)0U, true> > >') does not return a reference [-Werror,-Wrange-loop-analysis]
for (const typename ELFT::Note &Note : Obj.notes(S, Err))
```
Max Kazantsev [Thu, 26 Nov 2020 06:20:02 +0000 (13:20 +0700)]
[SCEV] Use isKnownPredicateAt in isLoopBackedgeGuardedByCond
A piece of code in `isLoopBackedgeGuardedByCond` basically duplicates
the dominators traversal from `isBlockEntryGuardedByCond` called from
`isKnownPredicateAt`, but it's less powerful because it does not give context
to `isImpliedCond`. This patch reuses the `isKnownPredicateAt `function there,
reducing the amount of code duplication and making it more powerful.
Differential Revision: https://reviews.llvm.org/D92152
Reviewed By: skatkov
Craig Topper [Thu, 26 Nov 2020 05:31:41 +0000 (21:31 -0800)]
[RISCV] Add isel pattern to match (i64 (sra (shl X, 32), C)) to SRAIW if C > 32.
Max Kazantsev [Thu, 26 Nov 2020 05:34:55 +0000 (12:34 +0700)]
[IndVars] Use isLoopBackedgeGuardedByCond for last iteration check
Use more context to prove contextual facts about the last iteration. It is
only executed when the backedge is taken, so we can use `isLoopBackedgeGuardedByCond`
to make this check.
Differential Revision: https://reviews.llvm.org/D91535
Reviewed By: skatkov
Craig Topper [Thu, 26 Nov 2020 04:35:23 +0000 (20:35 -0800)]
[RISCV] Remove unused PatFrag argument from the tablegen class used for c.beqz/c.bnez. NFC
Craig Topper [Thu, 26 Nov 2020 03:12:46 +0000 (19:12 -0800)]
[LegalizerTypes] Add support for scalarizing the operand of an FP_EXTEND when the result type is legal.
Max Kazantsev [Thu, 26 Nov 2020 03:49:44 +0000 (10:49 +0700)]
[LoopLoadElim] Make sure all loops are in simplify form. PR48150
LoopLoadElim may end up expanding an AddRec from a loop
which is not the current loop. This loop may not be in simplify
form. We figure it out after the no-return point, so cannot bail
in this case.
AddRec requires simplify form to expand. The only way to ensure
this does not crash is to simplify all loops beforehand.
The issue only exists in new PM. Old PM requests LoopSimplify
required pass and it simplifies all loops before the opt begins.
Differential Revision: https://reviews.llvm.org/D91525
Reviewed By: asbirlea, aeubanks
Stella Laurenzo [Thu, 26 Nov 2020 01:45:58 +0000 (17:45 -0800)]
[mlir][Python] Add additional capsule interop types.
Differential Revision: https://reviews.llvm.org/D92144
Sam Clegg [Mon, 23 Nov 2020 23:41:07 +0000 (15:41 -0800)]
[lld][WebAssembly] Ensure stub symbols always get address 0
Without this extra flag we can't distingish between stub functions and
functions that happen to have address 0 (relative to __table_base).
Adding this flag bit the base symbol class actually avoids growing the
SymbolUnion struct which would not be true if we added it to the
FunctionSymbol subclass (due to bitbacking).
The previous approach of setting it's table index to zero worked for
normal static relocations but not for `-fPIC` code.
See https://github.com/emscripten-core/emscripten/issues/12819
Differential Revision: https://reviews.llvm.org/D92038
Nico Weber [Thu, 26 Nov 2020 02:11:50 +0000 (21:11 -0500)]
[gn build] sync script: try to make a loop clearer
We want to find 'sources = [', but only if it's not the prefix
of 'sources = []' -- we're looking for a non-empty list.
No behavior change.
Nico Weber [Thu, 26 Nov 2020 02:05:11 +0000 (21:05 -0500)]
[gn build] sync script: only compute tokloc when adding files
No behavior change, but maybe a bit clearer.
Nico Weber [Thu, 26 Nov 2020 01:56:03 +0000 (20:56 -0500)]
[gn build] sync script: handle multiple source lists if only deleting
With this, changes like
b534beabeed3ba can be merged automatically.