Commit Graph

352571 Commits

Author SHA1 Message Date
Max Kazantsev 9cd4debd5a [LoopVectorize] Preserve CFG analyses if CFG wasn't modified
One of transforms the loop vectorizer makes is LCSSA formation. In some cases it
is the only transform it makes. We should not drop CFG analyzes if only LCSSA was
formed and no actual CFG changes was made.

We should think of expanding this logic to other passes as well, and maybe make
it a part of PM framework.

Reviewed By: Florian Hahn
Differential Revision: https://reviews.llvm.org/D78360
2020-04-24 17:22:24 +07:00
Sander de Smalen db7997472b [SveEmitter] Add builtins for svld1rq
Reviewed By: efriedma

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78748
2020-04-24 11:10:28 +01:00
Sander de Smalen c84e1305c4 [SveEmitter] Add builtins for scatter stores
D77735 only added scatters for the non-temporal variants.

Reviewers: SjoerdMeijer, efriedma, andwar

Reviewed By: efriedma

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78751
2020-04-24 10:57:43 +01:00
serge-sans-paille e307eeba01 Do not declare compiler extension member as const
It keeps them default constructible.
2020-04-24 11:44:42 +02:00
Haojian Wu a466e4be38 [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.
Summary:
this maybe not ideal, but it is trivial and does fix the crash.

Fixes https://github.com/clangd/clangd/issues/156.

Reviewers: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78715
2020-04-24 11:16:36 +02:00
Simon Atanasyan 0eec6662f6 [MC][mips] Replace setRType## methods by single setRTypes function. NFC
MCELFObjectWriter::setRType## methods are always used altogether to
build complete MIPS N64 ABI "chain" of relocations. Using single
function for this task makes code less verbose.
2020-04-24 12:13:27 +03:00
Kazushi (Jam) Marukawa 9aa6792729 [VE] Update floating-point arithmetic instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all floating-point arithmetic instructions.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D78768
2020-04-24 11:11:44 +02:00
Haojian Wu 500d378ee5 Fix -Wunused-variable warning, NFC. 2020-04-24 11:04:40 +02:00
Kang Zhang 302e11cd97 [NFC][PowerPC] Fix the liveins for 3 mir test cases 2020-04-24 08:03:02 +00:00
Johannes Doerfert 1dfc473177 Revert "[Attributor][NFC] Encode IRPositions in the bits of a single pointer"
A dependent patch has been reverted [0]. Until it goes back in this one
has to stay out.

[0] ebdb893994

This reverts commit d254b50b2b.
2020-04-24 02:53:51 -05:00
serge-sans-paille 8f766e382b Update compiler extension integration into the build system
The approach here is to create a new (empty) component, `Extensions', where all
statically compiled extensions dynamically register their dependencies. That way
we're more natively compatible with LLVMBuild and llvm-config.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=44870

Differential Revision: https://reviews.llvm.org/D78192
2020-04-24 09:40:14 +02:00
Johannes Doerfert ebdb893994 Revert "[Attributor][NFC] Let AbstractAttribute be an IRPosition"
It seems this breaks the windows builds:
  http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/7454/steps/build-llvm-project/logs/stdio

This reverts commit 6782635e90.
2020-04-24 02:24:15 -05:00
Frederik Gossen 7e4b139a04 [MLIR] Ensure `gpu.func` must be inside a `gpu.module`.
Ensure that `gpu.func` is only used within the dedicated `gpu.module`.
Implement the constraint to the GPU dialect and adopt test cases.

Differential Revision: https://reviews.llvm.org/D78541
2020-04-24 07:17:48 +00:00
Johannes Doerfert d254b50b2b [Attributor][NFC] Encode IRPositions in the bits of a single pointer
This reduces memory consumption for IRPositions by eliminating the
vtable pointer and the `KindOrArgNo` integer. Since each abstract
attribute has an associated IRPosition, the 12-16 bytes we save add up
quickly.

No functional change is intended.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 469545 (260135/s)
temporary memory allocations: 77137 (42735/s)
peak heap memory consumption: 30.50MB
peak RSS (including heaptrack overhead): 119.50MB
total memory leaked: 269.07KB
```

After:
```
calls to allocation functions: 468999 (274108/s)
temporary memory allocations: 77002 (45004/s)
peak heap memory consumption: 28.83MB
peak RSS (including heaptrack overhead): 118.05MB
total memory leaked: 269.07KB
```

Difference:
```
calls to allocation functions: -546 (5808/s)
temporary memory allocations: -135 (1436/s)
peak heap memory consumption: -1.67MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

---

CTMark 15 runs

Metric: compile_time

Program                                        lhs    rhs    diff
 test-suite...:: CTMark/sqlite3/sqlite3.test    25.07  24.09 -3.9%
 test-suite...Mark/mafft/pairlocalalign.test    14.58  14.14 -3.0%
 test-suite...-typeset/consumer-typeset.test    21.78  21.58 -0.9%
 test-suite :: CTMark/SPASS/SPASS.test          21.95  22.03  0.4%
 test-suite :: CTMark/lencod/lencod.test        25.43  25.50  0.3%
 test-suite...ark/tramp3d-v4/tramp3d-v4.test    23.88  23.83 -0.2%
 test-suite...TMark/7zip/7zip-benchmark.test    60.24  60.11 -0.2%
 test-suite :: CTMark/kimwitu++/kc.test         15.69  15.69 -0.0%
 test-suite...:: CTMark/ClamAV/clamscan.test    25.43  25.42 -0.0%
 test-suite :: CTMark/Bullet/bullet.test        37.63  37.62 -0.0%
 Geomean difference                                          -0.8%

---

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D78722
2020-04-24 01:58:47 -05:00
Johannes Doerfert 6782635e90 [Attributor][NFC] Let AbstractAttribute be an IRPosition
Since every AbstractAttribute so far, and for the foreseeable future,
corresponds to a single IRPosition we can simplify the class structure.
We already did this for IRAttribute but there is no reason to stop
there.
2020-04-24 01:58:47 -05:00
Christudasan Devadasan 207cd5f68f [AMDGPU] Add the SGPR used for FP copy to block livein lists.
The temporary register used for FP copy
should be live throughout the function.
2020-04-24 11:47:38 +05:30
Johannes Doerfert 10ff24d853 [Attributor][NFC] Remove and update old check lines 2020-04-24 01:08:23 -05:00
Johannes Doerfert a6b14bae0f [Attributor][NFC] Strip check lines not used while 3 tests are partially disable
The three tests modified by this commit have been partially disabled
(one run line is commented out). As a consequence subsequent updates
will have weird effects on the check lines. This is a commit to avoid
such effects by making the check lines match the three remaining run
lines.
2020-04-24 01:08:23 -05:00
Johannes Doerfert 2891b007e3 [Attributor][NFC] Add `const` and missing state constructors 2020-04-24 01:08:23 -05:00
Mircea Trofin 5948dafc69 [lldb][NFC][CallSite] Remove CallSite use
Reviewers: dblaikie, craig.topper

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D78791
2020-04-23 22:24:23 -07:00
Mircea Trofin b8960b5d81 [llvm][NFC][CallSite] Remove remaining {Immutable}CallSite uses
Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78789
2020-04-23 22:19:39 -07:00
Mehdi Amini 2107af9ccf Revert "[VPlan] Add & use VPValue operands for VPWidenRecipe (NFC)."
This reverts commit 9245c7ac13.

This is triggering a segfault in XLA downstream, we'll follow-up with
a reproducer, it is likely influenced by TTI/TLI settings or other
options as a simple `opt -loop-vectorize` invocation on the IR
before the crash does not reproduce immediately.
2020-04-24 05:07:32 +00:00
Mircea Trofin 2059a6e3ef [llvm][NFC][CallSite] Remove ImmutableCallSite from a few locations
Reviewers: craig.topper, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78783
2020-04-23 21:18:44 -07:00
Craig Topper cbe77ca9bd [CallSite removal] Remove unneeded includes of CallSite.h. NFC 2020-04-23 21:01:48 -07:00
Craig Topper 81c5e83f7d [CallSite removal][Transform] Replace CallSite with CallBase in Utils. NFC
Differential Revision: https://reviews.llvm.org/D78780
2020-04-23 20:49:33 -07:00
Matt Arsenault 6bffd0df78 AMDGPU: Fix redundant members 2020-04-23 23:14:01 -04:00
Matt Arsenault 50128f8a33 AMDGPU: Use Register 2020-04-23 22:25:36 -04:00
James Y Knight fb8152dcfe [CallSite removal] Remove the text describing CallSite from the manual. 2020-04-23 22:17:19 -04:00
Rob Suderman 5b89c1dd68 [mlir] DenseStringElementsAttr added to default attribute types
Summary:
Implemented a DenseStringsElements attr for handling arrays / tensors of strings. This includes the
necessary logic for parsing and printing the attribute from MLIR's text format.

To store the attribute we perform a single allocation that includes all wrapped string data tightly packed.
This means no padding characters and no null terminators (as they could be present in the string). This
buffer includes a first chunk of data that represents an array of StringRefs, that contain address pointers
into the string data, with the length of each string wrapped. At this point there is no Sparse representation
however strings are not typically represented sparsely.

Differential Revision: https://reviews.llvm.org/D78600
2020-04-23 19:02:15 -07:00
Fangrui Song 2c3ee8812c [Sema][test] Fix implicit-int-float-conversion.c on Windows 2020-04-23 18:52:04 -07:00
Fangrui Song 14aaf4457c [Sema] Split off warn_impcast_integer_float_precision_constant into -Wimplicit-const-int-float-conversion
Currently, both `warn_impcast_integer_float_precision_constant` and
`warn_impcast_integer_float_precision` are covered by
-Wimplicit-int-float-conversion, but only the ..._constant warning is on
by default.

`warn_impcast_integer_float_precision_constant` likely flags real problems
while `warn_impcast_integer_float_precision` may flag legitimate use
cases (for example, `int` used with limited range supported by `float`).

If -Wno-implicit-int-float-conversion is used, currently there is no way
to restore the ..._constant warning. This patch adds
-Wimplicit-const-int-float-conversion to address the issue. (Similar to
the reasoning in https://reviews.llvm.org/D64666#1598194)

Adapted from a patch by Brooks Moses.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D78661
2020-04-23 18:26:06 -07:00
Hubert Tong 2f9d1533d9 [llvm-objdump][ELF][NFC] Create ELFDump.h
Summary:
Continuing from D77285, the external interfaces implemented by
`ELFDump.cpp` are now declared in `ELFDump.h` and moved into the
`llvm::objdump` namespace. Externs defined in `ELFDump.cpp` that are
unreferenced externally are also made static.

Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty

Reviewed By: jhenderson, MaskRay

Subscribers: RKSimon, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78695
2020-04-23 21:24:37 -04:00
Eli Friedman 3291efc2b3 [ValueTracking] Handle shufflevector constants in ComputeNumSignBits
Differential Revision: https://reviews.llvm.org/D78688
2020-04-23 17:47:37 -07:00
Sean Silva 1b2c7877a4 Add support for IndexType inside DenseIntElementsAttr.
This also fixes issues discovered in the parsing/printing path.
2020-04-23 17:42:33 -07:00
Krzysztof Parzyszek 5c7a2cfac1 [Hexagon] Fix result word order when bitcasting vector pred to int64/128 2020-04-23 19:15:11 -05:00
Paula Toth 29213878e7 [libc] Add spec for sigdelset and sigfillset.
Summary: Caught by libc-tidy from patch D77281.

Reviewers: abrachet, sivachandra

Reviewed By: abrachet

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D78703
2020-04-23 16:38:47 -07:00
James Y Knight 248a5db3f2 Change callbr to only define its output SSA variable on the normal
path, not the indirect targets.

Fixes: PR45565.

Differential Revision: https://reviews.llvm.org/D78341
2020-04-23 19:36:44 -04:00
River Riddle 48e9ef4320 [mlir] Give each OpResult its own use list
This revision removes the multi use-list to ensure that each result gets its own. This decision was made by doing some extensive benchmarking of programs that actually use multiple results. This results in a size increase of 1-word per result >1, but the common case of 1-result remains unaffected. A side benefit is that 0-result operations now shrink by 1-word.

Differential Revision: https://reviews.llvm.org/D78701
2020-04-23 16:28:55 -07:00
Reid Kleckner bd6942eb21 Re-land "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"
This reverts commit 9b2ab41037 and
reinstates e62dc1f625 with changes.

This fix is speculative, since I don't have access to a crashing test
case for the old code, and fixing the crash bug on Windows when C++20 is
enabled seems more important than running it down.
2020-04-23 16:22:01 -07:00
James Y Knight 01097dc644 Remove InvokeInst methods which duplicate those of its superclass CallBase. 2020-04-23 19:11:11 -04:00
Pavel Iliin cc457672e6 [AArch64][FIX] FPR16_lo for f16 indexed patterns. 2020-04-23 23:44:56 +01:00
Christopher Tetreault 5d0c3a8026 [SVE] Remove VectorType::isScalable()
Summary:
* This is a property of the instance of VectorType. If
isa<ScalableVectorType>(T) is true, then T->isScalable() would have
returned true and vice-versa. Most code that checks this function uses
the result to bail out if a vector is a scalable vector. This code will
be cleaner if it just calls isa<ScalableVectorType>(T)

Reviewers: efriedma, craig.topper, huntergr, sdesmalen

Reviewed By: sdesmalen

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77690
2020-04-23 15:39:59 -07:00
Craig Topper d6c5daf0bf [CallSite removal][ValueTracking] Replace CallSite with CallBase. NFC" 2020-04-23 15:25:19 -07:00
shafik def7c7f602 [ASTImporter] Fix handling of not defined FromRecord in ImportContext(...)
In ImportContext(…) we may call into CompleteDecl(…) which if FromRecrord is not
defined will start the definition of a ToRecord but from what I can tell at least
one of the paths though here don't ensure we complete the definition.
For a RecordDecl this can be problematic since this means we won’t import base
classes and we won’t have any of the methods or types we inherit from these bases.

Differential Revision: https://reviews.llvm.org/D78000
2020-04-23 15:18:48 -07:00
Paula Toth d94af364ac [libc] Surround get_start_args_addr in __llvm_libc namespace.
Summary: Caught by libc-tidy from patch D77281.

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D78700
2020-04-23 15:15:00 -07:00
aartbik 907871d9ad [llvm] [CodeGen] Fixed vector halving bug for masked load
Summary:
Given a VL=14 that is enveloped by a proper VL=16, splitting the
masked load using the enveloping halving VL=8/8 should yields
should eventually yield V=8/5. This fixes various assert failures
in getHalfNumVectorElementsVT() and IncrementMemoryAddress().

Note, I suspect similar fixes will be needed for other masked
operations, but for now I send out a fix for masked load only.

Bugzilla issue 45563
https://bugs.llvm.org/show_bug.cgi?id=45563

Reviewers: craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: hiraditya, dmgreen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78608
2020-04-23 15:12:44 -07:00
aartbik e4e187d203 [llvm] [X86] Processed test with update_llc_test_checks
Summary:
As requested in another review for a similar regression test,
I updated this test with the same utility.

Reviewers: dmgreen, craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78739
2020-04-23 15:09:53 -07:00
Tim Keith c353ebbfa4 [flang] Compute sizes and offsets for symbols
Summary:
Add size and offset properties to symbols, representing their byte size
and offset within their enclosing scope.

Add size and align properties to scopes so that they are available for
scopes representing derived types.

Add ComputeOffsets pass over the symbol table to fill in those fields.

Compute descriptor size based on rank and length parameters. Extract
DerivedTypeSpec::NumLengthParameters from DynamicType::RequiresDescriptor
to share the code.

Add Scope::GetSymbols to get symbols in canonical order.
compute-offsets.cpp and mod-file.cpp both need to process symbols in the
order in which they are declared. Move the collecting of those symbols
into Scope so that it can be shared.

Add symbol size and offset to output of `-fdebug-dump-symbols` and use
that in some tests.

Still to do:
- make size and alignment rules configurable based on target
- use offsets to check EQUIVALENCE statements

Differential Revision: https://reviews.llvm.org/D78680
2020-04-23 14:54:34 -07:00
Jian Cai fcbc613ad8 Make "#pragma clang attribute" support uninitialized attribute.
Summary:
When using -ftrivial-auto-var-init=* options to initiate automatic
variables in a file, to disable initialization on some variables,
currently we have to manually annotate the variables with uninitialized
attribute, such as

int dont_initialize_me __attribute((uninitialized));

Making pragma clang attribute to support this attribute would make
annotating variables much easier, and could be particular useful for
bisection efforts, e.g.

void use(void*);

void buggy() {
    int arr[256];
    int boom;
    float bam;
    struct { int oops; } oops;
    union { int oof; float aaaaa; } oof;

    use(&arr);
    use(&boom);
    use(&bam);
    use(&oops);
    use(&oof);
}

Reviewers: jfb, rjmccall, aaron.ballman

Reviewed By: jfb, aaron.ballman

Subscribers: aaron.ballman, george.burgess.iv, dexonsmith, MaskRay, phosek, hubert.reinterpretcast, gbiv, manojgupta, llozano, srhines, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78693
2020-04-23 14:25:13 -07:00
Puyan Lotfi 9721fbf85b [NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec.
This is a code clean up of the PropertyAttributeKind and
ObjCPropertyAttributeKind enums in ObjCPropertyDecl and ObjCDeclSpec that are
exactly identical. This non-functional change consolidates these enums
into one. The changes are to many files across clang (and comments in LLVM) so
that everything refers to the new consolidated enum in DeclObjCCommon.h.

2nd Landing Attempt...

Differential Revision: https://reviews.llvm.org/D77233
2020-04-23 17:21:25 -04:00