Reid Kleckner [Tue, 3 Dec 2019 00:42:33 +0000 (16:42 -0800)]
Move tail call disabling code to target independent code
When the "disable-tail-calls" attribute was added, checks were added for
it in various backends. Now this code has proliferated, and it is
something the target is responsible for checking. Move that
responsibility back to the ISels (fast, global, and SD).
There's no major functionality change, except for targets that never
implemented this check.
This LLVM attribute was originally added in
d9699bc7bdf0362173fcd256690f61a4d47429c2 (2015).
Reviewers: echristo, MaskRay
Differential Revision: https://reviews.llvm.org/D72118
Alexander Lanin [Fri, 3 Jan 2020 19:13:40 +0000 (14:13 -0500)]
Remove outdated svn/git information from hacking page
The patch files section is redundant to https://llvm.org/docs/GettingStarted.html.
There is nothing clang specific here. We are talking about a monorepo after all.
While it may seem nice to have one single clang page which explains everything,
it's not: It doesn't cover the topics in sufficient depth, it's redundant to
other pages and it's hard to keep it up to date as we see with the svn
instructions.
Roman Lebedev [Fri, 3 Jan 2020 18:10:51 +0000 (21:10 +0300)]
[NFC][InstCombine] '(Op1 & С) - Op1' -> '-(Op1 & ~C)' fold (PR44427)
This decreases use count of Op1, potentially allows
us to further hoist said 'neg' later on,
and results in marginally better X86 codegen.
Name: (Op1 & С) - Op1 -> -(Op1 & ~C)
%o = and i64 %Op1, C1
%r = sub i64 %o, %Op1
=>
%n = and i64 %Op1, ~C1
%r = sub i64 0, %n
https://rise4fun.com/Alive/rwgA
https://godbolt.org/z/R_RMfM
https://bugs.llvm.org/show_bug.cgi?id=44427
Roman Lebedev [Fri, 3 Jan 2020 18:05:34 +0000 (21:05 +0300)]
[NFC][InstCombine] '(Op1 & С) - Op1' pattern tests (PR44427)
Roman Lebedev [Fri, 3 Jan 2020 17:54:31 +0000 (20:54 +0300)]
[NFC][InstCombine] Autogenerate and2.ll checklines
Ahmed Taei [Fri, 3 Jan 2020 18:20:43 +0000 (13:20 -0500)]
[mlir][linalg] Lower linalg to affine loops
Reviewers: nicolasvasilache
Reviewed By: nicolasvasilache
Subscribers: mgester, lucyrfox, merge_guards_bot, AlexEichenberger, mravishankar, ftynse, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72094
Nicolas Vasilache [Fri, 3 Jan 2020 18:05:44 +0000 (13:05 -0500)]
[mlir][Vector] NFC - Add documentation for the VectorOps dialect.
Jonas Devlieghere [Fri, 3 Jan 2020 17:30:20 +0000 (09:30 -0800)]
[DWARF] Don't assume optional always has a value.
When getting the file name form the line table prologue we assume that a
valid string form value can always be extracted as a string. If you look
at the implementation of DWARFormValue this is not necessarily true. I
hit this assertion from LLDB when I create a "dummy" DWARFContext that
was missing the string section.
Roman Lebedev [Fri, 3 Jan 2020 16:53:29 +0000 (19:53 +0300)]
[NFC][InstCombine] '(X & (- Y)) - X' -> '- (X & (Y - 1))' fold (PR44448)
Name: (X & (- Y)) - X -> - (X & (Y - 1)) (PR44448)
%negy = sub i8 0, %y
%unbiasedx = and i8 %negy, %x
%r = sub i8 %unbiasedx, %x
=>
%ymask = add i8 %y, -1
%xmasked = and i8 %ymask, %x
%r = sub i8 0, %xmasked
https://rise4fun.com/Alive/OIpla
This decreases use count of %x, may allow us to
later hoist said negation even further,
and results in marginally nicer X86 codegen.
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Roman Lebedev [Fri, 3 Jan 2020 16:34:39 +0000 (19:34 +0300)]
[NFC][InstCombine] '(X & (- Y)) - X' pattern tests (PR44448)
As discussed in https://bugs.llvm.org/show_bug.cgi?id=44448,
we can hoist negation out of the pattern.
Fangrui Song [Fri, 3 Jan 2020 17:15:52 +0000 (09:15 -0800)]
[AArch64][test] Merge arm64-$i.ll Linux tests into $i.ll
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D72061
Sam McCall [Fri, 3 Jan 2020 16:26:33 +0000 (17:26 +0100)]
[clangd] targetDecl() returns only NamedDecls.
Summary:
While it's perfectly reasonable for non-named decls such as
static_assert to resolve to themselves:
- nothing else ever resolves to them
- features based on references (hover, highlight, find refs etc) tend
to be uninteresting where only trivial references are possible
- returning NamedDecl is a more convenient API (we cast to it in many places)
- this aligns closer to findExplicitReferences/explicitReferenceTargets
This fixes a crash in explicitReferenceTargets: if the target is a
non-named decl then there's an invalid unchecked cast to NamedDecl.
In practice this means when hovering over e.g. a static_assert:
- before
ac3f9e4842, we would show a (boring) hover card
- after
ac3f9e4842, we would crash
- after this patch, we will show nothing
Reviewers: kadircet, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72163
Alexey Bataev [Fri, 3 Jan 2020 16:58:16 +0000 (11:58 -0500)]
[OPENMP]Fix crash on error message for declare reduction.
If the qualified reduction name is specified and not found, the compiler
may crash because of not specified parameter.
Nico Weber [Fri, 3 Jan 2020 17:11:36 +0000 (12:11 -0500)]
[clang-format/java] format multiple qualified annotations on one declaration better
Before:
class Foo {
@CommandLineFlags
.Add
@Features.foo
public void test() {}
}
Now:
class Foo {
@Features.foo
@CommandLineFlags.Add
public void test() { }
}
See also https://crbug.com/1034115
Kelvin Li [Fri, 3 Jan 2020 16:55:37 +0000 (11:55 -0500)]
[OpenMP] diagnose zero-length array section in the depend clause
The OpenMP specification disallows having zero-length array
sections in the depend clause (OpenMP 5.0 2.17.11).
Differential Revision: https://reviews.llvm.org/D71969
Johannes Doerfert [Thu, 2 Jan 2020 23:20:47 +0000 (17:20 -0600)]
[Attributor][FIX] Allow dead users of rewritten function
If we replace a function with a new one because we rewrite the
signature, dead users may still refer to the old version. With this
patch we reuse the code that deals with dead functions, which the old
versions are, to avoid problems.
Johannes Doerfert [Thu, 2 Jan 2020 22:53:37 +0000 (16:53 -0600)]
[Attributor][NFC] Unify the way we delete dead functions
Johannes Doerfert [Thu, 2 Jan 2020 22:41:17 +0000 (16:41 -0600)]
[Attributor][FIX] Don't crash on ptr2int/int2ptr instructions
An integer isn't allowed in getAlignmentForValue so we need to stop at a
ptr2int instruction during exploration.
Johannes Doerfert [Tue, 31 Dec 2019 22:09:12 +0000 (16:09 -0600)]
[Attributor][FIX] Do not derive nonnull and dereferenceable w/o access
An inbounds GEP results in poison if the value is not "inbounds", not in
UB. We accidentally derived nonnull and dereferenceable from these
inbounds GEPs even in the absence of accesses that would make the poison
to UB.
Johannes Doerfert [Tue, 31 Dec 2019 19:25:47 +0000 (13:25 -0600)]
[Attributor][FIX] Return CHANGED once a pessimistic fixpoint is reached.
Tyker [Fri, 3 Jan 2020 15:59:44 +0000 (16:59 +0100)]
[Diagnostic] Fixed add ftabstop to -Wmisleading-indentation
Summary:
this allow much better support of codebases like the linux kernel that mix tabs and spaces.
-ftabstop=//Width// allow specifying how large tabs are considered to be.
Reviewers: xbolva00, aaron.ballman, rsmith
Reviewed By: aaron.ballman
Subscribers: mstorsjo, cfe-commits, jyknight, riccibruno, rsmith, nathanchance
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71037
Matt Arsenault [Fri, 3 Jan 2020 15:02:08 +0000 (10:02 -0500)]
AMDGPU/GlobalISel: Fix off by one in operand index
This should be looking at the RHS of the add for a constant.
Roman Lebedev [Fri, 3 Jan 2020 13:14:29 +0000 (16:14 +0300)]
[DAGCombiner][X86][AArch64] Generalize `A-(A&B)`->`A&(~B)` fold (PR44448)
The fold 'A - (A & (B - 1))' -> 'A & (0 - B)'
added in
8dab0a4a7d691f2704f1079538e0ef29548db159
is too specific. It should/can just be 'A - (A & B)' -> 'A & (~B)'
Even if we don't manage to fold `~` into B,
we have likely formed `ANDN` node.
Also, this way there's less similar-but-duplicate folds.
Name: X - (X & Y) -> X & (~Y)
%o = and i32 %X, %Y
%r = sub i32 %X, %o
=>
%n = xor i32 %Y, -1
%r = and i32 %X, %n
https://rise4fun.com/Alive/kOUl
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Roman Lebedev [Fri, 3 Jan 2020 14:11:49 +0000 (17:11 +0300)]
[NFC][X86][AArch64] Add 'A - (A & B)' pattern tests (PR44448)
The fold 'A - (A & (B - 1))' -> 'A & (0 - B)'
added in
8dab0a4a7d691f2704f1079538e0ef29548db159
is too specific. It should just be 'A - (A & B)' -> 'A & (~B)'
Name: X - (X & Y) -> X & (~Y)
%o = and i32 %X, %Y
%r = sub i32 %X, %o
=>
%n = xor i32 %Y, -1
%r = and i32 %X, %n
https://rise4fun.com/Alive/kOUl
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Roman Lebedev [Fri, 3 Jan 2020 14:03:50 +0000 (17:03 +0300)]
[NFC][X86] Add BMI runlines to align-down.ll test
Roman Lebedev [Fri, 3 Jan 2020 13:01:16 +0000 (16:01 +0300)]
[DAGCombiner] `~(add X, -1)` -> `neg X` fold
The fold 'A - (A & (B - 1))' -> 'A & (0 - B)'
added in
8dab0a4a7d691f2704f1079538e0ef29548db159
is too specific. It should just be 'A - (A & B)' -> 'A & (~B)',
but we currently fail to sink that '~' into `(B - 1)`.
Name: ~(X - 1) -> (0 - X)
%o = add i32 %X, -1
%r = xor i32 %o, -1
=>
%r = sub i32 0, %X
https://rise4fun.com/Alive/rjU
Roman Lebedev [Fri, 3 Jan 2020 13:50:37 +0000 (16:50 +0300)]
[NFC][DAGCombine][X86] '~(X - 1)' pattern tests
The fold 'A - (A & (B - 1))' -> 'A & (0 - B)'
added in
8dab0a4a7d691f2704f1079538e0ef29548db159
is too specific. It should just be 'A - (A & B)' -> 'A & (~B)',
but we currently fail to sink that '~' into `(B - 1)`.
Name: ~(X - 1) -> (0 - X)
%o = add i32 %X, -1
%r = xor i32 %o, -1
=>
%r = sub i32 0, %X
https://rise4fun.com/Alive/rjU
Roman Lebedev [Fri, 3 Jan 2020 12:38:53 +0000 (15:38 +0300)]
[DAGCombine][X86][Thumb2/LowOverheadLoops] `A - (A & C)` -> `A & (~C)` fold (PR44448)
While we do manage to fold integer-typed IR in middle-end,
we can't do that for the main motivational case of pointers.
There is @llvm.ptrmask() intrinsic which may or may not be helpful,
but i'm not sure it is fully considered canonical yet,
not everything is fully aware of it likely.
Name: PR44448 ptr - (ptr & C) -> ptr & (~C)
%bias = and i32 %ptr, C
%r = sub i32 %ptr, %bias
=>
%r = and i32 %ptr, ~C
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Roman Lebedev [Fri, 3 Jan 2020 12:37:49 +0000 (15:37 +0300)]
[NFC][DAGCombine][X86] Tests for 'A - (A & C)' pattern (PR44448)
Name: PR44448 ptr - (ptr & C) -> ptr & (~C)
%bias = and i32 %ptr, C
%r = sub i32 %ptr, %bias
=>
%r = and i32 %ptr, ~C
The main motivational pattern involes pointer-typed values,
so this transform can't really be done in middle-end.
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Roman Lebedev [Fri, 3 Jan 2020 12:32:57 +0000 (15:32 +0300)]
[NFC][DAGCombine] Clarify comment for 'A - (A & (B - 1))' fold
Sam Parker [Fri, 3 Jan 2020 14:50:39 +0000 (14:50 +0000)]
[ARM][NFC] Update MIR test
serge-sans-paille [Fri, 3 Jan 2020 14:39:28 +0000 (15:39 +0100)]
Use llvm_canonicalize_cmake_booleans where intended
Differential Revision: https://reviews.llvm.org/D72130
serge-sans-paille [Fri, 3 Jan 2020 14:38:27 +0000 (15:38 +0100)]
Fix compiler extension testing
Correctly declare example dependency. Pipe stderr through FileCheck.
Differential Revision: https://reviews.llvm.org/D72130
serge-sans-paille [Fri, 3 Jan 2020 14:36:52 +0000 (15:36 +0100)]
Fix typo in compiler extension testing
s/CHECK-/CHECK
Differential Revision: https://reviews.llvm.org/D72130
Ankit [Fri, 3 Jan 2020 14:13:55 +0000 (14:13 +0000)]
Fix for a dangling point bug in DeadStoreElimination pass
The patch makes sure that the LastThrowing pointer does not point to any instruction deleted by call to DeleteDeadInstruction.
While iterating through the instructions the pass maintains a pointer to the lastThrowing Instruction. A call to deleteDeadInstruction deletes a dead store and other instructions feeding the original dead instruction which also become dead. The instruction pointed by the lastThrowing pointer could also be deleted by the call to DeleteDeadInstruction and thus it becomes a dangling pointer. Because of this, we see an error in the next iteration.
In the patch, we maintain a list of throwing instructions encountered previously and use the last non deleted throwing instruction from the container.
Reviewers: fhahn, bcahoon, efriedma
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D65326
Sanjay Patel [Fri, 3 Jan 2020 14:15:58 +0000 (09:15 -0500)]
[InstCombine] replace undef elements in vector constant when doing icmp folds (PR44383)
As shown in P44383:
https://bugs.llvm.org/show_bug.cgi?id=44383
...we can't safely propagate a vector constant through this icmp fold
if that vector constant contains undefined elements.
We know that each defined element of the constant is safe though, so
find the first of those and replicate it into the formerly undef lanes.
Differential Revision: https://reviews.llvm.org/D72101
Jay Foad [Fri, 3 Jan 2020 14:05:58 +0000 (14:05 +0000)]
Fix typo "psuedo" in comments
Jay Foad [Fri, 3 Jan 2020 13:32:52 +0000 (13:32 +0000)]
[TargetLowering] Remove comments referring to TLOF
These have been obsolete since about r221926, when
TargetLoweringObjectFile was completely moved from TargetLowering to
TargetMachine.
Lei Zhang [Fri, 3 Jan 2020 12:37:19 +0000 (07:37 -0500)]
[mlir][spirv] Fix shader ABI attribute prefix and add verification
This commit fixes shader ABI attributes to use `spv.` as the prefix
so that they match the dialect's namespace. This enables us to add
verification hooks in the SPIR-V dialect to verify them.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D72062
James Henderson [Thu, 2 Jan 2020 17:31:52 +0000 (17:31 +0000)]
[test][ELF] Use CHECK-NEXT to properly verify error messages
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D72092
James Henderson [Fri, 20 Dec 2019 15:13:29 +0000 (15:13 +0000)]
[DebugInfo] Remove redundant checks for past-the-end of prologue
The V5 directory and filename tables had checks in to make sure we
hadn't read past the end of the line table prologue. Since previous
changes to the data extractor class ensure we never read past the end,
these checks are now redundant, so this patch removes them.
There is still a check to show that the whole prologue remains within
the prologue length.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D71768
Anastasia Stulova [Fri, 3 Jan 2020 11:59:19 +0000 (11:59 +0000)]
[OpenCL] Add link to C++ for OpenCL documentation
Remove description of language mode from the language
extensions and add a link to pdf document.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72076
Ilya Biryukov [Fri, 3 Jan 2020 11:05:14 +0000 (12:05 +0100)]
[Syntax] Build spanning SimpleDecalration for classes, structs, etc
When they are free-standing, e.g. `struct X;` or `struct X {};`.
Although this complicates the common case (of free-standing class
declarations), this ensures the less common case (e.g. `struct X {} a;`)
are handled uniformly and produce similar syntax trees.
James Henderson [Fri, 20 Dec 2019 12:40:20 +0000 (12:40 +0000)]
[test][llvm-dwarfdump] Use --implicit-check-not to simplify test checks
This removes the need to duplicate the LASTONLY check pattern and the
last part of the NONFATAL pattern in the modified test.
Reviewed By: MaskRay, JDevlieghere
Differential Revision: https://reviews.llvm.org/D71757
James Henderson [Fri, 20 Dec 2019 12:30:23 +0000 (12:30 +0000)]
[test][llvm-dwarfdump] Normalise contents and checks for line tables
The line tables in debug_line_malformed.s had contents that varied more
than was necessary for the testing, making it harder to follow what was
important. This patch normalises them so that they all share
more-or-less the same body. Additionally, it makes the testing for what
was printed more consistent, to show that the right parts of the line
table prologue and body are/are not parsed and printed.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D71755
James Henderson [Fri, 20 Dec 2019 11:57:38 +0000 (11:57 +0000)]
[test][llvm-dwarfdump] Add missing checks for table dumping
Some of the tables in debug_line_malformed.s were not being checked in
the NONFATAL checks in debug_line_invalid.test (only the warnings coming
from them were being checked). This made the test harder to follow.
Additionally, a later change will change the way the errors are handled
such that more of the line table will be printed. That will require
checks for these tables (or something equivalent) so that the difference
in behaviour can be observed. This patch adds checks for the three
tables that were missing checks.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D71753
Roman Lebedev [Fri, 3 Jan 2020 09:50:00 +0000 (12:50 +0300)]
[DAGCombine][X86][AArch64] 'A - (A & (B - 1))' -> 'A & (0 - B)' fold (PR44448)
While we do manage to fold integer-typed IR in middle-end,
we can't do that for the main motivational case of pointers.
There is @llvm.ptrmask() intrinsic which may or may not be helpful,
but i'm not sure it is fully considered canonical yet,
not everything is fully aware of it likely.
https://rise4fun.com/Alive/ZVdp
Name: ptr - (ptr & (alignment-1)) -> ptr & (0 - alignment)
%mask = add i64 %alignment, -1
%bias = and i64 %ptr, %mask
%r = sub i64 %ptr, %bias
=>
%highbitmask = sub i64 0, %alignment
%r = and i64 %ptr, %highbitmask
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Roman Lebedev [Fri, 3 Jan 2020 09:46:52 +0000 (12:46 +0300)]
[NFC][DAGCombine][X86][AArch64] Tests for 'A - (A & (B - 1))' pattern (PR44448)
https://rise4fun.com/Alive/ZVdp
Name: ptr - (ptr & (alignment-1)) -> ptr & (0 - alignment)
%mask = add i64 %alignment, -1
%bias = and i64 %ptr, %mask
%r = sub i64 %ptr, %bias
=>
%highbitmask = sub i64 0, %alignment
%r = and i64 %ptr, %highbitmask
The main motivational pattern involes pointer-typed values,
so this transform can't really be done in middle-end.
See
https://bugs.llvm.org/show_bug.cgi?id=44448
https://reviews.llvm.org/D71499
Raphael Isemann [Fri, 3 Jan 2020 10:24:12 +0000 (11:24 +0100)]
[lldb][NFC] Remove forward declaration for non-existent type clang::Action and delete references to it
There is no clang::Action anymore so our forward decl for it and the obsolete pointer in the
ASTStructExtractor can both go (that code anyway didn't do anything).
Raphael Isemann [Fri, 3 Jan 2020 09:36:31 +0000 (10:36 +0100)]
[lldb][NFC] Document TypeSystem and related Compiler* classes
Sam Parker [Fri, 3 Jan 2020 08:48:33 +0000 (03:48 -0500)]
[ARM][NFC] Move tail predication checks
Extract the tail predication validation checks out into their own
LowOverHeadLoop method.
Craig Topper [Fri, 3 Jan 2020 07:27:51 +0000 (23:27 -0800)]
[X86] Reorder X86any* PatFrags to put the strict node first so that chain property will be inferred for the instruction by the tablegen backend.
Also use X86any_vfpround instead of X86vfpround in some instruction
definitions so the strict version can be used to infer the chain
property.
Without these changes we don't propagate strict FP chain through
isel for some instructions.
Kadir Cetinkaya [Wed, 18 Dec 2019 10:23:47 +0000 (11:23 +0100)]
[clangd] Replace shortenNamespace with getQualification
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71652
TH3CHARLie [Fri, 3 Jan 2020 06:04:01 +0000 (14:04 +0800)]
[llvm-size] print a blank line between archieve members when using sysv format
Summary: This patch is related to https://bugs.llvm.org/show_bug.cgi?id=42967 and it fixes llvm-size's sysv format output by adding a blank line between archieve members
Reviewers: jhenderson, Jim, MaskRay
Reviewed By: jhenderson, Jim, MaskRay
Subscribers: MaskRay, Jim, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71957
Craig Topper [Fri, 3 Jan 2020 04:51:13 +0000 (20:51 -0800)]
[X86] Re-enable lowerUINT_TO_FP_vXi32 under fast-math by using an FSUB instead of an FADD.
Summary:
We previously disabled this under fast math due to aggressive
reassociation by the machine combiner. But I think we can work
around this by using a FSUB instead of FADD for the first
operation.
This matches the similar algorithm we do for uint_to_fp i64->f64
in TargetLowering::expandUINT_TO_FP. If reassociation hasn't
been a problem for that, hopefully its not a problem here.
Reviewers: RKSimon, spatel, scanon
Reviewed By: spatel
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71968
QingShan Zhang [Fri, 3 Jan 2020 03:26:41 +0000 (03:26 +0000)]
[DAGCombine] Initialize the default operation action for SIGN_EXTEND_INREG for vector type as 'expand' instead of 'legal'
For now, we didn't set the default operation action for SIGN_EXTEND_INREG for
vector type, which is 0 by default, that is legal. However, most target didn't
have native instructions to support this opcode. It should be set as expand by
default, as what we did for ANY_EXTEND_VECTOR_INREG.
Differential Revision: https://reviews.llvm.org/D70000
Wang, Pengfei [Fri, 3 Jan 2020 02:57:27 +0000 (10:57 +0800)]
[X86] Enable strict FP by default and remove option -disable-strictnode-mutation. NFCI.
Kazuaki Ishizaki [Fri, 3 Jan 2020 02:25:06 +0000 (10:25 +0800)]
[mlir] NFC: Fix broken links in docs
Summary: This commit fixes missing links that are caused by the repository movement.
Reviewers: Jim, rriddle, jpienaar
Reviewed By: Jim, rriddle, jpienaar
Subscribers: arpith-jacob, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72065
Hideto Ueno [Fri, 3 Jan 2020 02:03:56 +0000 (11:03 +0900)]
Revert "[Attributor] AAValueConstantRange: Value range analysis using constant range"
This reverts commit
e9963034314edf49a12ea5e29f694d8f9f52734a.
Kamil Rytarowski [Fri, 3 Jan 2020 01:35:33 +0000 (02:35 +0100)]
[compiler-rt] [netbsd] Switch to syscall for ThreadSelfTlsTcb()
This change avoids using internal, namespaced per-CPU calls that
are not a stable interface to read the TSL base value.
Justin Hibbits [Fri, 20 Sep 2019 16:22:49 +0000 (11:22 -0500)]
[PowerPC]: Fix predicate handling with SPE
SPE floating-point compare instructions only update the GT bit in the CR
field. All predicates must therefore be reduced to GT/LE.
Justin Hibbits [Thu, 2 Jan 2020 22:00:43 +0000 (16:00 -0600)]
Run update_llc_test_checks against SPE tests.
This is in preparation for further tests which are better generated with
the script. No functional change.
Wang, Pengfei [Fri, 3 Jan 2020 01:04:44 +0000 (09:04 +0800)]
[X86] Optimization of inserting vxi1 sub vector into vXi1 vector
Summary:
After bugfix the undef value case here, we used more operations to implement inserting vxi1 sub vector into vXi1 vector, I optimize it by use less operations.
The history information at https://reviews.llvm.org/D68311
Reviewers: craig.topper, LuoYuanke, yubing, annita.zhang, pengfei, LiuChen3, RKSimon
Reviewed By: craig.topper
Subscribers: hiraditya, llvm-commits
Patch by Xiang Zhang (xiangzhangllvm)
Differential Revision: https://reviews.llvm.org/D71917
Med Ismail Bennani [Fri, 3 Jan 2020 01:14:45 +0000 (02:14 +0100)]
Revert "[lldb/Command] Add --force option for `watchpoint delete` command"
This reverts commit
3620e5f28a4d2800fb6c325ec24b3d660e48b9ba.
Jonas Devlieghere [Fri, 3 Jan 2020 00:14:35 +0000 (16:14 -0800)]
[lldb/Python] Remove unused imports (NFC)
Jonas Devlieghere [Fri, 3 Jan 2020 00:13:44 +0000 (16:13 -0800)]
[lldb/Python] Remove unused support file (NFC)
Med Ismail Bennani [Sat, 28 Dec 2019 13:47:51 +0000 (14:47 +0100)]
[lldb/Command] Add --force option for `watchpoint delete` command
Currently, there is no option to delete all the watchpoint without LLDB
asking for a confirmation. Besides making the watchpoint delete command
homogeneous with the breakpoint delete command, this option could also
become handy to trigger automated watchpoint deletion i.e. using
breakpoint actions.
rdar://
42560586
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Petr Hosek [Thu, 2 Jan 2020 22:45:07 +0000 (14:45 -0800)]
[CMake] clang-scan-deps in Fuchsia distribution
We would like to use clang-scan-deps in Fuchsia build so include it
in the toolchain distribution.
Differential Revision: https://reviews.llvm.org/D72113
Sean Fertile [Fri, 3 Jan 2020 00:29:56 +0000 (19:29 -0500)]
[PowerPC][AIX] Enable sret arguments.
Removes the fatal error for sret arguments and adds lit testing.
Differential Revision: https://reviews.llvm.org/D71504
Reid Kleckner [Mon, 25 Nov 2019 19:36:47 +0000 (11:36 -0800)]
[PDB] Print the most redundant type record indices with /summary
Summary:
I used this information to motivate splitting up the Intrinsic::ID enum
(
5d986953c8b917bacfaa1f800fc1e242559f76be) and adding a key method to
clang::Sema (
586f65d31f32ca6bc8cfdb8a4f61bee5057bf6c8) which saved a
fair amount of object file size.
Example output for clang.pdb:
Top 10 types responsible for the most TPI input bytes:
index total bytes count size
0x3890: 8,671,220 = 1,805 * 4,804
0xE13BE: 5,634,720 = 252 * 22,360
0x6874C: 5,181,600 = 408 * 12,700
0x2A1F: 4,520,528 = 1,574 * 2,872
0x64BFF: 4,024,020 = 469 * 8,580
0x1123: 4,012,020 = 2,157 * 1,860
0x6952: 3,753,792 = 912 * 4,116
0xC16F: 3,630,888 = 633 * 5,736
0x69DD: 3,601,160 = 985 * 3,656
0x678D: 3,577,904 = 319 * 11,216
In this case, we can see that record 0x3890 is responsible for ~8MB of
total object file size for objects in clang.
The user can then use llvm-pdbutil to find out what the record is:
$ llvm-pdbutil dump -types -type-index 0x3890
Types (TPI Stream)
============================================================
Showing 1 records.
0x3890 | LF_FIELDLIST [size = 4804]
- LF_STMEMBER [name = `WORDTYPE_MAX`, type = 0x1001, attrs = public]
- LF_MEMBER [name = `U`, Type = 0x37F0, offset = 0, attrs = private]
- LF_MEMBER [name = `BitWidth`, Type = 0x0075 (unsigned), offset = 8, attrs = private]
- LF_METHOD [name = `APInt`, # overloads = 8, overload list = 0x3805]
...
In this case, we can see that these are members of the APInt class,
which is emitted in 1805 object files.
The next largest type is ASTContext:
$ llvm-pdbutil dump -types -type-index 0xE13BE bin/clang.pdb
0xE13BE | LF_FIELDLIST [size = 22360]
- LF_BCLASS
type = 0x653EA, offset = 0, attrs = public
- LF_MEMBER [name = `Types`, Type = 0x653EB, offset = 8, attrs = private]
- LF_MEMBER [name = `ExtQualNodes`, Type = 0x653EC, offset = 24, attrs = private]
- LF_MEMBER [name = `ComplexTypes`, Type = 0x653ED, offset = 48, attrs = private]
- LF_MEMBER [name = `PointerTypes`, Type = 0x653EE, offset = 72, attrs = private]
...
ASTContext only appears 252 times, but the list of members is long, and
must be repeated everywhere it is used.
This was the output before I split Intrinsic::ID:
Top 10 types responsible for the most TPI input:
0x686C: 69,823,920 = 1,070 * 65,256
0x686D: 69,819,640 = 1,070 * 65,252
0x686E: 69,819,640 = 1,070 * 65,252
0x686B: 16,371,000 = 1,070 * 15,300
...
These records were all lists of intrinsic enums.
Reviewers: MaskRay, ruiu
Subscribers: mgrang, zturner, thakis, hans, akhuang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71437
Lang Hames [Thu, 2 Jan 2020 23:47:47 +0000 (15:47 -0800)]
[lli] Add a filter to avoid importing the process's main symbol.
If JIT'd code fails to define a main function and we import the process's
definition then we will end up recursively calling lli's main until we overflow
the stack and crash. This filter fixes the issue by ensuring that the process's
main function is never imported. This results in lli producing a much friendlier
"symbol not found" error when JIT'd code fails to define main.
Evgenii Stepanov [Thu, 2 Jan 2020 23:26:07 +0000 (15:26 -0800)]
Fix llvm-symbolizer tests on Windows, one more time.
River Riddle [Thu, 2 Jan 2020 22:28:37 +0000 (14:28 -0800)]
[mlir] Rewrite the internal representation of OpResult to be optimized for memory.
Summary:
This changes the implementation of OpResult to have some of the results be represented inline in Value, via a pointer int pair of Operation*+result number, and the rest being trailing objects on the main operation. The full details of the new representation is detailed in the proposal here:
https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ
The only difference between here and the above proposal is that we only steal 2-bits for the Value kind instead of 3. This means that we can only fit 2-results inline instead of 6. This allows for other users to steal the final bit for PointerUnion/etc. If necessary, we can always steal this bit back in the future to save more space if 3-6 results are common enough.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D72020
Evgenii Stepanov [Tue, 31 Dec 2019 01:46:22 +0000 (17:46 -0800)]
Add C source to two debug info tests.
Reviewers: dblaikie, jhenderson
Subscribers: aprantl, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72024
Evgenii Stepanov [Tue, 31 Dec 2019 02:06:25 +0000 (18:06 -0800)]
Change dbg-*-tag-offset tests to use llvm-dwarfdump.
Reviewers: dblaikie
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72023
Matt Arsenault [Thu, 2 Jan 2020 18:40:20 +0000 (13:40 -0500)]
AMDGPU/GlobalISel: Remove manual G_FENCE selection
The tablegen emitter now handles the immediate operand correctly, so
let the generatedd matcher works.
Matt Arsenault [Thu, 2 Jan 2020 21:20:26 +0000 (16:20 -0500)]
DAG: Use TargetConstant for FENCE operands
Alexey Bataev [Fri, 27 Dec 2019 14:44:43 +0000 (09:44 -0500)]
[OPENMP50]Codegen for lastprivate conditional list items.
Added codegen support for lastprivate conditional. According to the
standard, if when the conditional modifier appears on the clause, if an
assignment to a list item is encountered in the construct then the
original list item is assigned the value that is assigned to the new
list item in the sequentially last iteration or lexically last section
in which such an assignment is encountered.
We look for the assignment operations and check if the left side
references lastprivate conditional variable. Then the next code is
emitted:
if (last_iv_a <= iv) {
last_iv_a = iv;
last_a = lp_a;
}
At the end the implicit barrier is generated to wait for the end of all
threads and then in the check for the last iteration the private copy is
assigned the last value.
if (last_iter) {
lp_a = last_a; // <--- new code
a = lp_a; // <--- store of private value to the original variable.
}
Jonas Devlieghere [Thu, 2 Jan 2020 21:36:05 +0000 (13:36 -0800)]
[lldb/CMake] Print whether an optional dependency was enabled.
Use a status message to convey whether an optional dependency was found
or not. With the auto-detection code it's not longer as simple as
checking the CMake cache.
Jonas Devlieghere [Thu, 2 Jan 2020 21:31:32 +0000 (13:31 -0800)]
[lldb/CMake] Fix variable naming in FindLibEdit
The current FOUND_VAR for FindLibEdit is libedit_FOUND but wasn't set by
find_package_handle_standard_args. However this isn't valid for the
package name.
The argument for FOUND_VAR is "libedit_FOUND", but only "LibEdit_FOUND" and
"LIBEDIT_FOUND" are valid names.
This fixes all the variables set by FindLibEdit to match the desired
naming scheme.
Jonas Paulsson [Mon, 30 Dec 2019 21:14:43 +0000 (22:14 +0100)]
[SystemZ] Create brcl 0,0 instead of brcl 0,3 in EmitNop for 6 bytes.
For consistency with GCC, the target label is moved to the brcl itself
instead of the next instruction.
Review: Ulrich Weigand
Alexey Bataev [Thu, 2 Jan 2020 20:49:08 +0000 (15:49 -0500)]
[OPENMP] Restore allowing of braced initializers in the declare reduction
init.
Braced initializers were not accepted after the last fix in the initialier.Restored previous functionality.
Jonas Devlieghere [Thu, 2 Jan 2020 21:00:02 +0000 (13:00 -0800)]
[lldb/CMake] Use PYTHON_LIBRARIES instead of PYTHON_LIBRARY
PYTHON_LIBRARIES is the canonical variable set by FindPythonLibs while
PYTHON_LIBRARY is an implementation detail. This replaces the uses of
the latter with the former.
Matt Arsenault [Thu, 2 Jan 2020 20:31:26 +0000 (15:31 -0500)]
AMDGPU/GlobalISel: Correct MMO sizes in some tests
There intended to test non-extloads, but the memory size did not match
the result size.
Matt Arsenault [Thu, 2 Jan 2020 19:56:50 +0000 (14:56 -0500)]
AMDGPU/GlobalISel: Regenerate check lines
This avoids diff noise in a future commit from the check name change
from the G_GEP->G_PTR_ADD rename.
Saleem Abdulrasool [Thu, 2 Jan 2020 20:55:01 +0000 (12:55 -0800)]
build: disable zlib by default on Windows
zlib usage on Windows has caused issues in the past. Furthermore, the
GNUWin32 library can be detected and used although the headers are not
available. Require Windows to explicitly opt in.
Jacques Pienaar [Thu, 2 Jan 2020 20:53:43 +0000 (12:53 -0800)]
[mlir] Only generate default for uncovered cases
Have to explicitly check if all cases are covered instead.
Sanjay Patel [Thu, 2 Jan 2020 19:32:18 +0000 (14:32 -0500)]
[InstCombine] add tests for vector icmp with undef constant elements; NFC
Jacques Pienaar [Thu, 2 Jan 2020 20:32:41 +0000 (12:32 -0800)]
[mlir] Revert default case that was needed
This one isn't always complete.
Jacques Pienaar [Thu, 2 Jan 2020 20:27:09 +0000 (12:27 -0800)]
[mlir] Add parenthesis to avoid -Wparentheses
Craig Topper [Thu, 2 Jan 2020 20:26:31 +0000 (12:26 -0800)]
[X86] Move STRICT_ ISD nodes into the new section of X86ISelLowering.h where STRICT nodes are collected after D71841
Jacques Pienaar [Thu, 2 Jan 2020 20:22:12 +0000 (12:22 -0800)]
[mlir] Remove redudant default cases
These provide no value and trigger -Wcovered-switch-default.
David Blaikie [Thu, 2 Jan 2020 20:13:38 +0000 (12:13 -0800)]
Polly: Fix a tag type mismatch (struct/class)
Nemanja Ivanovic [Thu, 2 Jan 2020 19:37:34 +0000 (13:37 -0600)]
[PowerPC] Only legalize FNEARBYINT with unsafe fp math
Commit
0f0330a78709 legalized these nodes on PPC without consideration of
unsafe math which means that we get inexact exceptions raised for nearbyint.
Since this doesn't conform to the standard, switch this legalization to depend
on unsafe fp math.
Saleem Abdulrasool [Thu, 2 Jan 2020 19:40:49 +0000 (11:40 -0800)]
X86: remove unused variable
Remove the now unused-variable from
aa17d31edb00c66461093b5a7cd2f4a35dc143e9. This breaks `-Werror` builds.
Nico Weber [Thu, 2 Jan 2020 19:39:17 +0000 (14:39 -0500)]
Reland "[gn build] (manually) merge
68a235d07f9e70"
This reverts commit
70342641b3c064b1cdf90d16902b937e7a21ecf2.
68a235d relanded in
abb00753069, so this relands the gn port of it.
Saleem Abdulrasool [Wed, 1 Jan 2020 23:01:04 +0000 (15:01 -0800)]
build: reduce CMake handling for zlib
Rather than handling zlib handling manually, use `find_package` from CMake
to find zlib properly. Use this to normalize the `LLVM_ENABLE_ZLIB`,
`HAVE_ZLIB`, `HAVE_ZLIB_H`. Furthermore, require zlib if `LLVM_ENABLE_ZLIB` is
set to `YES`, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.
This restores
68a235d07f9e7049c7eb0c8091f37e385327ac28,
e6c7ed6d2164a0659fd9f6ee44f1375d301e3cad. The problem with the windows
bot is a need for clearing the cache.
Craig Topper [Thu, 2 Jan 2020 18:15:36 +0000 (10:15 -0800)]
[X86] Remove FP0-6 operands from call instructions in FPStackifier pass. Only count defs as returns.
All FP0-6 operands should be removed by the FP stackifier. By
removing these we fix the machine verifier error in PR39437.
I've also made it so that only defs are counted for STReturns
which removes what I think were extra stack cleanup instructions.
And I've removed the regcall assert because it was checking the
attributes of the caller, but here we're concerned with the
attributes of the callee. But I don't know how to get that
information from this level.
Lei Zhang [Thu, 2 Jan 2020 19:08:30 +0000 (14:08 -0500)]
[mlir][spirv] Update SPIR-V enums and ops with availability spec
This commit updates gen_spirv_dialect.py to query the grammar and
generate availability spec for various enum attribute definitions
and all defined ops.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D72095
Fangrui Song [Thu, 2 Jan 2020 17:52:59 +0000 (09:52 -0800)]
[ELF][Hexagon][test] Use llvm-readobj to check relocations. NFC
Reviewed By: sidneym
Differential Revision: https://reviews.llvm.org/D72093