Tyker [Wed, 19 Feb 2020 17:52:20 +0000 (18:52 +0100)]
[AssumeBundle] Add documentation for the operand bundles of an llvm.assume
Summary:
Operand bundles on an llvm.assume allows representing
assumptions that an attribute holds for a certain value at a certain position.
Operand bundles enable assumptions that are either hard or impossible to
represent as a boolean argument of an llvm.assume.
Reviewers: jdoerfert, fhahn, nlopes, reames, regehr, efriedma
Reviewed By: jdoerfert
Subscribers: lebedev.ri, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74209
Jonas Paulsson [Thu, 6 Feb 2020 18:27:50 +0000 (19:27 +0100)]
[ValueTracking] Improve isKnownNonNaN() to recognize zero splats.
isKnownNonNaN() could not recognize a zero splat because that is a
ConstantAggregateZero which is-a ConstantData but not a ConstantDataVector.
Patch makes a ConstantAggregateZero return true.
Review: Thomas Lively
Differential Revision: https://reviews.llvm.org/D74263
Nico Weber [Wed, 19 Feb 2020 17:30:46 +0000 (12:30 -0500)]
[gn build] use \bfoo\b instead of \<foo\> in sync script
\<foo\> is more correct, but since we use shell=True on Windows,
the < and > get interpreted as redirection operators.
Rather than adding cmd escaping, just use \bfoo\b, which is Good
Enough Often Enough.
LLVM GN Syncbot [Wed, 19 Feb 2020 17:28:29 +0000 (17:28 +0000)]
[gn build] Port
a54d81f5979
Sean Silva [Fri, 14 Feb 2020 00:29:10 +0000 (16:29 -0800)]
Fix Block::eraseArgument when block arg is also a successor operand.
Summary:
This could trigger an assertion due to the block argument being used by
this block's own successor operands.
Reviewers: rriddle!
Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74583
Nico Weber [Wed, 19 Feb 2020 17:24:01 +0000 (12:24 -0500)]
[gn build] Set up include_dirs for
a54d81f597 (first checker in a subdir)
Craig Topper [Wed, 19 Feb 2020 17:02:56 +0000 (09:02 -0800)]
[X86] Add DCI.isBeforeLegalize() check to the v64i1 constant splitting code in combineStore.
We only need to split after type legalization. If we're before
we can just use a wide store and type legalization will split it.
Add a v128i1 test to exercise it post type legalization.
Zurab Tsinadze [Wed, 19 Feb 2020 17:10:31 +0000 (18:10 +0100)]
[analyzer] CERT: POS34-C
Summary:
This patch introduces a new checker:
`alpha.security.cert.pos.34c`
This checker is implemented based on the following rule:
https://wiki.sei.cmu.edu/confluence/x/6NYxBQ
The check warns if `putenv` function is
called with automatic storage variable as an argument.
Differential Revision: https://reviews.llvm.org/D71433
Stanislav Mekhanoshin [Wed, 19 Feb 2020 00:14:20 +0000 (16:14 -0800)]
[AMDGPU] Fix assumption about LaneBitmask content
Yet another assumption about an actual LaneBitmask content
is fixed.
Differential Revision: https://reviews.llvm.org/D74805
Eric Fiselier [Wed, 19 Feb 2020 16:59:37 +0000 (11:59 -0500)]
[libc++] Fix ABI break in __bit_reference.
The libc++ __bit_iterator type has weird ABI calling conventions as a
quirk
of the implementation. The const bit iterator is trivial, but the
non-const
bit iterator is not because it declares a user-defined copy constructor.
Changing this now is an ABI break, so this test ensures that each type
is trivial/non-trivial as expected.
The definition of 'non-trivial for the purposes of calls':
A type is considered non-trivial for the purposes of calls if:
* it has a non-trivial copy constructor, move constructor, or
destructor, or
* all of its copy and move constructors are deleted.
Jordan Rupprecht [Wed, 19 Feb 2020 16:58:55 +0000 (08:58 -0800)]
[NFC][compiler-rt][test] Fully qualify string -> std::string
Nikita Popov [Wed, 19 Feb 2020 16:51:26 +0000 (17:51 +0100)]
Revert "[IRBuilder] Always respect inserter/folder"
This reverts commit
f12fb2d99b8dd0dbef1c79f1d401200150f2d0bd.
I missed some changes in instrumentation test cases.
Alexandre Eichenberger [Wed, 19 Feb 2020 16:39:28 +0000 (11:39 -0500)]
[mlir][ods] Adding attribute setters generation
In some dialects, attributes may have default values that may be
determined only after shape inference. For example, attributes that
are dependent on the rank of the input cannot be assigned a default
value until the rank of the tensor is inferred.
While we can set attributes without explicit setters, referring to
the attributes via accessors instead of having to use the string
interface is better for compile time verification.
The proposed patch add one method per operation attribute that let us
set its value. The code is a very small modification of the existing
getter methods.
Differential Revision: https://reviews.llvm.org/D74143
Nikita Popov [Tue, 18 Feb 2020 21:19:39 +0000 (22:19 +0100)]
[InstCombine] Fix removal from deferred instructions
Make sure we don't skip the Deferred.remove() call if the
instruction is not in the worklist. Both of those are separate.
We don't have any cases where deferred instructions get removed
right now, but may cause problems in the future.
David Goldman [Tue, 18 Feb 2020 21:21:12 +0000 (16:21 -0500)]
[Sema][CodeComplete] Handle symlinks for include code completion
Summary:
Previously any symlinks would be ignored since the directory
traversal doesn't follow them.
With this change we now follow symlinks (via a `stat` call
in order to figure out the target type of the symlink if it
is valid).
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74790
Nikita Popov [Tue, 18 Feb 2020 19:35:16 +0000 (20:35 +0100)]
[IRBuilder] Always respect inserter/folder
Some IRBuilder methods that were originally defined on
IRBuilderBase do not respect custom IRBuilder inserters/folders,
because those were not accessible prior to D73835. Fix this by
making use of existing (and now accessible) IRBuilder methods,
which will handle inserters/folders correctly.
There are some changes in OpenMP tests, where bitcasts now get
constant folded. I've also highlighted one InstCombine test which
now finishes in two rather than three iterations, thanks to new
instructions being inserted into the worklist.
Differential Revision: https://reviews.llvm.org/D74787
Simon Pilgrim [Wed, 19 Feb 2020 16:15:23 +0000 (16:15 +0000)]
[SystemZ] Regenerate risbg tests. NFCI.
Pre-commit for some upcoming SimplifyDemandedBits bitrotate handling.
Denis Khalikov [Wed, 19 Feb 2020 14:11:22 +0000 (09:11 -0500)]
[mlir][spirv] Add mlir-vulkan-runner
Add an initial version of mlir-vulkan-runner execution driver.
A command line utility that executes a MLIR file on the Vulkan by
translating MLIR GPU module to SPIR-V and host part to LLVM IR before
JIT-compiling and executing the latter.
Differential Revision: https://reviews.llvm.org/D72696
Raphael Isemann [Wed, 19 Feb 2020 16:22:31 +0000 (17:22 +0100)]
[lldb][NFC] Remove giant do{...}while(false); in ClangASTSource::FindExternalVisibleDecls
Daniel Fava [Wed, 19 Feb 2020 16:09:18 +0000 (17:09 +0100)]
tsan: removing redundant loop in ThreadClock::release()
The removed loop clears reused for entries at the tail of a SyncClock.
The loop is redundant since those entries were already cleared by the
immediately preceding loop, which iterates over all entries in the
SyncClock (including the tail entries).
Alex Zinenko [Wed, 19 Feb 2020 16:15:44 +0000 (17:15 +0100)]
[mlir] NFC: use ValueRange for BlockArgument in ConvertStandardToLLVM
When the conversion was implemented, ValueRange did not support
BlockArguments the code materialized a vector. This is no longer
necessary.
Mikhail Maltsev [Wed, 19 Feb 2020 16:24:54 +0000 (16:24 +0000)]
[ARM,MVE] Fix predicate types of some intrinsics
Summary:
Some predicated MVE intrinsics return a vector with element size
different from the input vector element size. In this case the
predicate must type correspond to the output vector type.
The following intrinsics use the incorrect predicate type:
* llvm.arm.mve.mull.int.predicated
* llvm.arm.mve.mull.poly.predicated
* llvm.arm.mve.vshll.imm.predicated
This patch fixes the issue.
Reviewers: simon_tatham, dmgreen, ostannard, MarkMurrayARM
Reviewed By: MarkMurrayARM
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74838
Cameron McInally [Wed, 19 Feb 2020 15:30:44 +0000 (09:30 -0600)]
[AArch64][SVE] Add initial backend support for FP splat_vector
Differential Revision: https://reviews.llvm.org/D74632
Nico Weber [Wed, 19 Feb 2020 16:10:19 +0000 (11:10 -0500)]
[gn build] revert
e8e078c8bf7987
Now that I've updated ancient goma clients on the bots, this should
work. (Internal goma bug: b/
139410332, fixed months ago.)
Jay Foad [Mon, 17 Feb 2020 10:32:57 +0000 (10:32 +0000)]
[AMDGPU][ConstantFolding] Fold llvm.amdgcn.fmul.legacy intrinsic
Reviewers: arsenm, rampitec, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74835
Stefan Pintilie [Wed, 19 Feb 2020 15:47:14 +0000 (09:47 -0600)]
[Hexagon][NFC] Rename VK_Hexagon_PCREL to VK_PCREL
On PowerPC we will soon need to use pcrel to indicate PC Relative addressing.
Renamed the Hexagon specific variant kind to a non target specific VK so that
it can be used on both Hexagon and PowerPC.
Differential Revision: https://reviews.llvm.org/D74788
Krzysztof Parzyszek [Fri, 7 Feb 2020 15:30:31 +0000 (09:30 -0600)]
Add <128 x i1> as an intrinsic type
Florian Hahn [Wed, 19 Feb 2020 15:05:00 +0000 (16:05 +0100)]
[CGP] Adjust CodeGen tests after
e01a3d49c22
Florian Hahn [Wed, 19 Feb 2020 13:37:30 +0000 (14:37 +0100)]
[PatternMatch] Match XOR variant of unsigned-add overflow check.
Instcombine folds (a + b <u a) to (a ^ -1 <u b) and that does not match
the expected pattern in CodeGenPerpare via UAddWithOverflow.
This causes a regression over Clang 7 on both X86 and AArch64:
https://gcc.godbolt.org/z/juhXYV
This patch extends UAddWithOverflow to also catch the XOR case, if the
XOR is only used in the ICMP. This covers just a single case, but I'd
like to make sure I am not missing anything before tackling the other
cases.
Reviewers: nikic, RKSimon, lebedev.ri, spatel
Reviewed By: nikic, lebedev.ri
Differential Revision: https://reviews.llvm.org/D74228
Matt Arsenault [Mon, 10 Feb 2020 03:32:44 +0000 (22:32 -0500)]
AMDGPU/GlobalISel: Select MUBUF path for global atomic cmpxchg
I'm not sure why this isn't a pattern, but the DAG manually selects
this.
Pierre-vh [Wed, 19 Feb 2020 09:46:50 +0000 (09:46 +0000)]
[AArch64][ASMParser] Refuse equal source/destination for LDRAA/LDRAB
Differential Revision: https://reviews.llvm.org/D74822
Raphael Isemann [Wed, 19 Feb 2020 13:29:37 +0000 (14:29 +0100)]
[lldb][NFC] Modernize test setup code in several lang/cpp tests
All these tests can just call lldbutil.run_to_source_breakpoint
instead of reimplementing it.
Raphael Isemann [Wed, 19 Feb 2020 14:03:40 +0000 (15:03 +0100)]
[lldb] Remove Windows X-fail for TestCPPAuto and TestStepTarget
TestCPPAuto was only failing on windows due to the std::string
copying (which was not related at all to 'auto' functionality).
TestStepTarget is now also passing but that seems more that we
now have by accident the right behavior in Windows. I'll remove
the x-fail just to make the bot green again.
Jay Foad [Fri, 7 Feb 2020 11:13:51 +0000 (11:13 +0000)]
[TableGen] Diagnose undefined fields when generating searchable tables
Summary:
Previously TableGen would crash trying to print the undefined value as
an integer.
Change-Id: I3900071ceaa07c26acafb33bc49966d7d7a02828
Reviewers: nhaehnle
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74210
Sven van Haastregt [Wed, 19 Feb 2020 13:52:58 +0000 (13:52 +0000)]
[OpenCL] Only declare _sat conversions for integer types
The `-fdeclare-opencl-builtins` option was accepting saturated
conversions for non-integer types, which contradicts both the OpenCL
specification (v2.0 s6.2.3) and Clang's opencl-c.h file.
Alexander Belyaev [Wed, 19 Feb 2020 12:39:57 +0000 (13:39 +0100)]
[MLIR] Add naive fusion of parallel loops.
Raphael Isemann [Wed, 19 Feb 2020 13:14:56 +0000 (14:14 +0100)]
[lldb][NFC] Pointer to reference conversion for CompilerDeclContext params in ClangExpressionDeclMap.
Follow up for
f9568a95493aea3ea813bd37cb8c084ec4294e38.
Miloš Stojanović [Wed, 19 Feb 2020 13:34:12 +0000 (14:34 +0100)]
Recommit: "[llvm-exegesis] Improve error reporting in Assembler.cpp"
Summary: Commit
63bb9fee525f8f29fd9c2174fa7f15573c3d1fd7 was reverted in
7603bfb4b0a6a90137d47f0182a490fe54bf7ca3 because it broke builds that treat
warnings as errors.
This commit updates the calls to `assembleToStream()` in tests to check that
the return value is valid.
Original commit message:
Followup to D74084.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.
Differential Revision: https://reviews.llvm.org/D74325
Pavel Labath [Tue, 18 Feb 2020 12:33:59 +0000 (13:33 +0100)]
[lldb/DWARF] Add support for location lists in package files
The only thing needed was to account for the offset from the
debug_cu_index section when searching for the location list.
This patch also fixes a bug in the Module::ParseAllDebugSymbols
function, which meant that we would only parse the variables of the
first compile unit in the module. This function is only used from
lldb-test, so this does not fix any real issue, besides preventing me
from writing a test for this patch.
Pavel Labath [Tue, 18 Feb 2020 17:59:16 +0000 (18:59 +0100)]
ErrorTest: Break up "ErrorMatchers" test
This test was getting a bit long. Before adding more checks, group the
existing checks according to the matcher used, and break it up into
smaller tests.
Raphael Isemann [Wed, 19 Feb 2020 13:00:25 +0000 (14:00 +0100)]
[lldb] Remove some unnecessary includes from test sources
Sam Parker [Tue, 18 Feb 2020 14:05:39 +0000 (14:05 +0000)]
[ARM][LowOverheadLoops] Check loop liveouts
Check that no Q-regs are live out of the loop, unless the instruction
within the loop is predicated on the vctp.
Differential Revision: https://reviews.llvm.org/D72713
Tamas Berghammer [Tue, 18 Feb 2020 18:04:26 +0000 (18:04 +0000)]
Support OptionalAttr inside a StructAttr
Differential revision: https://reviews.llvm.org/D74768
David Green [Mon, 17 Feb 2020 12:00:17 +0000 (12:00 +0000)]
[ARM] VMLAVA reduction patterns
Similar to VADDV and VADDLV that have been added recently, this adds
lowering and patterns for VMLAV, VMLAVA, VMLALV and VMLALVA. They
perform the same roles as the add's, just folding a mul into the same
instruction (and so taking two inputs). As such, they need to be lowered
in the same way as the types are often not legal.
Differential Revision: https://reviews.llvm.org/D74390
Raphael Isemann [Wed, 19 Feb 2020 12:21:51 +0000 (13:21 +0100)]
[lldb] Skip failing parts of TestCppConstructors that use 'new' on Windows
Raphael Isemann [Wed, 19 Feb 2020 10:27:10 +0000 (11:27 +0100)]
[lldb] Make comparing RegisterInfo::[alt_]name's pointer value less footy-shooty
Comparing those two `const char *` values relies on the assumption that both
strings were created by a ConstString. Let's check that assumption with an
assert as otherwise this code silently does nothing and that's not great.
Sander de Smalen [Wed, 19 Feb 2020 10:44:56 +0000 (10:44 +0000)]
[AArch64][SVE] CodeGen of ACLE Builtin Types
Summary:
This patch adds codegen support for the ACLE builtin types added in:
https://reviews.llvm.org/D62960
so that the ACLE builtin types are emitted as corresponding scalable
vector types in LLVM.
Reviewers: rsandifo-arm, rovka, rjmccall, efriedma
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74724
Georgii Rymar [Mon, 17 Feb 2020 17:27:43 +0000 (20:27 +0300)]
[yaml2obj] - Change the order of implicitly created sections.
.dynsym and .dynstr are allocatable and therefore normally are placed
before non-allocatable .strtab, .shstrtab, .symtab sections.
But we are placing them after currently what creates a mix of
alloc/non-alloc sections and does not look normal.
Differential revision: https://reviews.llvm.org/D74756
Oliver Stannard [Wed, 19 Feb 2020 12:03:27 +0000 (12:03 +0000)]
Revert "Reland D74436 "Change clang option -ffp-model=precise to select ffp-contract=on"""
Reverting because this patch is causing ~20 llvm-test-suite failures on
a number of different bots:
* http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/3366
* http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/8222
* http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/13275
* http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/17213
This reverts commit
cd2c5af6dfd6e32ee7043894bcb42981ce99e8ac.
Simon Pilgrim [Wed, 19 Feb 2020 11:45:45 +0000 (11:45 +0000)]
[AMDGPU] performCvtF32UByteNCombine - add SHL and SimplifyMultipleUseDemandedBits support
This is part of the work to remove SelectionDAG::GetDemandedBits and just use SimplifyMultipleUseDemandedBits.
Recent experiments raised some v_cvt_f32_ubyte*_e32 regressions, so I've added some additional abilities to performCvtF32UByteNCombine to help unpack byte data more aggressively.
We still don't remove all OR(SHL,SRL) patterns as some of the regenerated nodes don't get combined again, but we are getting closer.
Differential Revision: https://reviews.llvm.org/D74786
David Green [Mon, 17 Feb 2020 11:35:22 +0000 (11:35 +0000)]
[ARM] MVE VADDLV lowering
Following on from the extra VADDV lowering, this extends things to
handle VADDLV which allows summing values into a pair of i32 registers,
together treated as a i64. This needs to be done in DAGCombine too as
the types are otherwise illegal, which is a fairly simple addition on
top of the existing code.
There is also a VADDLVA instruction handled here, that adds the incoming
values from the two general purpose registers. As opposed to the
non-long version where we could just add patterns for add(x, VADDV), the
long version needs to handle this early before the i64 has being split
into too many pieces.
Differential Revision: https://reviews.llvm.org/D74224
Petar Avramovic [Wed, 19 Feb 2020 11:01:48 +0000 (12:01 +0100)]
[MIPS GlobalISel] Legalize non-power-of-2 and unaligned load and store
Custom legalize non-power-of-2 and unaligned load and store for MIPS32r5
and older, custom legalize non-power-of-2 load and store for MIPS32r6.
Don't attempt to combine non power of 2 loads or unaligned loads when
subtarget doesn't support them (MIPS32r5 and older).
Differential Revision: https://reviews.llvm.org/D74625
Petar Avramovic [Wed, 19 Feb 2020 10:35:43 +0000 (11:35 +0100)]
[MIPS GlobalISel] Select 4 byte unaligned load and store
Improve legality checks for load and store, 4 byte scalar
load and store are now legal for all subtargets.
During regbank selection 4 byte unaligned loads and stores
for MIPS32r5 and older get mapped to gprb.
Select 4 byte unaligned loads and stores for MIPS32r5.
Fix tests that unintentionally had unaligned load or store.
Differential Revision: https://reviews.llvm.org/D74624
Florian Hahn [Wed, 19 Feb 2020 09:00:59 +0000 (10:00 +0100)]
[TargetLower] Update shouldFormOverflowOp check if math is used.
On some targets, like SPARC, forming overflow ops is only profitable if
the math result is used: https://godbolt.org/z/DxSmdB
This patch adds a new MathUsed parameter to allow the targets
to make the decision and defaults to only allowing it
if the math result is used. That is the conservative choice.
This patch also updates AArch64ISelLowering, X86ISelLowering,
ARMISelLowering.h, SystemZISelLowering.h to allow forming overflow
ops if the math result is not used. On those targets using the
overflow intrinsic for the overflow check only generates better code.
Reviewers: nikic, RKSimon, lebedev.ri, spatel
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D74722
Kerry McLaughlin [Wed, 19 Feb 2020 09:55:36 +0000 (09:55 +0000)]
[AArch64][SVE] Add SVE2 intrinsics for polynomial arithmetic
Summary:
Implements the following intrinsics:
- @llvm.aarch64.sve.eorbt
- @llvm.aarch64.sve.eortb
- @llvm.aarch64.sve.pmullb.pair
- @llvm.aarch64.sve.pmullt.pair
Reviewers: sdesmalen, c-rhodes, dancgr, cameron.mcinally, efriedma, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74769
Djordje Todorovic [Wed, 19 Feb 2020 09:17:52 +0000 (10:17 +0100)]
Reland "[DebugInfo] Enable the debug entry values feature by default"
Differential Revision: https://reviews.llvm.org/D73534
Tamas Petz [Tue, 18 Feb 2020 17:53:26 +0000 (17:53 +0000)]
[LLD][ELF][ARM] Fix support for SBREL type relocations
With this patch lld recognizes ARM SBREL relocations.
R_ARM*_MOVW_BREL relocations are not tested because they are not used.
Patch by Tamas Petz
Differential Revision: https://reviews.llvm.org/D74604
Raphael Isemann [Wed, 19 Feb 2020 10:02:08 +0000 (11:02 +0100)]
[lldb] Let TestCppConstructors pass without fix-it intervention
This should use -> instead of '.', but the fix-it functionality of
the expression evaluator saved us here. Let's use the proper syntax
in the first place as we don't want to test fix-its here.
Raphael Isemann [Wed, 19 Feb 2020 09:47:37 +0000 (10:47 +0100)]
[lldb] Put Host/common headers in a module
This directory escaped the modularization effort it seems. Just adding
this to the Host module along with the other common headers, which should
make this code less likely to break under modules and speed up compilation.
David Green [Fri, 14 Feb 2020 11:00:16 +0000 (11:00 +0000)]
[ARM] Extra MVE VADDV reduction patterns
We already make use of the VADDV vector reduction instruction for cases
where the input and the output start out at the same type. The MVE
instruction however will sum into an i32, so if we are summing a v16i8
into an i32, we can still use the same instructions. In terms of IR,
this looks like a sext of a legal type (v16i8) into a very illegal type
(v16i32) and a vecreduce.add of that into the result. This means we have
to catch the pattern early in a DAG combine, producing a target VADDVs/u
node, where the signedness is now important.
This is the first part, handling VADDV and VADDVA. There are also
VADDVL/VADDVLA instructions, which are interesting because they sum into
a 64bit value. And VMLAV and VMLALV, which are interesting because they
also do a multiply of two values. It may look a little odd in places as
a result.
On it's own this will probably not do very much, as the vectorizer will
not produce this IR yet.
Differential Revision: https://reviews.llvm.org/D74218
Florian Hahn [Wed, 19 Feb 2020 09:38:38 +0000 (10:38 +0100)]
[DebugInfo] Pass linux triple to tests requiring ELF.
The tests added in D74425/commit
a71feda24ea092ec14474216532b3ce9883b81ab
fail with an assertion on macOS, as they seem to require ELF support.
Passing a linux triple ensures the object files are using ELF.
This fixes some GreenDragon failures.
Raphael Isemann [Wed, 19 Feb 2020 08:36:37 +0000 (09:36 +0100)]
[lldb] Let TypeSystemClang::GetDisplayTypeName remove anonymous and inline namespaces.
Summary:
Currently when printing data types we include implicit scopes such as inline namespaces or anonymous namespaces.
This leads to command output like this (for `std::set<X>` with X being in an anonymous namespace):
```
(lldb) print my_set
(std::__1::set<(anonymous namespace)::X, std::__1::less<(anonymous namespace)::X>, std::__1::allocator<(anonymous namespace)::X> >) $0 = size=0 {}
```
This patch removes all the implicit scopes when printing type names in TypeSystemClang::GetDisplayTypeName
so that our output now looks like this:
```
(lldb) print my_set
(std::set<X, std::less<X>, std::allocator<X> >) $0 = size=0 {}
```
As previously GetDisplayTypeName and GetTypeName had the same output we actually often used the
two as if they are the same method (they were in fact using the same implementation), so this patch also
fixes the places where we actually want the display type name and not the actual type name.
Note that this doesn't touch the `GetTypeName` class that for example the data formatters use, so this patch
is only changes the way we display types to the user. The full type name can also still be found when passing
'-R' to see the raw output of a variable in case someone is somehow interested in that.
Partly fixes rdar://problem/
59292534
Reviewers: shafik, jingham
Reviewed By: shafik
Subscribers: christof, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74478
Raphael Isemann [Wed, 19 Feb 2020 09:24:59 +0000 (10:24 +0100)]
[lldb][NFC] Add a missing test case to TestCppConstructors.py
Raphael Isemann [Wed, 19 Feb 2020 09:00:02 +0000 (10:00 +0100)]
[lldb] Make TestFormatters.py not rely on working constructor calls
All calls to operator new in this test fail for me with:
```
expression --show-types -- *(new foo(47))`
Error output:
error: Execution was interrupted, reason: internal c++ exception breakpoint(-6)..
The process has been returned to the state before expression evaluation.
```
As calling operator new isn't the idea of this test, this patch moves that
logic to the binary with some new_* utility functions and explicitly tests
this logic in the constructor test (where we can isolate the failures and
skip them on Linux).
Alexander Belyaev [Wed, 19 Feb 2020 07:03:51 +0000 (08:03 +0100)]
[MLIR][Ploops] Add custom builders from ParallelOp and ReduceOp.
Differential Revision: https://reviews.llvm.org/D74708
Petar Avramovic [Wed, 19 Feb 2020 09:06:28 +0000 (10:06 +0100)]
[MIPS GlobalISel] RegBankSelect G_MERGE_VALUES and G_UNMERGE_VALUES
Consider large operands in G_MERGE_VALUES and G_UNMERGE_VALUES as
Ambiguous during regbank selection.
Introducing new InstType AmbiguousWithMergeOrUnmerge which will
allow us to recognize whether to narrow scalar or use s64:fprb.
This change exposed a bug when reusing data from TypeInfoForMF.
Thus when Instr is about to get destroyed (using narrow scalar)
clear its data in TypeInfoForMF. Internal data is saved based on
Instr's address, and it will no longer be valid.
Add detailed asserts for InstType and operand size.
Generate generic instructions instead of MIPS target instructions
during argument lowering and custom legalizer.
Select G_UNMERGE_VALUES and G_MERGE_VALUES when proper banks are
selected: {s32:gprb, s32:gprb, s64:fprb} for G_UNMERGE_VALUES and
{s64:fprb, s32:gprb, s32:gprb} for G_MERGE_VALUES.
Update tests. One improvement is when floating point argument in
gpr(or two gprs) gets passed to another function through gpr
unnecessary fpr-to-gpr moves are no longer generated.
Differential Revision: https://reviews.llvm.org/D74623
Balázs Kéri [Wed, 19 Feb 2020 09:06:58 +0000 (10:06 +0100)]
[clang-tidy] Added a case to UnconventionalAssignOperatorCheck.
Summary:
The check accepts now a `return (*this = something);` as return
statement too (beneath of `*this`).
Reviewers: alexfh, hokein, aaron.ballman, JonasToth
Reviewed By: aaron.ballman
Subscribers: xazax.hun, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D74529
Florian Hahn [Tue, 18 Feb 2020 14:43:01 +0000 (15:43 +0100)]
[CGP] Precommit tests for D74228.
Kirill Bobyrev [Wed, 19 Feb 2020 08:18:38 +0000 (09:18 +0100)]
Fix build after D74606
Craig Topper [Wed, 19 Feb 2020 07:38:36 +0000 (23:38 -0800)]
[X86] Remove vXi1 select optimization from LowerSELECT. Move it to DAG combine.
Jonas Devlieghere [Wed, 19 Feb 2020 07:52:07 +0000 (23:52 -0800)]
[lldb/Core] Remove more duplicate code in PluginManager (NFCI)
The PluginManager contains a lot of duplicate code. I already removed a
bunch of it by introducing the templated PluginInstance class, and this
is the next step. The PluginInstances class combines the mutex and the
vector and implements the common operations.
To accommodate plugin instances with additional members it is possible
to access the underlying vector and mutex. The methods to query these
fields make use of that.
Differential revision: https://reviews.llvm.org/D74816
Kirill Bobyrev [Tue, 18 Feb 2020 16:55:12 +0000 (17:55 +0100)]
[clangd] Add add commit characters to the server capabilities
Summary:
Make it more convinient for the clients to select completion items by
providing a set of default characters (punctuation).
Related issue: https://github.com/clangd/clangd/issues/284
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74606
Craig Topper [Tue, 18 Feb 2020 07:21:48 +0000 (23:21 -0800)]
[X86] Handle splats in LowerBUILD_VECTORvXi1 by directly emitting scalar selects instead of deferring that to LowerSELECT.
LoweSELECT will detect the constant inputs and convert to scalar
selects, but we can do it directly here.
I might remove some of the code from LowerSELECT and move it to
DAG combine so doing this explicitly will make us less dependent
on it happening in lowering.
Brian Gesiak [Thu, 26 Dec 2019 13:00:00 +0000 (08:00 -0500)]
[Coroutines][6/6] Clang schedules new passes
Summary:
Depends on https://reviews.llvm.org/D71902.
The last in a series of six patches that ports the LLVM coroutines
passes to the new pass manager infrastructure.
This patch has Clang schedule the new coroutines passes when the
`-fexperimental-new-pass-manager` option is used. With this and the
previous 5 patches, Clang is capable of building and successfully
running the test suite of large coroutines projects such as
https://github.com/lewissbaker/cppcoro with
`ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=On`.
Reviewers: GorNishanov, lewissbaker, chandlerc, junparser
Subscribers: EricWF, cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71903
Brian Gesiak [Thu, 26 Dec 2019 13:00:00 +0000 (08:00 -0500)]
[Coroutines][5/6] Add coroutine passes to pipeline
Summary:
Depends on https://reviews.llvm.org/D71901.
The fifth in a series of patches that ports the LLVM coroutines passes
to the new pass manager infrastructure.
The first 4 patches allow users to run coroutine passes by invoking, for
example `opt -passes=coro-early`. However, most of LLVM's tests for
coroutines use an option, `opt -enable-coroutines`, which adds all 4
coroutine passes to the appropriate legacy pass manager extension points.
This patch does the same, but using the new pass manager: when
coroutine features are enabled and the new pass manager is being used,
this adds the new-pass-manager-compliant coroutine passes to the pass
builder's pipeline.
This allows us to run all coroutine tests using the new pass manager
(besides those that use the coroutine retcon ABI used by the Swift
compiler, which is not yet supported in the new pass manager).
Reviewers: GorNishanov, lewissbaker, chandlerc, junparser, wenlei
Subscribers: wenlei, EricWF, Prazek, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71902
Brian Gesiak [Thu, 26 Dec 2019 13:00:00 +0000 (08:00 -0500)]
[Coroutines][4/6] New pass manager: coro-cleanup
Summary:
Depends on https://reviews.llvm.org/D71900.
The fourth in a series of patches that ports the LLVM coroutines passes
to the new pass manager infrastructure. This patch implements
'coro-cleanup'.
No existing regression tests check the behavior of coro-cleanup on its
own, so this patch adds one. (A test named 'coro-cleanup.ll' exists, but
it relies on the entire coroutines pipeline being run. It's updated to
test the new pass manager in the 5th patch of this series.)
Reviewers: GorNishanov, lewissbaker, chandlerc, junparser, deadalnix, wenlei
Reviewed By: wenlei
Subscribers: wenlei, EricWF, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71901
Brian Gesiak [Tue, 18 Feb 2020 21:29:13 +0000 (16:29 -0500)]
Re-land new pass manager coro-split and coro-elide
This re-applies patches https://reviews.llvm.org/D71899 and
https://reviews.llvm.org/D71900, which were reverted in
https://reviews.llvm.org/rG11053a1cc61 and
https://reviews.llvm.org/rGe999aa38d16. The underlying problem that
caused two buildbots to fail with these patches is explained in
https://reviews.llvm.org/rG26f356350bd -- older compliers disagree with
the order in which the left- and right-hand side of an assignment in
LazyCallGraph ought to be evaluated, which caused an assertion in
SmallVector::operator[] to fire when the test suite was run.
Sourabh Singh Tomar [Tue, 11 Feb 2020 18:29:40 +0000 (23:59 +0530)]
[DebugInfo]: Added support for DWARFv5 Info section header parsing in llvm-dwp utility.
Summary:
This patch teaches llvm-dwp to parse DWARFv5 info section header.
Tested this using asm test case caontaining DWARFv5 info.
Assemling it to DWO object, checking corresponding content using llvm-dwarfdump. Then finally, packaging it
to DWP using llvm-dwp and again checking corresponding content using llvm-dwarfdump.
Reviewers: dblaikie, aprantl, probinson.
Reviewed By: dblaikie.
Differential Revision: https://reviews.llvm.org/D74425
Fangrui Song [Wed, 19 Feb 2020 04:08:36 +0000 (20:08 -0800)]
[DebugInfo][test] Fix section flags/type to avoid warning/error in the future
A future MC change may add a warning/error when a .section directive
specifies incorrect sh_flags/sh_type. Fix the tests to use correct
sh_flags/sh_type.
Brian Gesiak [Wed, 19 Feb 2020 04:28:00 +0000 (23:28 -0500)]
[LazyCallGraph] Fix ambiguous index value
After having committed https://reviews.llvm.org/D72226, 2 buildbots
running GCC 5.4.0 began failing. The cause was the order in which those
compilers evaluated the left- and right-hand sides of the expression
`RC.SCCIndices[C] = RC.SCCIndices.size();`. This commit splits the
expression into multiple statements to avoid ambiguity, and adds a test
case that exercises the code that caused the test failures on those
older compilers (which was originally included in the reviewed patch,
https://reviews.llvm.org/D72226).
Jonas Devlieghere [Wed, 19 Feb 2020 04:22:51 +0000 (20:22 -0800)]
[lldb] Sort forward declarations in lldb-forward.h
Sort forward declarations alphabetically. Also remove the two LLVM
forward declares as they frankly don't belong here.
Jonas Devlieghere [Wed, 19 Feb 2020 04:16:59 +0000 (20:16 -0800)]
[lldb] Move ArchitectureCreateInstance into ldb-private-interfaces
There's no reason this should be the only one living in the
PluginManager itself.
Jonas Devlieghere [Wed, 19 Feb 2020 04:08:41 +0000 (20:08 -0800)]
[lldb/Docs] Update the features matrix
Use YES/NO instead of OK, known issues instead of bugs and fix some
other small inconsistencies
Jonas Devlieghere [Wed, 19 Feb 2020 03:44:48 +0000 (19:44 -0800)]
[lldb/Docs] Update the Windows documentation
Update the build instructions for Windows with my recent experience.
Jonas Devlieghere [Wed, 19 Feb 2020 03:13:45 +0000 (19:13 -0800)]
Re-land "[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin"
This patch changes the way we initialize and terminate the plugins in
the system initializer. It uses an approach similar to LLVM's
TARGETS_TO_BUILD with a def file that enumerates the plugins.
Previous attempts to land this failed on the Windows bot because there's
a dependency between the different process plugins. Apparently
ProcessWindowsCommon needs to be initialized after all other process
plugins but before ProcessGDBRemote.
Differential revision: https://reviews.llvm.org/D73067
Richard Smith [Wed, 19 Feb 2020 02:39:57 +0000 (18:39 -0800)]
P0593R6: Pseudo-destructor expressions end object lifetimes.
This only has an observable effect on constant evaluation.
Wenlei He [Tue, 18 Feb 2020 23:05:37 +0000 (15:05 -0800)]
Fix test for profile remapper
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74799
Tim Shen [Fri, 14 Feb 2020 23:07:44 +0000 (15:07 -0800)]
[MLIR] change NVVM.mma.sync to the most useful variant.
Summary:
the .row.col variant turns out to be the popular one, contrary to what I
thought as .row.row. Since .row.col is so prevailing (as I inspect
cuDNN's behavior), I'm going to remove the .row.row support here, which
makes the patch a little bit easier.
Reviewers: ftynse
Subscribers: jholewinski, bixia, sanjoy.google, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74655
Tim Shen [Tue, 11 Feb 2020 03:44:42 +0000 (19:44 -0800)]
[MLIR] Add std.assume_alignment op.
Reviewers: ftynse, nicolasvasilache, andydavis1
Subscribers: bixia, sanjoy.google, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74378
Eric Christopher [Wed, 19 Feb 2020 01:49:22 +0000 (17:49 -0800)]
Fix a signed/unsigned warning promoted to error.
River Riddle [Wed, 19 Feb 2020 01:36:25 +0000 (17:36 -0800)]
[mlir][DialectConversion] Forward capture callback to fix build on older
GCC
Older GCC confuses the type of 'callback' after it gets captured, so
add a forward capture to move it properly.
Jonas Devlieghere [Wed, 19 Feb 2020 01:35:11 +0000 (17:35 -0800)]
[lldb/Core] Remove dead Get*PluginCreateCallbackForPluginName (NFC)
The plugin manager had dedicated Get*PluginCreateCallbackForPluginName
methods for each type of plugin, and only a small subset of those were
used. This removes the dead duplicated code.
Jim Lin [Wed, 19 Feb 2020 00:51:48 +0000 (08:51 +0800)]
[NFC] Update the testcase clang_f_opts.c for the removed options
Jonas Devlieghere [Wed, 19 Feb 2020 01:08:46 +0000 (17:08 -0800)]
[lldb/Core] Remove blatant code duplication by using a template (NFC)
Remove a bunch of duplicate code by using a templated base class.
Jim Lin [Wed, 19 Feb 2020 00:36:07 +0000 (08:36 +0800)]
Remove unused option that gcc ignored
Reviewers: efriedma, MaskRay
Reviewed By: efriedma, MaskRay
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72825
River Riddle [Tue, 18 Feb 2020 23:56:33 +0000 (15:56 -0800)]
[mlir] Refactor TypeConverter to add conversions without inheritance
Summary:
This revision refactors the TypeConverter class to not use inheritance to add type conversions. It instead moves to a registration based system, where conversion callbacks are added to the converter with `addConversion`. This method takes a conversion callback, which must be convertible to any of the following forms(where `T` is a class derived from `Type`:
* Optional<Type> (T type)
- This form represents a 1-1 type conversion. It should return nullptr
or `llvm::None` to signify failure. If `llvm::None` is returned, the
converter is allowed to try another conversion function to perform
the conversion.
* Optional<LogicalResult>(T type, SmallVectorImpl<Type> &results)
- This form represents a 1-N type conversion. It should return
`failure` or `llvm::None` to signify a failed conversion. If the new
set of types is empty, the type is removed and any usages of the
existing value are expected to be removed during conversion. If
`llvm::None` is returned, the converter is allowed to try another
conversion function to perform the conversion.
When attempting to convert a type, the TypeConverter walks each of the registered converters starting with the one registered most recently.
Differential Revision: https://reviews.llvm.org/D74584
Richard Smith [Wed, 19 Feb 2020 00:13:23 +0000 (16:13 -0800)]
Add -std=c++20 flag, replace C++2a with C++20 throughout the Clang
user interface and documentation, and update __cplusplus for C++20.
WG21 considers the C++20 standard to be finished (even though it still
has some more steps to pass through in the ISO process).
The old flag names are accepted for compatibility, as usual, and we
still have lots of references to C++2a in comments and identifiers;
those can be cleaned up separately.
LLVM GN Syncbot [Wed, 19 Feb 2020 00:02:12 +0000 (00:02 +0000)]
[gn build] Port
ca9ba76481f
Thomas Lively [Fri, 7 Feb 2020 00:29:59 +0000 (16:29 -0800)]
[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
Nick Desaulniers [Tue, 18 Feb 2020 23:33:42 +0000 (15:33 -0800)]
[Driver] -pg -mfentry should respect target specific decisions for -mframe-pointer=all
Summary:
$ clang -O2 -pg -mfentry foo.c
was adding frame pointers to all functions. This was exposed via
compiling the Linux kernel for x86_64 with CONFIG_FUNCTION_TRACER
enabled.
-pg was unconditionally setting the equivalent of -fno-omit-frame-pointer,
regardless of the presence of -mfentry or optimization level. After this
patch, frame pointers will only be omitted at -O0 or if
-fno-omit-frame-pointer is explicitly set for -pg -mfentry.
See also:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=
3c5273a96ba8dbf98c40bc6d9d0a1587b4cfedb2;hp=
c9d75a48c4ea63ab27ccdb40f993236289b243f2#patch2
(modification to ix86_frame_pointer_required())
Fixes: pr/44934
Reviewers: void, manojgupta, dberris, MaskRay, hfinkel
Reviewed By: MaskRay
Subscribers: cfe-commits, llozano, niravd, srhines
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74698