Sanjay Patel [Wed, 8 Jan 2020 15:33:44 +0000 (10:33 -0500)]
[InstCombine] Adding testcase for Z / (1.0 / Y) => (Y * Z); NFC
The added testcase shows the current transformation for the operation
Z / (1.0 / Y), which remains unchanged. This will be updated to align
with the transformed code (Y * Z) with D72319.
The existing transformation Z / (X / Y) => (Y * Z) / X is not handling
this case as there are multiple uses for (1.0 / Y) in this testcase.
Patch by: @raghesh (Raghesh Aloor)
Differential Revision: https://reviews.llvm.org/D72388
Sanjay Patel [Wed, 8 Jan 2020 14:42:21 +0000 (09:42 -0500)]
[DAGCombiner] clean up extract-of-concat fold; NFC
This hopes to improve readability and adds an assert.
The functional change noted by the TODO comment is
proposed in:
D72361
Alexey Bataev [Wed, 8 Jan 2020 14:39:44 +0000 (09:39 -0500)]
[OPENMP]Allow comma in combiner expression.
Use ParseExpression() instead of ParseAssignmentExpression() to allow
commas in combiner expressions.
Kazu Hirata [Wed, 8 Jan 2020 14:57:36 +0000 (06:57 -0800)]
[JumpThreading] Thread jumps through two basic blocks
Summary:
This patch teaches JumpThreading.cpp to thread through two basic
blocks like:
bb3:
%var = phi i32* [ null, %bb1 ], [ @a, %bb2 ]
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %bb4, label ...
bb4:
%cmp = icmp eq i32* %var, null
br i1 %cmp, label bb5, label bb6
by duplicating basic blocks like bb3 above. Once we duplicate bb3 as
bb3.dup and redirect edge bb2->bb3 to bb2->bb3.dup, we have:
bb3:
%var = phi i32* [ @a, %bb2 ]
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %bb4, label ...
bb3.dup:
%var = phi i32* [ null, %bb1 ]
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %bb4, label ...
bb4:
%cmp = icmp eq i32* %var, null
br i1 %cmp, label bb5, label bb6
Then the existing code in JumpThreading.cpp can thread edge
bb3.dup->bb4 through bb4 and eventually create bb3.dup->bb5.
Reviewers: wmi
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70247
Simon Tatham [Wed, 8 Jan 2020 13:37:12 +0000 (13:37 +0000)]
[ARM,MVE] Intrinsics for variable shift instructions.
This batch of intrinsics fills in all the shift instructions that take
a variable shift distance in a register, instead of an immediate. Some
of these instructions take a single shift distance in a scalar
register and apply it to all lanes; others take a vector of per-lane
distances.
These instructions are all basically one family, varying in whether
they saturate out-of-range values, and whether they round when bits
are shifted off the bottom. I've implemented them at the IR level by a
much smaller family of IR intrinsics, which take flag parameters to
indicate saturating and/or rounding (along with the usual one to
specify signed/unsigned integers).
An oddity is that all of them are //left// shift instructions – but if
you pass a negative shift count, they'll shift right. So the vector
shift distances are always vectors of //signed// integers, regardless
of whether you're considering the other input vector to be of signed
or unsigned. Also, even the simplest `vshlq` instruction in this
family (neither saturating nor rounding) has to be implemented as an
IR intrinsic, because the ordinary LLVM IR `shl` operation would
consider an out-of-range shift count to be undefined behavior.
Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
Reviewed By: dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72329
Simon Tatham [Wed, 8 Jan 2020 13:36:25 +0000 (13:36 +0000)]
[ARM,MVE] Intrinsics for partial-overwrite imm shifts.
This batch of intrinsics covers two sets of immediate shift
instructions, which have in common that they only overwrite part of
their output register and so they need an extra input giving its
previous value.
The VSLI and VSRI instructions shift each lane of the input vector
left or right just as if they were normal immediate VSHL/VSHR, but
then they only overwrite the output bits that correspond to actual
shifted bits of the input. So VSLI will leave the low n bits of each
output lane unchanged, and VSRI the same with the top n bits.
The V[Q][R]SHR[U]N family are all narrowing shifts: they take an input
vector of 2n-bit integers, shift each lane right by a constant, and
then narrowing the shifted result to only n bits. So they only
overwrite half of the n-bit lanes in the output register, and the B/T
suffix indicates whether it's the bottom or top half of each 2n-bit
lane.
I've implemented the whole of the latter family using a single IR
intrinsic `vshrn`, which takes a lot of i32 parameters indicating
which instruction it expands to (by specifying signedness of the input
and output types, whether it saturates and/or rounds, etc).
Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
Reviewed By: dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72328
Andi-Bogdan Postelnicu [Tue, 7 Jan 2020 09:44:15 +0000 (11:44 +0200)]
[clang-tidy] Disable match on `if constexpr` statements in template instantiation for `readability-misleading-indentation` check.
Summary: Fixes fixes `readability-misleading-identation` for `if constexpr`. This is very similar to D71980.
Reviewers: alexfh
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72333
Bevin Hansson [Wed, 8 Jan 2020 14:05:03 +0000 (15:05 +0100)]
[Intrinsic] Add fixed point division intrinsics.
Summary:
This patch adds intrinsics and ISelDAG nodes for
signed and unsigned fixed-point division:
llvm.sdiv.fix.*
llvm.udiv.fix.*
These intrinsics perform scaled division on two
integers or vectors of integers. They are required
for the implementation of the Embedded-C fixed-point
arithmetic in Clang.
Patch by: ebevhan
Reviewers: bjope, leonardchan, efriedma, craig.topper
Reviewed By: craig.topper
Subscribers: Ka-Ka, ilya, hiraditya, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70007
Qiu Chaofan [Wed, 8 Jan 2020 14:12:15 +0000 (22:12 +0800)]
[NFC] Move InPQueue into arguments of releaseNode
This patch moves `InPQueue` into function arguments instead of template
arguments of `releaseNode`, which is a cleaner approach.
Differential Revision: https://reviews.llvm.org/D72125
Aaron Ballman [Wed, 8 Jan 2020 13:53:04 +0000 (08:53 -0500)]
Fixing a formatting nit; NFC
LLVM GN Syncbot [Wed, 8 Jan 2020 13:43:29 +0000 (13:43 +0000)]
[gn build] Port
346f6b54bd1
Anna Welker [Wed, 8 Jan 2020 13:08:27 +0000 (13:08 +0000)]
[ARM][MVE] Enable masked gathers from vector of pointers
Adds a pass to the ARM backend that takes a v4i32
gather and transforms it into a call to MVE's
masked gather intrinsics.
Differential Revision: https://reviews.llvm.org/D71743
Aaron Ballman [Wed, 8 Jan 2020 13:38:02 +0000 (08:38 -0500)]
Disallow an empty string literal in an asm label
An empty string literal in an asm label does not make a whole lot of sense. GCC
does not diagnose such a construct, but it also generates code that cannot be
assembled by gas should two symbols have an empty asm label within the same TU.
This does not affect an asm statement with an empty string literal, which is
still a useful construct.
Nico Weber [Wed, 8 Jan 2020 12:44:33 +0000 (07:44 -0500)]
[gn build] (manually) merge
1cf11a4c67a15
Alexey Lapshin [Fri, 20 Dec 2019 16:23:31 +0000 (19:23 +0300)]
[Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2.
Summary:
This patch relands D71271. The problem with D71271 is that it has cyclic dependency:
CodeGen->AsmPrinter->DebugInfoDWARF->CodeGen. To avoid cyclic dependency this patch
puts implementation for DWARFOptimizer into separate library: lib/DWARFLinker.
Thus the difference between this patch and D71271 is in that DWARFOptimizer renamed into
DWARFLinker and it`s files are put into lib/DWARFLinker.
Reviewers: JDevlieghere, friss, dblaikie, aprantl
Reviewed By: JDevlieghere
Subscribers: thegameg, merge_guards_bot, probinson, mgorny, hiraditya, llvm-commits
Tags: #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D71839
Sam Parker [Wed, 8 Jan 2020 10:29:12 +0000 (05:29 -0500)]
[NFC][ARM] Update tests
Run the update_mir_test on some of the low-overhead loop tests.
Raphael Isemann [Wed, 8 Jan 2020 08:40:08 +0000 (09:40 +0100)]
[lldb] Remove default llvm::Triple argument from ClangASTContext constructor
Creating an ASTContext with an unknown triple is rarely a good idea (as usually
all our ASTs have a valid triple that is either from the host or the target) and the
default argument makes it far to easy to implicitly create such an AST. Let's
remove it and force people to pass a triple.
The only place where we don't pass a triple is a DWARFASTParserClangTests
where we now just pass the host triple instead (the test doesn't depend on any
triple so this shouldn't change anything).
Xuanda Yang [Wed, 8 Jan 2020 10:37:41 +0000 (18:37 +0800)]
[llvm-symbolizer]Fix printing of malformed address values not passed via stdin
Summary:
relates https://bugs.llvm.org/show_bug.cgi?id=44443
Adding missing newline when printing bad input values.
Fix testcase
Reviewers: jhenderson
Reviewed By: jhenderson
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72313
Kadir Cetinkaya [Wed, 8 Jan 2020 10:21:21 +0000 (11:21 +0100)]
Revert "[InstCombine] fold zext of masked bit set/clear"
This reverts commit
a041c4ec6f7aa659b235cb67e9231a05e0a33b7d.
This looks like a non-trivial change and there has been no code
reviews (at least there were no phabricator revisions attached to the
commit description). It is also causing a regression in one of our
downstream integration tests, we haven't been able to come up with a
minimal reproducer yet.
Tim Northover [Fri, 15 Nov 2019 12:39:56 +0000 (12:39 +0000)]
AArch64: add missing Apple CPU names and use them by default.
Apple's CPUs are called A7-A13 in official communication, occasionally with
weird suffixes which we probably don't need to care about. This adds each one
and describes its features. It also switches the default CPU to the canonical
name for Cyclone, but leaves legacy support in so that existing bitcode still
compiles.
Raphael Isemann [Wed, 8 Jan 2020 08:02:55 +0000 (09:02 +0100)]
[lldb][NFC] Remove redundant ClangASTContext constructor that takes ArchSpec
ArchSpec has a superset of the information of llvm::Triple but the ClangASTContext
just uses the Triple part of it. This deletes the ArchSpec constructor and all
the code creating ArchSpecs and instead just uses the llvm::Triple constructor
for ClangASTContext.
Stephan T. Lavavej [Wed, 8 Jan 2020 07:33:52 +0000 (23:33 -0800)]
[libcxx][test] Fix span tests.
span.cons/container.pass.cpp
N4842 22.7.3.2 [span.cons]/13 constrains span's range constructor
for ranges::contiguous_range (among other criteria).
24.4.5 [range.refinements]/2 says that contiguous_range requires data(),
and (via contiguous_range, random_access_range, bidirectional_range,
forward_range, input_range, range) it also requires begin() and end()
(see 24.4.2 [range.range]/1).
Therefore, IsAContainer needs to provide begin() and end().
(Detected by MSVC's concept-constrained implementation.)
span.cons/stdarray.pass.cpp
This test uses std::array, so it must include <array>.
<span> isn't guaranteed to drag in <array>.
(Detected by MSVC's implementation which uses a forward declaration to
avoid dragging in <array>, for increased compiler throughput.)
span.objectrep/as_bytes.pass.cpp
span.objectrep/as_writable_bytes.pass.cpp
Testing `sp.extent == std::dynamic_extent` triggers MSVC warning
C4127 "conditional expression is constant". Using `if constexpr` is a
simple way to avoid this without disrupting anyone else (as span
requires C++20 mode).
span.tuple/get.pass.cpp
22.7.3.2 [span.cons]/4.3: "Preconditions: If extent is not equal to
dynamic_extent, then count is equal to extent."
These lines were triggering undefined behavior (detected by assertions
in MSVC's implementation).
I changed the count arguments in the first two chunks, followed by
changing the span extents, in order to preserve the test's coverage
and follow the existing pattern.
span.cons/span.pass.cpp
22.7.3.2 [span.cons]/18.1 constrains span's converting constructor with
"Extent == dynamic_extent || Extent == OtherExtent is true".
This means that converting from dynamic extent to static extent is
not allowed. (Other constructors tested elsewhere, like
span(It first, size_type count), can be used to write such code.)
As this is the test for the converting constructor, I have:
* Removed the "dynamic -> static" case from checkCV(), which is
comprehensive.
* Changed the initialization of std::span<T, 0> s1{}; in
testConstexprSpan() and testRuntimeSpan(), because s1 is used below.
* Removed ASSERT_NOEXCEPT(std::span<T, 0>{s0}); from those functions,
as they are otherwise comprehensive.
* Deleted testConversionSpan() entirely. Note that this could never
compile (it had a bool return type, but forgot to say `return`). And it
couldn't have provided useful coverage, as the /18.2 constraint
"OtherElementType(*)[] is convertible to ElementType(*)[]"
permits only cv-qualifications, which are already tested by checkCV().
Utkarsh Saxena [Thu, 12 Dec 2019 11:12:17 +0000 (12:12 +0100)]
[clangd] Add xref for macros to FileIndex.
Summary:
Adds macro references to the dynamic index.
Tests added.
Also exposed a new API to convert path to URI in URI.h
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71406
Siva Chandra Reddy [Tue, 7 Jan 2020 19:09:40 +0000 (11:09 -0800)]
[libc] Add a convenience CMake rule to add testsuites.
Summary:
This rule helps avoid repeated setting of check-libc's dependency on the
various testsuites.
Reviewers: abrachet
Subscribers: mgorny, MaskRay, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D72353
QingShan Zhang [Wed, 8 Jan 2020 06:48:51 +0000 (06:48 +0000)]
[NFC][Test] Add the option -enable-no-signed-zeros-fp-math for test
fma-combine.ll
Jonas Devlieghere [Wed, 8 Jan 2020 05:53:33 +0000 (21:53 -0800)]
[lldb/CMake] Only auto-enable Python when SWIG is found
As correctly pointed out by Martin on the mailing list, Python should
only be auto-enabled if SWIG is found as well. This moves the logic of
finding SWIG into FindPythonInterpAndLibs to make that possible.
To make diagnosing easier I've included a status message to convey why
Python support is disabled.
Jonas Devlieghere [Wed, 8 Jan 2020 05:36:19 +0000 (21:36 -0800)]
[lldb/Test] Try to appease the Windows bot
In TestConvenienceVariables I changed %t from a file to a directory.
This tripped up mkdir which can't deal with an existing file at the
given location. In order to solve this issue on the bots I added an
`rm -rf %t` statement, but now the Windows bot complains that "This
function is not supported on this system".
If you never ran the test suite wit this temporary workaround, the test
might fail. If this happens please remove what %t expands to in the lit
output and rerun the test.
Wang, Pengfei [Thu, 26 Dec 2019 14:16:46 +0000 (22:16 +0800)]
[X86] Adding fp128 support for strict fcmp
Summary: Adding fp128 support for strict fcmp
Reviewers: craig.topper, LiuChen3, andrew.w.kaylor, RKSimon, uweigand
Subscribers: hiraditya, llvm-commits, LuoYuanke
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71897
James Clarke [Wed, 8 Jan 2020 04:32:04 +0000 (04:32 +0000)]
[RISCV] Fix evalutePCRelLo for symbols at the end of a fragment
Summary:
This is analogous to D58943, which correctly finds the corresponding
fixup. However, when linker relaxations are disabled and we evaluate the
fixup, we need to also ensure we use an offset of 0 rather than the size
of the previous fragment.
Reviewers: asb, efriedma, lenary
Reviewed By: efriedma
Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71978
Denis Khalikov [Wed, 8 Jan 2020 03:11:59 +0000 (22:11 -0500)]
[mlir][spirv] Add lowering for std.fpext, std.fptrunc, std.sitofp.
Differential Revision: https://reviews.llvm.org/D72137
Lei Zhang [Wed, 8 Jan 2020 03:11:17 +0000 (22:11 -0500)]
Revert "[mlir][spirv] Add lowering for std.fpext, std.fptrunc, std.sitofp."
This reverts commit
7e7f849a6d94f77f1a29630419acb7226051f4b6 because
it recorded the wrong commit author.
Matt Arsenault [Wed, 8 Jan 2020 02:11:56 +0000 (21:11 -0500)]
AMDGPU: Annotate EXTRACT_SUBREGs with source register classes
This partially fixes GlobalISel import of the patterns, but removes a
lot of entriess from the end of the skipped pattern log.
Denis Khalikov [Wed, 8 Jan 2020 02:47:49 +0000 (21:47 -0500)]
[mlir][spirv] Add lowering for std cmp ops.
Differential Revision: https://reviews.llvm.org/D72296
Denis Khalikov [Wed, 8 Jan 2020 02:40:42 +0000 (21:40 -0500)]
[mlir][spirv] Add lowering for standard bit ops
Differential Revision: https://reviews.llvm.org/D72205
Jim Lin [Wed, 8 Jan 2020 02:43:45 +0000 (10:43 +0800)]
[docs] Fix duplicate explicit target name: developer policy
Lei Zhang [Wed, 8 Jan 2020 02:28:26 +0000 (21:28 -0500)]
[mlir][spirv] Add lowering for std.fpext, std.fptrunc, std.sitofp.
Differential Revision: https://reviews.llvm.org/D72137
czhengsz [Wed, 8 Jan 2020 01:52:37 +0000 (20:52 -0500)]
[SCEV] get more accurate range for AddExpr with wrap flag.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D64869
Jim Lin [Wed, 8 Jan 2020 01:48:01 +0000 (09:48 +0800)]
[docs] Improve HowTo commit changes from git
Summary: As a novice here I tried to `git push` my changes for a while before figuring out the correct workflow which is described on other pages. This small change doesn't reduce redundancy between those pages, but at least readers can follow the links now.
Reviewers: Kokan, Jim
Reviewed By: Kokan, Jim
Subscribers: riccibruno, kiszk, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72077
Kazuaki Ishizaki [Wed, 8 Jan 2020 01:35:12 +0000 (09:35 +0800)]
[libcxx] fix incorrect attribute property
Summary:
`__has_attribute(fallthough)` -> `__has_attribute(fallthrough)`
This is a follow-up of https://reviews.llvm.org/D72287
Reviewers: EricWF, mclow.lists, Jim
Reviewed By: Jim
Subscribers: christof, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D72314
Eric Christopher [Wed, 8 Jan 2020 01:00:23 +0000 (17:00 -0800)]
XFAIL load_extension.ll for all targets currently - it's failing on
additional platforms than just darwin.
Jonas Devlieghere [Wed, 8 Jan 2020 00:45:43 +0000 (16:45 -0800)]
Revert "Re-land "[lldb/Lua] Add string conversion operator for SBTarget.""
This was returning a pointer to a stack-allocated memory location. This
works for Python where we return a PythonString which must own the
underlying string.
Jason Molenda [Wed, 8 Jan 2020 00:12:49 +0000 (16:12 -0800)]
Rewrite comment about what watchpoints Aarch64 supports.
Philip Reames [Wed, 8 Jan 2020 00:03:51 +0000 (16:03 -0800)]
[GVN/FP] Considate logic for reasoning about equality vs equivalance for floats
Factor out common logic into some reasonable commented helper functions. In the process, ensure that the in-block vs cross-block cases are handled the same. They previously weren't.
Differential Revision: https://reviews.llvm.org/D67126
Daniel Sanders [Wed, 8 Jan 2020 00:02:06 +0000 (16:02 -0800)]
Fix warnings as errors that occur on sanitizer-x86_64-linux
Fangrui Song [Tue, 7 Jan 2020 22:21:39 +0000 (14:21 -0800)]
[PowerPC] Default ppc64 linux-gnu/freebsd to -fno-PIC
According to D53384, the default was switched from -fno-PIC to -fPIC to
work around a -fsanitize=leak bug on big-endian.
This gratuitous difference between little-endian and big-endian is
undesired, and not acceptable on powerpc64-unknown-freebsd. If
-fsanitize=leak still has the problem, we should consider defaulting to
-fPIC/-fPIE only when -fsanitize=leak is specified (see SanitizerArgs::requiresPIE())
powerpc64-ibm-aix is unaffected: it still defaults to -fPIC.
powerpc64-linux-musl is unaffected (-fPIE since D39588): it still defaults to -fPIE.
Reviewed By: #powerpc, jhibbits
Differential Revision: https://reviews.llvm.org/D72363
Amara Emerson [Tue, 7 Jan 2020 18:52:26 +0000 (10:52 -0800)]
[AArch64][GlobalISel] Fold a chain of two G_PTR_ADDs of constant offsets.
E.g.
%addr1 = G_PTR_ADD %base, G_CONSTANT 20
%addr2 = G_PTR_ADD %addr1, G_CONSTANT 8
-->
%addr2 = G_PTR_ADD %base, G_CONSTANT 28
Differential Revision: https://reviews.llvm.org/D72351
Craig Topper [Tue, 7 Jan 2020 21:50:59 +0000 (13:50 -0800)]
[X86] Add SSE4.1 command lines to vec-strict-inttofp-128.ll to cover the v2i64->v2f32 strict_uitofp codegen. NFC
Bill Wendling [Tue, 7 Jan 2020 21:43:04 +0000 (13:43 -0800)]
Revert "Allow output constraints on "asm goto""
This reverts commit
52366088a8e42c2f1e96e8430b84b8b65ec3f7bc.
I accidentally pushed this before supporting changes.
Jonas Devlieghere [Tue, 7 Jan 2020 21:23:52 +0000 (13:23 -0800)]
Re-land "[lldb/Lua] Add string conversion operator for SBTarget."
Extend the SBTarget class with a string conversion operator and reuse
the same code between Python and Lua. This should happen for all the SB
classes, but I'm doing just this one as an example and for use in a test
case.
Bill Wendling [Tue, 7 Jan 2020 20:53:44 +0000 (12:53 -0800)]
Allow output constraints on "asm goto"
Summary:
Remove the restrictions that preventing "asm goto" from returning non-void
values. The values returned by "asm goto" are only valid on the "fallthrough"
path.
Reviewers: jyknight, nickdesaulniers, hfinkel
Reviewed By: jyknight, nickdesaulniers
Subscribers: rsmith, hiraditya, llvm-commits, cfe-commits, craig.topper, rnk
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D69876
Matt Arsenault [Tue, 7 Jan 2020 21:24:42 +0000 (16:24 -0500)]
AMDGPU/GlobalISel: Fix scalar G_SELECT for arbitrary pointers
4e85ca9562a588eba491e44bcbf73cb2f419780f missed updating the legal
condition type set for pointers with any unrecognized address space.
Matt Arsenault [Tue, 7 Jan 2020 21:04:43 +0000 (16:04 -0500)]
AMDGPU/GlobalISel: Add some missing G_SELECT testcases
Matt Arsenault [Tue, 7 Jan 2020 20:31:03 +0000 (15:31 -0500)]
AMDGPU/GlobalISel: Fix missing test for s16 icmp
Matt Arsenault [Tue, 7 Jan 2020 18:32:03 +0000 (13:32 -0500)]
AMDGPU: Apply i16 add->sub pattern with zext to i32
This was only applying the deeper nested zext pattern, and missing the
special case code size fold.
Mitchell Balan [Tue, 7 Jan 2020 18:49:55 +0000 (13:49 -0500)]
[clang-tidy] modernize-use-using uses AST and now supports struct defintions and multiple types in a typedef
Summary:
It now handles `typedef`s that include comma-separated multiple types, and handles embedded struct definitions, which previously could not be automatically converted.
For example, with this patch `modernize-use-using` now can convert:
typedef struct { int a; } R_t, *R_p;
to:
using R_t = struct { int a; };
using R_p = R_t*;
`-ast-dump` showed that the `CXXRecordDecl` definitions and multiple `TypedefDecl`s come consecutively in the tree, so `check()` stores information between calls to determine when it is receiving a second or additional `TypedefDecl` within a single `typedef`, or when the current `TypedefDecl` refers to an embedded `CXXRecordDecl` like a `struct`.
Reviewers: alexfh, aaron.ballman
Patch by: poelmanc
Subscribers: riccibruno, sammccall, cfe-commits, aaron.ballman
Tags: clang-tools-extra, clang
Differential Revision: https://reviews.llvm.org/D70270
Eric Fiselier [Tue, 7 Jan 2020 21:31:06 +0000 (16:31 -0500)]
[libc++] Add additional benchmark functions to libcxx/benchmarks/string.bench
This change adds the following benchmarks:
- StringAssignStr
Assign a const basic::string& value
- StringAssignAsciiz
Assign a const char* asciiz value
StringAssignAsciizMix
Assign mixed long/short const char* asciiz values
- StringResizeDefaultInit
Resize default init benchmark
Patch by Martijn Vels (mvels@google.com)
Reviewed as D72343
Craig Topper [Tue, 7 Jan 2020 21:25:29 +0000 (13:25 -0800)]
[X86] Enable v2i64->v2f32 uint_to_fp code in ReplaceNodeResults on SSE4.1 target
Now that we generate decent code for (v2i64 (setlt zero, X)) on pre-sse4.2 targets I think we can use this now.
Differential Revision: https://reviews.llvm.org/D72354
Jonas Devlieghere [Tue, 7 Jan 2020 21:21:47 +0000 (13:21 -0800)]
[lldb/Test] Remove old binary created by TestConvenienceVariables
On a dirty build directory the new mkdir fails because the file already
exists and is not a directory.
Jonas Devlieghere [Tue, 7 Jan 2020 21:05:39 +0000 (13:05 -0800)]
[lldb/Test] Make TestConvenienceVariables more strict
This test was passing even when the output of lldb.target was empty.
I've made the test more strict by checking explicitly for the target
name and by using CHECK-NEXT lines.
Daniel Sanders [Sat, 4 Jan 2020 00:51:28 +0000 (16:51 -0800)]
[gicombiner] Correct
64f1bb5cd2c to account for MSVC's %p format
Bill Wendling [Tue, 7 Jan 2020 20:48:17 +0000 (12:48 -0800)]
Remove extraneous semicolon.
Sanjay Patel [Tue, 7 Jan 2020 20:48:21 +0000 (15:48 -0500)]
[x86] add tests for extract-of-concat; NFC
Jonas Devlieghere [Tue, 7 Jan 2020 20:46:01 +0000 (12:46 -0800)]
Revert "[lldb/Lua] Add string conversion operator for SBTarget."
This reverts commit
640d0ba8760051afc002c672121c6989517fc94e.
Christopher Tetreault [Tue, 7 Jan 2020 20:15:07 +0000 (14:15 -0600)]
[cmake] Use source-groups in Polly.
Configure CMake to setup source-groups for Polly. Source groups
describe how source files should be organized in IDEs. By default, all
headers are dumped into one folder under PollyCore and all source files
into another. On disk, these files are organized into folders, but this
isn't reflected in the IDE. This change uses CMake source groups to have
the IDE reflect the on disk layout. This will make it easier to visualize
the project structure for users of Visual Studio and XCode
Patch by Christopher Tetreault <ctetreau@quicinc.com>
Reviewed By: Meinersbur, grosser
Differential Revision: https://reviews.llvm.org/D72117
Matt Arsenault [Tue, 7 Jan 2020 18:18:51 +0000 (13:18 -0500)]
AMDGPU: Add baseline test for missing pattern
The optimization to turn an add into a sub isn't triggering when the
pattern to use the zeroed high bits is used.
Matt Arsenault [Tue, 7 Jan 2020 17:02:11 +0000 (12:02 -0500)]
AMDGPU: Remove VOP3Mods0Clamp0OMod
Now that overridable default operands work, there's no reason to use
complex patterns to just produce 0s.
Matt Arsenault [Tue, 7 Jan 2020 18:12:12 +0000 (13:12 -0500)]
AMDGPU: Fix misleading, misplaced end block comments
Matt Arsenault [Tue, 7 Jan 2020 17:32:08 +0000 (12:32 -0500)]
AMDGPU: Use ImmLeaf
Matt Arsenault [Mon, 30 Sep 2019 17:39:33 +0000 (13:39 -0400)]
AMDGPU: Fix not using v_cvt_f16_[iu]16
We weren't treating i16->f16 casts as legal on targets with these
instructions, and always using a pair of casts through i32.
Jonas Devlieghere [Tue, 7 Jan 2020 19:11:38 +0000 (11:11 -0800)]
[lldb/Lua] Add string conversion operator for SBTarget.
Extend the SBTarget class with a string conversion operator and reuse
the same code between Python and Lua. This should happen for all the SB
classes, but I'm doing just this one as an example and for use in a test
case.
Michael Kruse [Tue, 7 Jan 2020 17:41:14 +0000 (11:41 -0600)]
[cmake] Use relative cmake binary dir for processing pass plugins.
https://reviews.llvm.org/D61446 introduced a new function to process
pass plugins that used CMAKE_BINARY_DIR. This is problematic when LLVM
is a subproject. Instead use LLVM_BINARY_DIR to get the right relative
directory for cmake.
Patch by Alan Baker <alanbaker@google.com>
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D72109
Fangrui Song [Tue, 7 Jan 2020 17:54:10 +0000 (09:54 -0800)]
[PowerPC][Triple] Use elfv2 on freebsd>=13 and linux-musl
Summary:
Every powerpc64le platform uses elfv2.
For powerpc64, the environments "elfv1" and "elfv2" were added for
FreeBSD ELFv1->ELFv2 migration in D61950. FreeBSD developers have
decided to use OS versions to select ABI, and no one is relying on the
environments.
Also use elfv2 on powerpc64-linux-musl.
Users can always use -mabi=elfv1 and -mabi=elfv2 to override the default
ABI.
Reviewed By: adalava
Differential Revision: https://reviews.llvm.org/D72352
Fangrui Song [Tue, 7 Jan 2020 18:41:13 +0000 (10:41 -0800)]
[test] Move ppc64 tests from test/Preprocessor/init.c to init-ppc64.c
Alexey Bataev [Tue, 7 Jan 2020 19:11:45 +0000 (14:11 -0500)]
[OPENMP]Reduce calls for the mangled names.
Use canonical decls instead of mangled names in the set of already
emitted decls. This allows to reduce the number of function calls for
getting declarations mangled names and speedup the compilation.
Jessica Paquette [Tue, 7 Jan 2020 19:12:32 +0000 (11:12 -0800)]
[MachineOutliner][AArch64] Save + restore LR in noreturn functions
Conservatively always save + restore LR in noreturn functions.
These functions do not end in a RET, and so they aren't guaranteed to have an
instruction which uses LR in any way. So, as a result, you can end up in
unfortunate situations where you can't backtrace out of these functions in a
debugger.
Remove the old noreturn test, and add a new one which is more descriptive.
Remove the restriction that we can't outline from noreturn functions as well
since we now do the right thing.
Craig Topper [Tue, 7 Jan 2020 19:09:33 +0000 (11:09 -0800)]
[X86] Improve lowering of (v2i64 (setgt X, -1)) on pre-SSE2 targets. Enable v2i64 in foldVectorXorShiftIntoCmp.
Similar to D72302 but for the canonical form for the opposite case. I've changed foldVectorXorShiftIntoCmp to form a target independent setcc node instead of PCMPGT now and enabled its for v2i64 on pre-SSE4.2 targets. The setcc should eventually get lowered to PCMPGT or the new v2i64 sequence.
Differential Revision: https://reviews.llvm.org/D72318
Craig Topper [Tue, 7 Jan 2020 19:08:45 +0000 (11:08 -0800)]
[X86] Improve lowering of v2i64 sign bit tests on pre-sse4.2 targets
Without sse4.2 a v2i64 setlt needs to expand into a pcmpgtd, pcmpeqd, 3 shuffles, and 2 logic ops. But if we're only interested in the sign bit of the i64 elements, we can just use one pcmpgtd and shuffle the odd elements to the even elements.
Differential Revision: https://reviews.llvm.org/D72302
LLVM GN Syncbot [Tue, 7 Jan 2020 19:13:41 +0000 (19:13 +0000)]
[gn build] Port
1d94fb21118
Daniel Sanders [Tue, 7 Jan 2020 18:27:53 +0000 (10:27 -0800)]
[gicombiner] Add GIMatchTree and use it for the code generation
Summary:
GIMatchTree's job is to build a decision tree by zipping all the
GIMatchDag's together.
Each DAG is added to the tree builder as a leaf and partitioners are used
to subdivide each node until there are no more partitioners to apply. At
this point, the code generator is responsible for testing any untested
predicates and following any unvisited traversals (there shouldn't be any
of the latter as the getVRegDef partitioner handles them all).
Note that the leaves don't always fit into partitions cleanly and the
partitions may overlap as a result. This is resolved by cloning the leaf
into every partition it belongs to. One example of this is a rule that can
match one of N opcodes. The leaf for this rule would end up in N partitions
when processed by the opcode partitioner. A similar example is the
getVRegDef partitioner where having rules (add $a, $b), and (add ($a, $b), $c)
will result in the former being in the partition for successfully
following the vreg-def and failing to do so as it doesn't care which
happens.
Depends on D69151
Fixed the issues with the windows bots which were caused by stdout/stderr
interleaving.
Reviewers: bogner, volkan
Reviewed By: volkan
Subscribers: lkail, mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69152
Alexandre Ganea [Tue, 7 Jan 2020 18:58:17 +0000 (13:58 -0500)]
Fix issues reported by -Wrange-loop-analysis when building with latest Clang (trunk). NFC.
Fixes warning: loop variable 'E' of type 'const llvm::StringRef' creates a copy from type 'const llvm::StringRef' [-Wrange-loop-analysis]
Alexey Bataev [Tue, 7 Jan 2020 18:39:18 +0000 (13:39 -0500)]
[OPENMP]Allow using of members in standalone declaration pragmas.
If standalone OpenMP declaration pragma, like declare mapper or declare
reduction, is declared in the class context, it may reference a member
(data or function) in its internal expressions/statements. So, the
parsing of such pragmas must be dalayed just like the parsing of the
member initializers/definitions before the completion of the class
declaration.
Nathan Ridge [Mon, 16 Dec 2019 01:42:25 +0000 (20:42 -0500)]
[clangd] Heuristically resolve dependent call through smart pointer type
Summary: Fixes https://github.com/clangd/clangd/issues/227
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71644
Nathan Ridge [Thu, 2 Jan 2020 06:08:05 +0000 (01:08 -0500)]
[clangd] Assert that the testcases in LocateSymbol.All have no diagnostics
Summary: Also fix some bugs in the testcases which this exposed.
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72066
Pavel Labath [Tue, 7 Jan 2020 17:01:59 +0000 (18:01 +0100)]
[lldb] Initialize some bitfields in FuncUnwinders.cpp
This got flagged by msan.
Simon Pilgrim [Tue, 7 Jan 2020 16:50:55 +0000 (16:50 +0000)]
[ARM] Regenerate bfi.ll test cases
Simon Pilgrim [Tue, 7 Jan 2020 15:52:15 +0000 (15:52 +0000)]
[X86] Pull out repeated SrcVT.getVectorNumElements() call. NFCI.
Gabor Horvath [Tue, 7 Jan 2020 16:37:49 +0000 (08:37 -0800)]
[analyzer] Update help text to reflect sarif support
Differential Revision: https://reviews.llvm.org/D72289
Gabor Horvath [Thu, 2 Jan 2020 19:57:42 +0000 (11:57 -0800)]
[LifetimeAnalysis] Do not forbid void deref type in gsl::Pointer/gsl::Owner annotations
It turns out it is useful to be able to define the deref type as void.
In case we have a type erased owner, we want to express that the pointee
can be basically any type. It should not be unnatural to have a void
deref type as we already familiar with "pointers to void".
Differential Revision: https://reviews.llvm.org/D72097
diggerlin [Tue, 7 Jan 2020 16:20:51 +0000 (11:20 -0500)]
[AIX][XCOFF]Implement mergeable const
SUMMARY:
In this patch, we map mergeable const objects to the read-only section in the same manner as const objects that are not mergeable.
Reviewers: hubert.reinterpretcast,jasonliu
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D71551
Yaxun (Sam) Liu [Mon, 9 Dec 2019 19:55:34 +0000 (14:55 -0500)]
[HIP] Add option --gpu-max-threads-per-block=n
Add this option to change the default launch bounds.
Differential Revision: https://reviews.llvm.org/D71221
Sjoerd Meijer [Tue, 7 Jan 2020 15:57:19 +0000 (15:57 +0000)]
[ARM][MVE] Renamed VPT Block tests and files to something more informative. NFC
Matt Arsenault [Tue, 7 Jan 2020 16:01:16 +0000 (11:01 -0500)]
AMDGPU/GlobalISel: Fix readfirstlane pattern import
The imm folding optimization pattern failed to import. The instruction
pattern was already working, but failing to fail on SGPR inputs.
Med Ismail Bennani [Tue, 7 Jan 2020 15:43:56 +0000 (16:43 +0100)]
Remove extraneous spaces
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Sanjay Patel [Tue, 7 Jan 2020 15:41:17 +0000 (10:41 -0500)]
[InstCombine] try to pull 'not' of select into compare operands
not (select ?, (cmp TPred, ?, ?), (cmp FPred, ?, ?) -->
select ?, (cmp TPred', ?, ?), (cmp FPred', ?, ?)
If both sides of the select are cmps, we can remove an instruction.
The case where only side is a cmp is deferred to a possible
follow-on patch.
We have a more general 'isFreeToInvert' analysis, but I'm not seeing
a way to use that more widely without inducing infinite looping
(opposing transforms).
Here, we flip the compare predicates directly, so we should not have
any danger by creating extra intermediate 'not' ops.
Alive proofs:
https://rise4fun.com/Alive/jKa
Name: both select values are compares - invert predicates
%tcmp = icmp sle i32 %x, %y
%fcmp = icmp ugt i32 %z, %w
%sel = select i1 %cond, i1 %tcmp, i1 %fcmp
%not = xor i1 %sel, true
=>
%tcmp_not = icmp sgt i32 %x, %y
%fcmp_not = icmp ule i32 %z, %w
%not = select i1 %cond, i1 %tcmp_not, i1 %fcmp_not
Name: false val is compare - invert/not
%fcmp = icmp ugt i32 %z, %w
%sel = select i1 %cond, i1 %tcmp, i1 %fcmp
%not = xor i1 %sel, true
=>
%tcmp_not = xor i1 %tcmp, -1
%fcmp_not = icmp ule i32 %z, %w
%not = select i1 %cond, i1 %tcmp_not, i1 %fcmp_not
Differential Revision: https://reviews.llvm.org/D72007
Matt Arsenault [Tue, 7 Jan 2020 15:22:06 +0000 (10:22 -0500)]
AMDGPU/GlobalISel: Fix import of s_abs_i32 pattern
Matt Arsenault [Mon, 16 Sep 2019 04:53:31 +0000 (00:53 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.wqm.vote
Tim Northover [Tue, 7 Jan 2020 10:03:31 +0000 (10:03 +0000)]
OpaquePtr: print byval types containing anonymous types correctly.
Attribute::getAsString doesn't have enough information to print anonymous
Module-level types correctly, so they come back as "%type 0xabcd". This results
in broken IR when printing as text.
Instead, print type-attributes (currently just byval) using the TypePrinting
infrastructure available in AsmWriter. This only applies to function argument
attributes.
Matt Arsenault [Mon, 9 Dec 2019 11:37:14 +0000 (17:07 +0530)]
llc: Change behavior of -mcpu with existing attribute
Don't overwrite existing target-cpu attributes.
I've often found the replacement behavior annoying, and this is
inconsistent with how the fast math command line flags interact with
the function attributes.
Does not yet change target-features, since I think that should behave
as a concatenation.
Matt Arsenault [Sun, 15 Sep 2019 16:50:17 +0000 (12:50 -0400)]
AMDGPU/GlobalISel: Partially fix llvm.amdgcn.kill pattern import
Tests deferred since the existing DAG test depends on some other
operations, but isn't far from working as-is.
Hans Wennborg [Tue, 7 Jan 2020 15:06:14 +0000 (16:06 +0100)]
[docs] NFC: Fix typos in documents
"the the" -> "the"
"an" -> "a"
Patch by Kazuaki Ishizaki <ishizaki@jp.ibm.com>!
Differential revision: https://reviews.llvm.org/D72091