Frederik Gossen [Tue, 21 Apr 2020 10:05:17 +0000 (10:05 +0000)]
[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
Johannes Doerfert [Fri, 17 Apr 2020 23:03:04 +0000 (18:03 -0500)]
[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
Johannes Doerfert [Thu, 23 Apr 2020 03:03:44 +0000 (22:03 -0500)]
[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.
Christudasan Devadasan [Wed, 22 Apr 2020 19:20:45 +0000 (00:50 +0530)]
[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.
Johannes Doerfert [Thu, 23 Apr 2020 02:00:12 +0000 (21:00 -0500)]
[Attributor][NFC] Remove and update old check lines
Johannes Doerfert [Wed, 22 Apr 2020 23:06:02 +0000 (18:06 -0500)]
[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.
Johannes Doerfert [Wed, 22 Apr 2020 21:02:10 +0000 (16:02 -0500)]
[Attributor][NFC] Add `const` and missing state constructors
Mircea Trofin [Fri, 24 Apr 2020 05:06:55 +0000 (22:06 -0700)]
[lldb][NFC][CallSite] Remove CallSite use
Reviewers: dblaikie, craig.topper
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D78791
Mircea Trofin [Fri, 24 Apr 2020 05:00:10 +0000 (22:00 -0700)]
[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
Mehdi Amini [Fri, 24 Apr 2020 05:07:32 +0000 (05:07 +0000)]
Revert "[VPlan] Add & use VPValue operands for VPWidenRecipe (NFC)."
This reverts commit
9245c7ac13480ed48ae339ad0e68cbe680cd0642.
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.
Mircea Trofin [Thu, 23 Apr 2020 17:35:10 +0000 (10:35 -0700)]
[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
Craig Topper [Fri, 24 Apr 2020 04:01:42 +0000 (21:01 -0700)]
[CallSite removal] Remove unneeded includes of CallSite.h. NFC
Craig Topper [Fri, 24 Apr 2020 01:19:04 +0000 (18:19 -0700)]
[CallSite removal][Transform] Replace CallSite with CallBase in Utils. NFC
Differential Revision: https://reviews.llvm.org/D78780
Matt Arsenault [Fri, 24 Apr 2020 02:58:25 +0000 (22:58 -0400)]
AMDGPU: Fix redundant members
Matt Arsenault [Fri, 24 Apr 2020 02:00:15 +0000 (22:00 -0400)]
AMDGPU: Use Register
James Y Knight [Fri, 24 Apr 2020 02:01:09 +0000 (22:01 -0400)]
[CallSite removal] Remove the text describing CallSite from the manual.
Rob Suderman [Fri, 24 Apr 2020 02:01:51 +0000 (19:01 -0700)]
[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
Fangrui Song [Fri, 24 Apr 2020 01:45:48 +0000 (18:45 -0700)]
[Sema][test] Fix implicit-int-float-conversion.c on Windows
Fangrui Song [Wed, 22 Apr 2020 16:53:35 +0000 (09:53 -0700)]
[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
Hubert Tong [Fri, 24 Apr 2020 01:20:45 +0000 (21:20 -0400)]
[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
Eli Friedman [Thu, 23 Apr 2020 00:15:39 +0000 (17:15 -0700)]
[ValueTracking] Handle shufflevector constants in ComputeNumSignBits
Differential Revision: https://reviews.llvm.org/D78688
Sean Silva [Thu, 23 Apr 2020 22:47:31 +0000 (15:47 -0700)]
Add support for IndexType inside DenseIntElementsAttr.
This also fixes issues discovered in the parsing/printing path.
Krzysztof Parzyszek [Fri, 24 Apr 2020 00:13:21 +0000 (19:13 -0500)]
[Hexagon] Fix result word order when bitcasting vector pred to int64/128
Paula Toth [Thu, 23 Apr 2020 23:30:23 +0000 (16:30 -0700)]
[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
James Y Knight [Fri, 17 Apr 2020 02:14:21 +0000 (22:14 -0400)]
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
River Riddle [Thu, 23 Apr 2020 23:23:34 +0000 (16:23 -0700)]
[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
Reid Kleckner [Mon, 20 Apr 2020 19:50:20 +0000 (12:50 -0700)]
Re-land "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"
This reverts commit
9b2ab41037f45ad92ab4e850591093ffc45d3e10 and
reinstates
e62dc1f6252c1dcdcc2a64e8e3b07a32412e9d89 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.
James Y Knight [Thu, 23 Apr 2020 18:06:58 +0000 (14:06 -0400)]
Remove InvokeInst methods which duplicate those of its superclass CallBase.
Pavel Iliin [Thu, 23 Apr 2020 21:03:42 +0000 (22:03 +0100)]
[AArch64][FIX] FPR16_lo for f16 indexed patterns.
Christopher Tetreault [Thu, 23 Apr 2020 22:11:04 +0000 (15:11 -0700)]
[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
Craig Topper [Thu, 23 Apr 2020 21:22:14 +0000 (14:22 -0700)]
[CallSite removal][ValueTracking] Replace CallSite with CallBase. NFC"
shafik [Thu, 23 Apr 2020 22:16:34 +0000 (15:16 -0700)]
[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
Paula Toth [Thu, 23 Apr 2020 22:09:40 +0000 (15:09 -0700)]
[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
aartbik [Thu, 23 Apr 2020 18:28:34 +0000 (11:28 -0700)]
[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
aartbik [Thu, 23 Apr 2020 18:41:58 +0000 (11:41 -0700)]
[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
Tim Keith [Wed, 22 Apr 2020 22:39:24 +0000 (15:39 -0700)]
[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
Jian Cai [Thu, 23 Apr 2020 19:11:50 +0000 (12:11 -0700)]
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
Puyan Lotfi [Thu, 23 Apr 2020 06:20:56 +0000 (02:20 -0400)]
[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
Sanjay Patel [Thu, 23 Apr 2020 20:47:32 +0000 (16:47 -0400)]
[x86] add tests for FP->int->FP with different FP types; NFC
Christopher Tetreault [Thu, 23 Apr 2020 20:53:31 +0000 (13:53 -0700)]
[SVE] Remove calls to isScalable from Hexagon
Reviewers: efriedma, sdesmalen, kparzysz, colinl
Reviewed By: kparzysz
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77757
Roman Lebedev [Thu, 23 Apr 2020 18:07:23 +0000 (21:07 +0300)]
[InstCombine] Negator: don't negate multi-use `sub`
While we can do that, it doesn't increase instruction count,
if the old `sub` sticks around then the transform is not only
not a unlikely win, but a likely regression, since we likely
now extended live range and use count of both of the `sub` operands,
as opposed to just the result of `sub`.
As Kostya Serebryany notes in post-commit review in
https://reviews.llvm.org/D68408#1998112
this indeed can degrade final assembly,
increase register pressure, and spilling.
This isn't what we want here,
so at least for now let's guard it with an use check.
Christopher Tetreault [Thu, 23 Apr 2020 20:30:30 +0000 (13:30 -0700)]
[SVE] Remove calls to isScalable from Transforms
Reviewers: efriedma, chandlerc, reames, aprantl, sdesmalen
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77756
MaheshRavishankar [Thu, 23 Apr 2020 20:41:02 +0000 (13:41 -0700)]
[mlir][Linalg] Add support for fusing linalg.tensor_reshape with
linalg.generic operations.
Differential Revision: https://reviews.llvm.org/D78464
MaheshRavishankar [Thu, 23 Apr 2020 20:40:55 +0000 (13:40 -0700)]
[mlir][Linalg] NFC: Refactor fusion on tensors to enable extending
it to fusing different kinds of linalg operations on tensors.
The implementation of fusion on tensor was initially planned for just
GenericOps (and maybe IndexedGenericOps). With addition of
linalg.tensor_reshape, and potentially other such non-structured ops,
refactor the existing implementation to allow easier specification of
fusion between different linalg operations on tensors.
Differential Revision: https://reviews.llvm.org/D78463
Christopher Tetreault [Thu, 23 Apr 2020 20:10:17 +0000 (13:10 -0700)]
[SVE] Remove isScalable from Bitcode
Reviewers: efriedma, dexonsmith, tejohnson, sdesmalen
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77695
Sergej Jaskiewicz [Thu, 23 Apr 2020 20:17:57 +0000 (23:17 +0300)]
[libcxx] Add FILE_DEPENDENCIES line to the func.blocks.sh.cpp test
This should fix the bots that use ssh.py to execute tests
Christopher Tetreault [Thu, 23 Apr 2020 20:00:59 +0000 (13:00 -0700)]
[SVE] Remove calls to isScalable from AARCH64
Reviewers: efriedma, sdesmalen, t.p.northover, mcrosier
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77758
Jay Foad [Thu, 23 Apr 2020 14:32:27 +0000 (15:32 +0100)]
[AMDGPU] Avoid hard-coded line numbers in error message checks
This makes it easier for us to maintain downstream changes to some of
these tests. NFC.
Differential Revision: https://reviews.llvm.org/D78716
Christopher Tetreault [Thu, 23 Apr 2020 19:45:34 +0000 (12:45 -0700)]
[SVE] Remove calls to isScalable from CodeGen
Reviewers: efriedma, sdesmalen, stoklund, sunfish
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77755
Christopher Tetreault [Thu, 23 Apr 2020 19:19:54 +0000 (12:19 -0700)]
[SVE] Remove calls to VectorType::isScalable from analysis
Reviewers: efriedma, sdesmalen, chandlerc, sunfish
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77692
Matt Arsenault [Wed, 22 Apr 2020 21:17:46 +0000 (17:17 -0400)]
AMDGPU: Fix inlining logic for denormals
This was backwards from intended and missing a test. We perhaps should
just ignored the FP mode here, since it shouldn't be legal to mix code
with different default modes in the absence of strictfp.
Matt Arsenault [Wed, 22 Apr 2020 21:34:10 +0000 (17:34 -0400)]
AMDGPU: Change pre-gfx9 implementation of fcanonicalize to mul
If f32 denormals were enabled pre-gfx9, we would still try to
implement this with v_max_f32. Pre-gfx9, these instructions ignored
the denormal mode and did not flush. Switch to the multiply form for
f32 as a workaround which should always work in any case.
This fixes conformance failures when the library implementation of
fmin/fmax were accidentally not inlined, forcing the assumption of no
flushing on targets where denormals are not enabled by default. This
is a workaround, since really we should not be mixing code with
different FP mode expectations, but prefer the lowering that will work
in any mode.
Now this will always use max to implement canonicalize on gfx9+. This
is only really beneficial for f64. For f32/f16 it's a neutral choice
(and worse in terms of code size in 1 case), but possibly worse for
the compiler since it does add an extra register use operand. Leave
this change for later.
Alexander Shaposhnikov [Thu, 23 Apr 2020 18:37:39 +0000 (11:37 -0700)]
[llvm-objcopy][MachO] Copy LC_LOAD_WEAK_DYLIB load commands
LC_LOAD_WEAK_DYLIB is analogous to LC_LOAD_DYLIB and doesn't require any special handling.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D78602
Matt Arsenault [Thu, 23 Apr 2020 13:45:54 +0000 (09:45 -0400)]
AMDGPU/GlobalISel: Add new baseline checks for canonicalize
Christopher Tetreault [Thu, 23 Apr 2020 17:58:37 +0000 (10:58 -0700)]
[SVE] Remove calls to isScalable from IR
Reviewers: efriedma, sdesmalen, dexonsmith, dblaikie
Reviewed By: sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77691
Simon Pilgrim [Thu, 23 Apr 2020 18:20:54 +0000 (19:20 +0100)]
[X86][SSE] Add SSE2 extract-concat tests
Check pre-SSE41 codegen where we have less PEXTR*/PINSR* instructions
Siva Chandra Reddy [Thu, 23 Apr 2020 17:57:28 +0000 (10:57 -0700)]
[libc] Link mpfr and gmp wrapper to the libcMPFRWrapper.
This will fix building the wrapper shared library when
BUILD_SHARED_LIBS is ON.
Reviewers: PaulkaToast
Differential Revision: https://reviews.llvm.org/D78737
Louis Dionne [Thu, 23 Apr 2020 17:53:14 +0000 (13:53 -0400)]
[libc++] Update scripts to build libc++/libc++abi for Apple
Also, make sure we test them.
Nicolas Vasilache [Thu, 23 Apr 2020 18:10:24 +0000 (14:10 -0400)]
[mlir][EDSC] Hotfix - Provide impl for `negate`
367229e100eca714276253bf95a0dd3d084a9624 retired ValueHandle but
mistakenly removed the implementation for `negate` which was not
tested and would result in linking errors.
This revision adds the implementation back and provides a test.
Feng Liu [Wed, 22 Apr 2020 21:14:29 +0000 (14:14 -0700)]
[mlir/Quant] Allows to use 32 bits storage type
Differential Revision: https://reviews.llvm.org/D78671
Mircea Trofin [Thu, 23 Apr 2020 16:14:08 +0000 (09:14 -0700)]
[llvm][NFC] Factor out cost-model independent inling decision
Summary:
llvm::getInlineCost starts off by determining whether inlining should
happen or not because of user directives or easily determinable
unviability. This CL refactors this functionality as a reusable API.
Reviewers: davidxl, eraman
Reviewed By: davidxl, eraman
Subscribers: hiraditya, haicheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73825
Christopher Tetreault [Thu, 23 Apr 2020 16:52:49 +0000 (09:52 -0700)]
[SVE] Make VectorType::getNumElements() complain for scalable vectors
Summary:
Piggy-back off of TypeSize's STRICT_FIXED_SIZE_VECTORS flag and:
- if it is defined, assert that the vector is not scalable
- if it is not defined, complain if the vector is scalable
Reviewers: efriedma, sdesmalen, c-rhodes
Reviewed By: sdesmalen
Subscribers: hiraditya, mgorny, tschuett, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78576
Mircea Trofin [Thu, 23 Apr 2020 16:15:04 +0000 (09:15 -0700)]
[llvm][NFC][CallSite] Removed CallSite from few implementation details
Reviewers: dblaikie, craig.topper
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78724
Vedant Kumar [Thu, 23 Apr 2020 17:20:01 +0000 (10:20 -0700)]
[DirectoryWatcher] Do not use FSEvents on non-macOS platforms
The FSEvents APIs are available on iOS6+: however, the DirectoryWatcher
code isn't wired up to really use FSEvents on embedded platforms.
I've duplicated code from DirectoryWatcher-not-implemented.cpp here and
used TargetConditionals instead of adding cmakery to check try_compile;
I couldn't get that to work properly.
Vedant Kumar [Thu, 23 Apr 2020 16:48:47 +0000 (09:48 -0700)]
MachineBasicBlock: Avoid copy in skipDebugInstructions{Forward,Backward}, NFC
Valeriy Savchenko [Thu, 23 Apr 2020 15:32:10 +0000 (18:32 +0300)]
[analyzer] Consider array subscripts to be interesting lvalues.
Static analyzer has a mechanism of clearing redundant nodes when
analysis hits a certain threshold with a number of nodes in exploded
graph (default is 1000). It is similar to GC and aims removing nodes
not useful for analysis. Unfortunately nodes corresponding to array
subscript expressions (that actively participate in data propagation)
get removed during the cleanup. This might prevent the analyzer from
generating useful notes about where it thinks the data came from.
This fix is pretty much consistent with the way analysis works
already. Lvalue "interestingness" stands for the analyzer's
possibility of tracking values through them.
Differential Revision: https://reviews.llvm.org/D78638
MaheshRavishankar [Thu, 23 Apr 2020 16:44:23 +0000 (09:44 -0700)]
[mlir][StandardToSPIRV] Fix test cases where DCE removes all the code.
Differential Revision: https://reviews.llvm.org/D78727
Simon Pilgrim [Thu, 23 Apr 2020 16:05:43 +0000 (17:05 +0100)]
X86MCTargetDesc.h - replace FormattedStream.h include with forward declaration. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 16:02:19 +0000 (17:02 +0100)]
X86TargetObjectFile.h - remove unnecessary TargetLoweringObjectFile.h include. NFC.
We already include TargetLoweringObjectFileImpl.h which includes it and we only use its types as part of TargetLoweringObjectFile* overridden methods.
Vedant Kumar [Thu, 23 Apr 2020 16:23:21 +0000 (09:23 -0700)]
Rename a shadowed variable causing build failure on gcc<5.5
See discussion here: https://reviews.llvm.org/D78265
Tim Keith [Thu, 23 Apr 2020 16:14:58 +0000 (09:14 -0700)]
[flang] Remove unused variable
Reviewers: sscalpone, jdoerfert, DavidTruby
Reviewed By: sscalpone
Subscribers: llvm-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D78725
Peter Smith [Thu, 23 Apr 2020 15:58:50 +0000 (16:58 +0100)]
Revert "[LLD][ELF][ARM] Fix ARM Exidx order for non monotonic section order"
This reverts commit
f969c2aa657e28633ece63a5430e551f0b8beb98.
There are some msan buildbot failures sanitzer-x86_64-linux-fast that
I need to investigate.
Differential Revision: https://reviews.llvm.org/D78422
Simon Pilgrim [Thu, 23 Apr 2020 15:21:18 +0000 (16:21 +0100)]
[RISCV] Remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 15:19:37 +0000 (16:19 +0100)]
[WebAssembly] Remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 15:17:45 +0000 (16:17 +0100)]
[XCore] Remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 15:08:16 +0000 (16:08 +0100)]
[NVPTX] Remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 14:15:38 +0000 (15:15 +0100)]
[Sparc] Remove unused forward declarations. NFC.
Tim Keith [Wed, 22 Apr 2020 22:26:29 +0000 (15:26 -0700)]
[flang][NFC] Refactor derived type instantiation
Summary:
Move InstantiateComponent and InstantiateIntrinsicType from symbol.cpp
to type.cpp as that is where they are called.
Put both in InstantiateHelper class to better isolate them.
Add CreateDerivedTypeSpec in InstantiateHelper.
Add non-const forms for AsIntrinsic and AsDerived to avoid const_cast.
No functional changes.
Reviewers: DavidTruby, klausler, PeteSteinfeld, jdoerfert
Reviewed By: klausler
Subscribers: llvm-commits
Tags: #flang, #llvm
Differential Revision: https://reviews.llvm.org/D78678
Krzysztof Parzyszek [Thu, 23 Apr 2020 14:39:43 +0000 (09:39 -0500)]
[Hexagon] Add missing live-in registers in some codegen tests
Victor Huang [Thu, 23 Apr 2020 15:24:38 +0000 (10:24 -0500)]
[PowerPC][Future] Add missing changes for PC Realtive addressing
1. Use Subtarget.isUsingPCRelativeCalls() in LowerConstantPool to
check if using PCRelative addressing.
2. Change MO_GOT_FLAG = 32 to MO_GOT_FLAG = 8 in PPC.h to use
consecutive bits.
Differential Revision: https://reviews.llvm.org/D78406
Mircea Trofin [Wed, 22 Apr 2020 20:19:15 +0000 (13:19 -0700)]
[llvm][NFC][CallSite] Remove CallSite from TypeMetadataUtils & related
Reviewers: craig.topper, dblaikie
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78666
Nicolas Vasilache [Thu, 23 Apr 2020 15:00:03 +0000 (11:00 -0400)]
[mlir][EDSC] Retire ValueHandle
The EDSC discussion [thread](https://llvm.discourse.group/t/evolving-builder-apis-based-on-lessons-learned-from-edsc/879) points out that ValueHandle has become an unnecessary level of abstraction since MLIR switch from `Value *` to `Value` everywhere.
This revision removes this level of indirection.
Raphael Isemann [Thu, 23 Apr 2020 14:58:49 +0000 (16:58 +0200)]
[lldb] Make RNBSocketTest compile again after socket modernization
Commit
c9e6b7010c6998b6 changed the API but didn't update this
macOS-specific test.
Peter Smith [Sat, 18 Apr 2020 09:09:06 +0000 (10:09 +0100)]
[LLD][ELF][ARM] Fix ARM Exidx order for non monotonic section order
The contents of the .ARM.exidx section must be ordered by SHF_LINK_ORDER
rules. We don't need to know the precise address for this order, but we
do need to know the relative order of sections. We have been using the
sectionIndex for this purpose, this works when the OutputSection order
has a monotonically increasing virtual address, but it is possible to
write a linker script with non-monotonically increasing virtual address.
For these cases we need to evaluate the base address of the OutputSection
so that we can order the .ARM.exidx sections properly.
This change moves the finalisation of .ARM.exidx till after the first
call to AssignAddresses. This permits us to sort on virtual address which
is linker script safe. It also permits a fix for part of pr44824 where
we generate .ARM.exidx section for the vector table when that table is so
far away it is out of range of the .ARM.exidx section. This fix will come
in a follow up patch.
Differential Revision: https://reviews.llvm.org/D78422
Xing GUO [Thu, 23 Apr 2020 14:46:58 +0000 (22:46 +0800)]
[doc] Fix broken link. NFC.
Pavel Labath [Thu, 23 Apr 2020 14:27:01 +0000 (16:27 +0200)]
[lldb/Core] Avoid more Communication::Disconnect races
Calling Disconnect while the read thread is running is racy because the
thread can also call Disconnect. This is a follow-up to
b424b0bf, which
reorders other occurences of Disconnect/StopReadThread I can find, and also
adds an assertion to guard against new occurences being introduced.
Kadir Cetinkaya [Thu, 23 Apr 2020 14:09:23 +0000 (16:09 +0200)]
[clangd] Delete remapped buffers in tests
These buffers normally get freed after being used in a CompilerInstance.
but tests don't make use of those, so we need to free them explicitly.
Marcel Koester [Wed, 8 Apr 2020 08:31:18 +0000 (10:31 +0200)]
[mlir] Extended Liveness analysis to support nested regions.
The current Liveness analysis does not support operations with nested regions.
This causes issues when querying liveness information about blocks nested within
operations. Furthermore, the live-in and live-out sets are not computed properly
in these cases.
Differential Revision: https://reviews.llvm.org/D77714
Sanjay Patel [Thu, 23 Apr 2020 13:59:41 +0000 (09:59 -0400)]
[InstCombine] substitute equivalent constant to reduce logic-of-icmps
(X == C) && (Y Pred1 X) --> (X == C) && (Y Pred1 C)
(X != C) || (Y Pred1 X) --> (X != C) || (Y Pred1 C)
This cooperates/overlaps with D78430, but it is a more general transform
that gets us most of the expected simplifications and several other
improvements.
http://volta.cs.utah.edu:8080/z/5gxjjc
PR45618:
https://bugs.llvm.org/show_bug.cgi?id=45618
Differential Revision: https://reviews.llvm.org/D78582
Sander de Smalen [Thu, 23 Apr 2020 14:04:12 +0000 (15:04 +0100)]
[SveEmitter] Use llvm.aarch64.sve.ld1/st1 for contiguous load/store builtins
This patch changes the codegen of the builtins for contiguous loads
to map onto the SVE specific IR intrinsics llvm.aarch64.sve.ld1/st1.
Reviewers: SjoerdMeijer, efriedma, kmclaughlin, rengolin
Reviewed By: efriedma
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78673
Pavel Labath [Mon, 20 Apr 2020 12:38:31 +0000 (14:38 +0200)]
[lldb/DWARF] Trust CU DW_AT_low/high_pc information when building address tables
Summary:
The code in DWARFCompileUnit::BuildAddressRangeTable tries hard to avoid
relying on DW_AT_low/high_pc for compile unit range information, and
this logic is a big cause of llvm/lldb divergence in the lowest layers
of dwarf parsing code.
The implicit assumption in that code is that this information (as opposed to
DW_AT_ranges) is unreliable. However, I have not been able to verify
that assumption. It is definitely not true for all present-day
compilers (gcc, clang, icc), and it was also not the case for the
historic compilers that I have been able to get a hold of (thanks Matt
Godbolt).
All compiler included in my research either produced correct
DW_AT_ranges or .debug_aranges entries, or they produced no DW_AT_hi/lo
pc at all. The detailed findings are:
- gcc >= 4.4: produces DW_AT_ranges and .debug_aranges
- 4.1 <= gcc < 4.4: no DW_AT_ranges, no DW_AT_high_pc, .debug_aranges
present. The upper version range here is uncertain as godbolt.org does
not have intermediate versions.
- gcc < 4.1: no versions on godbolt.org
- clang >= 3.5: produces DW_AT_ranges, and (optionally) .debug_aranges
- 3.4 <= clang < 3.5: no DW_AT_ranges, no DW_AT_high_pc, .debug_aranges
present.
- clang <= 3.3: no DW_AT_ranges, no DW_AT_high_pc, no .debug_aranges
- icc >= 16.0.1: produces DW_AT_ranges
- icc < 16.0.1: no functional versions on godbolt.org (some are present
but fail to compile)
Based on this analysis, I believe it is safe to start trusting
DW_AT_low/high_pc information in dwarf as well as remove the code for
manually reconstructing range information by traversing the DIE
structure, and just keep the line table fallback. The only compilers
where this will change behavior are pre-3.4 clangs, which are almost 7
years old now. However, the functionality should remain unchanged
because we will be able to reconstruct this information from the line
table, which seems to be needed for some line-tables-only scenarios
anyway (haven't researched this too much, but at least some compilers
seem to emit DW_AT_ranges even in these situations).
In addition, benchmarks showed that for these compilers computing the
ranges via line tables is noticably faster than doing so via the DIE
tree.
Other advantages include simplifying the code base, removing some
untested code (the only test changes are recent tests with overly
reduced synthetic dwarf), and increasing llvm convergence.
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D78489
Pavel Labath [Thu, 23 Apr 2020 13:55:39 +0000 (15:55 +0200)]
[lldb/Utility] Improve error_code->Status conversion
Both entities have the notion of error "namespaces". Map the errno
namespace correctly.
Simon Pilgrim [Thu, 23 Apr 2020 13:35:00 +0000 (14:35 +0100)]
[PowerPC] Remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 13:23:40 +0000 (14:23 +0100)]
[Mips] Remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 13:12:01 +0000 (14:12 +0100)]
LanaiMCTargetDesc.h - remove unused forward declarations. NFC.
Simon Pilgrim [Thu, 23 Apr 2020 13:09:22 +0000 (14:09 +0100)]
[MSP430] Remove unused forward declarations. NFC.
Tim Keith [Wed, 22 Apr 2020 23:19:38 +0000 (16:19 -0700)]
[flang] Add missing check for unresolved name
Summary:
The name in an InputItem isn't necessarily resolved if an error occurred,
so it needs to be checked.
Fixes https://bugs.llvm.org/show_bug.cgi?id=45477
Reviewers: klausler, PeteSteinfeld, DavidTruby, jdoerfert, sscalpone
Reviewed By: klausler, sscalpone
Subscribers: llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D78685
Sanjay Patel [Thu, 23 Apr 2020 13:10:23 +0000 (09:10 -0400)]
[InstSimplify] fold and/or of compares with equality to min/max constant
I found 12 (6 if we compress the DeMorganized forms) patterns for logic-of-compares
with a min/max constant while looking at PR45510:
https://bugs.llvm.org/show_bug.cgi?id=45510
The variations on those forms multiply the test cases by 8 (unsigned/signed, swapped
compare operands, commuted logic operands).
We have partial logic to deal with these for the unsigned min (zero) case, but
missed everything else.
We are deferring the majority of these patterns to InstCombine to allow more general
handling (see D78582).
We could use ConstantRange instead of predicate+constant matching here. I don't
expect there's any noticeable compile-time impact for either form.
Here's an abuse of Alive2 to show the 12 basic signed variants of the patterns in
one function:
http://volta.cs.utah.edu:8080/z/5Vpiyg
declare void @use(i1, i1, i1, i1, i1, i1, i1, i1, i1, i1, i1, i1)
define void @src(i8 %x, i8 %y) {
%m1 = icmp eq i8 %x, 127
%c1 = icmp slt i8 %x, %y
%r1 = and i1 %m1, %c1 ; (X == MAX) && (X < Y) --> false
%m2 = icmp ne i8 %x, 127
%c2 = icmp sge i8 %x, %y
%r2 = or i1 %m2, %c2 ; (X != MAX) || (X >= Y) --> true
%m3 = icmp eq i8 %x, -128
%c3 = icmp sgt i8 %x, %y
%r3 = and i1 %m3, %c3 ; (X == MIN) && (X > Y) --> false
%m4 = icmp ne i8 %x, -128
%c4 = icmp sle i8 %x, %y
%r4 = or i1 %m4, %c4 ; (X != MIN) || (X <= Y) --> true
%m5 = icmp eq i8 %x, 127
%c5 = icmp sge i8 %x, %y
%r5 = and i1 %m5, %c5 ; (X == MAX) && (X >= Y) --> X == MAX
%m6 = icmp ne i8 %x, 127
%c6 = icmp slt i8 %x, %y
%r6 = or i1 %m6, %c6 ; (X != MAX) || (X < Y) --> X != MAX
%m7 = icmp eq i8 %x, -128
%c7 = icmp sle i8 %x, %y
%r7 = and i1 %m7, %c7 ; (X == MIN) && (X <= Y) --> X == MIN
%m8 = icmp ne i8 %x, -128
%c8 = icmp sgt i8 %x, %y
%r8 = or i1 %m8, %c8 ; (X != MIN) || (X > Y) --> X != MIN
%m9 = icmp ne i8 %x, 127
%c9 = icmp slt i8 %x, %y
%r9 = and i1 %m9, %c9 ; (X != MAX) && (X < Y) --> X < Y
%m10 = icmp eq i8 %x, 127
%c10 = icmp sge i8 %x, %y
%r10 = or i1 %m10, %c10 ; (X == MAX) || (X >= Y) --> X >= Y
%m11 = icmp ne i8 %x, -128
%c11 = icmp sgt i8 %x, %y
%r11 = and i1 %m11, %c11 ; (X != MIN) && (X > Y) --> X > Y
%m12 = icmp eq i8 %x, -128
%c12 = icmp sle i8 %x, %y
%r12 = or i1 %m12, %c12 ; (X == MIN) || (X <= Y) --> X <= Y
call void @use(i1 %r1, i1 %r2, i1 %r3, i1 %r4, i1 %r5, i1 %r6, i1 %r7, i1 %r8, i1 %r9, i1 %r10, i1 %r11, i1 %r12)
ret void
}
define void @tgt(i8 %x, i8 %y) {
%m5 = icmp eq i8 %x, 127
%m6 = icmp ne i8 %x, 127
%m7 = icmp eq i8 %x, -128
%m8 = icmp ne i8 %x, -128
%c9 = icmp slt i8 %x, %y
%c10 = icmp sge i8 %x, %y
%c11 = icmp sgt i8 %x, %y
%c12 = icmp sle i8 %x, %y
call void @use(i1 0, i1 1, i1 0, i1 1, i1 %m5, i1 %m6, i1 %m7, i1 %m8, i1 %c9, i1 %c10, i1 %c11, i1 %c12)
ret void
}
Differential Revision: https://reviews.llvm.org/D78430
Sanjay Patel [Wed, 22 Apr 2020 13:49:36 +0000 (09:49 -0400)]
[InstCombine] add test for logic-of-icmps that should simplify (D78582); NFC
Kumar Harsh [Thu, 23 Apr 2020 12:04:23 +0000 (17:34 +0530)]
Add extension links for VSCode
The clang-format docs were missing mention or links for the VSCode extension, which have been added.