Bevin Hansson [Fri, 26 Jun 2020 14:32:30 +0000 (16:32 +0200)]
[CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.
Summary:
Using the result semantic is wrong in some cases, such as
unsigned fixed-point + signed integer. In this case, the
result semantic is unsigned and the common semantic is
signed.
Reviewers: leonardchan
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82662
Matt Arsenault [Sun, 28 Jun 2020 20:11:48 +0000 (16:11 -0400)]
AMDGPU: Use IsSSA property check instead of asserting on isSSA
Also fix an SSA violation in a test the MIRParser/verifier fails to
catch. It's illegal to define a subregister in SSA. For the purpose of
the test, it just needs to define the super-register to use the
subregister in the use operand.
Jake Merdich [Fri, 26 Jun 2020 01:59:33 +0000 (21:59 -0400)]
[clang-format] Preserve whitespace in selected macros
Summary:
https://bugs.llvm.org/show_bug.cgi?id=46383
When the c preprocessor stringizes tokens, the generated string literals
are affected by the whitespace. This means clang-format can affect
codegen silently, adding spaces and newlines to strings. Practically
speaking, the vast majority of cases will be harmless, only affecting
single identifiers or debug macros.
In the interest of doing no harm in other cases though, this introduces
a blacklist option 'WhitespaceSensitiveMacros', which contains a list of
names of function-like macros whose contents should not be touched by
clang-format, period. Clang-format can't automatically detect these
without a real compile context, so users will have to specify it
explicitly (it still beats clang-format off'ing at every invocation).
Defaults include "STRINGIZE", "PP_STRINGIZE", and "BOOST_PP_STRINGIZE".
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82620
Sanjay Patel [Mon, 29 Jun 2020 13:47:13 +0000 (09:47 -0400)]
[VectorCombine] refactor - make helper function for extract to shuffle logic; NFC
Preliminary for D82474
LLVM GN Syncbot [Mon, 29 Jun 2020 13:37:16 +0000 (13:37 +0000)]
[gn build] Port
2cb0644f90b
Luís Marques [Mon, 29 Jun 2020 10:03:26 +0000 (11:03 +0100)]
[RISCV] Split the pseudo instruction splitting pass
Extracts the atomic pseudo-instructions' splitting from `riscv-expand-pseudo`
/ `RISCVExpandPseudo` into its own pass, `riscv-expand-atomic-pseudo` /
`RISCVExpandAtomicPseudo`. This allows for the expansion of atomic operations
to continue to happen late (the new pass is added in `addPreEmitPass2`, so
those expansions continue to happen in the same place), while the remaining
pseudo-instructions can now be expanded earlier and benefit from more
optimization passes. The nonatomics pass is now added in `addPreSched2`.
Differential Revision: https://reviews.llvm.org/D79635
Balázs Kéri [Mon, 29 Jun 2020 12:35:00 +0000 (14:35 +0200)]
[Analyzer][StreamChecker] Use BugType instead of BuiltinBug (NFC) .
Summary:
I do not like the BuiltinBug class.
And it takes no SuppressOnSink parameter that may be needed in the future.
Reviewers: Szelethus, baloghadamsoftware, gamesh411
Reviewed By: Szelethus
Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82741
Pavel Labath [Mon, 29 Jun 2020 12:55:36 +0000 (14:55 +0200)]
[lldb] Deduplicate Scalar integral getters
These functions all follow the same pattern. Use template functions to
deduplicate.
Sven van Haastregt [Mon, 29 Jun 2020 13:13:12 +0000 (14:13 +0100)]
[OpenCL] Reject block arguments
OpenCL 2.0 does not allow block arguments, primarily because it is
difficult to support function pointers on the various architectures
that OpenCL targets. Clang was still accepting them.
Rename and reuse the `err_opencl_half_param` diagnostic.
Fixes PR46324.
Differential Revision: https://reviews.llvm.org/D82313
Guillaume Chatelet [Mon, 29 Jun 2020 13:00:37 +0000 (13:00 +0000)]
[NFC] Fix typos
LLVM GN Syncbot [Mon, 29 Jun 2020 12:53:46 +0000 (12:53 +0000)]
[gn build] Port
b56b467a9a8
Guillaume Chatelet [Mon, 29 Jun 2020 12:48:44 +0000 (12:48 +0000)]
[ADT] Add Bitfield utilities
Context:
--------
There are places in LLVM where we need to pack typed fields into opaque values.
For instance, the `XXXInst` classes in `llvm/include/llvm/IR/Instructions.h` that extract informations from `Value::SubclassData` via `getSubclassDataFromInstruction()`.
The bit twiddling is done manually: this impairs readability and prevent consistent handling of out of range values (e.g. https://github.com/llvm/llvm-project/blob/
435b458ad0a4630e6126246a6865748104ccad06/llvm/include/llvm/IR/Instructions.h#L564)
More importantly, the bit pattern is scattered throughout the implementation making it hard to pack additionnal fields or check for overlapping bits.
Design decisions:
-----------------
The Bitfield structs are to be declared together so it is clear which bits are used or not.
The code is designed with simplicity in mind, hence a few limitations:
- Storage is limited to a single integer,
- Enum values have to be `unsigned`,
- Storage type has to be `unsigned`,
- There are no automatic detection of overlapping fields (packed bitfield declaration should help though),
- The interface is C like so `storage` needs to be passed in everytime (code is simpler and lifetime considerations more obvious)
RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-June/142196.html
Differential Revision: https://reviews.llvm.org/D81580
Sebastian Neubauer [Fri, 12 Jun 2020 09:48:36 +0000 (11:48 +0200)]
Add intrinsic helper function
It simplifies getting generic argument types from intrinsics.
Differential Revision: https://reviews.llvm.org/D81084
Sander de Smalen [Mon, 29 Jun 2020 10:41:22 +0000 (11:41 +0100)]
[AArch64][SVE] NFCI: Choose consistent naming for predicated SDAG nodes
This patch proposes a naming convention for operations that take
a general predicate (and are thus predicated) that specifies
what happens to the false lanes.
Currently the _PRED suffix is used, which doesn't really say much other
than that it takes a predicate. In some instances this means it has
merging predication and in other cases it means zeroing-predication.
This patch also changes the order of operands to
AArch64ISD::DUP_MERGE_PASSTHRU, to pass the predicate as the first
operand, which is in line with all other predicates nodes. It takes the
passthru value as an explicit passthru value, which is always passed as
the last operand.
Reviewers: paulwalker-arm, cameron.mcinally, eli.friedman, dancgr, efriedma
Reviewed By: paulwalker-arm
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81850
Guillaume Chatelet [Mon, 29 Jun 2020 12:16:25 +0000 (12:16 +0000)]
[NFC] Introduce a helper in BasicTTIImpl.h to cast to T
This patch makes access to `this` as a `T` uniform accross the file.
Differential Revision: https://reviews.llvm.org/D82648
John Brawn [Mon, 29 Jun 2020 12:13:12 +0000 (13:13 +0100)]
[Driver] When forcing a crash print the bug report message
Commit
a945037e8fd0c30e250a62211469eea6765a36ae moved the printing of the
"PLEASE submit a bug report" message to the crash handler, but that means we
don't print it when forcing a crash using FORCE_CLANG_DIAGNOSTICS_CRASH. Fix
this by adding a function to get the bug report message and printing it when
forcing a crash.
Differential Revision: https://reviews.llvm.org/D81672
Guillaume Chatelet [Mon, 29 Jun 2020 11:56:06 +0000 (11:56 +0000)]
[Alignment][NFC] Migrate AMDGPU backend to Align
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82743
Guillaume Chatelet [Mon, 29 Jun 2020 11:24:36 +0000 (11:24 +0000)]
[Alignment][NFC] migrate DataLayout::getPreferredAlignment
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82752
Simon Pilgrim [Mon, 29 Jun 2020 11:18:27 +0000 (12:18 +0100)]
[X86] Add vector support to targetShrinkDemandedConstant for OR/XOR opcodes
If a constant is only allsignbits in the demanded/active bits, then sign extend it to an allsignbits bool pattern for OR/XOR ops.
This also requires SimplifyDemandedBits XOR handling to be modified to call ShrinkDemandedConstant on any (non-NOT) XOR pattern to account for non-splat cases.
Next step towards fixing PR45808 - with this patch we now get a <-1,-1,0,0> v4i64 constant instead of <1,1,0,0>.
Differential Revision: https://reviews.llvm.org/D82257
AndreyChurbanov [Mon, 29 Jun 2020 11:14:56 +0000 (14:14 +0300)]
[openmp][NFC] Cleanup: guard __kmp_mic_type by KMP_MIC_SUPPORTED macro.
Differential Revision: https://reviews.llvm.org/D82301
Cullen Rhodes [Fri, 19 Jun 2020 10:00:41 +0000 (10:00 +0000)]
[AArch64][SVE] Add bfloat16 support to svext intrinsic
Reviewers: sdesmalen, kmclaughlin, efriedma, david-arm, fpetrogalli
Reviewed By: sdesmalen, fpetrogalli
Differential Revision: https://reviews.llvm.org/D82391
Kerry McLaughlin [Mon, 29 Jun 2020 09:51:41 +0000 (10:51 +0100)]
[AArch64][SVE] Bail out of performPostLD1Combine for scalable types
Summary:
performPostLD1Combine will introduce either a LD1LANEpost
or LD1DUPpost node, which will cause selection failure if the
return type is a scalable vector.
Reviewers: sdesmalen, c-rhodes, efriedma
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82670
LLVM GN Syncbot [Mon, 29 Jun 2020 10:55:06 +0000 (10:55 +0000)]
[gn build] Port
8e5a56865f2
Dmitri Gribenko [Mon, 29 Jun 2020 10:47:51 +0000 (12:47 +0200)]
Move TestClangConfig into libClangTesting and use it in AST Matchers tests
Summary:
Previously, AST Matchers tests were using a custom way to run a test
with a specific C++ standard version. I'm migrating them to a shared
infrastructure to specify a Clang target from libClangTesting. I'm also
changing tests for AST Matchers to run in multiple language standards
versions, and under multiple triples that have different behavior with
regards to templates.
To keep the size of the patch manageable, in this patch I'm only
migrating one file to get the process started and get feedback on this
approach.
One caveat is that increasing the number of test configuration does
significantly increase the runtime of AST Matchers tests. On my machine,
the test runtime increases from 2.0 to 6.0s. I think it is worth the
improved test coverage.
Reviewers: jdoerfert, ymandel
Reviewed By: ymandel
Subscribers: gribozavr2, jfb, sstefan1, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82179
Simon Pilgrim [Mon, 29 Jun 2020 10:24:26 +0000 (11:24 +0100)]
[TargetLowering] Add DemandedElts arg to ShrinkDemandedConstant
Pre-commit for D82257, this adds a DemandedElts arg to ShrinkDemandedConstant/targetShrinkDemandedConstant which will allow future patches to (optionally) add vector support.
Joachim Protze [Mon, 29 Jun 2020 10:43:41 +0000 (12:43 +0200)]
[OpenMP][Tool] Fix buffer overflow in ompt-multiplex.h
Reviewed by: runlieb
Differential Revision: https://reviews.llvm.org/D82452
Dmitri Gribenko [Mon, 29 Jun 2020 10:21:14 +0000 (12:21 +0200)]
Add tests for sequences of callbacks that RecursiveASTVisitor produces
Summary:
These tests show a bug: post-order traversal introduces an extra call to
WalkUp*, that is not present in pre-order traversal. I'm fixing this bug
in a follow-up commit.
Reviewers: ymandel, eduucaldas
Reviewed By: ymandel, eduucaldas
Subscribers: gribozavr2, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82485
Tobias Gysi [Mon, 29 Jun 2020 09:32:46 +0000 (11:32 +0200)]
[mlir] make the bitwidth of device side index computations configurable (reland)
Summary:
The patch makes the index type lowering of the GPU to NVVM/ROCDL conversion configurable. It introduces a pass option that controls the bitwidth used when lowering index computations and uses the LowerToLLVMOptions structure to control the Standard to LLVM lowering.
This commit fixes a use-after-free bug introduced by the reverted commit d10b1a3. It implements the following changes:
- Added a getDefaultOptions method to the LowerToLLVMOptions struct that returns a reference to statically allocated default options.
- Use the getDefaultOptions method to provide default LowerToLLVMOptions (instead of an initializer list).
- Added comments to clarify the required lifetime of the LowerToLLVMOptions
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D82475
Alex Zinenko [Mon, 29 Jun 2020 10:16:23 +0000 (12:16 +0200)]
[mlir] LLVM dialect: use addressof instead of constant to create function pointers
`llvm.mlir.constant` was originally introduced as an LLVM dialect counterpart
to `std.constant`. As such, it was supporting "function pointer" constants
derived from the symbol name. This is different from `std.constant` that allows
for creation of a "function" constant since MLIR, unlike LLVM IR, supports
this. Later, `llvm.mlir.addressof` was introduced as an Op that obtains a
constant pointer to a global in the LLVM dialect. It naturally extends to
functions (in LLVM IR, functions are globals) and should be used for defining
"function pointer" values instead.
Fixes PR46344.
Differential Revision: https://reviews.llvm.org/D82667
Georgy Komarov [Mon, 29 Jun 2020 09:25:26 +0000 (10:25 +0100)]
[llvm-objcopy] Emit error if removing symtab referenced by group section
SHT_GROUP sections contain a reference to a symbol indicating their
"signature" symbol. The symbol table containing this symbol is referred
to by the group section's sh_link field. If llvm-objcopy is instructed
to remove the symbol table, it will emit an error.
This fixes https://bugs.llvm.org/show_bug.cgi?id=46153.
Reviewed By: jhenderson, Higuoxing
Differential Revision: https://reviews.llvm.org/D82274
Guillaume Chatelet [Mon, 29 Jun 2020 09:22:15 +0000 (09:22 +0000)]
Fix invalid alignment in DAGCombiner::isLegalNarrowLdSt
`ShAmt / 8` can be a non power of two, this can lead to an invalid alignment.
context: https://reviews.llvm.org/D41350#inline-749165
Differential Revision: https://reviews.llvm.org/D82565
Nathan James [Mon, 29 Jun 2020 08:44:11 +0000 (09:44 +0100)]
Revert "[clang-tidy] relanding b9306fd"
This reverts commit
37cc4fa2eaa3d03ca8cd4947eb0d4c60e3c9b45c. More investigation needed
Frederik Gossen [Mon, 29 Jun 2020 08:14:15 +0000 (08:14 +0000)]
[MLIR][Shape] Lower `shape.get_extent` to `extract_element` when possible
When the origin of a shape is an extent tensor the operation `get_extent` can be
lowered directly to `extract_element`.
This choice circumvents the necessity to materialize the shape in memory.
Differential Revision: https://reviews.llvm.org/D82645
Frederik Gossen [Mon, 29 Jun 2020 08:17:00 +0000 (08:17 +0000)]
[MLIR][Shape] Lower `shape.get_extent` to `std.dim` when possible
When the shape is derived from a tensor argument the shape extent can be derived
directly from that tensor with `std.dim`.
This lowering pattern circumvents the necessity to materialize the shape in
memory.
Differential Revision: https://reviews.llvm.org/D82644
Nathan James [Mon, 29 Jun 2020 08:29:26 +0000 (09:29 +0100)]
[clang-tidy] relanding b9306fd
Added some sanity checks to figure out the cause of a (seemingly unrelated) test failure on mac.
These can be removed should no issues arise on that platform again.
LLVM GN Syncbot [Mon, 29 Jun 2020 08:10:01 +0000 (08:10 +0000)]
[gn build] Port
8f9ca561a2b
Xing GUO [Mon, 29 Jun 2020 07:35:12 +0000 (15:35 +0800)]
[ObjectYAML][DWARF] Collect diagnostic message when YAMLParser fails.
Before this patch, the diagnostic message is printed to `errs()` directly, which makes it difficult to use `FailedWithMessage()` in unit testing.
In this patch, we add a custom error handler for YAMLParser, which helps collect diagnostic messages and make it easy to use `FailedWithMessage()` to check error messages.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D82630
Alex Zinenko [Mon, 29 Jun 2020 07:56:40 +0000 (09:56 +0200)]
[mlir] do not hardcode the name of the undefined function in the error message
The error message in the `std.constant` verifier for function-typed constants
had the name of the undefined function hardcoded to `bar`. Report the actual
name instead.
Differential Revision: https://reviews.llvm.org/D82666
Alex Zinenko [Fri, 26 Jun 2020 13:27:46 +0000 (15:27 +0200)]
[mlir] Modernize LLVM dialect rountrip test
This test largely predates MLIR testing guidelines. Update it to match the
guidelines. In particular, avoid pattern-matching SSA value names, avoid
unnecessary CHECK-NEXT, relax assumptions about the form of SSA names.
Value-returning operations are still matched agaist _any_ name in order to
check that the operation indeed produces values.
Differential Revision: https://reviews.llvm.org/D82656
Kadir Cetinkaya [Sat, 27 Jun 2020 09:12:51 +0000 (11:12 +0200)]
[clangd][Hover] Dont crash on null types
Reviewers: hokein, sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82701
Nico Weber [Mon, 29 Jun 2020 01:49:07 +0000 (21:49 -0400)]
Revert "[clang-tidy] Reworked enum options handling(again)"
This reverts commit
b9306fd042ce1c11d84f05d2124dfdc65b8331fe
and follow-up
42a51587c79a673045aec3586f4070630e5e7af3.
It seems to build check-clang-tools on macOS, see comments on
https://reviews.llvm.org/D82188
Fady Ghanim [Thu, 4 Jun 2020 19:55:17 +0000 (15:55 -0400)]
[Clang][OpenMP][OMPBuilder] Moving OMP allocation and cache creation code to OMPBuilderCBHelpers
Summary:
Modified the OMPBuilderCBHelpers in the following ways:
- Moved location of class definition and deleted all constructors
- Moved OpenMP-specific address allocation of local variables
- Moved threadprivate variable creation for the current thread
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79676
Sergey Dmitriev [Sun, 28 Jun 2020 22:24:33 +0000 (15:24 -0700)]
[NFC] CallGraph related cleanup
Summary: Tidy up some CallGraph-related code in preparation for D82572.
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82686
Nikita Popov [Sun, 28 Jun 2020 16:35:13 +0000 (18:35 +0200)]
[SimplifyCFG] Make test more robust (NFC)
Avoid changing this test if blocks get merged.
Nikita Popov [Sun, 28 Jun 2020 18:50:02 +0000 (20:50 +0200)]
[SimplifyCFG] Regenerate test checks (NFC)
Craig Topper [Sun, 28 Jun 2020 18:06:40 +0000 (11:06 -0700)]
[X86] Explicitly add popcnt feature to Intel CPUs with SSE4.2 in the frontend.
Previously we inferred it if sse4.2 ended up being enabled after
all feature processing. But writing -march=nehalem -mno-sse4.2
should have popcnt enabled.
cgyurgyik [Sun, 28 Jun 2020 17:33:56 +0000 (12:33 -0500)]
[libc] This commit fixes the strcmp fuzzing test. It uses a single input and
splits it into two by using the value of the first byte to determine the
length of the first string. Reviewed-by: PaulkaToast, Differential
Revision: https://reviews.llvm.org/D82427
Summary:
[libc] Since only one input is given, it is necessary to split the string into two containers so that they can be compared for the purposes of this fuzz test. This is done in the following manner:
1. Take the value of the first byte; this is size1. (Credits to @PaulkaToast for this idea).
2. size2 is the value of size - size1.
3. Copy the characters to new containers, data1 and data2 with corresponding sizes.
4. Add a null terminator to the first container, and verify the second container has a null terminator.
5. Verify output of strcmp.
A simpler alternative considered was simply splitting the input data into two, but this means the two strings are always within +- 1 character of each other. This above implementation avoids this.
ninja check-libc was run; no issues.
Reviewers: PaulkaToast, sivachandra
Reviewed By: PaulkaToast
Subscribers: mgorny, tschuett, ecnelises, libc-commits, PaulkaToast
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D82427
Roman Lebedev [Sun, 28 Jun 2020 17:31:14 +0000 (20:31 +0300)]
[NFC][ScalarEvolution] Add a test showing SCEV failure to recognize 'urem'
While InstCombine trivially converts that `srem` into a `urem`,
it might happen later than wanted. SCEV should recognize this natively.
Xun Li [Sun, 21 Jun 2020 03:29:10 +0000 (20:29 -0700)]
[Coroutines] Optimize the lifespan of temporary co_await object
Summary:
If we ever assign co_await to a temporary variable, such as foo(co_await expr),
we generate AST that looks like this: MaterializedTemporaryExpr(CoawaitExpr(...)).
MaterializedTemporaryExpr would emit an intrinsics that marks the lifetime start of the
temporary storage. However such temporary storage will not be used until co_await is ready
to write the result. Marking the lifetime start way too early causes extra storage to be
put in the coroutine frame instead of the stack.
As you can see from https://godbolt.org/z/zVx_eB, the frame generated for get_big_object2 is 12K, which contains a big_object object unnecessarily.
After this patch, the frame size for get_big_object2 is now only 8K. There are still room for improvements, in particular, GCC has a 4K frame for this function. But that's a separate problem and not addressed in this patch.
The basic idea of this patch is during CoroSplit, look for every local variable in the coroutine created through AllocaInst, identify all the lifetime start/end markers and the use of the variables, and sink the lifetime.start maker to the places as close to the first-ever use as possible.
Reviewers: lewissbaker, modocache, junparser
Reviewed By: junparser
Subscribers: hiraditya, llvm-commits, rsmith, ChuanqiXu, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D82314
Sanjay Patel [Sun, 28 Jun 2020 16:44:44 +0000 (12:44 -0400)]
[VectorCombine] add test for scalable vectors; NFC
Sanjay Patel [Sun, 28 Jun 2020 16:43:11 +0000 (12:43 -0400)]
Revert "[VectorCombine] add test for scalable vectors; NFC"
This reverts commit
700ec6b848c02ca3de9751d63a7a5a26671c3fe9.
An extra test diff snuck here.
Sanjay Patel [Sun, 28 Jun 2020 16:41:37 +0000 (12:41 -0400)]
[VectorCombine] add test for scalable vectors; NFC
Sanjay Patel [Fri, 26 Jun 2020 21:14:43 +0000 (17:14 -0400)]
[x86] add tests for rsqrt opportunities; NFC
Esme-Yi [Sun, 28 Jun 2020 16:26:05 +0000 (16:26 +0000)]
[NFC][PowerPC] Add run lines to test DivRemPairsPass.
Nikita Popov [Sun, 28 Jun 2020 14:16:35 +0000 (16:16 +0200)]
[InstCombine] Add tests for assume implication (NFC)
Nathan James [Sun, 28 Jun 2020 14:18:08 +0000 (15:18 +0100)]
[clang-tidy] Update lang restrictions on perf module
Nikita Popov [Sun, 28 Jun 2020 13:04:02 +0000 (15:04 +0200)]
[LVI] Refactor value from icmp cond handling (NFC)
Rewrite this in a way that is more amenable to extension.
Nikita Popov [Sun, 28 Jun 2020 12:54:30 +0000 (14:54 +0200)]
[CVP] Add tests for icmp or and/or edge conds (NFC)
Simon Pilgrim [Sun, 28 Jun 2020 12:00:15 +0000 (13:00 +0100)]
[X86] combineScalarToVector - handle (v2i64 scalar_to_vector(aextload)) as well as (v2i64 scalar_to_vector(aext))
We already fold (v2i64 scalar_to_vector(aext)) -> (v2i64 bitcast(v4i32 scalar_to_vector(x))), this adds support for similar aextload cases and also handles v2f64 cases that wrap the i64 extension behind bitcasts.
Fixes the remaining issue with PR39016
madhur13490 [Sun, 28 Jun 2020 11:52:33 +0000 (11:52 +0000)]
Revert accidentally landed patch citing o build errors
Summary: This reverts commit
c73966c2f79290e4eefe6e481f7bc94dd6ca4437.
Reviewers:
Subscribers:
madhur13490 [Sat, 27 Jun 2020 18:36:25 +0000 (18:36 +0000)]
Improve stack object printing. NFC.
Reviewers: madhur13490
Reviewed By: madhur13490
Subscribers: qcolombet, arsenm, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82712
dfukalov [Fri, 12 Jun 2020 10:49:18 +0000 (13:49 +0300)]
SpeculativeExecution: fix incorrect debug info move
Summary:
Debug info related instructions got zero cost so hoisted unconditionally
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=46267
Reviewers: arsenm, nhaehnle, chandlerc, aprantl
Reviewed By: aprantl
Subscribers: ormris, uabelho, wdng, aprantl, hiraditya, llvm-commits
Tags: #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D81730
Simon Pilgrim [Sun, 28 Jun 2020 11:11:38 +0000 (12:11 +0100)]
[X86] Rename dagcombine-cse.ll i386 test prefix X86 instead of X32.
Nathan James [Sun, 28 Jun 2020 10:02:19 +0000 (11:02 +0100)]
Fix build errors after
b9306fd0
Nathan James [Sun, 28 Jun 2020 09:18:32 +0000 (10:18 +0100)]
[clang-tidy] Reworked enum options handling(again)
Following on from D77085, I was never happy with the passing a mapping to the option get/store functions. This patch addresses this by using explicit specializations to handle the serializing and deserializing of enum options.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82188
Nathan James [Sun, 28 Jun 2020 08:49:39 +0000 (09:49 +0100)]
[clang][docs] Remove untracked files from formatted status
Currently on http://clang.llvm.org/docs/ClangFormattedStatus.html there are format stats on files no actually inside the tree but generated by build scripts. These are usually copied from somewhere else. Right now for example there are files from `llvm/utils/release/llvm-package...`. Adding these files bloats the list while not giving an accurate representation of how formatted the repo is.
This addresses this issue by checking the git index and ignoring any folder that doesn't contain tracked files.
I'm still unsure whether it would be better to just do away with the `os.walk` method and just check over every file returned from `git ls-index <project-root>`.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D82707
Chen Zheng [Sun, 28 Jun 2020 07:16:57 +0000 (03:16 -0400)]
[MachineLICM] testcase for hoisting rematerializable instruction, nfc
Brad Smith [Sun, 28 Jun 2020 01:14:44 +0000 (21:14 -0400)]
Add OpenBSD support to be able to retrieve the thread id
Mike Edwards [Sat, 27 Jun 2020 21:57:04 +0000 (14:57 -0700)]
[LIT] Correcting max-failures option in lit documentation.
Benjamin Kramer [Sat, 27 Jun 2020 21:24:28 +0000 (23:24 +0200)]
[RISCV] Silence unused variable warning in Release builds. NFC.
Nikita Popov [Sat, 27 Jun 2020 20:42:43 +0000 (22:42 +0200)]
[ValueTracking] Use a switch statement (NFC)
Simon Pilgrim [Sat, 27 Jun 2020 18:10:13 +0000 (19:10 +0100)]
[X86] SimplifyDemandedVectorEltsForTargetNode - merge shuffle/pack lower demanded elements handling.
Generalize the vector operand extraction code for shuffle/pack ops - we can assume that the vector operands are the same width as the result, and any non-vector values can be reused directly in the smaller width op.
Hsiangkai Wang [Thu, 4 Jun 2020 19:11:52 +0000 (03:11 +0800)]
[RISCV] Support experimental v extensions.
This follows the design as discussed on the mailing lists in the
following RFC:
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138364.html
Support for the vector 'v' extension v0.8.
Differential revision: https://reviews.llvm.org/D81188
Hsiangkai Wang [Thu, 24 Oct 2019 04:29:28 +0000 (12:29 +0800)]
[RISCV] Assemble/Disassemble v-ext instructions.
Assemble/disassemble RISC-V V extension instructions according to
latest version spec in https://github.com/riscv/riscv-v-spec/.
I have tested this patch using GNU toolchain. The encoding is aligned
to GNU assembler output. In this patch, there is a test case for each
instruction at least.
The V register definition is just for assemble/disassemble. Its type
is not important in this stage. I think it will be reviewed and modified
as we want to do codegen for scalable vector types.
This patch does not include Zvamo, Zvlsseg, and Zvediv.
Differential revision: https://reviews.llvm.org/D69987
Roman Lebedev [Sat, 27 Jun 2020 14:14:15 +0000 (17:14 +0300)]
[Analysis] isDereferenceableAndAlignedPointer(): don't crash on `bitcast <1 x ???*> to ???*`
Simon Pilgrim [Sat, 27 Jun 2020 14:56:01 +0000 (15:56 +0100)]
Update polly tests to use -disable-basicaa to -disable-basic-aa
These were missed in rG4cd19a6e15120cb
Simon Pilgrim [Sat, 27 Jun 2020 14:06:49 +0000 (15:06 +0100)]
[X86][AVX] SimplifyDemandedVectorEltsForTargetNode - reduce width of X86ISD::VPERMIL2
If we don't need the elements of the upper lanes, reduce the width of the X86ISD::VPERMIL2 node.
Simon Pilgrim [Sat, 27 Jun 2020 13:43:03 +0000 (14:43 +0100)]
[X86][AVX] SimplifyDemandedVectorEltsForTargetNode - reduce width of X86ISD::VPERMILPV
If we don't need the elements of the upper lanes, reduce the width of the X86ISD::VPERMILPV node.
mydeveloperday [Sat, 27 Jun 2020 11:16:05 +0000 (12:16 +0100)]
[clang-format] NFC 1% improvement in the overall clang-formatted status
lh123 [Sat, 27 Jun 2020 10:58:03 +0000 (18:58 +0800)]
Revert "[Docs] Fix typo and test git commit access. NFC."
This reverts commit
c19e82c6b38b74c56d595cb69582b7c3727762b5.
Simon Pilgrim [Sat, 27 Jun 2020 10:27:16 +0000 (11:27 +0100)]
ThreadPool.h - remove unused BitVector.h include. NFC.
mydeveloperday [Sat, 27 Jun 2020 10:35:22 +0000 (11:35 +0100)]
[clang-format] [PR462254] fix indentation of default and break correctly in whitesmiths style
Summary:
https://bugs.llvm.org/show_bug.cgi?id=46254
Reviewed By: curdeius, jbcoe
Differential Revision: https://reviews.llvm.org/D8201
Simon Pilgrim [Sat, 27 Jun 2020 10:16:25 +0000 (11:16 +0100)]
FileCollector.h - reduce Twine.h include to forward declaration. NFC.
Simon Pilgrim [Sat, 27 Jun 2020 10:03:57 +0000 (11:03 +0100)]
[DAG] reduceBuildVecExtToExtBuildVec - don't combine if it would break a splat.
reduceBuildVecExtToExtBuildVec was breaking a splat(zext(x)) pattern into buildvector(x, 0, x, 0, ..) resulting in much more complex insert+shuffle codegen.
We already go to some lengths to avoid this in SimplifyDemandedVectorElts etc. when we encounter splat buildvectors.
It should be OK to fold all splat(aext(x)) patterns - we might need to tighten this if we find a case where we mustn't introduce a buildvector(x, undef, x, undef, ..) but I can't find one.
Fixes PR46461.
Simon Pilgrim [Sat, 27 Jun 2020 09:42:44 +0000 (10:42 +0100)]
[X86] Add PR46461 test case
Simon Pilgrim [Sat, 27 Jun 2020 09:36:37 +0000 (10:36 +0100)]
[X86] Add AVX tests buildvec-insertvec.ll
Simon Pilgrim [Sat, 27 Jun 2020 09:30:05 +0000 (10:30 +0100)]
Fix unused type alias warning. NFC.
The "using InsertPointTy" line is an unnecessary copy + paste from other builder tests.
David Zarzycki [Tue, 23 Jun 2020 09:43:51 +0000 (05:43 -0400)]
Reland: [clang driver] Move default module cache from system temporary directory
This fixes a unit test. Otherwise here is the original commit:
1) Shared writable directories like /tmp are a security problem.
2) Systems provide dedicated cache directories these days anyway.
3) This also refines LLVM's cache_directory() on Darwin platforms to use
the Darwin per-user cache directory.
Reviewers: compnerd, aprantl, jakehehrlich, espindola, respindola, ilya-biryukov, pcc, sammccall
Reviewed By: compnerd, sammccall
Subscribers: hiraditya, llvm-commits, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D82362
Simon Pilgrim [Sat, 27 Jun 2020 09:12:20 +0000 (10:12 +0100)]
Error.h - GenericBinaryError - pass Twine arg by reference not value.
This allows us to reduce the Twine.h include to a forward declaration.
Simon Pilgrim [Sat, 27 Jun 2020 09:01:48 +0000 (10:01 +0100)]
CompileOnDemandLayer.h - remove unused Twine.h include. NFC.
Simon Pilgrim [Sat, 27 Jun 2020 08:59:05 +0000 (09:59 +0100)]
IndirectionUtils.h - reduce Twine.h include to forward declaration. NFC.
Simon Pilgrim [Sat, 27 Jun 2020 08:57:03 +0000 (09:57 +0100)]
MCSectionWasm.h - reduce includes to forward declarations. NFC.
Simon Pilgrim [Sat, 27 Jun 2020 08:47:34 +0000 (09:47 +0100)]
AsmPrinter.h - reduce includes to forward declarations. NFC.
Nikita Popov [Sun, 14 Jun 2020 20:49:57 +0000 (22:49 +0200)]
[IR] Store attributes that are available "somewhere" (NFC)
I noticed that for some benchmarks we spend quite a bit of time
inside AttributeList::hasAttrSomewhere(), mainly when checking
for the "returned" attribute. Most of the time the attribute will
not be present, in which case this function has to walk through
the whole attribute list and check for the attribute at each index.
This patch adds a cache of all "available somewhere" attributes
inside AttributeListImpl. This makes the structure 12 bytes larger,
but I don't think that's problematic, as attribute lists are uniqued.
Compile-time in terms of instructions retired improves by 0.4% on
average, but >1% for sqlite.
Differential Revision: https://reviews.llvm.org/D81867
Simon Pilgrim [Fri, 26 Jun 2020 15:31:38 +0000 (16:31 +0100)]
AsmWriter - printConstVCalls/printNonConstVCalls - avoid std::vector pass by value. NFCI.
Roman Lebedev [Sat, 27 Jun 2020 08:34:58 +0000 (11:34 +0300)]
[SCEV] Make SCEVAddExpr actually always return pointer type if there is pointer operand (PR46457)
Summary:
The added assertion fails on the added test without the fix.
Reduced from test-suite/MultiSource/Benchmarks/MiBench/office-ispell/correct.c
In IR, getelementptr, obviously, takes pointer as it's base,
and returns a pointer.
When creating an SCEV expression, SCEV operands are sorted in hope
that it increases folding potential, and at the same time SCEVAddExpr's
type is the type of the last(!) operand.
Which means, in some exceedingly rare cases, pointer operand may happen to
end up not being the last operand, and as a result SCEV for GEP
will suddenly have a non-pointer return type.
We should ensure that does not happen.
In the end, actually storing the `Type *`, at the cost of increasing
memory footprint of `SCEVAddExpr`, appears to be the solution.
We can't just store a 'is a pointer' bit and create pointer type
on the fly since we don't have data layout in getType().
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=46457 | PR46457 ]]
Reviewers: efriedma, mkazantsev, reames, nikic
Reviewed By: efriedma
Subscribers: hiraditya, javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82633
Roman Lebedev [Sat, 27 Jun 2020 08:34:58 +0000 (11:34 +0300)]
[NFCI][SCEV] getPointerBase(): de-recursify
Summary:
This is boringly straight-forward, each iteration we see if
V is some expression that we can look into, and if it has
a single pointer operand, then set V to that operand
and repeat.
Reviewers: efriedma, mkazantsev, reames, nikic
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82632
Melanie Blower [Fri, 26 Jun 2020 16:23:45 +0000 (09:23 -0700)]
Reland D81869 "Modify FPFeatures to use delta not absolute settings"
This reverts commit
defd43a5b393bb63a902042adf578081b03b171d.
with correction to solve msan report
To solve https://bugs.llvm.org/show_bug.cgi?id=46166 where the
floating point settings in PCH files aren't compatible, rewrite
FPFeatures to use a delta in the settings rather than absolute settings.
With this patch, these floating point options can be benign.
Reviewers: rjmccall
Differential Revision: https://reviews.llvm.org/D81869
Fady Ghanim [Sat, 27 Jun 2020 06:43:04 +0000 (02:43 -0400)]
[OpenMP][OMPBuilder] Remove unused variable in Unittest
Relating to buildbot errors to commit
82b8236cf248ef91968b67d18af23890322cde43
Gui Andrade [Sat, 27 Jun 2020 06:46:04 +0000 (06:46 +0000)]
[MSAN] Handle x86 {round,min,max}sd intrinsics
These need special handling over the simple vector intrinsics as they
behave more like a shuffle operation: taking the top half of the vector
from one input, and the bottom half separately. Previously, these were
being handled as though all bits of all operands were combined.
Differential Revision: https://reviews.llvm.org/D82398