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
Nicolas Vasilache [Tue, 31 Dec 2019 14:28:18 +0000 (09:28 -0500)]
[mlir][Linalg] Extend generic ops to allow tensors
Summary:
This diff adds support to allow `linalg.generic` and
`linalg.indexed_generic` to take tensor input and output
arguments.
The subset of output tensor operand types must appear
verbatim in the result types after an arrow. The parser,
printer and verifier are extended to accomodate this
behavior.
The Linalg operations now support variadic ranked tensor
return values. This extension exhibited issues with the
current handling of NativeCall in RewriterGen.cpp. As a
consequence, an explicit cast to `SmallVector<Value, 4>`
is added in the proper place to support the new behavior
(better suggestions are welcome).
Relevant cleanups and name uniformization are applied.
Relevant invalid and roundtrip test are added.
Reviewers: mehdi_amini, rriddle, jpienaar, antiagainst, ftynse
Subscribers: burmako, shauheen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72022
Nico Weber [Thu, 2 Jan 2020 18:44:54 +0000 (13:44 -0500)]
Make mangled_names.test and update_cc_test_checks.py work with Python 2.
Differential Revision: https://reviews.llvm.org/D71565
Kazuaki Ishizaki [Thu, 2 Jan 2020 18:41:43 +0000 (13:41 -0500)]
Fix trivial typos in comments; NFC
Nathan James [Thu, 2 Jan 2020 18:37:41 +0000 (13:37 -0500)]
Handle init statements in readability-else-after-return
Adds a new ASTMatcher condition called 'hasInitStatement()' that matches if,
switch and range-for statements with an initializer. Reworked clang-tidy
readability-else-after-return to handle variables in the if condition or init
statements in c++17 ifs. Also checks if removing the else would affect object
lifetimes in the else branch.
Fixes PR44364.
Lei Zhang [Thu, 2 Jan 2020 18:19:19 +0000 (13:19 -0500)]
[mlir][spirv] Allow specifying availability on enum attribute cases
Lots of SPIR-V ops take enum attributes and certain enum cases
need extra capabilities or extensions to be available. This commit
extends to allow specifying availability spec on enum cases.
Extra utility functions are generated for the corresponding enum
classes to return the availability requirement. The availability
interface implemention for a SPIR-V op now goes over all enum
attributes to collect the availability requirements.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D71947
Sterling Augustine [Mon, 30 Dec 2019 16:20:24 +0000 (08:20 -0800)]
Check for aarch64 when not using .init_arrays
Reviewers: vvereschaka
Subscribers: kristof.beyls, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D72005
River Riddle [Thu, 2 Jan 2020 17:58:16 +0000 (09:58 -0800)]
Fix some corner cases missed by D71955
* replaceAllUsesWith may be supplied with a null value.
* some compilers fail to implicitly convert single result operations to
OpaqueValue, so add an explicit OpOperand::set(Value) method.
James Henderson [Fri, 20 Dec 2019 14:30:31 +0000 (14:30 +0000)]
[DebugInfo][NFC] Use function_ref consistently in debug line parsing
This patch fixes an inconsistency where we were using std::function in
some places and function_ref in others to pass around the error handling
callback.
Reviewed by: MaskRay
Differential Revision: https://reviews.llvm.org/D71762
Alex Richardson [Thu, 2 Jan 2020 17:21:57 +0000 (17:21 +0000)]
[llvm-ranlib] Update expected error message check for Windows
On Windows hosts, the error message will be something like
`c:\src\llvm-project\out\gn\bin\llvm-ranlib.exe: error: Invalid option: '--D'`.
Due to the .exe after llvm-ranlib the existing CHECK lines do not match.
Fix this by ignoring the program name and starting the check line at "error:".
Fangrui Song [Mon, 30 Dec 2019 05:53:34 +0000 (21:53 -0800)]
[SelectionDAG] Simplify SelectionDAGBuilder::visitInlineAsm
Alina Sbirlea [Thu, 2 Jan 2020 12:17:27 +0000 (04:17 -0800)]
[NewPassManager] Rename AM to OuterAM in the OuterAnalysisManagerProxy [NFCI].
Provides clarity and consistency with the InnerAnalysisManagerProxy.
Nico Weber [Thu, 2 Jan 2020 17:22:04 +0000 (12:22 -0500)]
[gn build] (manually) merge
24ab9b537e61b3 yet more, to fix redef warnings
Sid Manning [Thu, 2 Jan 2020 16:27:05 +0000 (10:27 -0600)]
Add TPREL relocation support to Hexagon
Differential Revision: https://reviews.llvm.org/D71069
James Y Knight [Sat, 21 Dec 2019 22:18:38 +0000 (17:18 -0500)]
update_test_checks: match CHECK-EMPTY lines for replacement.
In
a8a89c77ea3c16b45763fca6940bbfd3bef7884f, the script started adding
CHECK-EMPTY lines, but the regex for which lines to replace was not
updated.
James Henderson [Fri, 20 Dec 2019 13:51:18 +0000 (13:51 +0000)]
[test][ELF] Verify debug line corruption messages are printed once
LLD warns if it encounters malformed debug data when parsing line
information for an undefined reference. We only want to warn once.
This patch adds additional checking to make sure the warnings are
printed only once, both for variables within the same program and
variables in later line programs.
Reviewed by: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D71759
Kevin P. Neal [Mon, 23 Dec 2019 19:05:06 +0000 (14:05 -0500)]
[SystemZ] Use FNeg in s390x clang builtins
The s390x builtins are still using FSub instead of FNeg. Correct that.
Nico Weber [Thu, 2 Jan 2020 17:11:59 +0000 (12:11 -0500)]
fix doc grammar-o to cycle bots
James Henderson [Fri, 20 Dec 2019 12:32:43 +0000 (12:32 +0000)]
[test][llvm-dwarfdump][NFC] Remove unused check
Reviewed by: JDevlieghere
Differential Revision: https://reviews.llvm.org/D71756
Sam McCall [Thu, 2 Jan 2020 16:59:10 +0000 (17:59 +0100)]
[clangd] Reorder FindTarget.h - group targetDecl() stuff and findExplicitReferences(). NFC
James Henderson [Fri, 20 Dec 2019 11:30:37 +0000 (11:30 +0000)]
[test][llvm-dwarfdump][NFC] Improve test readability
This patch adds and improves comments in the debug_line_invalid.test and
its associated input file so that it is easier to follow. It uses '##'
to make comments stand out from lit and FileCheck commands.
It also reflows some commands so that the lines are not so long and are
easier to read and fixes some copy/paste errors.
Reviewed by: JDevlieghere
Differential Revision: https://reviews.llvm.org/D71752
Nico Weber [Thu, 2 Jan 2020 16:44:07 +0000 (11:44 -0500)]
[gn build] (manually) merge
24ab9b537e61b3 more
serge-sans-paille [Thu, 2 Jan 2020 16:16:48 +0000 (17:16 +0100)]
Add intrinsics_gen *dependency* on Bye example
serge-sans-paille [Thu, 2 Jan 2020 16:05:59 +0000 (17:05 +0100)]
Add intrinsics_gen dependency on Bye example
This fixes build error introduced by commit
24ab9b537e61b3fe5e6a1019492ff6530d82a3ee
Nico Weber [Thu, 2 Jan 2020 16:07:31 +0000 (11:07 -0500)]
Revert "[gn build] (manually) merge
68a235d07f9e70"
This reverts commit
6ff6d32ebfec3150aa462cd31042b5719edb84da,
because
68a235d07f9e70 was reverted in
e406cca5f9.
Nico Weber [Thu, 2 Jan 2020 16:06:09 +0000 (11:06 -0500)]
[gn build] (manually) merge
24ab9b537e61b3
James Henderson [Thu, 2 Jan 2020 15:35:22 +0000 (15:35 +0000)]
Revert "build: reduce CMake handling for zlib"
This reverts commit
68a235d07f9e7049c7eb0c8091f37e385327ac28.
This commit broke the clang-x64-windows-msvc build bot and a follow-up
commit did not fix it. Reverting to fix the bot.
James Henderson [Thu, 2 Jan 2020 15:34:40 +0000 (15:34 +0000)]
Revert "build: make `LLVM_ENABLE_ZLIB` a tri-bool for users"
This reverts commit
e6c7ed6d2164a0659fd9f6ee44f1375d301e3cad.
This commit was an attempt to fix the build bots, but it still left the
clang-x64-windows-msvc bot in a broken state.
Ulrich Weigand [Thu, 2 Jan 2020 15:54:49 +0000 (16:54 +0100)]
[FPEnv] Default NoFPExcept SDNodeFlag to false
The NoFPExcept bit in SDNodeFlags currently defaults to true, unlike all
other such flags. This is a problem, because it implies that all code that
transforms SDNodes without copying flags can introduce a correctness bug,
not just a missed optimization.
This patch changes the default to false. This makes it necessary to move
setting the (No)FPExcept flag for constrained intrinsics from the
visitConstrainedIntrinsic routine to the generic visit routine at the
place where the other flags are set, or else the intersectFlagsWith
call would erase the NoFPExcept flag again.
In order to avoid making non-strict FP code worse, whenever
SelectionDAGISel::SelectCodeCommon matches on a set of orignal nodes
none of which can raise FP exceptions, it will preserve this property
on all results nodes generated, by setting the NoFPExcept flag on
those result nodes that would otherwise be considered as raising
an FP exception.
To check whether or not an SD node should be considered as raising
an FP exception, the following logic applies:
- For machine nodes, check the mayRaiseFPException property of
the underlying MI instruction
- For regular nodes, check isStrictFPOpcode
- For target nodes, check a newly introduced isTargetStrictFPOpcode
The latter is implemented by reserving a range of target opcodes,
similarly to how memory opcodes are identified. (Note that there a
bit of a quirk in identifying target nodes that are both memory nodes
and strict FP nodes. To simplify the logic, right now all target memory
nodes are automatically also considered strict FP nodes -- this could
be fixed by adding one more range.)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D71841
serge_sans_paille [Sat, 8 Jun 2019 15:37:47 +0000 (17:37 +0200)]
Generalize the pass registration mechanism used by Polly to any third-party tool
There's quite a lot of references to Polly in the LLVM CMake codebase. However
the registration pattern used by Polly could be useful to other external
projects: thanks to that mechanism it would be possible to develop LLVM
extension without touching the LLVM code base.
This patch has two effects:
1. Remove all code specific to Polly in the llvm/clang codebase, replaicing it
with a generic mechanism
2. Provide a generic mechanism to register compiler extensions.
A compiler extension is similar to a pass plugin, with the notable difference
that the compiler extension can be configured to be built dynamically (like
plugins) or statically (like regular passes).
As a result, people willing to add extra passes to clang/opt can do it using a
separate code repo, but still have their pass be linked in clang/opt as built-in
passes.
Differential Revision: https://reviews.llvm.org/D61446
Sam McCall [Mon, 16 Dec 2019 18:08:51 +0000 (19:08 +0100)]
Revert "Revert "[clangd] Implement "textDocument/documentLink" protocol support""
This reverts commit
079ef783dd5530b5f87beefe624b9179547ded7e.
The revert describes a test failure without details, after offline
discussion this in in a private/unsupported build system and doesn't
seem to reflect a real upstream bug.
Nicolas Vasilache [Thu, 2 Jan 2020 15:06:46 +0000 (10:06 -0500)]
[mlir][Linalg] NFC - Make consistent use of op.emitOpError
Summary: This is part of an ongoing cleanup and uniformization work.
Reviewers: ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72084
Nicolas Vasilache [Thu, 2 Jan 2020 14:54:47 +0000 (09:54 -0500)]
[mlir][Linalg] NFC - Cleanup Linalg Declarative Transformations
Summary:
This is part of an ongoing cleanup and uniformization work.
This diff performs 3 types of cleanups:
1. Uniformize transformation names.
2. Replace all pattern operands that need not be captured by `$_`
3. Replace all usage of pattern captured op by the normalized `op` name (instead of positional parameters such as `$0`)
Reviewers: ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72081
Alexey Bataev [Thu, 2 Jan 2020 14:26:32 +0000 (09:26 -0500)]
[OpenMP] Fix formatting of OpenMP error message, by Wang Tianqing.
Summary: `getListOfPossibleValues()` formatted incorrectly when there is only one value, emitting something like `expected 'conditional' or in OpenMP clause 'lastprivate'`.
Reviewers: jdoerfert, ABataev
Reviewed By: jdoerfert
Subscribers: guansong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71884
Alex Richardson [Thu, 2 Jan 2020 14:53:33 +0000 (14:53 +0000)]
[llvm-ranlib] Relax D-flag.test to allow it to pass on Windows hosts
It appears that Windows hosts always report rwxrwxrwx even with the
chmod 644 invocation. As this test only cares about the timestamps
and not the permissions, use a regex wildcard instead.
Sanjay Patel [Thu, 2 Jan 2020 14:33:50 +0000 (09:33 -0500)]
[InstCombine] remove uses before deleting instructions (PR43723)
This is a less ambitious alternative to previous attempts to fix
this bug with:
rG56b2aee1875a
rGef02831f0a4e
rG56b2aee1875a
...because those all failed bot testing with use-after-free or
other problems.
The original crashing/assert problem is still showing up on
various fuzzers, so I've added a new minimal test based on
another one of those failures.
Instead of trying to manage and coordinate the logic in
isAllocSiteRemovable() with the deletion loops, just loosen
the existing code that handles casts and GEP by replacing
with undef to allow other opcodes. That means that no
instructions with uses should assert on deletion, and there
are hopefully no non-obvious sanitizer bugs induced.
Nicolas Vasilache [Thu, 2 Jan 2020 14:22:44 +0000 (09:22 -0500)]
[mlir][Linalg] NFC - Rename ViewTraits -> StructuredOpTraits
Summary: This is part of an ongoing cleanup and uniformization work.
Reviewers: ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72079
Nicolas Vasilache [Thu, 2 Jan 2020 14:14:23 +0000 (09:14 -0500)]
[mlir][Linalg] NFC - Rename LinalgGeneric -> GenericLinalg
Summary: This is part of an ongoing cleanup and uniformization work.
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72078
Jay Foad [Thu, 2 Jan 2020 14:14:27 +0000 (14:14 +0000)]
Remove unneeded extra variable realArgIdx. NFC.
Dmitri Gribenko [Thu, 2 Jan 2020 14:18:35 +0000 (15:18 +0100)]
Make the llvm-ranlib/help-message.test test pass in unusual configurations
The version string can be customized by CMake options, so the 'LLVM
version' substring is not guaranteed to appear (see
VersionPrinter::print in llvm/lib/Support/CommandLine.cpp).
David Green [Thu, 2 Jan 2020 11:43:37 +0000 (11:43 +0000)]
[ARM] Update ifcvt test target triples and opcodes. NFC
Some of the instructions in these tests were technically invalid
combinations (using ARM opcodes in Thumb mode, for example). Update the
targets and the instructions used to be more correct.
Raphael Isemann [Thu, 2 Jan 2020 13:46:39 +0000 (14:46 +0100)]
[lldb] Fix crash in AccessDeclContextSanity when copying FunctionTemplateDecl inside a record.
Summary:
We currently don't set access specifiers for function template declarations. This seems to be fine
as long as the function template is not declared inside any record in which case Clang asserts
with the following once we try to query it's access:
```
Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function AccessDeclContextSanity,
```
This patch just marks these function template declarations as public to make Clang happy.
Reviewers: shafik, teemperor
Reviewed By: teemperor
Subscribers: JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71909
Alex Richardson [Thu, 2 Jan 2020 13:27:32 +0000 (14:27 +0100)]
Fix D-flag.test by running chmod before creating the archive
Not all systems create the .o file with mode 644 by default.
Adding an explicit chmod invocation should fix this test added in
535b3c6b2f1c81ed91942ebd9ea06a1022dc59a1
Qiu Chaofan [Thu, 2 Jan 2020 13:15:20 +0000 (21:15 +0800)]
[NFC] Add explicit instantiation to releaseNode
Resolve a build failure about undefined symbols introduced by f9f78cf.
Differential Revision: https://reviews.llvm.org/D72069
Andrzej Warzynski [Thu, 19 Dec 2019 20:37:57 +0000 (20:37 +0000)]
[AArch64][SVE] Gather loads: pass 32 bit unpacked offsets as nxv2i32
Summary:
Currently 32 bit unpacked offsets are passed as nxv2i64. However, as
pointed out in https://reviews.llvm.org/D71074, using nxv2i32 instead
would improve consistency with:
* how other arguments are treated
* how scatter stores are implemented
This patch makes sure that 32 bit unpacked offsets are passes as nxv2i32
instead of nxv2i64.
Reviewers: sdesmalen, efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71724
Alex Richardson [Thu, 2 Jan 2020 12:44:02 +0000 (13:44 +0100)]
[llvm-ranlib] Handle -D and -U command line flag
I have been trying to build CheriBSD (a fork for FreeBSD for the CHERI
CPU) with LLVM binutils instead of the default elftoolchain utilities.
I noticed that building static archives was failing because ranlib is
invoked with the -D flag. This failed with llvm-ranlib since it parses
the -D flag as the archive path and reports an error that more than one
archive has been passed.
This fixes https://llvm.org/PR41707
Reviewed By: rupprecht
Differential Revision: https://reviews.llvm.org/D71554
Alexander Lanin [Thu, 2 Jan 2020 11:28:53 +0000 (19:28 +0800)]
[docs] Update path to clang-tools-extra
Summary:
> tools/clang/tools/extra
has become
>clang-tools-extra
which was not updated in all docs.
Reviewers: alexfh, aaron.ballman, ilya-biryukov, juliehockett
Reviewed By: aaron.ballman
Subscribers: Jim, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D71982
Raphael Isemann [Thu, 2 Jan 2020 10:57:00 +0000 (11:57 +0100)]
[lldb][NFC] Remove unused variable in DWARFASTParserClang::ParseSingleMember
Raphael Isemann [Mon, 30 Dec 2019 20:20:01 +0000 (21:20 +0100)]
[lldb][NFC] Create type-safe function for creating a CompilerType from a QualType
LLDB frequently converts QualType to CompilerType. This is currently done like this:
result = CompilerType(this, qual_type_var.getAsOpaquePtr())
There are a few shortcomings in this current approach:
1. CompilerType's constructor takes a void* pointer so it isn't type safe.
2. We can't add any sanity checks to the CompilerType constructor (e.g. that the type
actually belongs to the passed ClangASTContext) without expanding the TypeSystem API.
3. The logic for converting QualType->CompilerType is spread out over all of LLDB so
changing it is difficult (e.g., what if we want to just pass the type ptr and not the
1type_ptr | qual_flags1 to CompilerType).
This patch adds a `ClangASTContext::GetType` function similar to the other GetTypeForDecl
functions that does this conversion in a type safe way.
It also adds a sanity check for Tag-based types that the type actually belongs to the
current ClangASTContext (Types don't seem to know their ASTContext, so we have to
workaround by looking at the decl for the underlying TagDecl. This doesn't cover all types
we construct but it's better than no sanity check).
Shengchen Kan [Thu, 2 Jan 2020 06:24:13 +0000 (14:24 +0800)]
[NFC] Make the type of X86AlignBranchBoundary compatible
Change the type of X86AlignBranchBoundary from cl::opt<uint64_t> to
cl::opt<unsigned> since the template class cl::opt is only instantiated with
type unsigned, int, std::string, char and bool.
Fangrui Song [Thu, 2 Jan 2020 06:14:33 +0000 (22:14 -0800)]
[XRay][test] Fix xray-empty-firstmbb.mir and delete incorrect xray-empty-function.mir
xray-empty-firstmbb.mir does not test the intended code path. Change
xray-instruction-threshold to 0 to exercise the code path.
Delete xray-empty-function.mir . Empty MachineFunction does not work.
Various passes (e.g. MachineDominatorTree) assume the presence of an
entry block.
Lei Zhang [Thu, 2 Jan 2020 03:42:39 +0000 (22:42 -0500)]
[mlir][spirv] NFC: Move shader ABI attributes to a new file
This allows us to include the definitions of these attributes in
other files without pulling in all dependencies for lowering.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D72054
Lei Zhang [Thu, 2 Jan 2020 03:39:28 +0000 (22:39 -0500)]
[mlir][spirv] Fix links in docs and update dialect docs
Summary:
This commit fixes links to code directories and uses doc links on
mlir.llvm.org where possible. The docs in TableGen dialect definition
is also updated to reflect recent developments.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D72051
Craig Topper [Thu, 2 Jan 2020 03:06:05 +0000 (19:06 -0800)]
[X86] Add x86_regcallcc calling convention to function declaration recently added in a test.
The callsite had the calling convention, but not the function itself.
Nico Weber [Thu, 2 Jan 2020 03:06:31 +0000 (22:06 -0500)]
[gn build] (manually) merge
68a235d07f9e70
Brian Gesiak [Thu, 2 Jan 2020 01:24:14 +0000 (20:24 -0500)]
[Coroutines] const-ify internal helpers (NFC)
Several helpers internal to llvm/Transforms/Coroutines do not use
'const' for parameters that are not modified. Add const where possible.
Craig Topper [Thu, 2 Jan 2020 02:14:13 +0000 (18:14 -0800)]
[X86] Add test cases for regcall function that takes a long double as a parameter, but does not return a long double.
I believe we are incorrectly doing some FP stack manipulations
after the call.
Craig Topper [Thu, 2 Jan 2020 01:30:05 +0000 (17:30 -0800)]
[RegisterClassInfo] Use SmallVector::assign instead of resize to make sure we erase previous contents from all entries of the vector.
resize only writes to elements that get added. Any elements that
already existed maintain their previous value. In this case we're
trying to erase cached information so we should use assign which
will write to every element.
Found while trying to add new tests to an existing X86 test and
noticed register allocation changing in other functions.
Brian Gesiak [Thu, 2 Jan 2020 01:07:34 +0000 (20:07 -0500)]
[Coroutines] Rename "legacy" passes (NFC)
A series of patches beginning with https://reviews.llvm.org/D71898
propose to add an implementation of the coroutine passes to the new pass
manager. As part of these changes, the coroutine passes that implement
the legacy pass manager interface are renamed, to `<PassName>Legacy`.
This mirrors similar changes that have been made to many other passes in
LLVM as they've been transitioned to support both old and new pass
managers.
This commit splits out the renaming portion of that patch and commits it
in advance as an NFC (no functional change intended) commit. It renames:
* `CoroEarly` => `CoroEarlyLegacy`
* `CoroSplit` => `CoroSplitLegacy`
* `CoroElide` => `CoroElideLegacy`
* `CoroCleanup` => `CoroCleanupLegacy`
Saleem Abdulrasool [Thu, 2 Jan 2020 00:57:00 +0000 (16:57 -0800)]
build: make `LLVM_ENABLE_ZLIB` a tri-bool for users
Treat the flag `LLVM_ENABLE_ZLIB` as a tri-bool, `FORCE_ON` being `ON`,
and `ON` being an auto-detect. This is needed as many of the builders
enable the flag without having zlib available.
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.
Fangrui Song [Wed, 1 Jan 2020 23:55:14 +0000 (15:55 -0800)]
[mlir] Fix -Wrange-loo-analysis warnings
for (const auto &x : llvm::zip(..., ...))
->
for (auto x : llvm::zip(..., ...))
The return type of zip() is a wrapper that wraps a tuple of references.
> warning: loop variable 'p' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<long> &, ArrayRef<long> &>' does not return a reference [-Wrange-loop-analysis]
Fangrui Song [Wed, 1 Jan 2020 23:28:48 +0000 (15:28 -0800)]
[lld] Fix -Wrange-loop-analysis warnings
One instance looks like a false positive:
lld/ELF/Relocations.cpp:1622:14: note: use reference type 'const std::pair<ThunkSection *, uint32_t> &' (aka 'cons
t pair<lld::elf::ThunkSection *, unsigned int> &') to prevent copying
for (const std::pair<ThunkSection *, uint32_t> ts : isd->thunkSections)
It is not changed in this commit.
Alexandre Ganea [Wed, 1 Jan 2020 22:23:06 +0000 (17:23 -0500)]
[polly][Support] Un-break polly tests
Previously, the polly unit tests were stuck in a infinite loop.
There was an edge case in StringRef::count() introduced by
9f6b13e5cce96066d7262d224c971d93c2724795, where an empty 'Str' would cause the function to never exit.
Also fixed usage in polly.
Alexandre Ganea [Wed, 1 Jan 2020 22:05:16 +0000 (17:05 -0500)]
[mlir] Fix compilation warnings
Fixes:
- (MSVC) F:\llvm-project\mlir\lib\Dialect\Linalg\Analysis\DependenceAnalysis.cpp(103): warning C4551: function call missing argument list
- (Clang) tools\mlir\lib\Dialect\SPIRV\SPIRVCanonicalization.inc(232,1): warning: unused function 'populateWithGenerated' [-Wunused-function]
Alexandre Ganea [Tue, 31 Dec 2019 19:04:29 +0000 (14:04 -0500)]
[mlir] Fix linking with LLD
The issue is that /WHOLEARCHIVE is interpreted differently in LLD, which needs the same exact path as the .lib; whereas link.exe can take the library name, withoutout a path or extension, if that was already supplied on the cmd-line. I'll write a follow-up patch to fix the issue in LLD.
Alexandre Ganea [Tue, 31 Dec 2019 19:00:31 +0000 (14:00 -0500)]
[mlir] Fix warnings when compiling with Clang 9.0
Fixes: warning: comparison of integers of different signs: 'const unsigned int' and '(anonymous namespace)::OperationPrinter::(anonymous enum at F:\llvm-project\mlir\lib\IR\AsmPrinter.cpp:1444:3)' [-Wsign-compare]
Saleem Abdulrasool [Wed, 1 Jan 2020 22:19:41 +0000 (14:19 -0800)]
tests: XFAIL/UNSUPPORTED tests on Windows
Now that we are building the python bindings on Windows once more, the
extended testsuite is running. Mark a few failing tests and skip a few
tests which hang. This should at least bring the bot back to green
without reverting the Python changes which are an improvement for the
build system and enable another ~35% of the test suite which was
previously disabled.
Nikita Popov [Wed, 1 Jan 2020 19:09:40 +0000 (20:09 +0100)]
[InstCombine] Preserve inbounds when merging with zero-index GEP (PR44423)
This addresses https://bugs.llvm.org/show_bug.cgi?id=44423.
If one of the GEPs is inbounds and the other is zero-index,
we can also preserve inbounds.
Differential Revision: https://reviews.llvm.org/D72060
Raphael Isemann [Wed, 1 Jan 2020 21:42:25 +0000 (22:42 +0100)]
[lldb][NFC] Simplify CompilerType constructors/destructors and fix unused variable warning
CompilerType has no virtual functions and no statements in its constructors,
so we can simplify this code. This also allows Clang to emit unused variable warnings
for CompilerType, so I also removed one unused variable that otherwise causes -Werror
builds to fail.
Mark de Wever [Wed, 1 Jan 2020 21:19:18 +0000 (22:19 +0100)]
Revert "Adds -Wrange-loop-analysis to -Wall"
The sanitizer-x86_64-linux buildbot failed to build lld with -Werror.
This reverts commit
d8117542ac57f6051674ca70ea14c0e0d7d9b046.
Nikita Popov [Wed, 1 Jan 2020 19:09:40 +0000 (20:09 +0100)]
[InstCombine] Fix incorrect inbounds on GEP of GEP (PR44425)
This fixes https://bugs.llvm.org/show_bug.cgi?id=44425. We need to
drop inbounds if one of the GEPs is not inbounds. This was already
done when creating a new GEP, but not when modifying in place.
Differential Revision: https://reviews.llvm.org/D72059
Lorenzo Casalino [Wed, 1 Jan 2020 19:53:16 +0000 (19:53 +0000)]
[MachineScheduler] improve reuse of 'releaseNode'method
The 'SchedBoundary::releaseNode' is merely invoked for releasing the Top/Bottom root nodes.
However, 'SchedBoundary::releasePending' uses its same logic to check if the Pending queue
has any releasable SUnit.
It is possible to slightly modify the body of the two, allowing re-use of the former ('releaseNode')
in the latter.
Patch by Lorenzo Casalino <lorenzo.casalino93@gmail.com>
Reviewers: MatzeB, fhahn, atrick
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D65506
Nikita Popov [Wed, 1 Jan 2020 19:27:20 +0000 (20:27 +0100)]
[InstCombine] Add tests for PR44423 and PR44425; NFC
Nikita Popov [Wed, 1 Jan 2020 19:25:13 +0000 (20:25 +0100)]
[InstCombine] Regenerate test checks; NFC
Nikita Popov [Wed, 1 Jan 2020 10:15:13 +0000 (11:15 +0100)]
[InstCombine] Add tests for sub nuw of geps; NFC
Tests for PR44419.
Craig Topper [Wed, 1 Jan 2020 18:29:09 +0000 (10:29 -0800)]
[X86] Call SimplifyMultipleUseDemandedBits from combineVSelectToBLENDV if the condition is used by something other than select conditions.
We might be able to bypass some nodes on the condition path.
Differential Revision: https://reviews.llvm.org/D71984
Mark de Wever [Wed, 1 Jan 2020 16:23:18 +0000 (17:23 +0100)]
Adds -Wrange-loop-analysis to -Wall
This makes the range loop warnings part of -Wall.
Fixes PR32823: Warn about accidental coping of data in range based for
Differential Revision: https://reviews.llvm.org/D68912
Mark de Wever [Wed, 1 Jan 2020 16:23:20 +0000 (17:23 +0100)]
Improve Wrange-loop-analyses for rvalue reference
The Wrange-loop-analyses warns if a copy is made. Suppress this warning when
a temporary is bound to a rvalue reference.
While fixing this issue also found a copy-paste error in test6, which is also
fixed.
Differential Revision: https://reviews.llvm.org/D71806
Mark de Wever [Wed, 1 Jan 2020 16:23:19 +0000 (17:23 +0100)]
Adds fixit hints to the -Wrange-loop-analysis
Differential Revision: https://reviews.llvm.org/D68913
Mark de Wever [Wed, 1 Jan 2020 16:23:21 +0000 (17:23 +0100)]
[NFC] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71857
Raphael Isemann [Wed, 1 Jan 2020 17:47:44 +0000 (18:47 +0100)]
[lldb][NFC] Make some checks more readable in Variable::PrivateAutoComplete
David Green [Mon, 30 Dec 2019 13:01:09 +0000 (13:01 +0000)]
[ARM] Add +mve feature to mve tests. NFC
Sylvestre Ledru [Wed, 1 Jan 2020 11:55:59 +0000 (12:55 +0100)]
clang-tidy doc: Remove severities as they don't make consensus
Reviewers: jdoerfert, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: whisperity, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72049
Liu, Chen3 [Tue, 31 Dec 2019 03:38:17 +0000 (11:38 +0800)]
add strict float for round operation
Differential Revision: https://reviews.llvm.org/D72026
Fangrui Song [Wed, 1 Jan 2020 08:15:28 +0000 (00:15 -0800)]
[MC][TargetMachine] Delete MCTargetOptions::MCPIECopyRelocations
clang/lib/CodeGen/CodeGenModule performs the -mpie-copy-relocations
check and sets dso_local on applicable global variables. We don't need
to duplicate the work in TargetMachine shouldAssumeDSOLocal.
Verified that -mpie-copy-relocations can still emit PC relative
relocations for external variable accesses.
clang -target x86_64 -fpie -mpie-copy-relocations -c => R_X86_64_PC32
clang -target aarch64 -fpie -mpie-copy-relocations -c => R_AARCH64_ADR_PREL_PG_HI21+R_AARCH64_LDST64_ABS_LO12_NC
Fangrui Song [Tue, 31 Dec 2019 23:00:59 +0000 (15:00 -0800)]
[ELF][RISCV][test] Test absolute/PC-relative/branch relocations to undefined weak symbols
Hideto Ueno [Wed, 1 Jan 2020 06:25:19 +0000 (15:25 +0900)]
[Attributor] AAValueConstantRange: Value range analysis using constant range
This patch introduces `AAValueConstantRange`, which answers a possible range for integer value in a specific program point.
One of the motivations is propagating existing `range` metadata. (I think we need to change the situation that `range` metadata cannot be put to Argument).
The state is a tuple of `ConstantRange` and it is initialized to (known, assumed) = ([-∞, +∞], empty).
Currently, AAValueConstantRange is created when AAValueSimplify cannot
simplify the value.
Supported
- BinaryOperator(add, sub, ...)
- CmpInst(icmp eq, ...)
- !range metadata
`AAValueConstantRange` is not intended to extend to polyhedral range value analysis.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D71620
Craig Topper [Wed, 1 Jan 2020 05:40:58 +0000 (21:40 -0800)]
[X86] Fix typo in getCMovOpcode.
The 64-bit HasMemoryOperand line was using CMOV32rm instead of
CMOV64rm. Not sure how to test this. We have no test coverage
that passes true for HasMemoryOperand.
Craig Topper [Wed, 1 Jan 2020 04:29:41 +0000 (20:29 -0800)]
[X86] Add X87 FCMOV support to X86FlagsCopyLowering.
Fixes PR44396
Matt Arsenault [Mon, 30 Dec 2019 19:46:24 +0000 (14:46 -0500)]
DAG: Stop trying to fold FP -(x-y) -> y-x in getNode with nsz
This was increasing the number of instructions when fsub was legalized
on AMDGPU with no signed zeros enabled. This fold should be guarded by
hasOneUse, and I don't think getNode should be doing that. The same
fold is already done as a regular combine through isNegatibleForFree.
This does require duplicating, even though isNegatibleForFree does
this combine already (and properly checks hasOneUse) to avoid one PPC
regression. In the regression, the outer fneg has nsz but the fsub
operand does not. isNegatibleForFree only sees the operand, and
doesn't see it's used from a nsz context. A nsz parameter needs to be
added and threaded through isNegatibleForFree to avoid this.