Guillaume Chatelet [Wed, 18 Dec 2019 11:08:38 +0000 (12:08 +0100)]
[llvm-exegesis][NFC] internal changes
Summary:
BitVectors are now cached to lower memory utilization.
Instructions have reference semantics.
Reviewers: courbet
Subscribers: sdardis, tschuett, jrtc27, atanasyan, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71653
Michał Górny [Wed, 18 Dec 2019 16:20:40 +0000 (17:20 +0100)]
[compiler-rt] [test] Disable ASLR on UBSAN+[AMT]SAN tests on NetBSD
Michał Górny [Wed, 18 Dec 2019 16:07:34 +0000 (17:07 +0100)]
[compiler-rt] [test] Disable ASLR on LSAN+ASAN tests on NetBSD
Mircea Trofin [Wed, 18 Dec 2019 15:56:47 +0000 (07:56 -0800)]
[NFC][InlineCost] Run clang-format on InlineCost.cpp
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: Jim, eraman, hiraditya, haicheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71646
Sanjay Patel [Wed, 18 Dec 2019 16:00:38 +0000 (11:00 -0500)]
[AArch64] update test checks; NFC
The common prefix reduces a bunch of replication; not sure why it
didn't happen before.
LLVM GN Syncbot [Wed, 18 Dec 2019 16:00:24 +0000 (16:00 +0000)]
gn build: Merge
9883d7edc65
Whitney Tsang [Wed, 18 Dec 2019 15:57:50 +0000 (15:57 +0000)]
[LoopUtils] Updated deleteDeadLoop() to handle loop nest.
Reviewer: kariddi, sanjoy, reames, Meinersbur, bmahjour, etiotto,
kbarton
Reviewed By: Meinersbur
Subscribers: mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D70939
Michał Górny [Wed, 18 Dec 2019 15:51:31 +0000 (16:51 +0100)]
[compiler-rt] [test] Disable ASLR for fuzzer tests on NetBSD
Michał Górny [Tue, 17 Dec 2019 17:09:18 +0000 (18:09 +0100)]
[clang] [cmake] Fix gen_ast_dump_json_test.py binary dir
Use correct directory to put gen_ast_dump_json_test.py instead of
LLVM_BINARY_DIR. This fixes attempting to write to /usr when building
clang standalone.
Differential Revision: https://reviews.llvm.org/D71615
evgeny [Wed, 18 Dec 2019 15:33:15 +0000 (18:33 +0300)]
[ThinLTO] Show preserved symbols in DOT files
Differential revision: https://reviews.llvm.org/D71608
Daniel Sanders [Wed, 18 Dec 2019 14:56:23 +0000 (14:56 +0000)]
[globalisel] Small correction to the fixup in
0a0813962d6. The two ID's are not the same size
The rule ID is a uint64_t as it has global scope but the UID is scoped to
the rule and expected to be much smaller so it's only unsigned.
Kamil Rytarowski [Wed, 18 Dec 2019 14:20:09 +0000 (15:20 +0100)]
[compiler-rt] Sync NetBSD ioctl definitions with 9.99.26
Document the minimal version supported to 9.0.
Daniel Sanders [Wed, 18 Dec 2019 12:35:08 +0000 (12:35 +0000)]
[gicombiner] Import tryCombineIndexedLoadStore()
Summary:
Now that arbitrary data is supported, import tryCombineIndexedLoadStore()
Depends on D69147
Reviewers: bogner, volkan
Reviewed By: volkan
Subscribers: hiraditya, arphaman, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69151
Roman Lebedev [Wed, 18 Dec 2019 14:14:40 +0000 (17:14 +0300)]
[NFC][InstCombine] Autogenerate assume.ll test
Daniel Sanders [Wed, 18 Dec 2019 14:14:06 +0000 (14:14 +0000)]
[globalisel] Attempt to fix ARM bots that emit the correct number in the wrong place
Hans Wennborg [Wed, 18 Dec 2019 14:00:15 +0000 (15:00 +0100)]
Add an -fno-temp-file flag for compilation
Our build system does not handle randomly named files created during
the build well. We'd prefer to write compilation output directly
without creating a temporary file. Function parameters already
existed to control this behavior but were not exposed all the way out
to the command line.
Patch by Zachary Henkel!
Differential revision: https://reviews.llvm.org/D70615
Sanjay Patel [Wed, 18 Dec 2019 13:47:07 +0000 (08:47 -0500)]
[AArch64] match fcvtl2 with bitcasted extract
This should eliminate a regression seen in D63815.
If we are FP extending the high half extract of a vector,
we should be able to peek through a bitcast sitting
between the extract and extend.
This replaces tablegen patterns with a more general
DAG to DAG override, so we can handle any casted type.
Differential Revision: https://reviews.llvm.org/D71515
Sanjay Patel [Tue, 17 Dec 2019 21:46:42 +0000 (16:46 -0500)]
[InstCombine] add tests for copysign; NFC
Raphael Isemann [Tue, 17 Dec 2019 15:12:07 +0000 (16:12 +0100)]
[lldb][NFC] Add unit test for persistent variable lookup with ClangExpressionDeclMap
This adds a unit test for looking up persistent declarations in the scratch AST
context. Also adds the `GetPersistentDecl` hook to the ClangExpressionDeclMap
that this unit test can emulate looking up persistent variables without having
a lldb_private::Target.
Daniel Sanders [Wed, 18 Dec 2019 12:26:31 +0000 (12:26 +0000)]
[gicombiner] Add support for arbitrary match data being passed from match to apply
Summary:
This is used by the extending_loads combine to tell the apply step which
use is the preferred one to fold and the other uses should be re-written
to consume.
Depends on D69117
Reviewers: volkan, bogner
Reviewed By: volkan
Subscribers: hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69147
stozer [Wed, 18 Dec 2019 11:46:10 +0000 (11:46 +0000)]
Revert "[DebugInfo] Correctly handle salvaged casts and split fragments at ISel"
Reverted due to build failure on windows bots.
This reverts commit
bb1b0bc4e57428ce364d3d6c075ff03cb8973462.
LLVM GN Syncbot [Wed, 18 Dec 2019 11:37:45 +0000 (11:37 +0000)]
gn build: Merge
7ea2e5195a8
Daniel Sanders [Wed, 18 Dec 2019 10:25:19 +0000 (10:25 +0000)]
Revert "Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input""
This reverts commit
e62e760f29567fe0841af870c65a4f8ef685d217.
The issue @uweigand raised should have been fixed by iterating over the
vector that owns the operand list data instead of the FoldingSet.
The MSVC issue raised by @thakis should have been fixed by relaxing the
regexes a little. I don't have a Windows machine available to test that so
I tested it by using `perl -p -e 's/0x([0-9a-f]+)/\U\1\E/g' to convert the
output of %p to the windows style.
I've guessed at the issue @phosek raised as there wasn't enough information
to investigate it. What I think is happening on that bot is the -debug
option isn't available because the second stage build is a release build.
I'm not sure why other release-mode bots didn't report it though.
LLVM GN Syncbot [Wed, 18 Dec 2019 11:25:51 +0000 (11:25 +0000)]
gn build: Merge
1ad15046dcf
Ilya Biryukov [Wed, 18 Dec 2019 10:44:06 +0000 (11:44 +0100)]
[Syntax] Use a hash table to search for tokens by their location
This is both more efficient and avoids corner cases in
`SourceManager::isBeforeInTranslationUnit`.
The change is trivial and clearly a performance improvement on the hot
path of building the syntax tree, so sending without review.
Ilya Biryukov [Wed, 18 Dec 2019 11:20:30 +0000 (12:20 +0100)]
[Syntax] Uppercase the first letter of the test name. NFC
To match naming style of other tests.
Ilya Biryukov [Wed, 18 Dec 2019 10:52:43 +0000 (11:52 +0100)]
[Syntax] Allow to mutate syntax trees
Summary:
This patch adds facilities to mutate the syntax trees and produce
corresponding text replacements.
The public interface of the syntax library now includes facilities to:
1. perform type-safe modifications of syntax trees,
2. compute textual replacements to apply the modifications,
3. create syntax trees not backed by the source code.
For each of the three, we only add a few example transformations in this
patch to illustrate the idea, support for more kinds of nodes and
transformations will be done in follow-up patches.
The high-level mutation operations are implemented on top of operations
that allow to arbitrarily change the trees. They are considered to be
implementation details and are not available to the users of the
library.
Reviewers: sammccall, gribozavr2
Reviewed By: gribozavr2
Subscribers: merge_guards_bot, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64573
stozer [Tue, 17 Dec 2019 09:37:17 +0000 (09:37 +0000)]
[DebugInfo] Correctly handle salvaged casts and split fragments at ISel
Previously, LLVM had no functional way of performing casts inside of a
DIExpression(), which made salvaging cast instructions other than Noop
casts impossible. This patch enables the salvaging of casts by using the
DW_OP_LLVM_convert operator for SExt and Trunc instructions.
There is another issue which is exposed by this fix, in which fragment
DIExpressions (which are preserved more readily by this patch) for
values that must be split across registers in ISel trigger an assertion,
as the 'split' fragments extend beyond the bounds of the fragment
DIExpression causing an error. This patch also fixes this issue by
checking the fragment status of DIExpressions which are to be split, and
dropping fragments that are invalid.
Gabor Marton [Wed, 4 Dec 2019 16:12:08 +0000 (17:12 +0100)]
recommit: [ASTImporter] Friend class decl should not be visible in its context
Summary:
In the past we had to use DeclContext::makeDeclVisibleInContext to make
friend declarations available for subsequent lookup calls and this way
we could chain (redecl) the structurally equivalent decls.
By doing this we created an AST that improperly made declarations
visible in some contexts, so the AST was malformed.
Since we use the importer specific lookup this is no longer necessary,
because with that we can find every previous nodes.
Reviewers: balazske, a_sidorin, a.sidorin, shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71020
Sven van Haastregt [Wed, 18 Dec 2019 10:13:51 +0000 (10:13 +0000)]
[OpenCL] Add builtin function extension handling
Provide a mechanism to attach OpenCL extension information to builtin
functions, so that their use can be restricted according to the
extension(s) the builtin is part of.
Patch by Pierre Gondois and Sven van Haastregt.
Differential Revision: https://reviews.llvm.org/D71476
Victor Campos [Mon, 28 Oct 2019 13:44:48 +0000 (13:44 +0000)]
[AArch64] Improve codegen of volatile load/store of i128
Summary:
Instead of generating two i64 instructions for each load or store of a
volatile i128 value (two LDRs or STRs), now emit a single LDP or STP.
Reviewers: labrinea, t.p.northover, efriedma
Reviewed By: efriedma
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69559
Jay Foad [Wed, 11 Dec 2019 10:29:23 +0000 (10:29 +0000)]
[AArch64] Enable clustering memory accesses to fixed stack objects
Summary:
r347747 added support for clustering mem ops with FI base operands
including support for fixed stack objects in shouldClusterFI, but
apparently this was never tested.
This patch fixes shouldClusterFI to work with scaled as well as
unscaled load/store instructions, and fixes the ordering of memory ops
in MemOpInfo::operator< to ensure that memory addresses always
increase, regardless of which direction the stack grows.
Subscribers: MatzeB, kristof.beyls, hiraditya, javed.absar, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71334
Miloš Stojanović [Wed, 18 Dec 2019 09:21:06 +0000 (10:21 +0100)]
[llvm-exegesis][mips] Add lit test
Adding a basic lit test for MIPS.
Differential Revision: https://reviews.llvm.org/D71605
Anna Welker [Wed, 18 Dec 2019 08:42:53 +0000 (08:42 +0000)]
[NFC][TTI] Add Alignment for isLegalMasked[Gather/Scatter]
Add an extra parameter so alignment can be taken under
consideration in gather/scatter legalization.
Differential Revision: https://reviews.llvm.org/D71610
David Stenberg [Wed, 18 Dec 2019 08:54:21 +0000 (09:54 +0100)]
[cmake] Add llvm-locstats to LLVM_TEST_DEPENDS
Summary:
Make sure that llvm-locstats is updated before running lit tests even
when it's not an explicit target.
Reviewers: djtodoro, krisb, spatel
Reviewed By: djtodoro
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71611
Georgii Rymar [Wed, 18 Dec 2019 08:50:08 +0000 (11:50 +0300)]
[llvm-readobj][test] - Move a comment. NFC.
I've forgot to address this review comment.
Georgii Rymar [Tue, 17 Dec 2019 09:24:50 +0000 (12:24 +0300)]
[llvm-readob] - Refactor printing of sections flags. NFCI.
This is a natural clean-up after D71462/D71464.
It allows to define known section letters used for GNU style
in one place.
Differential revision: https://reviews.llvm.org/D71591
Georgii Rymar [Tue, 17 Dec 2019 14:13:47 +0000 (17:13 +0300)]
[llvm-readobj][test] - Cleanup hash-histogram.test
In this test case we use 3 precompiled objects to
test how we print a histogram for an GNU hash section.
It does not make sense to use precompiled objects
for that. Also we could have 2 tests: one for 32 and
another for 64 bits target.
This patch does this change. It is not possible to remove
these precompiled objects because they are used elsewhere.
Differential revision: https://reviews.llvm.org/D71606
Georgii Rymar [Fri, 13 Dec 2019 14:02:03 +0000 (17:02 +0300)]
[llvm-readelf] - Change letters used for SHF_ARM_PURECODE and SHF_X86_64_LARGE flags.
GNU uses `l` for SHF_X86_64_LARGE and `y` for SHF_ARM_PURECODE.
Lets follow.
To do this I had to refactor and refine how we print the help flags description.
It was too generic and inconsistent with GNU readelf.
Differential revision: https://reviews.llvm.org/D71464
Fangrui Song [Tue, 17 Dec 2019 21:43:04 +0000 (13:43 -0800)]
[ELF] writePlt, writeIplt: replace parameters gotPltEntryAddr and index with `const Symbol &`. NFC
PPC::writeIplt (IPLT code sequence, D71621) needs to access `Symbol`.
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D71631
Georgii Rymar [Fri, 13 Dec 2019 12:48:09 +0000 (15:48 +0300)]
[llvm-readelf][llvm-readobj] - Reimplement the logic of section flags dumping.
Our logic that dumped the flags was buggy.
For LLVM style it dumped SHF_MASKPROC/SHF_MASKOS named constants, though
they are not flags, but masks.
For GNU style it was just very inconsistent with GNU which has logic
that is not straightforward. Imagine we have sh_flags == 0x90000000.
SHF_EXCLUDE ("E") has a value of 0x80000000 and SHF_MASKPROC is 0xf0000000.
GNU readelf will not print "E" or "Ep" in this case, but will print just
"p". It only will print "E" when no other processor flag is set.
I had to investigate the GNU source to find the algorithm and now our logic should
match it.
Differential revision: https://reviews.llvm.org/D71462
Wang, Pengfei [Fri, 13 Dec 2019 00:17:41 +0000 (08:17 +0800)]
[X86] Add calculation for elements in structures in getting uniform base for the Gather/Scatter intrinsic.
Summary: Add calculation for elements in structures in getting uniform
base for the Gather/Scatter intrinsic.
Reviewers: craig.topper, c-rhodes, RKSimon
Subscribers: hiraditya, llvm-commits, annita.zhang, LuoYuanke
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71442
Wang, Pengfei [Tue, 17 Dec 2019 13:27:46 +0000 (21:27 +0800)]
[X86] Add strict fma support
Summary: Add strict fma support
Reviewers: craig.topper, RKSimon, LiuChen3
Subscribers: hiraditya, llvm-commits, LuoYuanke
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71604
Gabor Horvath [Wed, 18 Dec 2019 01:53:26 +0000 (17:53 -0800)]
[CFG] Add an option to expand CXXDefaultInitExpr into aggregate initialization
This is useful for clients that are relying on linearized CFGs for evaluating
subexpressions and want the default initializer to be evaluated properly.
The upcoming lifetime analysis is using this but it might also be useful
for the static analyzer at some point.
Differential Revision: https://reviews.llvm.org/D71642
Petr Hosek [Wed, 18 Dec 2019 01:18:24 +0000 (17:18 -0800)]
[unwind] Don't link libpthread and libdl on Fuchsia
This is a follow up to D71135.
Fangrui Song [Wed, 18 Dec 2019 01:17:33 +0000 (17:17 -0800)]
[ELF] Fix a comment. NFC
Justin Bogner [Wed, 18 Dec 2019 01:10:48 +0000 (17:10 -0800)]
[docs] Remove `git llvm push` and `git llvm revert` from GettingStarted
These sections aren't accurate since the github move.
Differential Revision: https://reviews.llvm.org/D71640
Nemanja Ivanovic [Wed, 18 Dec 2019 01:07:18 +0000 (19:07 -0600)]
[PowerPC] Add missing legalization for vector BSWAP
We somehow missed doing this when we were working on Power9 exploitation.
This just adds the missing legalization and cost for producing the vector
intrinsics.
Differential revision: https://reviews.llvm.org/D70436
LLVM GN Syncbot [Wed, 18 Dec 2019 00:29:06 +0000 (00:29 +0000)]
gn build: Merge
e62e760f295
Eric Christopher [Wed, 18 Dec 2019 00:22:31 +0000 (16:22 -0800)]
Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input"
and follow-on patches.
This is breaking a few build bots and local builds with follow-up already
on the patch thread.
This reverts commits
390c8baa5440dda8907688d9ef860f6982bd925f and
520e3d66e7257c77f1226185504bbe1cb90afcfa.
Craig Topper [Wed, 18 Dec 2019 00:04:26 +0000 (16:04 -0800)]
[X86] Manually format some setOperationAction calls to line up arguments to improve readability. NFC
Xiaoqing Wu [Tue, 17 Dec 2019 23:41:06 +0000 (15:41 -0800)]
[AArch64][GlobalISel]: Fix a crash in GlobalIsel in dealing with 16bit uadd.with.overflow.
Summary: AArch64 doesn't support uadd.with.overflow.i16 natively. This change adds a legalization rule to convert the 32bit add result to 16bit. This should fix PR43981.
Reviewers: arsenm, qcolombet, paquette, aemerson
Reviewed By: paquette
Subscribers: wdng, rovka, kristof.beyls, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71587
Craig Topper [Tue, 17 Dec 2019 23:14:44 +0000 (15:14 -0800)]
[FPEnv][LegalizeTypes] Make ScalarizeVecOp_STRICT_FP_ROUND do its own replacements and return SDValue()
The caller will assert for nodes with more than 2 results unless
we return a null SDValue.
I tried to test this by copying an AArch64 test for ScalarizeVecOp_FP_ROUND.
While it did hit the assert and this commited fixed that. It also
hit a later problem that couldn't be fixed without adding strict
FP support to AArch64.
Stanislav Mekhanoshin [Tue, 17 Dec 2019 19:16:06 +0000 (11:16 -0800)]
[AMDGPU] Fixed cost model for packed 16 bit ops
Differential Revision: https://reviews.llvm.org/D71622
Thomas Lively [Tue, 17 Dec 2019 21:58:39 +0000 (13:58 -0800)]
[WebAssembly] Implement SIMD {i8x16,i16x8}.avgr_u instructions
Summary:
These instructions were added to the spec proposal in
https://github.com/WebAssembly/simd/pull/126. Their semantics are
equivalent to `(a + b + 1) / 2`. The opcode for the experimental
i32x4.dot_i16x8_s is also bumped due to a collision with the
i8x16.avgr_u opcode.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71628
Mitch Phillips [Tue, 17 Dec 2019 23:03:10 +0000 (15:03 -0800)]
Revert "[ MC ] Match labels to existing fragments even when switching sections."
This reverts commit
4272372c571cd33edc77a8844b0a224ad7339138.
Caused an MSan buildbot failure. More information available in the patch
that introduced the bug: https://reviews.llvm.org/D71368
Artem Dergachev [Tue, 17 Dec 2019 22:49:53 +0000 (14:49 -0800)]
[analysis] Discard type qualifiers when casting values retrieved from the Store.
This canonicalizes the representation of unknown pointer symbols,
which reduces the overall confusion in pointer cast representation.
Patch by Vince Bridgers!
Differential Revision: https://reviews.llvm.org/D70836
Craig Topper [Tue, 17 Dec 2019 22:32:21 +0000 (14:32 -0800)]
[FPEnv][LegalizeTypes][LegalizeDAG][AArch64] Few fixes/improvements for legalizing fp<->int conversion nodes.
This started with adding a test to support get code coverage on
ScalarizeVecOp_UnaryOp_StrictFP by copying an existing AArch64 test
and using constrained sitofp/uitofp intrinsics.
This found 3 separate issues:
-ScalarizeVecOp_UnaryOp_StrictFP needs to do its own replacement
because the caller can't handle replacing multiple results.
-Missing integer promotion support for sitofp/uitofp
-Chain result not always assigned in ExpandLegalINT_TO_FP.
Committing them together so I can add the test case.
Alex Lorenz [Tue, 17 Dec 2019 22:24:23 +0000 (14:24 -0800)]
[driver][darwin] Use explicit -mlinker-version in the -platform_version tests
The driver actually adds a default -mlinker-version, based on HOST_LINK_VERSION
cmake variable. The tests should be explicit about which version they're using to
trigger the right behavior.
Whitney Tsang [Tue, 17 Dec 2019 21:44:06 +0000 (21:44 +0000)]
[LoopFusion] Move instructions from FC0.Latch to FC1.Latch.
Summary:This PR move instructions from FC0.Latch bottom up to the
beginning of FC1.Latch as long as they are proven safe.
To illustrate why this is beneficial, let's consider the following
example:
Before Fusion:
header1:
br header2
header2:
br header2, latch1
latch1:
br header1, preheader3
preheader3:
br header3
header3:
br header4
header4:
br header4, latch3
latch3:
br header3, exit3
After Fusion (before this PR):
header1:
br header2
header2:
br header2, latch1
latch1:
br header3
header3:
br header4
header4:
br header4, latch3
latch3:
br header1, exit3
Note that preheader3 is removed during fusion before this PR.
Notice that we cannot fuse loop2 with loop4 as there exists block latch1
in between.
This PR move instructions from latch1 to beginning of latch3, and remove
block latch1. LoopFusion is now able to fuse loop nest recursively.
After Fusion (after this PR):
header1:
br header2
header2:
br header3
header3:
br header4
header4:
br header2, latch3
latch3:
br header1, exit3
Reviewer: kbarton, jdoerfert, Meinersbur, dmgreen, fhahn, hfinkel,
bmahjour, etiotto
Reviewed By: kbarton, Meinersbur
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D71165
David Tenty [Tue, 17 Dec 2019 21:56:59 +0000 (16:56 -0500)]
[AIX] Avoid unset csect assert for functions defined after their use in TOC
Summary:
If a function is defined after it appears in a TOC expression, we may
try to access an unset containing csect when returning a symbol for the
expression.
Reviewers: Xiangling_L, DiggerLin, jasonliu, hubert.reinterpretcast
Reviewed By: hubert.reinterpretcast
Subscribers: hubert.reinterpretcast, wuzish, nemanjai, hiraditya, kbarton, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71125
Tom Stellard [Tue, 17 Dec 2019 04:37:39 +0000 (20:37 -0800)]
AMDGPU/SILoadStoreOptimillzer: Refactor CombineInfo struct
Summary:
Modify CombineInfo to only store information about a single instruction.
This is a little easier to work with and removes a lot of duplicate
initialization code.
Reviewers: arsenm, nhaehnle
Reviewed By: arsenm, nhaehnle
Subscribers: merge_guards_bot, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71045
Nemanja Ivanovic [Tue, 17 Dec 2019 21:24:51 +0000 (15:24 -0600)]
Fix buildbot failures after removing REQUIRES-ANY
It would appear that the removal of this lit feature was incomplete
and there is a test case that still tests for this. This patch removes
the remaining tests to bring the bots back to green. I would encourage the
author to do a post-commit review on this in case there is a more desirable fix.
Mark de Wever [Tue, 17 Dec 2019 20:57:58 +0000 (21:57 +0100)]
[IR] Use a reference in a range-based for
This avoids unneeded copies when using a range-based for loops.
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D70870
Mark de Wever [Tue, 17 Dec 2019 20:56:04 +0000 (21:56 +0100)]
[Driver] Avoid copies in range-based for loops
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71527
Mark de Wever [Tue, 17 Dec 2019 20:54:32 +0000 (21:54 +0100)]
[Sema] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71529
Mark de Wever [Tue, 17 Dec 2019 20:52:47 +0000 (21:52 +0100)]
[Frontend] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71530
Sourabh Singh Tomar [Wed, 4 Dec 2019 13:02:39 +0000 (18:32 +0530)]
Recommit "[DebugInfo] Refactored macro related generation,
added a test case for macinfo.dwo emission."
This was reverted in
caa412090666c10f854322cdc701c1cbf8ed726e,
since it was causing an assertion failure on Windows bots.
This revision is revised to fix that.
Original commit message -
[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission.
Reviewers: dblaikie, aprantl, jini.susan.george
Tags: #debug-info #llvm
Differential Revision: https://reviews.llvm.org/D71008
Xin-Xin Wang [Tue, 17 Dec 2019 19:05:35 +0000 (11:05 -0800)]
[perf-training] Change profile file pattern string to use %4m instead of %p
Summary: With %p, each test file that we're using to generate profile data will make its own profraw file which is around 60 MB in size. If we have a lot of test files, that quickly uses a lot of space. Use %4m instead to share the profraw files used to store the profile data. We use 4 here based on the default value in https://reviews.llvm.org/source/llvm-github/browse/master/llvm/CMakeLists.txt$604
Reviewers: beanz, phosek, xiaobai, smeenai, vsk
Reviewed By: vsk
Subscribers: vsk, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71585
Ulrich Weigand [Tue, 17 Dec 2019 20:08:18 +0000 (21:08 +0100)]
[FPEnv] Remove unnecessary rounding mode argument for constrained intrinsics
The following intrinsics currently carry a rounding mode metadata argument:
llvm.experimental.constrained.minnum
llvm.experimental.constrained.maxnum
llvm.experimental.constrained.ceil
llvm.experimental.constrained.floor
llvm.experimental.constrained.round
llvm.experimental.constrained.trunc
This is not useful since the semantics of those intrinsics do not in any way
depend on the rounding mode. In similar cases, other constrained intrinsics
do not have the rounding mode argument. Remove it here as well.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D71218
Alexey Bataev [Mon, 16 Dec 2019 20:54:17 +0000 (15:54 -0500)]
[OPENMP50]Add parsing/sema analysis for nontemporal clause.
Add basic support for parsing/sema analysis of the nontemporal clause in
simd-based directives.
Alexey Bataev [Tue, 17 Dec 2019 19:33:03 +0000 (14:33 -0500)]
[LIBOPENMP][NVPTX]Fix the build error in the runtime.
Stefan Stipanovic [Tue, 17 Dec 2019 19:41:09 +0000 (20:41 +0100)]
[Attributor] H2S fix.
Summary: Fixing issues that were noticed in D71521
Reviewers: jdoerfert, lebedev.ri, uenoku
Subscribers:
Differential Revision: https://reviews.llvm.org/D71564
Stefan Stipanovic [Tue, 17 Dec 2019 19:36:10 +0000 (20:36 +0100)]
[Attributor][NFC] Add test for sle comparison in h2s.
Sam Clegg [Fri, 13 Dec 2019 23:12:56 +0000 (15:12 -0800)]
[WebAssembly] Convert MC tests to from bitcode to asm
Now that our `.s` format is stable(ish) and useable we should really
convert all our MC and lld tests over to .s format to match other
targets.
This is a test PR that just converts 2 of our MC tests to see what
it might look like.
Differential Revision: https://reviews.llvm.org/D71506
Jonas Paulsson [Thu, 12 Dec 2019 20:40:26 +0000 (21:40 +0100)]
[Clang FE, SystemZ] Recognize -mpacked-stack CL option
Recognize -mpacked-stack from the command line and add a function attribute
"mpacked-stack" when passed. This is needed for building the Linux kernel.
If this option is passed for any other target than SystemZ, an error is
generated.
Review: Ulrich Weigand
https://reviews.llvm.org/D71441
Dominic Chen [Tue, 17 Dec 2019 00:01:26 +0000 (19:01 -0500)]
llvm-diff: Perform structural comparison on GlobalVariables, if possible
Summary: Names of GlobalVariables may not be preserved depending on compilation options, so prefer a structural diff
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71582
Pierre Habouzit [Tue, 17 Dec 2019 19:06:17 +0000 (11:06 -0800)]
[objc_direct] fix uniquing when re-declaring a readwrite-direct property
ObjCMethodDecl::getCanonicalDecl() for re-declared readwrite properties,
only looks in the ObjCInterface for the declaration of the setter
method, which it won't find.
When the method is a property accessor, we must look in extensions for a
possible redeclaration.
Radar-Id: rdar://problem/
57991337
Differential Revision: https://reviews.llvm.org/D71588
Jay Foad [Tue, 17 Dec 2019 16:09:02 +0000 (16:09 +0000)]
[AMDGPU] Fix typo in SIInstrInfo::memOpsHaveSameBasePtr
Summary:
The typo has been present since memOpsHaveSameBasePtr was introduced in
r313208.
It caused SIInstrInfo::shouldClusterMemOps to cluster more mem ops than
it was supposed to.
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71616
Sanjay Patel [Tue, 17 Dec 2019 18:49:15 +0000 (13:49 -0500)]
[SDAG] adjust isNegatibleForFree calculation to avoid crashing
This is an alternate fix for the bug discussed in D70595.
This also includes minimal tests for other in-tree targets to show the problem more
generally.
We check the number of uses as a predicate for whether some value is free to negate,
but that use count can change as we rewrite the expression in getNegatedExpression().
So something that was marked free to negate during the cost evaluation phase becomes
not free to negate during the rewrite phase (or the inverse - something that was not
free becomes free). This can lead to a crash/assert because we expect that everything
in an expression that is negatible to be handled in the corresponding code within
getNegatedExpression().
This patch adds a hack to work-around the case where we probably no longer detect
that either multiply operand of an FMA isNegatibleForFree which is assumed to be
true when we started rewriting the expression.
Differential Revision: https://reviews.llvm.org/D70975
Sanjay Patel [Tue, 17 Dec 2019 18:47:59 +0000 (13:47 -0500)]
Revert "[SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpression()"
This reverts commit
36b1232ec5f370ab9fe8fcff0458d2fca5ca9b7f.
Need to adjust commit message - that was a leftover from the earlier version.
Sanjay Patel [Tue, 17 Dec 2019 17:07:28 +0000 (12:07 -0500)]
[SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpression()
This is an alternate fix for the bug discussed in D70595.
This also includes minimal tests for other in-tree targets to show the problem more
generally.
We check the number of uses as a predicate for whether some value is free to negate,
but that use count can change as we rewrite the expression in getNegatedExpression().
So something that was marked free to negate during the cost evaluation phase becomes
not free to negate during the rewrite phase (or the inverse - something that was not
free becomes free). This can lead to a crash/assert because we expect that everything
in an expression that is negatible to be handled in the corresponding code within
getNegatedExpression().
This patch adds a hack to work-around the case where we probably no longer detect
that either multiply operand of an FMA isNegatibleForFree which is assumed to be
true when we started rewriting the expression.
Differential Revision: https://reviews.llvm.org/D70975
Nico Weber [Tue, 17 Dec 2019 18:43:50 +0000 (13:43 -0500)]
Revert "[ASTImporter] Friend class decl should not be visible in its context"
This reverts commit
4becf68c6f17fe143539ceac954b21175914e1c1.
Breaks building on Windows, see comments on D71020
Alex Lorenz [Tue, 17 Dec 2019 00:46:41 +0000 (16:46 -0800)]
[driver][darwin] Pass -platform_version flag to the linker instead of the -<platform>_version_min flag
In Xcode 11, ld added a new flag called -platform_version that can be used instead of the old -<platform>_version_min flags.
The new flag allows Clang to pass the SDK version from the driver to the linker.
This patch adopts the new -platform_version flag in Clang, and starts using it by default,
unless a linker version < 520 is passed to the driver.
Differential Revision: https://reviews.llvm.org/D71579
JonChesterfield [Tue, 17 Dec 2019 18:02:48 +0000 (18:02 +0000)]
[libomptarget][nfc] Move three files under common, build them for amdgcn
Summary:
[libomptarget][nfc] Move three files under common, build them for amdgcn
Change to reduction.cu to remove two dead includes, otherwise no code change.
Reviewers: jdoerfert, ABataev, grokos
Reviewed By: jdoerfert
Subscribers: jvesely, mgorny, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D71601
Zakk Chen [Thu, 28 Nov 2019 16:33:55 +0000 (08:33 -0800)]
[RISCV] Add subtargets initialized with target feature
expected failed test (RV32IF-ILP32F) will be fixed in a subsequent patch.
Reviewers: efriedma, lenary, asb
Reviewed By: efriedma, lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70116
Kevin P. Neal [Tue, 17 Dec 2019 17:30:41 +0000 (12:30 -0500)]
[FPEnv] IRBuilder support for constrained sitofp/uitofp.
Amaury Séchet [Mon, 2 Dec 2019 18:13:38 +0000 (19:13 +0100)]
[DAGCombiner] Add node back in the worklist in topological order in CommitTargetLoweringOpt
Summary:
Right now, DAGCombiner process the nodes in an iplementation defined order. This tends to be fragile as optimisation may or may not kick in depending on the traversal order.
This is part of a larger effort to get the DAGCombiner to process its node in topological order.
Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70921
Ulrich Weigand [Tue, 17 Dec 2019 17:20:14 +0000 (18:20 +0100)]
[SystemZ][FPEnv] Back-end support for STRICT_[SU]INT_TO_FP
As of b1d8576 there is middle-end support for STRICT_[SU]INT_TO_FP,
so this patch adds SystemZ back-end support as well.
The patch is SystemZ target specific except for adding SD patterns
strict_[su]int_to_fp and any_[su]int_to_fp to TargetSelectionDAG.td
as usual.
Daniel Sanders [Tue, 17 Dec 2019 15:43:58 +0000 (15:43 +0000)]
[gicombiner] Process the MatchDag such that every node is reachable from the roots
Summary:
When we build the walk across these DAG's we need to be able to reach every node
from the roots. Flip and traversal edges (so that use->def becomes def->uses)
that make nodes unreachable. Note that early on we'll just error out on these
flipped edges as def->uses edges are more complicated to match due to their
one->many nature.
Depends on D69077
Reviewers: volkan, bogner
Subscribers: llvm-commits
Piotr Sobczak [Fri, 15 Nov 2019 14:07:41 +0000 (15:07 +0100)]
[InstCombine][AMDGPU] Trim more components of *buffer_load
Summary:
Add trimming of unused components of s_buffer_load.
Extend trimming of *buffer_load to also include
unused components at the beginning of vectors and update offset.
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70315
Michael Trent [Wed, 11 Dec 2019 18:42:37 +0000 (10:42 -0800)]
[ MC ] Match labels to existing fragments even when switching sections.
Summary:
This commit builds upon Derek Schuff's 2014 commit for attaching labels to
existing fragments ( Diff Revision: http://reviews.llvm.org/D5915 )
When temporary labels appear ahead of a fragment, MCObjectStreamer will
track the temporary label symbol in a "Pending Labels" list. Labels are
associated with fragments when a real fragment arrives; otherwise, an empty
data fragment will be created if the streamer's section changes or if the
stream finishes.
This commit moves the "Pending Labels" list into each MCStream, so that
this label-fragment matching process is resilient to section changes. If
the streamer emits a label in a new section, switches to another section to
do other work, then switches back to the first section and emits a
fragment, that initial label will be associated with this new fragment.
Labels will only receive empty data fragments in the case where no other
fragment exists for that section.
The downstream effects of this can be seen in Mach-O relocations. The
previous approach could produce local section relocations and external
symbol relocations for the same data in an object file, and this mix of
relocation types resulted in problems in the ld64 Mach-O linker. This
commit ensures relocations triggered by temporary labels are consistent.
Reviewers: pete, ab, dschuff
Reviewed By: pete, dschuff
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71368
Jay Foad [Tue, 17 Dec 2019 16:48:02 +0000 (16:48 +0000)]
[AMDGPU] Update autogenerated checks
Joel E. Denny [Tue, 17 Dec 2019 15:23:11 +0000 (10:23 -0500)]
[lit] Fix internal diff newlines for -w/-b
For example, without this patch:
```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
1! 2--- 1,2 ----
1! 20
```
With this patch:
```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
1
! 2
--- 1,2 ----
1
! 20
```
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D71577
Sanjay Patel [Tue, 17 Dec 2019 15:21:32 +0000 (10:21 -0500)]
[AArch64] add tests for fcvtl2; NFC
Mitch Phillips [Tue, 17 Dec 2019 15:31:31 +0000 (07:31 -0800)]
Revert "Honor -fuse-init-array when os is not specified on x86"
This reverts commit
aa5ee8f244441a8ea103a7e0ed8b6f3e74454516.
This change broke the sanitizer buildbots. See comments at the patchset
(https://reviews.llvm.org/D71360) for more information.
Kadir Cetinkaya [Mon, 16 Dec 2019 13:22:48 +0000 (14:22 +0100)]
[clangd] Fix handling of inline/anon namespaces and names of deduced types in hover
Summary:
Clangd normally skips inline and anon namespaces while printing nested name
specifiers. It also drops any tag specifiers since we make use of `HoverInfo::Kind`
instead of some text in `HoverInfo::Name`
There was a bug causing us to print innermost inline/anon namespace, this patch
fixes that by skipping those.
Also changes printing and kind detection of deduced types to be similar to decl
case.
Also improves printing for lambdas, currently clangd prints lambdas as
`(anonymous class)`, we can improve it by at least printing `(lambda)`
instead.
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71543
Kadir Cetinkaya [Tue, 17 Dec 2019 12:00:12 +0000 (13:00 +0100)]
[clangd][NFC] Make use of TagDecl inside type for hover on auto
Summary:
We were traversing AST twice to get the Decl in case of sugared
types(auto, decltype). They seem to be same in practice, so this patch gets rid
of the second traversal and makes use of TagDecl inside QualType instead.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71597
LLVM GN Syncbot [Tue, 17 Dec 2019 15:28:35 +0000 (15:28 +0000)]
gn build: Merge
390c8baa544
Daniel Sanders [Tue, 17 Dec 2019 14:29:14 +0000 (14:29 +0000)]
[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input
Summary:
The MatchDag structure is a representation of the checks that need to be
performed and the dependencies that limit when they can happen.
There are two kinds of node in the MatchDag:
* Instrs - Represent a MachineInstr
* Predicates - Represent a check that needs to be performed (i.e. opcode, is register, same machine operand, etc.)
and two kinds of edges:
* (Traversal) Edges - Represent a register that can be traversed to find one instr from another
* Predicate Dependency Edges - Indicate that a predicate requires a piece of information to be tested.
For example, the matcher:
(match (MOV $t, $s),
(MOV $d, $t))
with MOV declared as an instruction of the form:
%dst = MOV %src1
becomes the following MatchDag with the following instruction nodes:
__anon0_0 // $t=getOperand(0), $s=getOperand(1)
__anon0_1 // $d=getOperand(0), $t=getOperand(1)
traversal edges:
__anon0_1[src1] --[t]--> __anon0_0[dst]
predicate nodes:
<<$mi.getOpcode() == MOV>>:$__anonpred0_2
<<$mi.getOpcode() == MOV>>:$__anonpred0_3
and predicate dependencies:
__anon0_0 ==> __anonpred0_2[mi]
__anon0_0 ==> __anonpred0_3[mi]
The result of this parse is currently unused but can be tested
using -gicombiner-stop-after-parse as done in parse-match-pattern.td. The
dump for testing includes a graphviz format dump to allow the rule to be
viewed visually.
Later on, these MatchDag's will be used to generate code and to build an
efficient decision tree.
Reviewers: volkan, bogner
Reviewed By: volkan
Subscribers: arsenm, mgorny, mgrang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69077