Commit Graph

325586 Commits

Author SHA1 Message Date
Amaury Sechet 8365e42010 [DAGCombiner] (insert_vector_elt (vector_shuffle X, Y), (extract_vector_elt X, N), IdxC) -> (vector_shuffle X, Y)
Summary: This is beneficial when the shuffle is only used once and end up being generated in a few places when some node is combined into a shuffle.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66718

llvm-svn: 370326
2019-08-29 10:35:51 +00:00
David Green e9211b764c [ARM] Masked load and store and predicate tests. NFC
llvm-svn: 370325
2019-08-29 10:32:12 +00:00
Roman Lebedev f13b0e3ed8 [InstCombine] Shift amount reassociation in bittest: trunc-of-lshr (PR42399)
Summary:
Finally, the fold i was looking forward to :)

The legality check is muddy, i doubt  i've groked the full generalization,
but it handles all the cases i care about, and can come up with:
https://rise4fun.com/Alive/26j

I.e. we can perform the fold if **any** of the following is true:
* The shift amount is either zero or one less than widest bitwidth
* Either of the values being shifted has at most lowest bit set
* The value that is being shifted by `shl` (which is not truncated) should have no less leading zeros than the total shift amount;
* The value that is being shifted by `lshr` (which **is** truncated) should have no less leading zeros than the widest bit width minus total shift amount minus one

I strongly suspect there is some better generalization, but i'm not aware of it as of right now.
For now i also avoided using actual `computeKnownBits()`, but restricted it to constants.

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66383

llvm-svn: 370324
2019-08-29 10:26:23 +00:00
Dmitri Gribenko c65204148c [Index] Create PP callbacks in the ASTConsumer
Doing so removes one reason to create a custom FrontendAction.
FrontendActions are not desirable because they are difficult to compose.
ASTConsumers are much easier to compose.

llvm-svn: 370323
2019-08-29 10:23:29 +00:00
Sven van Haastregt a280b63ead [OpenCL] Fix diagnosing enqueue_kernel call with too few args
The err_typecheck_call_too_few_args diagnostic takes arguments, but
none were provided causing clang to crash when attempting to diagnose
an enqueue_kernel call with too few arguments.

Fixes llvm.org/PR42045

Differential Revision: https://reviews.llvm.org/D66883

llvm-svn: 370322
2019-08-29 10:21:06 +00:00
Dmitri Gribenko 3c790585e7 [Index] Marked a bunch of classes 'final'
This file defines multiple inheritance hierarchies and 'final' helps
with readability.

llvm-svn: 370321
2019-08-29 10:16:41 +00:00
Simon Pilgrim dfb2a19ac2 LegalizeSetCCCondCode - Reduce scope of NeedSwap to fix cppcheck warning. NFCI.
No need for this to be defined outside the only switch case its used in.

llvm-svn: 370320
2019-08-29 10:11:34 +00:00
Simon Pilgrim 920b04011b Fix variable set but no used warnings on NDEBUG builds. NFCI.
llvm-svn: 370319
2019-08-29 10:08:45 +00:00
Simon Pilgrim ef9c6a7077 Fix variable set but no used warning on NDEBUG builds. NFCI.
llvm-svn: 370317
2019-08-29 09:58:47 +00:00
Raphael Isemann 250cef2c7d [lldb][NFC] Try fixing TestCompletion.py on Windows
llvm-svn: 370316
2019-08-29 09:57:02 +00:00
Raphael Isemann a884a06c92 [lldb][NFC] Also test operator new/new[]/delete/delete[]/comma/addr-of
llvm-svn: 370315
2019-08-29 09:39:33 +00:00
Adam Balogh 12f5c7f0c3 [Analyzer] Iterator Checkers - Make range errors and invalidated access fatal
Range errors (dereferencing or incrementing the past-the-end iterator or
decrementing the iterator of the first element of the range) and access of
invalidated iterators lead to undefined behavior. There is no point to
continue the analysis after such an error on the same execution path, but
terminate it by a sink node (fatal error). This also improves the
performance and helps avoiding double reports (e.g. in case of nested
iterators).

Differential Revision: https://reviews.llvm.org/D62893

llvm-svn: 370314
2019-08-29 09:35:47 +00:00
Martin Storsjo 7ba81d95d5 [COFF] Add a ResourceSectionRef method for getting the data entry, print it in llvm-readobj
Differential Revision: https://reviews.llvm.org/D66819

llvm-svn: 370311
2019-08-29 09:00:14 +00:00
Martin Storsjo edb6ab9ba6 [COFF] Add a bounds checking helper for iterating a coff_resource_dir_table
Instead of blindly incrementing pointers in llvm-readobj, use this
helper, which does bounds checking against the available section
data.

Differential Revision: https://reviews.llvm.org/D66818

llvm-svn: 370310
2019-08-29 08:59:56 +00:00
Martin Storsjo 357a40ec7c [COFF] Fix error handling in ResourceSectionRef
Previously, the expression (Reader.readFoo()) was expanded twice,
triggering asserts as one of the Error types ends up not checked
(and as it was expanded twice, the method would end up called twice
if it failed first).

Differential Revision: https://reviews.llvm.org/D66817

llvm-svn: 370309
2019-08-29 08:59:41 +00:00
Martin Storsjo e3e8874b89 [llvm-readobj] Print the resource type textually for .res files
This already is done when dumping resources from coff objects.

Differential Revision: https://reviews.llvm.org/D66816

llvm-svn: 370308
2019-08-29 08:59:31 +00:00
Martin Storsjo cdb9aa6339 [llvm-readobj] Remove a leftover string trim operation. NFC.
This became unnecessary in SVN r359153.

Differential Revision: https://reviews.llvm.org/D66815

llvm-svn: 370307
2019-08-29 08:59:05 +00:00
Johan Vikstrom 4683eec2d3 [clangd] Update themeRuleMatcher when color theme changes in vscode extension.
Summary:
Add event listener that listens to configuration changes and reloads the ThemeRuleMatcher when the theme changes.

Right now it will not recolor the files, depends on the colorizer CL for that.

Reviewers: hokein, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66406

llvm-svn: 370305
2019-08-29 08:40:17 +00:00
Sam McCall d792204288 Reland "[clangd] Migrate last tweak tests to TweakTesting.h and remove old helpers. NFC"
This reverts commit 3dcf55aa45bad800533b36b70a14ebeb2b84e219, and avoids
use of multiline raw strings in macro calls.

llvm-svn: 370304
2019-08-29 08:20:48 +00:00
Sylvestre Ledru c6e825efc7 use https for llvm.org in the doc
llvm-svn: 370303
2019-08-29 07:20:08 +00:00
Sylvestre Ledru 2831d1aedd fix the bugzilla url
llvm-svn: 370302
2019-08-29 07:19:14 +00:00
Sylvestre Ledru d07de02291 Provide a real link to the doc and remove old information
llvm-svn: 370301
2019-08-29 07:14:09 +00:00
Anton Afanasyev 101aca0484 [Test][Time profiler] Fix test for python3
Summary:
Fix test checking time profiler generates correct tracing json-file.
`filter` works differently for python2 and python3, so unifying this.

Reviewers: mgehre, nathanchance

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66873

llvm-svn: 370300
2019-08-29 06:49:05 +00:00
Craig Topper c96284002e [X86] Remove isel patterns with X86VBroadcast+scalar_to_vector+load.
The DAG should have these as X86VBroadcast+load.

llvm-svn: 370299
2019-08-29 06:36:16 +00:00
Dmitri Gribenko c2f9268f9f Removed dead code from clang/AST/NSAPI.h
Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66884

llvm-svn: 370298
2019-08-29 06:30:12 +00:00
Pengfei Wang caac097fbf [x86] Adding support for some missing intrinsics: _mm512_cvtsi512_si32
Summary:
Adding support for some missing intrinsics:
_mm512_cvtsi512_si32

Reviewers: craig.topper, pengfei, LuoYuanke, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: llvm-commits

Patch by Bing Yu (yubing)

Differential Revision: https://reviews.llvm.org/D66785

llvm-svn: 370297
2019-08-29 06:18:34 +00:00
Craig Topper 231e628d69 [X86] Remove some unneeded X86VBroadcast isel patterns that have larger than 128 bit input types.
We should always be shrinking the input to 128 bits or smaller
when the node is created.

llvm-svn: 370296
2019-08-29 06:02:11 +00:00
Hideto Ueno cbab334e40 [Attributor] Deduce "noalias" attribute
Summary:
This patch adds very basic deduction for noalias.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Tags: LLVM

Differential Revision: https://reviews.llvm.org/D66207

llvm-svn: 370295
2019-08-29 05:52:00 +00:00
Craig Topper 1ec5c204b8 [X86] Add a DAG combine to combine INSERTPS and VBROADCAST of a scalar load. Remove corresponding isel patterns.
We had an isel pattern to perform this, but its better to
do it in DAG combine as a simplification. This also fixes the lack
of patterns for AVX512 targets.

llvm-svn: 370294
2019-08-29 05:48:48 +00:00
Craig Topper 1aadf6f39f [X86] Make inline assembly 'x' and 'v' constraints work for f128.
Including a type legalizer fix to make bitcast operand promotion
work correctly when getSoftenedFloat returns f128 instead of i128.

Fixes PR43157

llvm-svn: 370293
2019-08-29 05:13:56 +00:00
Florian Hahn 3177b92231 [LoopUnroll] Use Lazy strategy for DTU used for MergeBlockIntoPredecessor.
We do not access the DT in the loop, so we do not have to apply updates
eagerly. We can apply them lazyly and flush them after we are done
merging blocks.

As follow-up work, we might be able to use the DTU above as well,
instead of manually updating the DT.

This brings the example from PR43134 from ~100s to ~4s for a relase +
assertions build on my machine.

Reviewers: efriedma, kuhar, asbirlea, brzycki

Reviewed By: kuhar, brzycki

Differential Revision: https://reviews.llvm.org/D66911

llvm-svn: 370292
2019-08-29 04:26:29 +00:00
Vitaly Buka db751c3778 [ObjectYAML] Fix lifetime issue in dumpDebugLines
Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66901

llvm-svn: 370289
2019-08-29 02:36:48 +00:00
Vitaly Buka 342197e6fc [sanitizer] Support monorepo layout in symbolizer build script
llvm-svn: 370288
2019-08-29 02:02:03 +00:00
Davide Italiano 54b3aa91d0 [python] remove testsuite vestiges.
llvm-svn: 370287
2019-08-29 01:45:10 +00:00
Davide Italiano a633d29ba1 [TSanRuntime] Upstream thread swift race detector.
Summary:
This is self-contained, and doesn't need anything in the
compiler to work. Mainly to reduce the diff between upstream
and downstream.

Patch by Kuba Mracek!

Reviewers: kubamracek

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D66915

llvm-svn: 370286
2019-08-29 01:39:26 +00:00
Johannes Doerfert bf112139ac [Attributor] Improve messages in iteration verify mode
When we now verify the iteration count we will see the actual count
and the expected count before the assertion is triggered.

llvm-svn: 370285
2019-08-29 01:29:44 +00:00
Johannes Doerfert a283125ef2 [Attributor][NFC] Add const to map key
llvm-svn: 370284
2019-08-29 01:28:30 +00:00
Johannes Doerfert 62a9c1da78 [Attributor][Fix] Indicate change correctly
llvm-svn: 370283
2019-08-29 01:26:58 +00:00
Johannes Doerfert 1aac182f31 [Attributor] Fix typo
llvm-svn: 370282
2019-08-29 01:26:09 +00:00
Matt Arsenault 216d8ff60b AMDGPU: Don't use frame virtual registers
SGPR spills aren't really handled after SILowerSGPRSpills. In order to
directly control what happens if the scavenger needs to spill, the
scavenger needs to be used directly. There is an alternative to
spilling in these contexts anyway since the frame register can be
increment and restored.

This does present another possible issue if spilling is needed for the
unused carry out if an add is needed. I think this can be avoided by
using a scalar add (although that clobbers SCC, which happens anyway).

llvm-svn: 370281
2019-08-29 01:13:47 +00:00
Matt Arsenault 8ec5c10042 GlobalISel/TableGen: Handle setcc patterns
This is a special case because one node maps to two different G_
instructions, and the operand order is changed.

This mostly enables G_FCMP for AMDPGPU. G_ICMP is still manually
selected for now since it has the SALU and VALU complication to deal
with.

llvm-svn: 370280
2019-08-29 01:13:41 +00:00
Richard Trieu e4a7f0182d Add requirement to test.
-debug-only option for llc is only available in debug builds so
"REQUIRES: asserts" is needed in the tes.

llvm-svn: 370279
2019-08-29 00:46:57 +00:00
Jonas Devlieghere 5c04497217 [dotest] Make dotest.py invocation repeatable
This removes support for reading the LLDB_TEST_ARGUMENTS environment
variable and instead requires all arguments to be specified as part of
the invocation. This ensures that dotest.py invocations are easily
repeatable.

Differential revision: https://reviews.llvm.org/D66912

llvm-svn: 370278
2019-08-28 23:54:23 +00:00
Vitaly Buka f6b9126890 [sanitizer] Simplify COMPILER_RT setup in lint script
llvm-svn: 370277
2019-08-28 23:52:21 +00:00
Craig Topper af364131af [X86] Fix a couple isel patterns to not shrink a volatile load.
Also add a FIXME because I'm not sure why these patterns exist. Looks like a missing combine.

And another FIXME because the AVX512 equivalent one of the patterns is missing.

llvm-svn: 370276
2019-08-28 23:45:10 +00:00
Shiva Chen b39876d8cd [RISCV] Avoid generating AssertZext for LP64 ABI when lowering floating LibCall
The patch fixed the issue that RV64 didn't clear the upper bits
when return complex floating value with lp64 ABI.

float _Complex
complex_add(float _Complex a, float _Complex b)
{
   return a + b;
}

RealResult = zero_extend(RealA + RealB)
ImageResult = ImageA + ImageB
Return (RealResult | (ImageResult << 32))

The patch introduces shouldExtendTypeInLibCall target hook to suppress
the AssertZext generation when lowering floating LibCall.

Thanks to Eli's comments from the Bugzilla
https://bugs.llvm.org/show_bug.cgi?id=42820

Differential Revision: https://reviews.llvm.org/D65497

llvm-svn: 370275
2019-08-28 23:40:37 +00:00
Volodymyr Sapsai f91b6f8159 [Modules] Fix rebuilding an updated module for each of its consumers.
Marking a module for a rebuild when its signature differs from the
expected one causes redundant module rebuilds for incremental builds.
When a module is updated, its signature changes. But its consumers still
have the old signature and loading them will result in signature
mismatches. It will correctly cause the rebuilds for the consumers but
we don't need to rebuild the common module for each of them as it is
already up to date.

In practice this bug causes longer build times. We are doing more work
than required and only a single process can build a module, so parallel
builds degrade to a single-process mode where extra processes are just
waiting on a file lock.

Fix by not marking a module dependency for a rebuild on signature
mismatch. We'll check if it is up to date when we load it.

rdar://problem/50212358

Reviewers: dexonsmith, bruno, rsmith

Reviewed By: dexonsmith, bruno

Subscribers: jkorous, ributzka, cfe-commits, aprantl

Differential Revision: https://reviews.llvm.org/D66907

llvm-svn: 370274
2019-08-28 23:31:32 +00:00
Heejin Ahn 660efa596f [clangd] Fix ExtractFunction dependencies
Summary: Without these dependencies, builds with `-DBUILD_SHARED_LIBS=ON` fail.

Reviewers: SureYeaah

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66910

llvm-svn: 370273
2019-08-28 23:17:38 +00:00
Heejin Ahn d85fd5a3f4 [WebAssembly] Add atomic.fence instruction
Summary:
This adds `atomic.fence` instruction:
https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#fence-operator

And we now emit the new `atomic.fence` instruction for multithread
fences, rather than the prevous `atomic.rmw` hack.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jfb, tlively, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66794

llvm-svn: 370272
2019-08-28 23:13:43 +00:00
Tom Stellard 5be949e3d0 [LLVM-C] Fix omission of INSTALL_WITH_TOOLCHAIN to llvm_add_library()
Due to a misstake with r365902 that tried to simplify the install with
toolchain logic LLVM-C.dll was no longer being installed.

Patch By: Jakob Bornecrantz

llvm-svn: 370271
2019-08-28 22:59:04 +00:00