Joseph Tremoulet [Mon, 17 Jun 2019 19:11:28 +0000 (19:11 +0000)]
[EarlyCSE] Fix hashing of self-compares
Summary:
Update compare normalization in SimpleValue hashing to break ties (when
the same value is being compared to itself) by switching to the swapped
predicate if it has a lower numerical value. This brings the hashing in
line with isEqual, which already recognizes the self-compares with
swapped predicates as equal.
Fixes PR 42280.
Reviewers: spatel, efriedma, nikic, fhahn, uabelho
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63349
llvm-svn: 363598
Alina Sbirlea [Mon, 17 Jun 2019 18:58:40 +0000 (18:58 +0000)]
[MemorySSA] Don't use template when the clone is a simplified instruction.
Summary:
LoopRotate doesn't create a faithful clone of an instruction, it may
simplify it beforehand. Hence the clone of an instruction that has a
MemoryDef associated may not be a definition, but a use or not a memory
alternig instruction.
Don't rely on the template when the clone may be simplified.
Reviewers: george.burgess.iv
Subscribers: jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63355
llvm-svn: 363597
Jessica Paquette [Mon, 17 Jun 2019 18:40:06 +0000 (18:40 +0000)]
[GlobalISel][AArch64] Fold G_SUB into G_ICMP when it's safe to do so
Basically porting over the behaviour in AArch64ISelLowering to GISel. See
emitComparison for reference.
When we have something like this:
```
lhs = G_SUB 0, y
...
G_ICMP lhs, rhs
```
We can fold away the G_SUB and produce a cmn instead, given that we produce
the same value in NZCV.
Add a test showing that the transformation works, and also showing that we
don't perform the transformation when it's unsafe.
Also factor out the CSet emission into emitCSetForICMP.
Differential Revision: https://reviews.llvm.org/D63163
llvm-svn: 363596
Craig Topper [Mon, 17 Jun 2019 18:38:07 +0000 (18:38 +0000)]
[X86] Add TB_NO_REVERSE to some memory folding table entries where the register form requires 64-bit mode, but the memory form does not.
We don't know if its safe to unfold if we're in 32-bit mode.
This is simlar to what was done to some load opcodes in r363523.
I think its pretty unlikely we will try to unfold these anyway so
I don't think this is testable.
llvm-svn: 363595
Marshall Clow [Mon, 17 Jun 2019 18:25:52 +0000 (18:25 +0000)]
Update status of issue 3209
llvm-svn: 363594
Valery Pykhtin [Mon, 17 Jun 2019 18:23:39 +0000 (18:23 +0000)]
LiveInterval.h: add LiveRange::findIndexesLiveAt function - return a list of SlotIndexes the LiveRange live at.
Differential revision: https://reviews.llvm.org/D62411
llvm-svn: 363593
Simon Pilgrim [Mon, 17 Jun 2019 18:20:04 +0000 (18:20 +0000)]
[X86][SSE] Scalarize under-aligned XMM vector nt-stores (PR42026)
If a XMM non-temporal store has less than natural alignment, scalarize the vector - with SSE4A we can stay on the vector and use MOVNTSD(f64), else we must move to GPRs and use MOVNTI(i32/i64).
llvm-svn: 363592
Matt Arsenault [Mon, 17 Jun 2019 18:17:25 +0000 (18:17 +0000)]
AMDGPU: Make getreg intrinsic inaccessiblememonly
llvm-svn: 363591
Alina Sbirlea [Mon, 17 Jun 2019 18:16:53 +0000 (18:16 +0000)]
[MemorySSA] Add all MemoryPhis before filling their values.
Summary:
Add all MemoryPhis in IDF before filling in their incomign values.
Otherwise, a new Phi can be added that needs to become the incoming
value of another Phi.
Test fails the verification in verifyPrevDefInPhis.
Reviewers: george.burgess.iv
Subscribers: jlebar, Prazek, zzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63353
llvm-svn: 363590
Marshall Clow [Mon, 17 Jun 2019 18:06:30 +0000 (18:06 +0000)]
Add tests for LWG 3206. NFC
llvm-svn: 363589
Stanislav Mekhanoshin [Mon, 17 Jun 2019 17:57:50 +0000 (17:57 +0000)]
[AMDGPU] gfx1010 wavefrontsize intrinsic folding
Differential Revision: https://reviews.llvm.org/D63206
llvm-svn: 363588
Matt Arsenault [Mon, 17 Jun 2019 17:52:35 +0000 (17:52 +0000)]
AMDGPU: Fold readlane/readfirstlane calls
llvm-svn: 363587
Stanislav Mekhanoshin [Mon, 17 Jun 2019 17:47:28 +0000 (17:47 +0000)]
[AMDGPU] Pass to propagate ABI attributes from kernels to the functions
The pass works in two modes:
Mode 1: Just set attributes starting from kernels. This can work at
the very beginning of opt and llc pipeline, but cannot clone functions
because it must be a function pass.
Mode 2: Actually clone functions for new attributes. This can only work
after all function passes in the opt pipeline because it has to be a
module pass.
Differential Revision: https://reviews.llvm.org/D63208
llvm-svn: 363586
Michael Liao [Mon, 17 Jun 2019 17:47:03 +0000 (17:47 +0000)]
[clang][AST] Remove unnecessary 'const'.
llvm-svn: 363585
Mitch Phillips [Mon, 17 Jun 2019 17:45:34 +0000 (17:45 +0000)]
[GWP-ASan] Integration with Scudo [5].
Summary:
See D60593 for further information.
This patch adds GWP-ASan support to the Scudo hardened allocator. It also
implements end-to-end integration tests using Scudo as the backing allocator.
The tests include crash handling for buffer over/underflow as well as
use-after-free detection.
Reviewers: vlad.tsyrklevich, cryptoad
Reviewed By: vlad.tsyrklevich, cryptoad
Subscribers: kubamracek, mgorny, #sanitizers, llvm-commits, morehouse
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D62929
llvm-svn: 363584
Nico Weber [Mon, 17 Jun 2019 17:45:12 +0000 (17:45 +0000)]
gn build: Merge r363541
llvm-svn: 363583
Simon Pilgrim [Mon, 17 Jun 2019 17:22:38 +0000 (17:22 +0000)]
[X86][AVX] Split under-aligned vector nt-stores.
If a YMM/ZMM non-temporal store has less than natural alignment, split the vector - either they will be satisfactorily aligned or will continue to be split until they are XMMs - at which point the legalizer will scalarize it.
llvm-svn: 363582
Warren Ristow [Mon, 17 Jun 2019 17:20:08 +0000 (17:20 +0000)]
[LV] Suppress vectorization in some nontemporal cases
When considering a loop containing nontemporal stores or loads for
vectorization, suppress the vectorization if the corresponding
vectorized store or load with the aligment of the original scaler
memory op is not supported with the nontemporal hint on the target.
This adds two new functions:
bool isLegalNTStore(Type *DataType, unsigned Alignment) const;
bool isLegalNTLoad(Type *DataType, unsigned Alignment) const;
to TTI, leaving the target independent default implementation as
returning true, but with overriding implementations for X86 that
check the legality based on available Subtarget features.
This fixes https://llvm.org/PR40759
Differential Revision: https://reviews.llvm.org/D61764
llvm-svn: 363581
Matt Arsenault [Mon, 17 Jun 2019 17:01:35 +0000 (17:01 +0000)]
GlobalISel: Ignore callsite attributes when picking intrinsic type
A target intrinsic may be defined as possibly reading memory, but the
call site may have additional knowledge that it doesn't read
memory. The intrinsic lowering will expect the pessimistic assumption
of the intrinsic definition, so the chain should still be used.
I fixed the same bug in SelectionDAG in r287593.
llvm-svn: 363580
Matt Arsenault [Mon, 17 Jun 2019 17:01:32 +0000 (17:01 +0000)]
GlobalISel: Verify intrinsics
I keep using the wrong instruction when manually writing tests. This
really needs to check the number of operands, but I don't see an easy
way to do that right now.
llvm-svn: 363579
Matt Arsenault [Mon, 17 Jun 2019 17:01:27 +0000 (17:01 +0000)]
AMDGPU/GlobalISel: Account for multiple defs when finding intrinsic ID
llvm-svn: 363578
Stanislav Mekhanoshin [Mon, 17 Jun 2019 16:48:56 +0000 (16:48 +0000)]
[AMDGPU] gfx1010 wave32 metadata
Differential Revision: https://reviews.llvm.org/D63207
llvm-svn: 363577
Tom Stellard [Mon, 17 Jun 2019 16:27:43 +0000 (16:27 +0000)]
AMDGPU/GlobalISel: Implement select for G_ICMP and G_SELECT
Reviewers: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60640
llvm-svn: 363576
Marshall Clow [Mon, 17 Jun 2019 16:17:56 +0000 (16:17 +0000)]
Update the meeting page with papers/issues that are ready for Cologne
llvm-svn: 363575
Mike Spertus [Mon, 17 Jun 2019 16:12:45 +0000 (16:12 +0000)]
Various improvements to Clang MSVC Visualizer
This change adds/improves MSVC visualizers for many Clang types, including array types, trailing return types in function, deduction guides, a fix for OpaquePtr, etc. It also replaces all of the view(deref) with the "na" formatter, which is a better built-in natvis technique for doing the same thing.
Differential Revision: https://reviews.llvm.org/D63039
llvm-svn: 363574
Francis Visoiu Mistrih [Mon, 17 Jun 2019 16:06:00 +0000 (16:06 +0000)]
[Remarks] Extend -fsave-optimization-record to specify the format
Use -fsave-optimization-record=<format> to specify a different format
than the default, which is YAML.
For now, only YAML is supported.
llvm-svn: 363573
Michael Kruse [Mon, 17 Jun 2019 16:01:40 +0000 (16:01 +0000)]
[ScopInliner] Register FunctionAnalysisManagerModuleProxy.
FunctionAnalysisManagerModuleProxy started to be used by the
AlwaysInlinerPass in r363287 and therefore had to be registered in the
New PassManager.
Should fix the regression tests
Polly :: ScopInliner/invariant-load-func.ll
Polly :: ScopInliner/simple-inline-loop.ll
llvm-svn: 363572
Simon Pilgrim [Mon, 17 Jun 2019 15:54:36 +0000 (15:54 +0000)]
[X86] combineLoad - begun making the load split code more generic. NFCI.
This is currently only used for ymm->xmm splitting but we shouldn't hardcode the offsets/alignment.
This is necessary for an upcoming patch to split under-aligned non-temporal vector loads.
llvm-svn: 363570
Kostya Kortchinsky [Mon, 17 Jun 2019 15:23:11 +0000 (15:23 +0000)]
[scudo][standalone] Introduce the combined allocator
Summary:
The Combined allocator hold together all the other components, and
provides a memory allocator interface based on various template
parameters. This will be in turn used by "wrappers" that will provide
the standard C and C++ memory allocation functions, but can be
used as is as well.
This doesn't depart significantly from the current Scudo implementation
except for a few details:
- Quarantine batches are now protected by a header a well;
- an Allocator instance has its own TSD registry, as opposed to a
static one for everybody;
- a function to iterate over busy chunks has been added, for Android
purposes;
This also adds the associated tests, and a few default configurations
for several platforms, that will likely be further tuned later on.
Reviewers: morehouse, hctim, eugenis, vitalybuka
Reviewed By: morehouse
Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D63231
llvm-svn: 363569
Haojian Wu [Mon, 17 Jun 2019 14:49:18 +0000 (14:49 +0000)]
[clangd] Perform merge for main file symbols.
Summary:
Previously, we randomly pick one main file symbol in dynamic index, we
may loose the ideal symbol (with definition location) in the index.
It fixes the issue where sometimes we fail to go to the symbol definition, see:
1. call go-to-decl on Foo in Foo.cpp
2. jump to Foo.h, call go-to-def on Foo in Foo.h
we can't go back to Foo.cpp -- because we open Foo.cpp, Foo.h in clangd, both
files have Foo symbol (one with def&decl, one with decl only), we randomely
choose one.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63425
llvm-svn: 363568
Jan Kratochvil [Mon, 17 Jun 2019 14:46:17 +0000 (14:46 +0000)]
[lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more testcases
D55859 <https://reviews.llvm.org/D55859> has no effect for some of the
testcases so this patch extends it even for (all?) other testcases known to me.
LLDB was failing when LLDB prints errors reading system debug infos
(`*-debuginfo.rpm`, DWZ-optimized) which should never happen as LLDB testcases
should not be affected by system debug infos.
`lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template` is
using only SB API which does not expose `ModuleList` so I had to call
`HandleCommand()` there.
`lldb-test.cpp` could also use `HandleCommand` and then there would be no need
for `ModuleListProperties::SetEnableExternalLookup()` but I think it is cleaner
with API and not on based on text commands.
Differential Revision: https://reviews.llvm.org/D63339
llvm-svn: 363567
Whitney Tsang [Mon, 17 Jun 2019 14:38:56 +0000 (14:38 +0000)]
PHINode: introduce setIncomingValueForBlock() function, and use it.
Summary:
There is PHINode::getBasicBlockIndex() and PHINode::setIncomingValue()
but no function to replace incoming value for a specified BasicBlock*
predecessor.
Clearly, there are a lot of places that could use that functionality.
Reviewer: craig.topper, lebedev.ri, Meinersbur, kbarton, fhahn
Reviewed By: Meinersbur, fhahn
Subscribers: fhahn, hiraditya, zzheng, jsji, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D63338
llvm-svn: 363566
Simon Pilgrim [Mon, 17 Jun 2019 14:38:17 +0000 (14:38 +0000)]
[X86][SSE] Add tests for underaligned nt loads
Test both 'unaligned' (which we should just use regular unaligned loads) and 'subvector aligned' (which we should split)
llvm-svn: 363565
Simon Pilgrim [Mon, 17 Jun 2019 14:26:10 +0000 (14:26 +0000)]
[X86][SSE] Prevent misaligned non-temporal vector load/store combines
For loads, pre-SSE41 we can't perform NT loads at all, and after that we can only perform vector aligned loads, so if the alignment is less than for a xmm we'll just end up using the regular unaligned vector loads anyway.
First step towards fixing PR42026 - the next step for stores will be to use SSE4A movntsd where possible and to avoid the stack spill on SSE2 targets.
Differential Revision: https://reviews.llvm.org/D63246
llvm-svn: 363564
Kadir Cetinkaya [Mon, 17 Jun 2019 14:23:06 +0000 (14:23 +0000)]
[clang][CodeGen] Remove std::move on temporary
llvm-svn: 363563
Matt Arsenault [Mon, 17 Jun 2019 14:13:29 +0000 (14:13 +0000)]
InferAddressSpaces: Fix cloning original addrspacecast
If an addrspacecast needed to be inserted again, this was creating a
clone of the original cast for each user. Just use the original, which
also saves losing the value name.
llvm-svn: 363562
Matt Arsenault [Mon, 17 Jun 2019 14:13:24 +0000 (14:13 +0000)]
AMDGPU: Ignore subtarget for InferAddressSpaces
Even if the target doesn't have flat instructions, addrspace(0) is
still flat. It just happens to not work.
llvm-svn: 363561
Matt Arsenault [Mon, 17 Jun 2019 13:52:24 +0000 (13:52 +0000)]
AMDGPU: Mark exp/exp.compr as inaccessiblememonly
Should also be marked writeonly, but I think that would require
splitting the version with done set to a separate intrinsic
Test change is only from renumbering the attribute group numbers,
which for some reason the generated check lines consider.
llvm-svn: 363560
Matt Arsenault [Mon, 17 Jun 2019 13:52:19 +0000 (13:52 +0000)]
AMDGPU/GlobalISel: Fix default mapping for non-register operands
Tests will be in future commits when new intrinsics are handled here.
llvm-svn: 363559
Matt Arsenault [Mon, 17 Jun 2019 13:52:15 +0000 (13:52 +0000)]
AMDGPU: Cleanup custom PseudoSourceValue definitions
Use separate enums for each kind, avoid repeating overloads, and add
missing classof implementation.
llvm-svn: 363558
Marshall Clow [Mon, 17 Jun 2019 13:41:14 +0000 (13:41 +0000)]
Fix a '>= 0' test on unsigned that I inadvertantly introduced. Now correctly '!= 0'. Thanks to Arthur for the catch
llvm-svn: 363557
Sam Parker [Mon, 17 Jun 2019 13:39:28 +0000 (13:39 +0000)]
[CodeGen] Check for HardwareLoop Latch ExitBlock
The HardwareLoops pass finds exit blocks with a scevable exit count.
If the target specifies to update the loop counter in a register,
through a phi, we need to ensure that the exit block is a latch so
that we can insert the phi with the correct value for the incoming
edge.
Differential Revision: https://reviews.llvm.org/D63336
llvm-svn: 363556
Haojian Wu [Mon, 17 Jun 2019 13:18:24 +0000 (13:18 +0000)]
[clangd] Bump vscode-clangd v0.0.15.
CHANGELOG:
- support detecting C++ language from first line (`-*- C++ -*-`) of the file.
llvm-svn: 363555
Haojian Wu [Mon, 17 Jun 2019 12:59:14 +0000 (12:59 +0000)]
[clangd] Detect C++ for extension-less source files in vscode extension
Summary:
Extend our extension to support detecting these files as C++ files based on the first
line (`-*- C++ -*-`), it will make clangd work on C++ standard headers
(e.g. iostream).
We use the contributes.languages[1] to enrich the builtin VScode C++
support.
[1]: https://code.visualstudio.com/api/references/contribution-points#contributes.languages
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63397
llvm-svn: 363554
Michael Liao [Mon, 17 Jun 2019 12:51:36 +0000 (12:51 +0000)]
[HIP] Add the interface deriving the stub name of device kernels.
Summary:
- Revise the interface to derive the stub name and simplify the
assertion of it.
Reviewers: yaxunl, tra
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63335
llvm-svn: 363553
Simon Pilgrim [Mon, 17 Jun 2019 12:35:26 +0000 (12:35 +0000)]
[X86][SSE] Avoid unnecessary stack codegen in NT store codegen tests.
llvm-svn: 363552
Michal Gorny [Mon, 17 Jun 2019 12:32:09 +0000 (12:32 +0000)]
[lldb] [test] Watchpoint tests can be always run as root on NetBSD
llvm-svn: 363551
Nicolai Haehnle [Mon, 17 Jun 2019 12:24:04 +0000 (12:24 +0000)]
AsmPrinter: add doc-string for EmitLinkage
Change-Id: I376fcbd58f84a2aac6aaf744bc1665c92d312b25
llvm-svn: 363550
Nico Weber [Mon, 17 Jun 2019 12:18:27 +0000 (12:18 +0000)]
gn build: Merge r363530
llvm-svn: 363549
Nico Weber [Mon, 17 Jun 2019 12:10:40 +0000 (12:10 +0000)]
Promote -fdebug-compilation-dir from a cc1 flag to clang and clang-cl driver flags
The flag is useful when wanting to create .o files that are independent
from the absolute path to the build directory. -fdebug-prefix-map= can
be used to the same effect, but it requires putting the absolute path
to the build directory on the build command line, so it still requires
the build command line to be dependent on the absolute path of the build
directory. With this flag, "-fdebug-compilation-dir ." makes it so that
both debug info and the compile command itself are independent of the
absolute path of the build directory, which is good for build
determinism (in the sense that the build is independent of which
directory it happens in) and for caching compile results.
(The tradeoff is that the debugger needs explicit configuration to know
the build directory. See also http://dwarfstd.org/ShowIssue.php?issue=171130.2)
Differential Revision: https://reviews.llvm.org/D63387
llvm-svn: 363548
Bjorn Pettersson [Mon, 17 Jun 2019 12:02:24 +0000 (12:02 +0000)]
[LV] Deny irregular types in interleavedAccessCanBeWidened
Summary:
Avoid that loop vectorizer creates loads/stores of vectors
with "irregular" types when interleaving. An example of
an irregular type is x86_fp80 that is 80 bits, but that
may have an allocation size that is 96 bits. So an array
of x86_fp80 is not bitcast compatible with a vector
of the same type.
Not sure if interleavedAccessCanBeWidened is the best
place for this check, but it solves the problem seen
in the added test case. And it is the same kind of check
that already exists in memoryInstructionCanBeWidened.
Reviewers: fhahn, Ayal, craig.topper
Reviewed By: fhahn
Subscribers: hiraditya, rkruppe, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63386
llvm-svn: 363547
Sander de Smalen [Mon, 17 Jun 2019 12:01:53 +0000 (12:01 +0000)]
Test forward references in IntrinsicEmitter on Neon LD(2|3|4)
This patch tests the forward-referencing added in D62995 by changing
some existing intrinsics to use forward referencing of overloadable
parameters, rather than backward referencing.
This patch changes the TableGen definition/implementation of
llvm.aarch64.neon.ld2lane and llvm.aarch64.neon.ld2lane intrinsics
(and similar for ld3 and ld4). This change is intended to be
non-functional, since the behaviour of the intrinsics is
expected to be the same.
Reviewers: arsenm, dmgreen, RKSimon, greened, rnk
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D63189
llvm-svn: 363546
Mikhail Maltsev [Mon, 17 Jun 2019 11:00:21 +0000 (11:00 +0000)]
[libunwind][AArch64] Fix libunwind::Registers_arm64::jumpto
Summary:
The AArch64 version of the libunwind function which restores the
CPU state and resumes execution is not interrupt-safe. It restores
the target value of SP before loading the floating-point registers
from the context struct, but that struct is allocated on the stack
which is being deallocated. This means that if an interrupt occurs
during this function, and uses a lot of stack space, it could
overwrite the values about to be loaded into the floating-point
registers.
This patch fixes the issue.
Patch by Oliver Stannard.
Reviewers: phosek, chill
Reviewed By: chill
Subscribers: chill, javed.absar, kristof.beyls, christof, LukeCheeseman, pbarrio, olista01, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D63006
llvm-svn: 363545
Luis Marques [Mon, 17 Jun 2019 10:54:12 +0000 (10:54 +0000)]
[DAGCombiner] [CodeGenPrepare] More comprehensive GEP splitting
Some GEPs were not being split, presumably because that split would just be
undone by the DAGCombiner. Not performing those splits can prevent important
optimizations, such as preventing the element indices / member offsets from
being (partially) folded into load/store instruction immediates. This patch:
- Makes the splits also occur in the cases where the base address and the GEP
are in the same BB.
- Ensures that the DAGCombiner doesn't reassociate them back again.
Differential Revision: https://reviews.llvm.org/D60294
llvm-svn: 363544
Fangrui Song [Mon, 17 Jun 2019 10:20:20 +0000 (10:20 +0000)]
Fix clang -Wcovered-switch-default after stack-id change by D60137
llvm-svn: 363543
Simon Pilgrim [Mon, 17 Jun 2019 10:14:52 +0000 (10:14 +0000)]
[SelectionDAG] Fold insert_subvector(undef, extract_subvector(v, c), c) -> v in getNode
This is already done in DAGCombiner::visitINSERT_SUBVECTOR, but this helps a number of shuffles across different vector widths recognise when they come from the same source.
llvm-svn: 363542
Sven van Haastregt [Mon, 17 Jun 2019 10:06:34 +0000 (10:06 +0000)]
Recommit [OpenCL] Move OpenCLBuiltins.td and remove unused include
Reland r363242 after fixing an issue with the tablegen dependence.
Patch by Pierre Gondois and Sven van Haastregt.
Differential revision: https://reviews.llvm.org/D62849
llvm-svn: 363541
Sam Parker [Mon, 17 Jun 2019 10:05:18 +0000 (10:05 +0000)]
[SCEV] Use NoWrapFlags when expanding a simple mul
Second functional change following on from rL362687. Pass the
NoWrapFlags from the MulExpr to InsertBinop when we're generating a
shl or mul.
Differential Revision: https://reviews.llvm.org/D61934
llvm-svn: 363540
Fangrui Song [Mon, 17 Jun 2019 09:59:55 +0000 (09:59 +0000)]
[llvm-objdump] Use %08 instead of %016 to print leading addresses for 32-bit binaries
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D63398
llvm-svn: 363539
Fangrui Song [Mon, 17 Jun 2019 09:51:07 +0000 (09:51 +0000)]
[lit] Delete empty lines at the end of lit.local.cfg NFC
llvm-svn: 363538
Roman Lebedev [Mon, 17 Jun 2019 09:50:50 +0000 (09:50 +0000)]
[NFC][Codegen] Standalone tests for icmp eq/ne (urem %x, C), 0 -> icmp eq/ne %x, 0 fold (D63390)
llvm-svn: 363537
Michal Gorny [Mon, 17 Jun 2019 09:49:05 +0000 (09:49 +0000)]
[lldb] [test] Skip watchpoint tests on NetBSD if userdbregs is disabled
Skip watchpoint tests if security.models.extensions.user_set_dbregs
is disabled. This indicates that unprivileged processes are not allowed
to write to debug registers which is a prerequisite for using hardware
watchpoints.
Differential Revision: https://reviews.llvm.org/D63380
llvm-svn: 363536
Fangrui Song [Mon, 17 Jun 2019 09:29:50 +0000 (09:29 +0000)]
[ARM] Fix another -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63265
llvm-svn: 363535
Fangrui Song [Mon, 17 Jun 2019 09:26:50 +0000 (09:26 +0000)]
[ARM] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D63265
llvm-svn: 363534
Sander de Smalen [Mon, 17 Jun 2019 09:13:29 +0000 (09:13 +0000)]
Describe stack-id as an enum
This patch changes MIR stack-id from an integer to an enum,
and adds printing/parsing support for this in MIR files. The default
stack-id '0' is now renamed to 'default'.
This should make MIR tests that have stack objects with different stack-ids
more descriptive. It also clarifies code operating on StackID.
Reviewers: arsenm, thegameg, qcolombet
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D60137
llvm-svn: 363533
Sam Parker [Mon, 17 Jun 2019 09:13:10 +0000 (09:13 +0000)]
[ARM] Remove ARMComputeBlockSize
Forgot to remove file!
llvm-svn: 363532
Sam Parker [Mon, 17 Jun 2019 09:05:43 +0000 (09:05 +0000)]
[ARM] Add ARMBasicBlockInfo.cpp
Forgot to add file!
llvm-svn: 363531
Sam Parker [Mon, 17 Jun 2019 08:49:09 +0000 (08:49 +0000)]
[ARM] Extract some code from ARMConstantIslandPass
Create the ARMBasicBlockUtils class for tracking and querying basic
blocks sizes so we can use them when generating low-overhead loops.
Differential Revision: https://reviews.llvm.org/D63265
llvm-svn: 363530
Hans Wennborg [Mon, 17 Jun 2019 07:47:28 +0000 (07:47 +0000)]
Re-commit r357452 (take 3): "SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259)"
Third time's the charm.
This was reverted in r363220 due to being suspected of an internal benchmark
regression and a test failure, none of which turned out to be caused by this.
llvm-svn: 363529
Pavel Labath [Mon, 17 Jun 2019 07:32:56 +0000 (07:32 +0000)]
DWARF: Avoid storing DIERefs in long-lived containers
Summary:
A user_id_t carries the same information as a DIERef, but it takes up
less space.
Furthermore, DIERef::operator<'s implementation is very
questionable, as it does not take the cu_offset and section fields into
account. Using just the die offset was correct in the days when all
debug info lived in a single section, but since we started supporting
DWO debug info, this was no longer true. The comparison operator could
be fixed, but it seems like using the user_id_t for these purposes is a
better idea overall.
I think this did not cause any bugs, because the only place the
comparison operator was used is in m_function_scope_qualified_name_map,
and this one is local to a dwo file, but I am not 100% sure of that.
Reviewers: clayborg, JDevlieghere
Subscribers: aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D63322
llvm-svn: 363528
Yevgeny Rouban [Mon, 17 Jun 2019 05:55:12 +0000 (05:55 +0000)]
[SimplifyCFG] Fix prof branch_weights MD while removing unreachable switch cases
SimplifyCFG has a bug that results in inconsistent prof branch_weights metadata
if unreachable switch cases are removed. This patch fixes this bug by making use
of the newly introduced SwitchInstProfUpdateWrapper class (see patch D62122).
A new test is created.
Differential Revision: https://reviews.llvm.org/D62186
llvm-svn: 363527
Justin Hibbits [Mon, 17 Jun 2019 03:15:23 +0000 (03:15 +0000)]
PowerPC: Optimize SPE double parameter calling setup
Summary:
SPE passes doubles the same as soft-float, in register pairs as i32
types. This is all handled by the target-independent layer. However,
this is not optimal when splitting or reforming the doubles, as it
pushes to the stack and loads from, on either side.
For instance, to pass a double argument to a function, assuming the
double value is in r5, the sequence currently looks like this:
evstdd 5, X(1)
lwz 3, X(1)
lwz 4, X+4(1)
Likewise, to form a double into r5 from args in r3 and r4:
stw 3, X(1)
stw 4, X+4(1)
evldd 5, X(1)
This optimizes the fence to use SPE instructions. Now, to pass a double
to a function:
mr 4, 5
evmergehi 3, 5, 5
And to form a double into r5 from args in r3 and r4:
evmergelo 5, 3, 4
This is comparable to the way that gcc generates the double splits.
This also fixes a bug with expanding builtins to libcalls, where the
LowerCallTo() code path was generating intermediate illegal type nodes.
Reviewers: nemanjai, hfinkel, joerg
Subscribers: kbarton, jfb, jsji, llvm-commits
Differential Revision: https://reviews.llvm.org/D54583
llvm-svn: 363526
Seiya Nuta [Mon, 17 Jun 2019 02:07:20 +0000 (02:07 +0000)]
[yaml2obj][MachO] Don't fill dummy data for virtual sections
Summary:
Currently, MachOWriter::writeSectionData writes dummy data (0xdeadbeef) to fill section data areas in the file even if the section is a virtual one. Since virtual sections don't occupy any space in the file, writing dummy data could results the "OS.tell() - fileStart <= Sec.offset" assertion failure.
This patch fixes the bug by simply not writing any dummy data for virtual sections.
Reviewers: beanz, jhenderson, rupprecht, alexshap
Reviewed By: alexshap
Subscribers: compnerd, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62991
llvm-svn: 363525
Seiya Nuta [Mon, 17 Jun 2019 02:03:45 +0000 (02:03 +0000)]
[llvm-objcopy] Add elf32-sparc and elf32-sparcel target
Summary:
The "sparc"/"sparcel" architectures appears in ArchMap (used by -B option) but not in OutputFormatMap (used by -I/-O option). Add their targets into OutputFormatMap for consistency.
Note that AFAIK there're no targets for 32-bit little-endian SPARC ("elf32-sparcel") in GNU binutils.
Reviewers: espindola, alexshap, rupprecht, jhenderson, compnerd, jakehehrlich
Reviewed By: jhenderson, compnerd, jakehehrlich
Subscribers: jyknight, emaste, arichardson, fedor.sergeev, jakehehrlich, MaskRay, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63238
llvm-svn: 363524
Craig Topper [Sun, 16 Jun 2019 22:33:09 +0000 (22:33 +0000)]
[X86] Add TB_NO_REVERSE to some folding table entries where the register from uses the REX prefix, but the memory form does not.
It would not be safe to unfold the memory form the register form
without checking that we are compiling for 64-bit mode.
This probaby isn't a real functional issue since we are unlikely
to unfold any of these instructions since they don't have any
tied registers, aren't commutable, and don't have any inputs
other than the address.
llvm-svn: 363523
Roman Lebedev [Sun, 16 Jun 2019 20:39:45 +0000 (20:39 +0000)]
[InstSimplify] Fix addo/subo undef folds (PR42209)
Fix folds of addo and subo with an undef operand to be:
`@llvm.{u,s}{add,sub}.with.overflow` all fold to `{ undef, false }`,
as per LLVM undef rules.
Same for commuted variants.
Based on the original version of the patch by @nikic.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=42209 | PR42209 ]]
Differential Revision: https://reviews.llvm.org/D63065
llvm-svn: 363522
Don Hinton [Sun, 16 Jun 2019 19:15:04 +0000 (19:15 +0000)]
[docs] Fix another bot error by setting highlight language of objc code-block to objc instead of c++.
llvm-svn: 363521
Don Hinton [Sun, 16 Jun 2019 18:41:31 +0000 (18:41 +0000)]
[docs] Fix another bot warning by adding a blank line to separate the `option::` command from the text below.
llvm-svn: 363520
Nicolai Haehnle [Sun, 16 Jun 2019 18:30:42 +0000 (18:30 +0000)]
[AsmPrinter] Make EmitLinkage and EmitVisibility public
Summary:
This allows target to implement custom emit of global variables if
required. See subsequent patch for a use case.
Change-Id: I9654197e3df24503104a54c41fff06845aed37fe
Reviewers: arsenm, kzhuravl
Subscribers: wdng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61650
llvm-svn: 363519
Don Hinton [Sun, 16 Jun 2019 17:57:37 +0000 (17:57 +0000)]
[docs] Fix a few problems with clang-tool docs to get the bots green again.
llvm-svn: 363518
Nicolai Haehnle [Sun, 16 Jun 2019 17:43:37 +0000 (17:43 +0000)]
AMDGPU: Prepare for explicit absolute relocations in code generation
Summary:
We will use absolute relocations for LDS symbols.
Change-Id: I9a32795ed0ea835e433a787129cfe3c57ee9a325
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61492
llvm-svn: 363517
Nicolai Haehnle [Sun, 16 Jun 2019 17:32:01 +0000 (17:32 +0000)]
AMDGPU: Be explicit about whether the high-word in SI_PC_ADD_REL_OFFSET is 0
Summary:
Instead of encoding a high-word of 0 using a fake TargetGlobalAddress,
just use a literal target constant. This simplifies some subsequent changes.
The generated assembly is now more explicit about the kind of relocation
that is to be used.
Change-Id: I066835202d23b5941fa7a358eb4b89e9b71ab6f8
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61491
llvm-svn: 363516
Csaba Dabis [Sun, 16 Jun 2019 17:29:37 +0000 (17:29 +0000)]
[analyzer] ReturnVisitor: more portable test case
llvm-svn: 363515
Nicolai Haehnle [Sun, 16 Jun 2019 17:14:12 +0000 (17:14 +0000)]
AMDGPU/GFX10: Support DLC bit in llvm.amdgcn.s.buffer.load intrinsic
Summary: Change-Id: Ie4c971462a7749740938c687144e77441dac2539
Reviewers: rampitec, arsenm
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62486
Change-Id: Iae59523edd75c74918d2118df6571a7b671717a0
llvm-svn: 363514
Stanislav Mekhanoshin [Sun, 16 Jun 2019 17:13:09 +0000 (17:13 +0000)]
[AMDGPU] gfx10 conditional registers handling
This is cpp source part of wave32 support, excluding overriden
getRegClass().
Differential Revision: https://reviews.llvm.org/D63351
llvm-svn: 363513
Kristof Umann [Sun, 16 Jun 2019 15:41:25 +0000 (15:41 +0000)]
[analyzer] Push correct version of 'Track indices of arrays'
Messed up the commit, oops.
llvm-svn: 363512
Sanjay Patel [Sun, 16 Jun 2019 15:29:03 +0000 (15:29 +0000)]
[CodeGenPrepare][x86] shift both sides of a vector select when profitable
This is based on the example/discussion in PR37428:
https://bugs.llvm.org/show_bug.cgi?id=37428
Proper vector shift instructions don't appear until AVX2, so we may generate several
extra instructions within a loop trying to compensate for that. It's difficult to
recover from that shift expansion later than this, so use the existing TLI hook and
splat analysis to enable better codegen.
This extends CGP functionality introduced with:
rL201655
Differential Revision: https://reviews.llvm.org/D63233
llvm-svn: 363511
Kristof Umann [Sun, 16 Jun 2019 14:52:56 +0000 (14:52 +0000)]
[analyzer] Track indices of arrays
Often times, when an ArraySubscriptExpr was reported as null or
undefined, the bug report was difficult to understand, because the
analyzer explained why arr[i] has that value, but didn't realize that in
fact i's value is very important as well. This patch fixes this by
tracking the indices of arrays.
Differential Revision: https://reviews.llvm.org/D63080
llvm-svn: 363510
Kristof Umann [Sun, 16 Jun 2019 14:09:11 +0000 (14:09 +0000)]
[analyzer][NFC] Tease apart and clang-format NoStoreFuncVisitor
Make several methods static functions
Move non-trivial methods out-of-line
Add a divider
Turn non-obvious autos into Optional<RegionVector>
clang-format affected lines
Differential Revision: https://reviews.llvm.org/D63086
llvm-svn: 363509
Sanjay Patel [Sun, 16 Jun 2019 14:04:49 +0000 (14:04 +0000)]
[x86] split 256-bit vector selects if operands are vector concats
This is similar logic/motivation to the select splitting in D62969.
In D63233, the pattern changes so that we no longer have an extract_subvector of vselect,
but the operands of the select are still being concatenated.
The closest case is represented in either the first or last test diffs here - we have an
extra instruction, but we converted 3-4 ymm instructions into 4-5 xmm instructions.
I think that's the right trade-off for most AVX1 targets.
In the example based on PR37428:
https://bugs.llvm.org/show_bug.cgi?id=37428
...this makes the loop about 30% faster (tested on Haswell by compiling with -mavx).
Differential Revision: https://reviews.llvm.org/D63364
llvm-svn: 363508
Simon Pilgrim [Sun, 16 Jun 2019 08:00:41 +0000 (08:00 +0000)]
[X86] CombineShuffleWithExtract - handle cases with different vector extract sources
Insert the shorter vector source into an undef vector of the longer vector source's type.
llvm-svn: 363507
Nathan Ridge [Sun, 16 Jun 2019 02:31:37 +0000 (02:31 +0000)]
[clangd] Type hierarchy subtypes
Summary:
This builds on the relations support added in D59407, D62459, D62471,
and D62839 to implement type hierarchy subtypes.
Reviewers: kadircet
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman,
jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58880
llvm-svn: 363506
Nico Weber [Sun, 16 Jun 2019 02:24:01 +0000 (02:24 +0000)]
gn build: Merge r363444
llvm-svn: 363505
Don Hinton [Sun, 16 Jun 2019 01:09:41 +0000 (01:09 +0000)]
Fix gcc-05.4 bot failures caused by in r363481 "[clangd] Index API and implementations for relations"
Use std::make_tuple instead of initializer list to make gcc-5.4 happy.
See https://reviews.llvm.org/D62839 for details.
llvm-svn: 363504
Eric Fiselier [Sat, 15 Jun 2019 21:16:57 +0000 (21:16 +0000)]
add header to help with template testing
llvm-svn: 363503
Don Hinton [Sat, 15 Jun 2019 20:09:54 +0000 (20:09 +0000)]
Recommit r363298 "[lit] Disable test on darwin when building shared libs."
Was reverted in r363379 due to build breakage.
Thanks to Nico Weber for reverting the original and suggesting the
fix.
Please see https://reviews.llvm.org/D61697
llvm-svn: 363502
Simon Pilgrim [Sat, 15 Jun 2019 19:12:44 +0000 (19:12 +0000)]
[X86] CombineShuffleWithExtract - assert all src ops types are multiples of rootsize. NFCI.
llvm-svn: 363501
Simon Pilgrim [Sat, 15 Jun 2019 18:30:43 +0000 (18:30 +0000)]
[X86][AVX] Handle lane-crossing shuffle(extract_subvector(x,c1),extract_subvector(y,c2),m1) shuffles
Pull out the existing (non)lane-crossing fold into a helper lambda and use for lane-crossing unary shuffles as well.
Fixes PR34380
llvm-svn: 363500
Simon Pilgrim [Sat, 15 Jun 2019 17:05:24 +0000 (17:05 +0000)]
[X86][AVX] Decode constant bits from insert_subvector(c1, c2, c3)
This mostly happens due to SimplifyDemandedVectorElts reducing a vector to insert_subvector(undef, c1, 0)
llvm-svn: 363499
Roman Lebedev [Sat, 15 Jun 2019 16:12:13 +0000 (16:12 +0000)]
[NFC][MCA][X86] Add one more 'clear super register' pattern - movss/movsd load clears high XMM bits
llvm-svn: 363498