Volodymyr Sapsai [Fri, 21 Feb 2020 01:45:51 +0000 (17:45 -0800)]
clang/Modules: Finish renaming CompilerInstance::ModuleManager, NFC.
Follow-up to
20d51b2f14ac4488f684f8fc57cb0ba718a6b91d, rename the setter to
make it consistent with the getter. Also fixed a few comments along the
way, didn't try to find all references to a module manager.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D74939
Fangrui Song [Fri, 21 Feb 2020 21:45:12 +0000 (13:45 -0800)]
[AArch64][SVE] Fix -Wimplicit-fallthrough after D73711
Med Ismail Bennani [Fri, 21 Feb 2020 21:43:25 +0000 (22:43 +0100)]
[lldb/Plugins] Add ability to fetch crash information on crashed processes
Currently, in macOS, when a process crashes, lldb halts inside the
implementation disassembly without yielding any useful information.
The only way to get more information is to detach from the process, then wait
for ReportCrash to generate a report, find the report, then see what error
message was included in it. Instead of waiting for this to happen, lldb could
locate the error_string and make it available to the user.
This patch addresses this issue by enabling the user to fetch extended
crash information for crashed processes using `process status --verbose`.
Depending on the platform, this will try to gather different crash information
into an structured data dictionnary. This dictionnary is generic and extensible,
as it contains an array for each different type of crash information.
On Darwin Platforms, lldb will iterate over each of the target's images,
extract their `__crash_info` section and generated a StructuredData::Array
containing, in each entry, the module spec, its UUID, the crash messages
and the abort cause. The array will be inserted into the platform's
`m_extended_crash_info` dictionnary and `FetchExtendedCrashInformation` will
return its JSON representation like this:
```
{
"crash-info annotations": [
{
"abort-cause": 0,
"image": "/usr/lib/system/libsystem_malloc.dylib",
"message": "main(76483,0x1000cedc0) malloc: *** error for object 0x1003040a0: pointer being freed was not allocated",
"message2": "",
"uuid": "
5747D0C9-900D-3306-8D70-
1E2EA4B7E821"
},
...
],
...
}
```
This crash information can also be fetched using the SB API or lldb-rpc protocol
using SBTarget::GetExtendedCrashInformation().
rdar://
37736535
Differential Revision: https://reviews.llvm.org/D74657
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Wed, 19 Feb 2020 15:33:39 +0000 (16:33 +0100)]
[lldb/test] Move `platform process list` tests to its own directory (NFC)
Since the `platform process` commamnd has more tests now, this commits
separates each of the `platform process` subcommand's test in its own directory.
Differential Revision: https://reviews.llvm.org/D74836
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Alexander Shaposhnikov [Fri, 21 Feb 2020 21:18:36 +0000 (13:18 -0800)]
[llvm-objcopy][MachO] Change the storage of sections
In this diff we change the storage of a section to unique_ptr.
This refactoring was factored out from D71647.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D74946
Cameron McInally [Fri, 21 Feb 2020 20:41:35 +0000 (14:41 -0600)]
[AArch64][SVE] Add support for DestructiveBinary and DestructiveBinaryComm DestructiveInstTypes
Add support for DestructiveBinaryComm DestructiveInstType, as well as the lowering code to expand the new Pseudos into the final movprfx+instruction pairs.
Differential Revision: https://reviews.llvm.org/D73711
Jay Foad [Fri, 21 Feb 2020 20:59:44 +0000 (20:59 +0000)]
AMDGPU/GlobalISel: Better code for one case of G_SHUFFLE_VECTOR on v2i16
Reviewers: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74987
Sanjay Patel [Fri, 21 Feb 2020 20:43:05 +0000 (15:43 -0500)]
[VectorCombine] refactor to reduce duplicated code; NFC
This should be the last step in the current cleanup.
Follow-ups should resolve the TODO about cost calc
and enable the more general case where we extract
different elements.
LLVM GN Syncbot [Fri, 21 Feb 2020 20:51:44 +0000 (20:51 +0000)]
[gn build] Port
1874dee5662
Haibo Huang [Mon, 17 Feb 2020 01:33:32 +0000 (17:33 -0800)]
Allow customized relative PYTHONHOME
Summary:
This change allows a hard coded relative PYTHONHOME setting. So that
python can easily be packaged together with lldb.
The change includes:
1. Extend LLDB_RELOCATABLE_PYTHON to all platforms. It defaults to ON
for platforms other than Windows, to keep the behavior compatible.
2. Allows to customize LLDB_PYTHON_HOME. But still defaults to
PYTHON_HOME.
3. LLDB_PYTHON_HOME can be a path relative to liblldb. If it is
relative, we will resolve it before send it to Py_DecodeLocale.
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74727
Francis Visoiu Mistrih [Wed, 19 Feb 2020 00:39:05 +0000 (16:39 -0800)]
[macho][NFC] Extract all CPU_(SUB_)TYPE logic to BinaryFormat
This moves all the logic of converting LLVM Triples to
MachO::CPU_(SUB_)TYPE from the specific target (Target)AsmBackend to
more convenient functions in lib/BinaryFormat.
This also gets rid of the separate two X86AsmBackend classes.
The previous attempt was to add it to libObject, but that adds an
unnecessary dependency to libObject from all the targets.
Differential Revision: https://reviews.llvm.org/D74808
Craig Topper [Fri, 21 Feb 2020 20:30:27 +0000 (12:30 -0800)]
[X86] Add a new format type for instructions that represent named prefix bytes like data16 and rep. Use it to make a simpler version of isPrefix.
isPrefix was added to support the patches to align branches.
it relies on a switch over instruction names.
This moves those opcodes to a new format so the information is
tablegen and we can just check for a specific value in some bits
in TSFlags instead.
I've left the other function in place for now so that the
existing patches in phabricator will still work. I'll work with
the owner to get them migrated.
Reid Kleckner [Fri, 21 Feb 2020 20:31:00 +0000 (12:31 -0800)]
[IR] Update BasicBlock::validateInstrOrdering comments, NFC
Pointed out by Jay Foad.
Francesco Petrogalli [Thu, 13 Feb 2020 20:42:26 +0000 (20:42 +0000)]
[llvm][CodeGen][aarch64] Add contiguous prefetch intrinsics for SVE.
Summary: The patch covers both register/register and register/immediate addressing modes.
Reviewers: efriedma, andwar, sdesmalen
Reviewed By: sdesmalen
Subscribers: sdesmalen, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74581
Sanjay Patel [Fri, 21 Feb 2020 19:25:39 +0000 (14:25 -0500)]
[VectorCombine] refactor cost calcs to reduce duplication; NFC
More cleanup is possible now, but we probably need to
resolve the TODO about the existing difference between
compares and binops.
Francesco Petrogalli [Tue, 28 Jan 2020 20:37:52 +0000 (20:37 +0000)]
[llvm][aarch64] SVE addressing modes.
Summary:
Added register + immediate and register + register addressing modes for the following intrinsics:
1. Masked load and stores:
* Sign and zero extended load and truncated stores.
* No extension or truncation.
2. Masked non-temporal load and store.
Reviewers: andwar, efriedma
Subscribers: cameron.mcinally, sdesmalen, tschuett, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74254
Rob Suderman [Fri, 21 Feb 2020 19:54:49 +0000 (11:54 -0800)]
Move StandardOps/Ops.h to StandardOps/IR/Ops.h
Summary:
NFC - Moved StandardOps/Ops.h to a StandardOps/IR dir to better match surrounding
directories. This is to match other dialects, and prepare for moving StandardOps
related transforms in out for Transforms and into StandardOps/Transforms.
Differential Revision: https://reviews.llvm.org/D74940
Krzysztof Parzyszek [Fri, 21 Feb 2020 16:35:59 +0000 (10:35 -0600)]
[Hexagon] Simplify intrinsic (vandvrt (vandqrt q b) m) -> q if possible
When each byte in b&m is non-zero, this conversion Q->V->Q is a no-op.
Nagy Mostafa [Fri, 21 Feb 2020 19:48:45 +0000 (11:48 -0800)]
[MLIR] Remove constexpr from LoopOps.td
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D74978
Hanhan Wang [Fri, 21 Feb 2020 19:39:32 +0000 (14:39 -0500)]
[mlir][spirv] Add lowering for load/store zero-rank memref from std to SPIR-V.
Differential Revision: https://reviews.llvm.org/D74874
Luís Marques [Fri, 21 Feb 2020 19:26:09 +0000 (19:26 +0000)]
[CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V
By default the RISC-V target doesn't have the atomics standard extension
enabled. The first RUN line in `clang/test/CodeGen/atomic_ops.c` didn't
specify a target triple, which meant that on RISC-V Linux hosts it would
target RISC-V, but because it used clang cc1 we didn't get the toolchain
driver functionality to automatically turn on the extensions implied by
the target triple (riscv64-linux includes atomics). This would cause the
test to fail on RISC-V hosts.
This patch changes the test to have RUN lines for two explicit targets,
one with native atomics and one without. To work around FileCheck
limitations and more accurately match the output, some tests now have
separate prefixes for the two cases.
Reviewers: jyknight, eli.friedman, lenary, efriedma
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D74847
Cameron McInally [Fri, 21 Feb 2020 19:15:28 +0000 (13:15 -0600)]
[AArch64][SVE] Add backend support for splats of immediates
This patch adds backend support for splats of both Int and FP immediates.
Differential Revision: https://reviews.llvm.org/D74856
Louis Dionne [Fri, 21 Feb 2020 18:53:50 +0000 (13:53 -0500)]
[libc++] Do not set the `availability=XXX` feature when not testing against a system libc++
Otherwise, the `availability=XXX` lit feature is set even when we're
testing trunk and _LIBCPP_DISABLE_AVAILABILITY is defined, which causes
tests that check for availability markup to be enabled and unexpectedly
pass.
Fangrui Song [Fri, 21 Feb 2020 18:55:12 +0000 (10:55 -0800)]
[ARM] Change ARMAttributeParser::Parse to use support::endianness and simplify
Matt Arsenault [Wed, 19 Feb 2020 19:53:03 +0000 (14:53 -0500)]
AMDGPU/GlobalISel: Fix SALU mapping for v2s16 min/max
The legalizer helper functions are unusably awkward to perform the 3-5
part legalization. This needs to be widened, scalarized, lowered, and
we should avoid creating vector extends and truncates. Manually do all
of this and expand.
Matt Davis [Fri, 21 Feb 2020 18:33:35 +0000 (10:33 -0800)]
[lldb/cmake] Enable more verbose find_package output.
Summary:
The purpose of this patch is to make identifying missing dependencies clearer to the user.
`find_package` will report if a package is not found, that output, combined with the exiting
status message, is clearer than not having the additional verbosity.
If the SWIG dependency is required {LLDB_ENABLE_PYTHON, LLDB_ENABLE_LUA}
and SWIG is not available, fail the configuration step. Terminate the
configure early rather than later with a clear error message.
We could possibly modify:
`llvm-project/lldb/cmake/modules/FindPythonInterpAndLibs.cmake`
However, the patch here seems clear in my opinion.
Reviewers: aadsm, hhb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: labath, jrm, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74917
Matt Arsenault [Wed, 19 Feb 2020 15:42:31 +0000 (10:42 -0500)]
AMDGPU: Move dot intrinsic patterns to instruction def
I tried to use some of the new tablegen features to avoid creating
different operand list permutations, but I still don't see a way to
programmatically build a source pattern dag.
Also add GlobalISel tests, which now all import successfully.
Some of the fneg fold tests are incorrect, which need to be fixed in a
future commit
Matt Arsenault [Tue, 18 Feb 2020 03:26:04 +0000 (22:26 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.fdot2
I'm slighly worried about the generated checks, since they won't catch
incorrect modifiers being added at the end of the line.
Matt Arsenault [Sun, 1 Sep 2019 02:39:00 +0000 (22:39 -0400)]
AMDGPU/GlobalISel: Select VOP3P instructions
This only handles the basic cases. More work is needed to make better
use of op_sel.
Matt Arsenault [Sun, 16 Feb 2020 04:56:56 +0000 (23:56 -0500)]
AMDGPU/GlobalISel: Select G_SHUFFLE_VECTOR
G_SHUFFLE_VECTOR is legal since it theoretically may help match op_sel
for VOP3P instructions. Expand it in some other way in case it doesn't
fold into the use instructions.
Simon Pilgrim [Fri, 21 Feb 2020 18:23:29 +0000 (18:23 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 21 Feb 2020 18:14:01 +0000 (18:14 +0000)]
[LoopVectorize][X86] Regenerate tests. NFCI.
jasonliu [Fri, 21 Feb 2020 17:20:45 +0000 (17:20 +0000)]
[XCOFF][AIX] Put undefined symbol name into StringTable when neccessary
Summary:
When we have a long name for the undefined symbol, we would hit this assertion:
Assertion failed: I != StringIndexMap.end() && "String is not in table!"
This patch addresses that.
Reviewed by: DiggerLin, daltenty
Differential Revision: https://reviews.llvm.org/D74924
Nagy Mostafa [Fri, 21 Feb 2020 17:58:00 +0000 (09:58 -0800)]
[MLIR] Allow Loop dialect IfOp and ForOp to define values
This patch implements the RFCs proposed here:
https://llvm.discourse.group/t/rfc-modify-ifop-in-loop-dialect-to-yield-values/463
https://llvm.discourse.group/t/rfc-adding-operands-and-results-to-loop-for/459/19.
It introduces the following changes:
- All Loop Ops region, except for ReduceOp, terminate with a YieldOp.
- YieldOp can have variadice operands that is used to return values out of IfOp and ForOp regions.
- Change IfOp and ForOp syntax and representation to define values.
- Add unit-tests and update .td documentation.
- YieldOp is a terminator to loop.for/if/parallel
- YieldOp custom parser and printer
Lowering is not supported at the moment, and will be in a follow-up PR.
Thanks.
Reviewed By: bondhugula, nicolasvasilache, rriddle
Differential Revision: https://reviews.llvm.org/D74174
Francesco Petrogalli [Tue, 18 Feb 2020 19:13:39 +0000 (19:13 +0000)]
[llvm][CodeGen] DAG Combiner folds for vscale.
Summary:
This patch simplifies the DAGs generated when using the intrinsic `@llvm.vscale.*` as follows:
* Fold (add (vscale * C0), (vscale * C1)) to (vscale * (C0 + C1)).
* Canonicalize (sub X, (vscale * C)) to (add X, (vscale * -C)).
* Fold (mul (vscale * C0), C1) to (vscale * (C0 * C1)).
* Fold (shl (vscale * C0), C1) to (vscale * (C0 << C1)).
The test `sve-gep-ll` have been updated to reflect the folding introduced by this patch.
Reviewers: efriedma, sdesmalen, andwar, rengolin
Reviewed By: sdesmalen
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74782
Nikita Popov [Thu, 20 Feb 2020 21:19:10 +0000 (22:19 +0100)]
[InstCombine] Improve simplify demanded bits worklist management
This fixes a small mistake from D72944: The worklist add should
happen before assigning the new operand, not after.
In case an actual replacement happens, the old operand needs to
be added for DCE. If no actual replacement happens, then old/new
are the same, so it doesn't matter.
This drops one iteration from the annotated test case.
Hiroshi Yamauchi [Wed, 12 Feb 2020 22:55:53 +0000 (14:55 -0800)]
[BFI] Fix missed BFI updates in MachineSink.
Summary:
This prevents BFI queries on new blocks (from
MachineSinking::GetAllSortedSuccessors) and fixes a bunch of assert failures
under -check-bfi-unknown-block-queries=true.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74511
Fangrui Song [Thu, 20 Feb 2020 22:54:22 +0000 (14:54 -0800)]
[Clang interpreter] Rename Block.{h,cpp} to InterpBlock.{h,cpp}
The Blocks runtime provide a header named Block.h.
It is generally preferable to avoid name collision with system headers
(reducing reliance on -isystem order, more friendly when navigating files in
an editor, etc).
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D74934
Nikita Popov [Sun, 16 Feb 2020 09:16:17 +0000 (10:16 +0100)]
[InstCombine] Use replaceOperand() in more places
Followup to D73919 with another batch of replacements of
setOperand() -> replaceOperand(), to make sure the old
operand gets DCEd right away.
Differential Revision: https://reviews.llvm.org/D74932
Florian Hahn [Fri, 21 Feb 2020 17:34:34 +0000 (17:34 +0000)]
[DSE,MSSA] Dbg counters required assertions. Mark test accordingly.
Florian Hahn [Fri, 21 Feb 2020 17:21:44 +0000 (17:21 +0000)]
[VectorUtils] Move ToVectorTy to VectorUtils.h (NFC).
ToVectorTy is defined and used in multiple places. Hoist it to
VectorUtils.h to avoid duplication and improve re-usability.
Reviewers: rengolin, hsaito, Ayal, gilr, fpetrogalli
Reviewed By: fpetrogalli
Differential Revision: https://reviews.llvm.org/D74959
Nikita Popov [Fri, 21 Feb 2020 17:11:51 +0000 (18:11 +0100)]
[X86] Fix SDLoc initialization
Fixes -Wparentheses warning, in this case indicating a genuine
bug.
Nikita Popov [Tue, 18 Feb 2020 21:20:55 +0000 (22:20 +0100)]
[SimplifyLibCalls][IRBuilder] Accept any IRBuilder in SimplifyLibCalls
This changes the SimplifyLibCalls utility to accept an IRBuilderBase,
which allows us to pass through the IRBuilder used by InstCombine.
This will ensure that new instructions get added to the worklist.
The annotated test-case drops from 4 to 2 InstCombine iterations thanks
to this.
To achieve this, I'm adding an IRBuilderBase::OperandBundlesGuard,
which is basically the same as the existing InsertPointGuard and
FastMathFlagsGuard, but for operand bundles. Also add a
setDefaultOperandBundles() method so these can be set outside the
constructor.
Differential Revision: https://reviews.llvm.org/D74792
LLVM GN Syncbot [Fri, 21 Feb 2020 17:21:54 +0000 (17:21 +0000)]
[gn build] Port
23444edf30b
Jonas Paulsson [Thu, 20 Feb 2020 18:40:30 +0000 (10:40 -0800)]
[SystemZ] Return scalarized costs for vector instructions on older archs.
A cost query for a vector instruction should return a cost even without
target vector support, and not trigger an assert.
VectorCombine does this with an input containing source code vectors.
Review: Ulrich Weigand
Matt Arsenault [Tue, 18 Feb 2020 14:34:31 +0000 (09:34 -0500)]
AMDGPU: Use default operand for VOP3P clamp
We don't use this, and matching from the def doesn't make much sense.
There are multiple tablegen bugs with default operand
handling. undef_tied_input should work to handle the vdst_in
correctly, but this breaks the operand register class constraint which
it should be able to infer.
Danilo Carvalho Grael [Fri, 21 Feb 2020 16:59:52 +0000 (11:59 -0500)]
[AArch64][SVE] Add intrinsics for SVE2 bitwise ternary operations
Summary:
Add intrinsics for the following operations:
- eor3, bcax
- bsl, bsl1n, bsl2n, nbsl
Fix MC tests for bsl instructions.
Reviewers: kmclaughlin, c-rhodes, sdesmalen, efriedma, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74785
Sanjay Patel [Fri, 21 Feb 2020 16:49:11 +0000 (11:49 -0500)]
[VectorCombine] refactor matching code to reduce duplication; NFC
cmp/binop were already diverging even though they are largely
the same logic.
Yitzhak Mandelbaum [Wed, 19 Feb 2020 16:04:51 +0000 (11:04 -0500)]
[AST matchers] Add basic matchers for googletest EXPECT/ASSERT calls.
Summary:
This revision adds matchers that match calls to the gtest EXPECT and ASSERT
macros almost like function calls. The matchers are placed in separate files
(GtestMatchers...), because they are specific to the gtest library.
Reviewers: gribozavr2
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74840
Florian Hahn [Fri, 21 Feb 2020 16:55:18 +0000 (16:55 +0000)]
[DSE,MSSA] Add debug counter.
Can be used like
-debug-counter=dse-memoryssa-skip=10,dse-memoryssa-counter-count=20
Reviewers: dmgreen, rnk, efriedma, bryant, asbirlea
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D72147
Cameron McInally [Fri, 21 Feb 2020 16:55:25 +0000 (10:55 -0600)]
[AArch64][SVE] Add +fullfp16 to sve-vector-splat.ll
Add +fullfp16 to sve-vector-splat.ll so we can test folding of immediates into moves.
This attribute can go away later when SVE has a full set of fp16 patterns in place.
Differential Revision: https://reviews.llvm.org/D74965
Jay Foad [Thu, 20 Feb 2020 20:21:30 +0000 (20:21 +0000)]
GlobalISel: Fix narrowing of (G_ASHR i64:x, 32)
Reviewers: arsenm
Subscribers: jvesely, wdng, nhaehnle, rovka, hiraditya, volkan, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74950
Matt Arsenault [Thu, 20 Feb 2020 14:58:03 +0000 (09:58 -0500)]
AMDGPU/GlobalISel: Commit test changes I forgot to squash
These should have been in
ac7abe0ba9ae4c6a2248cc3ef4e4fe7e6d270105
Matt Arsenault [Fri, 21 Feb 2020 02:12:04 +0000 (21:12 -0500)]
AMDGPU/GlobalISel: Fix xnor matching
We should try the generated matchers before the manual selection. This
means the patterns are now handling the common cases, but the manual
selection code is not yet dead. It's still handling the non-s32/s64
cases (like v2s16 and v2s32). Currently tablegen doesn't have a nice
way to have a single pattern that covers multiple types.
Simon Pilgrim [Fri, 21 Feb 2020 15:30:56 +0000 (15:30 +0000)]
[TargetLowering] Apply basic shift combines before recursive SimplifyDemandedBits calls.
Minor refactor/cleanup before we begin adding non-uniform support.
Fangrui Song [Thu, 20 Feb 2020 07:14:49 +0000 (23:14 -0800)]
[ELF] Shuffle .init_array/.fini_array with --shuffle-sections=
Useful for detecting static initialization order fiasco.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D74887
Ivan Hernandez [Fri, 21 Feb 2020 16:13:05 +0000 (08:13 -0800)]
[lldb-vscode] Use libOption with tablegen to parse command line options.
This change will bring lldb-vscode in line with how several other llvm
tools process command line arguments and make it easier to add future
options.
Differential revision: https://reviews.llvm.org/D74798
Fangrui Song [Mon, 17 Feb 2020 21:56:01 +0000 (13:56 -0800)]
[ELF] Warn changed output section address
When the output section address (addrExpr) is specified, GNU ld warns if
sh_addr is different. This patch implements the warning.
Note, LinkerScript::assignAddresses can be called more than once. We
need to record the changed section addresses, and only report the
warnings after the addresses are finalized.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D74741
Fangrui Song [Mon, 17 Feb 2020 18:21:31 +0000 (10:21 -0800)]
[ELF] Ignore the maximum of input section alignments for two cases
Follow-up for D74286.
Notations:
* alignExpr: the computed ALIGN value
* max_input_align: the maximum of input section alignments
This patch changes the following two cases to match GNU ld:
* When ALIGN is present, GNU ld sets output sh_addr to alignExpr, while lld use max(alignExpr, max_input_align)
* When addrExpr is specified but alignExpr is not, GNU ld sets output sh_addr to addrExpr, while lld uses `advance(0, max_input_align)`
Note, sh_addralign is still set to max(alignExpr, max_input_align).
lma-align.test is enhanced a bit to check we don't overalign sh_addr.
fixSectionAlignments() sets addrExpr but not alignExpr for the `!hasSectionsCommand` case.
This patch sets alignExpr as well so that max_input_align will be respected.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D74736
Matt Arsenault [Fri, 21 Feb 2020 16:09:20 +0000 (11:09 -0500)]
AMDGPU/GlobalISel: Precommit xnor matching test
David Green [Fri, 21 Feb 2020 16:07:09 +0000 (16:07 +0000)]
[ARM] Correct Formatting. NFC
Also removed an unnecessary TODO that I don't believe is relevant for
the instruction in question.
Matt Arsenault [Sat, 15 Feb 2020 22:14:17 +0000 (17:14 -0500)]
AMDGPU/GlobalISel: Manually select G_BUILD_VECTOR_TRUNC
We have patterns for s_pack* selection, but they assume the inputs are
a build_vector with 16-bit inputs, not a truncating build
vector. Since there's still outstanding work for how to handle
mismatched result and source element vector operations, and since I'm
trying a different packed vector strategy than SelectionDAG, just
manually select this for now.
Matt Arsenault [Thu, 20 Feb 2020 23:59:08 +0000 (18:59 -0500)]
AMDGPU/GlobalISel: Legalize G_FPOW
There are few differences from the DAG handling. First, the DAG
handling uses a primitive selection pattern instead of custom
legalizing it. Because of this, this makes use of source modifiers
while the DAG does not.
Also instead of promoting f16, try to use the f16 log/exp. There's no
f16 fmul_legacy, so widen just for the multiply, although I'm not sure
that's the best solution.
Matt Arsenault [Thu, 20 Feb 2020 22:40:43 +0000 (17:40 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.fmul.legacy
Matt Arsenault [Thu, 20 Feb 2020 20:34:51 +0000 (15:34 -0500)]
AMDGPU/GlobalISel: Fix constant bus violation with source modifiers
This looked through copies to find the source modifiers, which may
have been SGPR->VGPR copies added to avoid potential constant bus
violations. Re-insert a copy to a VGPR if this happens.
Alexandre Ganea [Fri, 21 Feb 2020 15:05:07 +0000 (10:05 -0500)]
[mlir] Silence error: call to constructor of 'llvm::APInt' is ambiguous
I was getting this error when using Clang 9.0.1 for compiling.
F:\llvm-project\mlir\lib\IR\Builders.cpp(119,27): error: call to constructor of 'llvm::APInt' is ambiguous
APInt(32, value, /*isSigned=*/false));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F:\llvm-project\llvm\include\llvm/ADT/APInt.h(277,3): note: candidate constructor
APInt(unsigned numBits, uint64_t val, bool isSigned = false)
^
F:\llvm-project\llvm\include\llvm/ADT/APInt.h(304,3): note: candidate constructor
APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
^
1 error generated.
Eric Astor [Thu, 20 Feb 2020 14:43:02 +0000 (09:43 -0500)]
Remove unused functions in llvm-ml
On review, these functions will likely not be needed even in the final MasmParser.
Pavel Labath [Fri, 21 Feb 2020 14:42:07 +0000 (15:42 +0100)]
[lldb/DWARF] Add support for type units in dwp files
all that was needed was to teach lldb's DWARF context about the
debug_tu_index section.
Sean Fertile [Thu, 20 Feb 2020 14:18:10 +0000 (09:18 -0500)]
[PowerPC][NFC] Add a test for vrsave usage iinline asm.
Add a lit test that that uses vrsave register in the clobber list, and
tests the extended mnemonics mtvrsave and mfvrsave.
Gabor Marton [Fri, 21 Feb 2020 14:54:58 +0000 (15:54 +0100)]
[AST][NFC] Update outdated comments in ASTStructuralEquivalence.cpp
Sean Fertile [Thu, 20 Feb 2020 20:33:18 +0000 (15:33 -0500)]
[PowerPC][NFC] Remove Darwin specific logic in frame finalization.
Remove some cumbersome Darwin specific logic for updating the frame
offsets of the condition-register spill slots. The containing function has an
early return if the subtarget is not ELF based which makes the Darwin logic
dead.
Pavel Labath [Thu, 20 Feb 2020 14:06:01 +0000 (15:06 +0100)]
[Error/unittests] Add a FailedWithMessage gtest matcher
Summary:
We already have a "Failed" matcher, which can be used to check any
property of the Error object. However, most frequently one just wants to
check the error message, and while this is possible with the "Failed"
matcher, it is also very convoluted
(Failed<ErrorInfoBase>(testing::Property(&ErrorInfoBase::message, "the
message"))).
Now, one can just write: FailedWithMessage("the message"). I expect that
most of the usages will remain this simple, but the argument of the
matcher is not limited to simple strings -- the argument of the matcher
can be any other matcher, so one can write more complicated assertions
if needed (FailedWithMessage(ContainsRegex("foo|bar"))). If one wants to
match multiple error messages, he can pass multiple arguments to the
matcher.
If one wants to match the message list as a whole (perhaps to check the
message count), I've also included a FailedWithMessageArray matcher,
which takes a single matcher receiving a vector of error message
strings.
Reviewers: sammccall, dblaikie, jhenderson
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74898
Simon Pilgrim [Fri, 21 Feb 2020 14:23:38 +0000 (14:23 +0000)]
[X86] Regenerate hi reg tests
Simon Pilgrim [Fri, 21 Feb 2020 13:29:40 +0000 (13:29 +0000)]
[TargetLowering] SimplifyDemandedBits - use getValidShiftAmountConstant helper.
Use the SelectionDAG::getValidShiftAmountConstant helper to get const/constsplat shift amounts, which allows us to drop the out of range shift amount early-out.
First step towards better non-uniform shift amount support in SimplifyDemandedBits.
Lei Zhang [Fri, 10 Jan 2020 19:48:24 +0000 (14:48 -0500)]
[mlir] Add a signedness semantics bit to IntegerType
Thus far IntegerType has been signless: a value of IntegerType does
not have a sign intrinsically and it's up to the specific operation
to decide how to interpret those bits. For example, std.addi does
two's complement arithmetic, and std.divis/std.diviu treats the first
bit as a sign.
This design choice was made some time ago when we did't have lots
of dialects and dialects were more rigid. Today we have much more
extensible infrastructure and different dialect may want different
modelling over integer signedness. So while we can say we want
signless integers in the standard dialect, we cannot dictate for
others. Requiring each dialect to model the signedness semantics
with another set of custom types is duplicating the functionality
everywhere, considering the fundamental role integer types play.
This CL extends the IntegerType with a signedness semantics bit.
This gives each dialect an option to opt in signedness semantics
if that's what they want and helps code sharing. The parser is
modified to recognize `si[1-9][0-9]*` and `ui[1-9][0-9]*` as
signed and unsigned integer types, respectively, leaving the
original `i[1-9][0-9]*` to continue to mean no indication over
signedness semantics. All existing dialects are not affected (yet)
as this is a feature to opt in.
More discussions can be found at:
https://groups.google.com/a/tensorflow.org/d/msg/mlir/XmkV8HOPWpo/7O4X0Nb_AQAJ
Differential Revision: https://reviews.llvm.org/D72533
Krzysztof Parzyszek [Thu, 20 Feb 2020 22:42:02 +0000 (16:42 -0600)]
[Hexagon] Introduce noop intrinsic to cast between vector predicate types
The (overloaded) intrinsic is llvm.hexagon.V6.pred.typecast[.128B]. The
types of the operand and the return value are HVX boolean vector types.
For each cast, there needs to be a corresponding intrinsic declared,
with different suffixes appended to the name, e.g.
; cast <128 x i1> to <32 x i1>
declare <32 x i1> @llvm.hexagon.V6.pred.typecast.128B.s1(<128 x i1>)
; cast <32 x i1> to <64 x i1>
declare <64 x i1> @llvm.hexagon.V6.pred.typecast.128B.s2(<32 x i1>)
etc.
Evgeniy Brevnov [Mon, 20 Jan 2020 12:35:39 +0000 (19:35 +0700)]
[DependenceAnalysis] Memory dependence analysis internal caching mechanism is broken in presence of TBAA (PR42733).
Summary:
There is a flaw in memory dependence analysis caching mechanism when memory accesses with TBAA are involved. Assume we first analysed and cached results for access with TBAA. Later we request dependence for the same memory but without TBAA (or different TBAA). By design these two queries should share one entry in the internal cache which corresponds to a general access (without TBAA). Thus upon second request internal cached is cleared and we continue analysis for access as if there is no TBAA.
The problem is that even though internal cache is cleared the set of visited nodes is not. That means we won't traverse visited nodes again and populate internal cache with the corresponding dependence results. So we end up with internal cache in an incomplete state. Current implementation tries to signal that situation by resetting CacheInfo->Pair at line 1104. But that doesn't actually help since later code ignores this invalidation and relies on 'Cache->empty()' property to decide on cache completeness.
Reviewers: reames, hfinkel, chandlerc, fedor.sergeev, asbirlea, fhahn, john.brawn, Prazek, sunfish
Reviewed By: john.brawn
Subscribers: DaniilSuchkov, kosarev, jfb, dantrushin, hiraditya, bmahjour, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73032
Sanjay Patel [Fri, 21 Feb 2020 12:58:36 +0000 (07:58 -0500)]
[ConstantFold] fold fsub -0.0, undef to undef rather than NaN
A question about this behavior came up on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-February/139003.html
...and as part of backend improvements in D73978, but this is an IR
change first because we already have fairly thorough tests in place
here.
We decided not to implement a more general change that would have
folded any FP binop with nearly arbitrary constant + undef operand
to undef because that is not theoretically correct (even if it is
practically correct).
Differential Revision: https://reviews.llvm.org/D74713
serge-sans-paille [Fri, 21 Feb 2020 08:48:27 +0000 (09:48 +0100)]
Detect and disable openmp tests that require multiple hardware processor to run
Team tests seem to require at least two physical cores, and using the same trick
as in https://reviews.llvm.org/D55598 doesn't work (why?) .
Using lit configuration instead.
Differential Revision: https://reviews.llvm.org/D74921
Swiftfuchs [Fri, 21 Feb 2020 12:55:43 +0000 (13:55 +0100)]
[NFC] Corrected a minor typo in a comment
Nicolai Hähnle [Fri, 21 Feb 2020 12:10:18 +0000 (13:10 +0100)]
test/CodeGen/AMDGPU: Add a test case that shows a miscompilation
Related to https://reviews.llvm.org/D74908
Change-Id: I6ebf3b5c7a32493016994f30d6796c41e95aecde
Kern Handa [Fri, 21 Feb 2020 12:25:24 +0000 (13:25 +0100)]
[NFC][mlir] Adding more operators to EDSC TemplatedIndexedValue
This change adds some missing arithmetic and logical operators to
`TemplatedIndexedValue` for EDSC usage.
Differential Revision: https://reviews.llvm.org/D74686
Sebastian Neubauer [Fri, 24 Jan 2020 11:17:08 +0000 (12:17 +0100)]
Make unittests include path relative
This change is relevant when embedding the llvm cmake project into
another project. It should not change the build behavior of a normal
llvm build.
In the case where llvm is embedded as a cmake subproject,
CMAKE_SOURCE_DIR does not point to the expected directory and building
the tests fails.
Using CMAKE_CURRENT_SOURCE_DIR fixes this problem, as it will always
point to the same directory.
Differential Revision: https://reviews.llvm.org/D73466
Haojian Wu [Fri, 21 Feb 2020 08:57:05 +0000 (09:57 +0100)]
[clangd] Allow renaming class templates in cross-file rename.
Summary:
It was disabled because we don't handle explicit template
specialization well (due to the index limitation).
renaming templates is normal in practic, rather than disabling it, this patch
allows to rename them though it is not perfect (just a known limitation).
Context: https://github.com/clangd/clangd/issues/280
Reviewers: kbobyrev
Reviewed By: kbobyrev
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74709
Raphael Isemann [Thu, 20 Feb 2020 12:23:39 +0000 (13:23 +0100)]
[lldb][NFC] Split up ClangASTSource::FindExternalVisibleDecls
This function has two functions hidden inside it. Let's make
them proper functions.
Haojian Wu [Thu, 20 Feb 2020 14:22:07 +0000 (15:22 +0100)]
[clangd] Fix the incomplete template specialization in findTarget.
Summary:
FindTarget doesn't report the TemplatePattern for incomplete
specialization.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74900
Craig Topper [Fri, 21 Feb 2020 08:29:18 +0000 (00:29 -0800)]
[X86] Don't bother avoiding illegal FCMOVs if we don't have the cmov subtarget feature.
We'll be forced to emit branches so we might as well use the most
direct condition.
Craig Topper [Fri, 21 Feb 2020 07:53:00 +0000 (23:53 -0800)]
[X86] Make combineCMov not create unsupported FCMOVs when f32/f64 are using X87.
This makes the behavior consistent with what's in LowerSELECT.
Craig Topper [Fri, 21 Feb 2020 07:49:44 +0000 (23:49 -0800)]
[X86] Autogenerate complete checks. NFC
Sam Clegg [Thu, 13 Feb 2020 16:38:18 +0000 (08:38 -0800)]
[WebAssembly] Remove unneeded getWasmKindForNamedSection function
I believe this was carried over from getELFKindForNamedSection since
the wasm backend originally used ELF object writing as a template.
Differential Revision: https://reviews.llvm.org/D74565
Craig Topper [Fri, 21 Feb 2020 05:38:49 +0000 (21:38 -0800)]
[X86] Remove unnecessary isNullConstant in LowerSelect. NFC
At this point in the code we know that Op1 or Op2 is
all ones. Y points to the other operand. In the case that
Op2 is zero, Op1 must be all ones and Y is Op2. The OR
ORs Y into Res. But if Y is 0 the OR will be folded away by
getNode so we don't need to check for it.
Jan Vesely [Tue, 4 Feb 2020 21:13:17 +0000 (16:13 -0500)]
libclc: Use acos implementation from amd_builtins
Fixes acos CTS (1 thread, scalar) on AMD Turks.
Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D74011
Craig Topper [Fri, 21 Feb 2020 03:56:44 +0000 (19:56 -0800)]
[X86] Add CMOV_VR64 pseudo instruction for MMX. Remove mmx handling from combineSelect.
The combineSelect code was casting to i64 without any check that
i64 was legal. This can break after type legalization.
It also required splitting the mmx register on 32-bit targets.
It's not clear that this makes sense. Instead switch to using
a cmov pseudo like we do for XMM/YMM/ZMM.
Martijn Vels [Wed, 19 Feb 2020 21:27:50 +0000 (16:27 -0500)]
Split _LIBCPP_STRING_EXTERN_TEMPLATE_LIST up into a V1 and UNSTABLE version.
This change splits the _LIBCPP_STRING_EXTERN_TEMPLATE_LIST up into a _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST containing the stable ABI, and a _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST containing the unstable ABI.
The purpose is to explicitly define and maintain the two lists, where the unstable ABI allows for ABI breaking changes for purposes such as optimization while offering a strong guarantee that any change inside the unstable ABI does not affect the stable ABI.
As per the comment in the __string header, we do still allow etries to be added to the stable ABI list as the c++ versions and corresponding c++ std API changes.
River Riddle [Fri, 21 Feb 2020 04:08:33 +0000 (20:08 -0800)]
[mlir] Use getOperation()->setAttr when generating attribute set
methods.
This avoids the need to resolve overloads when the current operation
also defines a 'setAttr' method.
Johannes Doerfert [Thu, 20 Feb 2020 22:43:03 +0000 (16:43 -0600)]
[OpenMP][NFC] Remove leftover debug messages
Jim Lin [Fri, 21 Feb 2020 01:28:49 +0000 (09:28 +0800)]
[XCore] Add instruction pattern for bitrev
Summary:
Add support for lowering bitreverse to the bitrev instruction.
Fix https://bugs.llvm.org/show_bug.cgi?id=34628.
Reviewers: RKSimon, rtrieu, robertlytton
Reviewed By: RKSimon
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74748
Vedant Kumar [Thu, 20 Feb 2020 22:16:25 +0000 (14:16 -0800)]
[Dominators] Use Instruction::comesBefore for block-local queries, NFC
Use the lazy instruction ordering facility for block-local dominance
queries.
Differential Revision: https://reviews.llvm.org/D74931
Bill Wendling [Fri, 21 Feb 2020 00:22:35 +0000 (16:22 -0800)]
Filter callbr insts from critical edge splitting
Similarly to how splitting predecessors with an indirectbr isn't handled
in the generic way, we also shouldn't split callbrs, for similar
reasons.
Michael Spencer [Thu, 20 Feb 2020 23:25:36 +0000 (15:25 -0800)]
[libunwind][CMake] Treat S files as C to work around CMake bug.
The OSX_ARCHITECTURES property is supposed to add the -arch flag when
targeting Apple platforms. However, due to a bug in CMake
(https://github.com/Kitware/CMake/blob/master/Source/cmLocalGenerator.cxx#L1780),
this does not apply to assembly files. This results in a linker error
when trying to build libunwind for i386 on MacOS.
rdar://
59642189