Albertas Vyšniauskas [Mon, 25 Jan 2021 19:47:22 +0000 (20:47 +0100)]
[clang-format] PR16518 Add flag to suppress empty line insertion before access modifier
Add new option called InsertEmptyLineBeforeAccessModifier. Empty line
before access modifier is inerted if this option is set to true (which
is the default value, because clang-format always inserts empty lines
before access modifiers), otherwise empty lines are removed.
Fixes issue #16518.
Differential Revision: https://reviews.llvm.org/D93846
Björn Schäpers [Thu, 21 Jan 2021 12:53:27 +0000 (13:53 +0100)]
[clang-format] [NFC] Remove unsued arguments
Björn Schäpers [Wed, 20 Jan 2021 20:48:19 +0000 (21:48 +0100)]
[clang-format] [NFC] Restructure getLineCommentIndentPrefix
When sorting the known prefixes after length the if in the loop will hit
at most once, so we can return from there.
Also replace the inner loop with an algorithm, that makes it more
readable.
Differential Revision: https://reviews.llvm.org/D95081
Björn Schäpers [Wed, 20 Jan 2021 20:35:19 +0000 (21:35 +0100)]
[clang-format] [NFC] Use some constexpr StringRef
Instead of const char*.
Differential Revision: https://reviews.llvm.org/D95078
Akira Hatanaka [Mon, 25 Jan 2021 19:56:33 +0000 (11:56 -0800)]
[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV
or claimRV calls in the IR
Background:
This patch makes changes to the front-end and middle-end that are
needed to fix a longstanding problem where llvm breaks ARC's autorelease
optimization (see the link below) by separating calls from the marker
instructions or retainRV/claimRV calls. The backend changes are in
https://reviews.llvm.org/D92569.
https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-autoreleasereturnvalue
What this patch does to fix the problem:
- The front-end annotates calls with attribute "clang.arc.rv"="retain"
or "clang.arc.rv"="claim", which indicates the call is implicitly
followed by a marker instruction and a retainRV/claimRV call that
consumes the call result. This is currently done only when the target
is arm64 and the optimization level is higher than -O0.
- ARC optimizer temporarily emits retainRV/claimRV calls after the
annotated calls in the IR and removes the inserted calls after
processing the function.
- ARC contract pass emits retainRV/claimRV calls after the annotated
calls. It doesn't remove the attribute on the call since the backend
needs it to emit the marker instruction. The retainRV/claimRV calls
are emitted late in the pipeline to prevent optimization passes from
transforming the IR in a way that makes it harder for the ARC
middle-end passes to figure out the def-use relationship between the
call and the retainRV/claimRV calls (which is the cause of PR31925).
- The function inliner removes the autoreleaseRV call in the callee that
returns the result if nothing in the callee prevents it from being
paired up with the calls annotated with "clang.arc.rv"="retain/claim"
in the caller. If the call is annotated with "claim", a release call
is inserted since autoreleaseRV+claimRV is equivalent to a release. If
it cannot find an autoreleaseRV call, it tries to transfer the
attributes to a function call in the callee. This is important since
ARC optimizer can remove the autoreleaseRV call returning the callee
result, which makes it impossible to pair it up with the retainRV or
claimRV call in the caller. If that fails, it simply emits a retain
call in the IR if the call is annotated with "retain" and does nothing
if it's annotated with "claim".
- This patch teaches dead argument elimination pass not to change the
return type of a function if any of the calls to the function are
annotated with attribute "clang.arc.rv". This is necessary since the
pass can incorrectly determine nothing in the IR uses the function
return, which can happen since the front-end no longer explicitly
emits retainRV/claimRV calls in the IR, and change its return type to
'void'.
Future work:
- Use the attribute on x86-64.
- Fix the auto upgrader to convert call+retainRV/claimRV pairs into
calls annotated with the attributes.
rdar://
71443534
Differential Revision: https://reviews.llvm.org/D92808
Keith Smiley [Mon, 25 Jan 2021 19:54:46 +0000 (11:54 -0800)]
Revert "[clangd][NFC] Simplify handing on methods with no params"
This broke the build http://lab.llvm.org:8011/#/builders/7/builds/1405
This reverts commit
f05b492aae4d4a741ec59f19518df91a3012824c.
Differential Revision: https://reviews.llvm.org/D95385
Julian Lettner [Fri, 15 Jan 2021 01:04:39 +0000 (17:04 -0800)]
[lit] Use os.cpu_count() to cleanup TODO
We can now use Python3. Let's use `os.cpu_count()` to cleanup this
helper.
Differential Revision: https://reviews.llvm.org/D94734
Florian Hahn [Mon, 25 Jan 2021 19:34:59 +0000 (19:34 +0000)]
[VPlan] Replace uses with new value in VPInstructionsToVPRecipe (NFC).
Now that VPRecipeBase inherits from VPDef, we can always use the new
VPValue for replacement, if the recipe defines one. Given the recipes
that are supported at the moment, all new recipes must have either 0 or
1 defined values.
Walter Erquinigo [Fri, 22 Jan 2021 18:22:26 +0000 (10:22 -0800)]
[ThreadPlan] fix exec on Linux
Nick Desaulniers [Mon, 25 Jan 2021 19:12:17 +0000 (11:12 -0800)]
[GVN] do not repeat PRE on failure to split critical edge
Fixes an infinite loop encountered in GVN.
GVN will delay PRE if it encounters critical edges, attempt to split
them later via calls to SplitCriticalEdge(), then restart.
The caller of GVN::splitCriticalEdges() assumed a return value of true
meant that critical edges were split, that the IR had changed, and that
PRE should be re-attempted, upon which we loop infinitely.
This was exposed after D88438, by compiling the Linux kernel for s390,
but the test case is reproducible on x86.
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1261
Reviewed By: void
Differential Revision: https://reviews.llvm.org/D94996
Alex Zinenko [Mon, 25 Jan 2021 16:12:35 +0000 (17:12 +0100)]
[mlir] Add C API for IntegerSet
Depends On D95357
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D95368
Shilei Tian [Mon, 25 Jan 2021 19:14:23 +0000 (14:14 -0500)]
[OpenMP][NVPTX] Rewrite CUDA intrinsics with NVVM intrinsics
This patch makes prep for dropping CUDA when compiling `deviceRTLs`.
CUDA intrinsics are replaced by NVVM intrinsics which refers to code in
`__clang_cuda_intrinsics.h`. We don't want to directly include it because in the
near future we're going to switch to OpenMP and by then the header cannot be
used anymore.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D95327
Nathan James [Mon, 25 Jan 2021 19:08:10 +0000 (19:08 +0000)]
[clangd][NFC] Simplify handing on methods with no params
Add bind methods handling the case when a method has an empty params interface and when it has no parameters.
Remove ShutdownParams and ExitParams from Protocol, In LSP they aren't defined, instead the methods are defined to have void as the params. This signature now better reflects that.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D95270
Craig Topper [Mon, 25 Jan 2021 17:35:14 +0000 (09:35 -0800)]
[RISCV] Custom type legalize i8/i16 UDIV/UREM/SDIV on RV64 so we can use divuw/remuw/divw.
This makes our i8/i16 codegen more similar to the i32 codegen.
I've also added computeKnownBits support for DIVUW/REMUW so
that we can remove zero extending ANDs from the output. Without
this we end up turning DIVUW/REMUW back into DIVU/REMU via some
isel patterns.
Reviewed By: frasercrmck, luismarques
Differential Revision: https://reviews.llvm.org/D95322
Ruslan Arutyunyan [Mon, 25 Jan 2021 18:34:03 +0000 (13:34 -0500)]
[libc++] Fix build after
51faba35fd81fbd3af407a29c136895a718ccd96
Differential Revision: https://reviews.llvm.org/D95372
Reid Kleckner [Mon, 25 Jan 2021 18:26:51 +0000 (10:26 -0800)]
[Win64] Ensure all stack frames are 8 byte aligned
The unwind info format requires that all adjustments are 8 byte aligned,
and the bottom three bits are masked out. Most Win64 calling conventions
have 32 bytes of shadow stack space for spilling parameters, and I
believe that constructing these fixed stack objects had the side effect
of ensuring an alignment of 8. However, the Intel regcall convention
does not have this shadow space, so when using that convention, it was
possible to make a 4 byte stack frame, which was impossible to describe
with unwind info.
Fixes pr48867
Diego Caballero [Wed, 20 Jan 2021 22:41:51 +0000 (00:41 +0200)]
[mlir][Affine] Add support for multi-store producer fusion
This patch adds support for producer-consumer fusion scenarios with
multiple producer stores to the AffineLoopFusion pass. The patch
introduces some changes to the producer-consumer algorithm, including:
* For a given consumer loop, producer-consumer fusion iterates over its
producer candidates until a fixed point is reached.
* Producer candidates are gathered beforehand for each iteration of the
consumer loop and visited in reverse program order (not strictly guaranteed)
to maximize the number of loops fused per iteration.
In general, these changes were needed to simplify the multi-store producer
support and remove some of the workarounds that were introduced in the past
to support more fusion cases under the single-store producer limitation.
This patch also preserves the existing functionality of AffineLoopFusion with
one minor change in behavior. Producer-consumer fusion didn't fuse scenarios
with escaping memrefs and multiple outgoing edges (from a single store).
Multi-store producer scenarios will usually (always?) have multiple outgoing
edges so we couldn't fuse any with escaping memrefs, which would greatly limit
the applicability of this new feature. Therefore, the patch enables fusion for
these scenarios. Please, see modified tests for specific details.
Reviewed By: andydavis1, bondhugula
Differential Revision: https://reviews.llvm.org/D92876
Wei Mi [Fri, 22 Jan 2021 23:09:21 +0000 (15:09 -0800)]
[SampleFDO] Report error when reading a bad/incompatible profile instead of
turning off SampleFDO silently.
Currently sample loader pass turns off SampleFDO optimization silently when
it sees error in reading the profile. This behavior will defeat the tests
which could have caught those bad/incompatible profile problems. This patch
change the behavior to report error.
Differential Revision: https://reviews.llvm.org/D95269
Sam Clegg [Mon, 18 Jan 2021 19:39:28 +0000 (11:39 -0800)]
[lld] Consistent help text for `--save-temps`
I noticed that this option was not appearing at all in the `--help`
messages for `wasm-ld` or `ld.lld`.
Add help text and make it consistent across all ports.
Differential Revision: https://reviews.llvm.org/D94925
Nemanja Ivanovic [Mon, 25 Jan 2021 18:22:19 +0000 (12:22 -0600)]
[PowerPC] Add missing negate for VPERMXOR on little endian subtargets
This intrinsic is supposed to have the permute control vector complemented on
little endian systems (as the ABI specifies and GCC implements). With the
current code gen, the result vector is byte-reversed.
Differential revision: https://reviews.llvm.org/D95004
Alex Zinenko [Mon, 25 Jan 2021 14:22:16 +0000 (15:22 +0100)]
[mlir] Use more C99 comments in C API header files
These were left over from the original reformatting commit.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D95357
Keith Smiley [Mon, 25 Jan 2021 18:03:07 +0000 (10:03 -0800)]
[clang] Add -fprofile-prefix-map
This flag allows you to re-write absolute paths in coverage data analogous to -fdebug-prefix-map. This flag is also implied by -ffile-prefix-map.
Arthur O'Dwyer [Thu, 17 Dec 2020 05:01:08 +0000 (00:01 -0500)]
[libc++] [P0879] constexpr std::reverse, partition, *_permutation.
After this patch, the only parts of P0879 that remain missing will be
std::nth_element, std::sort, and the heap/partial_sort algorithms.
Differential Revision: https://reviews.llvm.org/D93443
Erik Pilkington [Mon, 25 Jan 2021 15:53:25 +0000 (10:53 -0500)]
[Sema] Fix an assertion failure in -Wcompletion-handler
NamedDecl::getName() was being called on a constructor.
Arthur O'Dwyer [Sat, 26 Dec 2020 06:39:03 +0000 (01:39 -0500)]
[libc++] Implement [P0769] "Add shift to algorithm" (shift_left, shift_right)
I believe this is a complete implementation of std::shift_left and std::shift_right from
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0769r2.pdf
Some test cases copied-with-modification from D60027.
Differential Revision: https://reviews.llvm.org/D93819
Lukas Barth [Mon, 25 Jan 2021 17:37:54 +0000 (18:37 +0100)]
[clang-format] add case aware include sorting
* Adds an option to [clang-format] which sorts
headers in an alphabetical manner using case
only for tie-breakers. The options is off by
default in favor of the current ASCIIbetical
sorting style.
Reviewed By: curdeius, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D95017
David Green [Mon, 25 Jan 2021 17:50:19 +0000 (17:50 +0000)]
[ARM] Use half directly for args/return types in test. NFC
Until fairly recently the calling convention for IR half was not handled
correctly in the ARM backend, meaning we needed to pass pointers that
were loaded/stored. Now that that is fixed we can switch to using the
type directly instead.
Joseph Huber [Mon, 25 Jan 2021 17:07:09 +0000 (12:07 -0500)]
[OpenMP][NFC] Fix SourceInfo.h variable names
Summary:
Fix the names to use Pascal case to comply with the LLVM coding guidelines. `ident_t` is required for compatibility with the rest of libomp.
Craig Topper [Mon, 25 Jan 2021 17:16:45 +0000 (09:16 -0800)]
[RISCV] Use sign extend for i32 arguments and returns in makeLibCall on RV64.
As far as I know 32 bits arguments and returns on RV64 are always
sign extended to i64. So I think we should be taking this into
account around libcalls.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D95285
Mark de Wever [Fri, 22 Jan 2021 18:03:14 +0000 (19:03 +0100)]
[libc++][doc] Update the release notes.
Updates the libc++ release notes with the changes since the last
release.
Differential Revision: https://reviews.llvm.org/D95248
Kostya Kortchinsky [Sat, 9 Jan 2021 16:40:17 +0000 (08:40 -0800)]
[scudo][standalone] Enable death tests on Fuchsia
zxtest doesn't have `EXPECT_DEATH` and the Scudo unit-tests were
defining it as a no-op.
This enables death tests on Fuchsia by using `ASSERT_DEATH` instead.
I used a lambda to wrap the expressions as this appears to not be
working the same way as `EXPECT_DEATH`.
Additionnally, a death test using `alarm` was failing with the change,
as it's currently not implemented in Fuchsia, so move that test within
a `!SCUDO_FUCHSIA` block.
Differential Revision: https://reviews.llvm.org/D94362
Anton Zabaznov [Mon, 25 Jan 2021 16:23:58 +0000 (19:23 +0300)]
[OpenCL] Refactor of targets OpenCL option settings
Currently, there is some refactoring needed in existing interface of OpenCL option
settings to support OpenCL C 3.0. The problem is that OpenCL extensions and features
are not only determined by the target platform but also by the OpenCL version.
Also, there are core extensions/features which are supported unconditionally in
specific OpenCL C version. In fact, these rules are not being followed for all targets.
For example, there are some targets (as nvptx and r600) which don't support
OpenCL C 2.0 core features (nvptx.languageOptsOpenCL.cl, r600.languageOptsOpenCL.cl).
After the change there will be explicit differentiation between optional core and core
OpenCL features which allows giving diagnostics if target doesn't support any of
necessary core features for specific OpenCL version.
This patch also eliminates `OpenCLOptions` instance duplication from `TargetOptions`.
`OpenCLOptions` instance should take place in `Sema` as it's going to be modified
during parsing. Removing this duplication will also allow to generally simplify
`OpenCLOptions` class for parsing purposes.
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D92277
Xun Li [Mon, 25 Jan 2021 16:37:18 +0000 (08:37 -0800)]
Revert "Fix unused variable in CoroFrame.cpp when building Release with GCC 10"
This reverts commit
ff5e896425577f445ed080d88b582aab0896fba0.
Ruslan Arutyunyan [Mon, 25 Jan 2021 16:12:25 +0000 (11:12 -0500)]
[libc++] Implement P0655R1 visit<R>: Explicit Return Type for visit
Differential Revision: https://reviews.llvm.org/D92044
Jon Chesterfield [Mon, 25 Jan 2021 16:12:56 +0000 (16:12 +0000)]
[libomptarget] Compile with older cuda, revert D95274
[libomptarget] Compile with older cuda, revert D95274
Fixes regression reported in comments of D95274.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D95367
Dmitry Preobrazhensky [Mon, 25 Jan 2021 16:01:19 +0000 (19:01 +0300)]
[AMDGPU][MC] Improved errors handling for SDWA operands
Reviewers: rampitec
Differential Revision: https://reviews.llvm.org/D95212
Nico Weber [Mon, 25 Jan 2021 16:00:38 +0000 (11:00 -0500)]
Revert "[JITLink] Enable exception handling for ELF."
This reverts commit
6884fbc2c4fb46d0528c02d16d510f4f725fac11.
Breaks tests on Windows: http://45.33.8.238/win/31981/step_11.txt
Muhammad Omair Javaid [Mon, 25 Jan 2021 15:29:22 +0000 (20:29 +0500)]
[LLDB] Skip TestPlatformProcessConnect on arm/aarch64 buildbot
TestPlatformProcessConnect is randomly failing on LLDB Arm/AArch64
buildbot. I am disabling it temporarily untill problem is fixed.
Muhammad Omair Javaid [Mon, 25 Jan 2021 12:04:38 +0000 (17:04 +0500)]
[LLDB] Define AUXV_AT_HWCAP2 in AuxVector.h
This patch defines AUXV_AT_HWCAP2 for accessing Aux extensions.
Muhammad Omair Javaid [Mon, 25 Jan 2021 11:41:24 +0000 (16:41 +0500)]
[LLDB] Remove leftovers and typos from RegisterInfos_arm64_sve.h
This patch removes a couple of left-overs and a typo from
RegisterInfos_arm64_sve.h and RegisterInfoPOSIX_arm64.h.
Jeroen Dobbelaere [Mon, 25 Jan 2021 15:40:01 +0000 (16:40 +0100)]
[Verifier] disable llvm.experimental.noalias.scope.decl dominance check.
This was enabled in https://reviews.llvm.org/D95335 but it breaks the stage2 fuchsia build
(See http://lab.llvm.org:8011/#/builders/98/builds/4105/steps/9/logs/stdio)
Simon Pilgrim [Mon, 25 Jan 2021 14:48:40 +0000 (14:48 +0000)]
[X86][AVX] Generalize vperm2f128/vperm2i128 patterns to support all legal 256-bit vector types
Remove bitcasts to/from v4x64 types through vperm2f128/vperm2i128 ops to help improve shuffle combining and demanded vector elts folding.
Jeroen Dobbelaere [Mon, 25 Jan 2021 15:19:12 +0000 (16:19 +0100)]
[Verifier] enable and limit llvm.experimental.noalias.scope.decl dominance checking
Checking the llvm.experimental.noalias.scope.decl dominance can be worstcase O(N^2).
Limit the dominance check to N=32.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D95335
Sam McCall [Mon, 25 Jan 2021 13:03:13 +0000 (14:03 +0100)]
[clangd] Allow diagnostics to be suppressed with configuration
This has been specifically requested:
https://github.com/clangd/vscode-clangd/issues/114
and various issues can be addressed with this as a workaround, e.g.:
https://github.com/clangd/clangd/issues/662
Differential Revision: https://reviews.llvm.org/D95349
Adam Czachorowski [Mon, 18 Jan 2021 17:17:52 +0000 (18:17 +0100)]
[clangd] Fix a crash when indexing invalid ObjC method declaration
This fix will make us not crash, but ideally we would handle this case
better.
Differential Revision: https://reviews.llvm.org/D94919
xgupta [Mon, 25 Jan 2021 14:28:03 +0000 (19:58 +0530)]
[Doc][NFC] Fix Kaleidoscope links, typos and add blog posts for MCJIT
Florian Hahn [Mon, 25 Jan 2021 11:17:56 +0000 (11:17 +0000)]
[VPlan] Handle scalarized values in VPTransformState.
This patch adds plumbing to handle scalarized values directly in
VPTransformState.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D92282
Nicolas Vasilache [Mon, 25 Jan 2021 14:16:01 +0000 (14:16 +0000)]
[mlir] Generalize OpFoldResult usage in ops with offsets, sizes and operands.
This revision starts evolving the APIs to manipulate ops with offsets, sizes and operands towards a ValueOrAttr abstraction that is already used in folding under the name OpFoldResult.
The objective, in the future, is to allow such manipulations all the way to the level of ODS to avoid all the genuflexions involved in distinguishing between values and attributes for generic constant foldings.
Once this evolution is accepted, the next step will be a mechanical OpFoldResult -> ValueOrAttr.
Differential Revision: https://reviews.llvm.org/D95310
xgupta [Mon, 25 Jan 2021 14:08:32 +0000 (19:38 +0530)]
[NFC] Fix title comment typo and provide description for LLJIT example.
Nicolas Vasilache [Mon, 25 Jan 2021 14:04:06 +0000 (14:04 +0000)]
[mlir][Linalg] Fix incorrect erase order
Adam Czachorowski [Thu, 21 Jan 2021 16:51:13 +0000 (17:51 +0100)]
[clang] Fix a nullptr dereference bug on invalid code
When working with invalid code, we would try to dereference a nullptr
while deducing template arguments in some dependend code operating on a
lambda with invalid return type.
Differential Revision: https://reviews.llvm.org/D95145
Nicolas Vasilache [Mon, 25 Jan 2021 13:41:50 +0000 (13:41 +0000)]
[mlir][Linalg] Address missed review item
This revision addresses a remaining comment that was overlooked in https://reviews.llvm.org/D95243:
the pad hoisting transformation is made to additionally bail out on side effecting ops other than LoopLikeOps.
Simon Pilgrim [Mon, 25 Jan 2021 13:45:19 +0000 (13:45 +0000)]
[X86][AVX] combineX86ShuffleChainWithExtract - widen to at least original root size. NFCI.
We're relying on the source inputs for shuffle combining having already been widened to the root size (otherwise the offset logic falls over) - we're going to be supporting different sized shuffle inputs soon, so we need to explicitly make the minimum widened width the original root size.
Abhina Sreeskantharajan [Mon, 25 Jan 2021 13:02:41 +0000 (08:02 -0500)]
Revert "[SystemZ][z/OS] Fix No such file or directory expression error"
This reverts commit
06f8a49693957bc27b83e0ab5f429ff874941a07.
Abhina Sreeskantharajan [Mon, 25 Jan 2021 13:02:27 +0000 (08:02 -0500)]
Revert "[SystemZ][z/OS] Fix No such file or directory expression error matching in lit tests - continued"
This reverts commit
520b5ecf856152f35ee38207eec39f5674dd2bd4.
Tom Ritter [Mon, 25 Jan 2021 13:06:54 +0000 (08:06 -0500)]
Add a --use-color option to clang-query to allow forcing the behavior
D62056 makes the output color if clang auto-detects a tty, but if it
does not, there is no way to force it to use colors anyway.
This patch adjusts the command-lines given to ClangTool which will
force color on or off if --use-color is specified.
Sanjay Patel [Sun, 24 Jan 2021 17:57:11 +0000 (12:57 -0500)]
[InstCombine] narrow min/max intrinsics with extended inputs
We can sink extends after min/max if they match and would
not change the sign-interpreted compare. The only combo
that doesn't work is zext+smin/smax because the zexts
could change a negative number into positive:
https://alive2.llvm.org/ce/z/D6sz6J
Sext+umax/umin works:
define i32 @src(i8 %x, i8 %y) {
%0:
%sx = sext i8 %x to i32
%sy = sext i8 %y to i32
%m = umax i32 %sx, %sy
ret i32 %m
}
=>
define i32 @tgt(i8 %x, i8 %y) {
%0:
%m = umax i8 %x, %y
%r = sext i8 %m to i32
ret i32 %r
}
Transformation seems to be correct!
Sanjay Patel [Sun, 24 Jan 2021 17:37:38 +0000 (12:37 -0500)]
[InstCombine] add tests for min/max intrinsics with extended values; NFC
Sven van Haastregt [Mon, 25 Jan 2021 12:43:30 +0000 (12:43 +0000)]
Revert "[clang] Fix signedness in vector bitcast evaluation"
This reverts commit
14947cd04701d923a57a0161fd1967b81e00ff5e because
it broke clang-cmake-armv7-quick.
Nicolas Vasilache [Mon, 25 Jan 2021 11:48:39 +0000 (11:48 +0000)]
[mlir][Linalg] Add a hoistPaddingOnTensors transformation
This transformation anchors on a padding op whose result is only used as an input
to a Linalg op and pulls it out of a given number of loops.
The result is a packing of padded tailes of ops that is amortized just before
the outermost loop from which the pad operation is hoisted.
Differential revision: https://reviews.llvm.org/D95243
Faris Rehman [Mon, 25 Jan 2021 12:07:17 +0000 (12:07 +0000)]
[flang][driver] Update PP tests to use the new driver
Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18.
Summary of changes:
- Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18
- Update all tests in flang/test/Preprocessing/ to use %flang
Differential Revision: https://reviews.llvm.org/D94805
Sander de Smalen [Wed, 20 Jan 2021 09:10:24 +0000 (09:10 +0000)]
[SLPVectorizer] NFC: Migrate getVectorCallCosts to use InstructionCost.
This change also changes getReductionCost to return InstructionCost,
and it simplifies two expressions by removing a redundant 'isValid' check.
Simon Pilgrim [Mon, 25 Jan 2021 12:10:12 +0000 (12:10 +0000)]
[X86][AVX] LowerTRUNCATE - avoid bitcasts around extract_subvectors.
We allow extract_subvector lowering of all legal types, so pre-bitcast the source type to try and reduce bitcast pollution.
Sven van Haastregt [Mon, 25 Jan 2021 12:01:42 +0000 (12:01 +0000)]
[clang] Fix signedness in vector bitcast evaluation
The included test case triggered a sign assertion on the result in
`Success()`. This was caused by the APSInt created for a bitcast
having its signedness bit inverted. The second APSInt constructor
argument is `isUnsigned`, so invert the result of
`isSignedIntegerType`.
Differential Revision: https://reviews.llvm.org/D95135
Faris Rehman [Mon, 25 Jan 2021 11:58:52 +0000 (11:58 +0000)]
[flang][driver] Remove newline in CompilerInvocation
Remove a new line in CompilerInvocation, to now follow the style when clang-format is applied.
Simon Pilgrim [Mon, 25 Jan 2021 11:10:17 +0000 (11:10 +0000)]
[X86][AVX] combineX86ShuffleChain - avoid bitcasts around insert_subvector() shuffle patterns.
We allow insert_subvector lowering of all legal types, so don't always cast to the vXi64/vXf64 shuffle types - this is only necessary for X86ISD::SHUF128/X86ISD::VPERM2X128 patterns later.
Simon Pilgrim [Sat, 23 Jan 2021 18:01:12 +0000 (18:01 +0000)]
[TableGen] RuleMatcher::defineComplexSubOperand avoid std::string copy. NFCI.
Use const reference to avoid std::string copy - accordingly to the style guide we shouldn't be using auto anyway.
Fixes MSVC analyzer warning.
Sander de Smalen [Thu, 21 Jan 2021 16:37:09 +0000 (16:37 +0000)]
[InstructionCost] Prevent InstructionCost being created with CostState.
For a function that returns InstructionCost, it is very tempting to write:
return InstructionCost::Invalid;
But that actually returns InstructionCost(1 /* int value of Invalid */))
which has a totally different meaning. By marking this constructor as
`delete`, this can no longer happen.
Anastasia Stulova [Mon, 25 Jan 2021 11:17:03 +0000 (11:17 +0000)]
[OpenCL][Docs] Describe tablegen BIFs declarations.
Added documentation for the fast builtin
function declarations with -fdeclare-opencl-builtins.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D95038
Fraser Cormack [Fri, 8 Jan 2021 09:32:15 +0000 (09:32 +0000)]
[SelectionDAG] Support scalable-vector splats in more cases
This patch adds support for scalable-vector splats in DAGCombiner's
`isConstantOrConstantVector` and `ISD::matchUnaryPredicate` functions,
which enable the SelectionDAG div/rem-by-constant optimizations for
scalable vector types.
It also fixes up one case where the UDIV optimization was generating a
SETCC without first consulting the target for its preferred SETCC result
type.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D94501
Philip Pfaffe [Mon, 25 Jan 2021 10:05:13 +0000 (11:05 +0100)]
[llvm-dwp] Automatically set the target triple
The llvm-dwp tool hard-codes the target triple to x86. Instead, deduce the
target triple from the object files being read.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D93749
Benjamin Kramer [Mon, 25 Jan 2021 10:48:58 +0000 (11:48 +0100)]
[mlir] Perfectly forward ImplicitLocOpBuilder ctors to OpBuilder
This is both cleaner and less prone to creating a mess out of overload
resolution.
Georgii Rymar [Mon, 25 Jan 2021 10:23:58 +0000 (13:23 +0300)]
[ObjectYAML] - An attempt to fix BB after commit of D95140.
D95140 introduced `static constexpr StringRef TypeStr = "SectionHeaderTable";` member
of `SectionHeaderTable` with in-class initialized. BB reports the link error:
/usr/bin/ld: lib/libLLVMObjectYAML.a(ELFYAML.cpp.o): in function
`llvm::yaml::MappingTraits<std::unique_ptr<llvm::ELFYAML::Chunk, std::default_delete<llvm::ELFYAML::Chunk> > >::mapping(llvm::yaml::IO&, std::unique_ptr<llvm::ELFYAML::Chunk, std::default_delete<llvm::ELFYAML::Chunk> >&)':
ELFYAML.cpp:(.text._ZN4llvm4yaml13MappingTraitsISt10unique_ptrINS_7ELFYAML5ChunkESt14default_deleteIS4_EEE7mappingERNS0_2IOERS7_+0x58): undefined reference to `llvm::ELFYAML::SectionHeaderTable::TypeStr'
/usr/bin/ld: ELFYAML.cpp:(.text._ZN4llvm4yaml13MappingTraitsISt10unique_ptrINS_7ELFYAML5ChunkESt14default_deleteIS4_EEE7mappingERNS0_2IOERS7_+0x353):undefined reference to `llvm::ELFYAML::SectionHeaderTable::TypeStr'
/usr/bin/ld: ELFYAML.cpp:(.text._ZN4llvm4yaml13MappingTraitsISt10unique_ptrINS_7ELFYAML5ChunkESt14default_deleteIS4_EEE7mappingERNS0_2IOERS7_+0x6e5): undefined reference to `llvm::ELFYAML::SectionHeaderTable::TypeStr'
This patch adds a definition to cpp file, I guess it should fix the issue.
Kirill Bobyrev [Mon, 25 Jan 2021 10:09:56 +0000 (11:09 +0100)]
[clang] NFC: Remove else-after-return pattern from some files
Follow-up on D95336. A bunch of these cases were found manually, the
rest made sense to be included to eliminate llvm-else-after-return
Clang-Tidy warnings.
Georgii Rymar [Tue, 19 Jan 2021 14:02:08 +0000 (17:02 +0300)]
[yaml2obj, obj2yaml] - Implement section header table as a special Chunk.
This was discussed in D93678 thread.
Currently we have one special chunk - Fill.
This patch re implements the "SectionHeaderTable" key to become a special chunk too.
With that we are able to place the section header table at any location,
just like we place sections.
Differential revision: https://reviews.llvm.org/D95140
Marek Kurdej [Mon, 25 Jan 2021 09:59:47 +0000 (10:59 +0100)]
[clang-format] [docs] Fix RST indentation.
James Henderson [Thu, 21 Jan 2021 11:13:30 +0000 (11:13 +0000)]
[lld][ELF][test] Add testing for IE/LD TLS weak undef references
Whilst migrating/retiring some downstream testing, I came across a test
for weak undef IE and LD TLS references, but was unable to find any
equivalent in LLD's upstream testing. There does seem to be some slight
subtle differences that could be worth testing compared to LE TLS
references, in particular that IE can be relaxed to LE in this case,
hence this change.
Differential Revision: https://reviews.llvm.org/D95124
Reviewed by: grimar, MaskRay
Kirill Bobyrev [Mon, 25 Jan 2021 09:58:15 +0000 (10:58 +0100)]
[clang] NFC: Remove else if after return
Update the code to be compatible with LLVM Coding Guidelines.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D95336
Nicolas Vasilache [Mon, 25 Jan 2021 09:11:31 +0000 (09:11 +0000)]
[mlir][Linalg] Add a padding option to Linalg tiling
This revision allows the base Linalg tiling pattern to optionally require padding to
a constant bounding shape.
When requested, a simple analysis is performed, similar to buffer promotion.
A temporary `linalg.simple_pad` op is added to model padding for the purpose of
connecting the dots. This will be replaced by a more fleshed out `linalg.pad_tensor`
op when it is available.
In the meantime, this temporary op serves the purpose of exhibiting the necessary
properties required from a more fleshed out pad op, to compose with transformations
properly.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D95149
Sjoerd Meijer [Mon, 25 Jan 2021 08:48:04 +0000 (08:48 +0000)]
[AArch64] Add Cortex CPU subtarget features for instruction fusion.
This adds subtarget features for AES, literal, and compare and branch
instruction fusion for different Cortex CPUs.
Patch by: Cassie Jones.
Differential Revision: https://reviews.llvm.org/D94457
Simon Cook [Mon, 25 Jan 2021 08:58:53 +0000 (08:58 +0000)]
[RISCV] Add attribute support for all supported extensions
This adds support for ".attribute arch" for all extensions that are
currently supported by the compiler.
Differential Revision: https://reviews.llvm.org/D94931
Simon Cook [Mon, 25 Jan 2021 08:58:46 +0000 (08:58 +0000)]
[RISCV] Implement new architecture extension macros
This adds support for the new architecture extension test macros as
defined in the C-API Document:
https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md
Extension versions have been taken from what are used in
RISCVTargetStreamer for ratified extensions, and the -march parser
for experimental extensions.
Differential Revision: https://reviews.llvm.org/D94403
Marek Kurdej [Mon, 25 Jan 2021 08:50:03 +0000 (09:50 +0100)]
[libc++] Set CMAKE_FOLDER. NFC.
* This variable populates the default value of FOLDER target property. It is used in some IDE's (e.g. MSVC) to group different targets together.
Fangrui Song [Mon, 25 Jan 2021 08:49:18 +0000 (00:49 -0800)]
[XRay] Support DW_TAG_call_site and delete unneeded PATCHABLE_EVENT_CALL/PATCHABLE_TYPED_EVENT_CALL lowering
Fangrui Song [Mon, 25 Jan 2021 08:26:54 +0000 (00:26 -0800)]
[XRay] Make __xray_customevent support non-Linux
Haojian Wu [Mon, 25 Jan 2021 08:42:06 +0000 (09:42 +0100)]
Fix a build-bot failure.
The test ms-lookup-template-base-classes.cpp added in
d972d4c749048531953a16b815e07c67e8455a3b
is failing on some builtbot that don't include x86.
This patch should fix that (following the patterns in the test directory).
Lukas Barth [Mon, 25 Jan 2021 08:30:02 +0000 (09:30 +0100)]
[clang-format] Add the possibility to align assignments spanning empty lines or comments
Currently, empty lines and comments break alignment of assignments on consecutive
lines. This makes the AlignConsecutiveAssignments option an enum that allows controlling
whether empty lines or empty lines and comments should be ignored when aligning
assignments.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, tinloaf
Differential Revision: https://reviews.llvm.org/D93986
Marek Kurdej [Mon, 25 Jan 2021 08:40:46 +0000 (09:40 +0100)]
Revert "[clang-format] Add the possibility to align assignments spanning empty lines or comments"
This reverts commit
f00a20e51c1d186e72844939aad10416e1cc99de.
Marek Kurdej [Mon, 25 Jan 2021 08:30:02 +0000 (09:30 +0100)]
[clang-format] Add the possibility to align assignments spanning empty lines or comments
Currently, empty lines and comments break alignment of assignments on consecutive
lines. This makes the AlignConsecutiveAssignments option an enum that allows controlling
whether empty lines or empty lines and comments should be ignored when aligning
assignments.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, tinloaf
Differential Revision: https://reviews.llvm.org/D93986
Ben Shi [Mon, 25 Jan 2021 08:33:58 +0000 (16:33 +0800)]
Revert "[clang][AVR] Improve avr-ld command line options"
This reverts commit
89a5147e5a0c2e886cdf7ffa34799c069d825940.
Jan Svoboda [Mon, 25 Jan 2021 07:42:44 +0000 (08:42 +0100)]
[clang][cli] NFC: Pass CC1Option explicitly to BoolOption
When `Bool{F,G}Option` were introduced, they were designed after the existing `Opt{In,Out}FFlag` in that they implied `CC1Option` for the `ChangedBy` flag.
This means less typing, but can be misleading in situations when the `ResetBy` has explicit `CC1Option` and `ChangedBy` doesn't.
This patch stops implicitly putting `CC1Option` to `ChangedBy` flag.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95225
Jan Svoboda [Mon, 25 Jan 2021 07:41:41 +0000 (08:41 +0100)]
[clang][cli] NFC: Move prefix to the front of BoolOption
The prefix used to be the last (optional) argument to BoolOption. This decision was made with the expectation that only few command line options would need to pass it explicitly instead of using Bool{F,G}Option. It turns out that a considerable number of options don't conform to Bool{F,G}Option and need to provide the prefix anyways. This sometimes requires to explicitly pass `BothFlags<[]>`.
This patch makes prefix the first parameter, so it now directly precedes the spelling base string. Now 8 options dropped `BothFlags<[]>` and only two options (`pthread` and `emit_llvm_uselists`) need to pass an empty prefix.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95221
Andre Vieira [Mon, 25 Jan 2021 07:55:13 +0000 (07:55 +0000)]
[AArch64] Merge [US]MULL with half adds and subs into [US]ML[AS]L
This patch adds patterns to teach the AArch64 backend to merge [US]MULL
instructions and adds/subs of half the size into [US]ML[AS]L where we don't use
the top half of the result.
Differential Revision: https://reviews.llvm.org/D95218
Lang Hames [Mon, 25 Jan 2021 04:14:22 +0000 (15:14 +1100)]
[JITLink] Enable exception handling for ELF.
Adds the EHFrameSplitter and EHFrameEdgeFixer passes to the default JITLink
pass pipeline for ELF/x86-64, and teaches EHFrameEdgeFixer to handle some
new pointer encodings.
Together these changes enable exception handling (at least for the basic
cases that I've tested so far) for ELF/x86-64 objects loaded via JITLink.
QingShan Zhang [Mon, 25 Jan 2021 04:00:32 +0000 (04:00 +0000)]
[NFC] [DAGCombine] Correct the result for sqrt even the iteration is zero
For now, we correct the result for sqrt if iteration > 0. This doesn't make
sense as they are not strict relative.
Reviewed By: dmgreen, spatel, RKSimon
Differential Revision: https://reviews.llvm.org/D94480
Ben Shi [Mon, 25 Jan 2021 04:01:26 +0000 (12:01 +0800)]
[clang][AVR] Improve avr-ld command line options
Stella Laurenzo [Sun, 24 Jan 2021 22:46:56 +0000 (14:46 -0800)]
[mlir][Python] Roll up of python API fixes.
* As discussed, fixes the ordering or (operands, results) -> (results, operands) in various `create` like methods.
* Fixes a syntax error in an ODS accessor method.
* Removes the linalg example in favor of a test case that exercises the same.
* Fixes FuncOp visibility to properly use None instead of the empty string and defaults it to None.
* Implements what was documented for requiring that trailing __init__ args `loc` and `ip` are keyword only.
* Adds a check to `InsertionPoint.insert` so that if attempting to insert past the terminator, an exception is raised telling you what to do instead. Previously, this would crash downstream (i.e. when trying to print the resultant module).
* Renames `_ods_build_default` -> `build_generic` and documents it.
* Removes `result` from the list of prohibited words and for single-result ops, defaults to naming the result `result`, thereby matching expectations and what is already implemented on the base class.
* This was intended to be a relatively small set of changes to be inlined with the broader support for ODS generating the most specific builder, but it spidered out once actually testing various combinations, so rolling up separately.
Differential Revision: https://reviews.llvm.org/D95320
David Blaikie [Tue, 5 Jan 2021 06:48:54 +0000 (22:48 -0800)]
lldb: Add support for printing variables with DW_AT_ranges on DW_TAG_subprograms
Finishing out the support (to the best of my knowledge/based on current
testing running the whole check-lldb with a clang forcibly using
DW_AT_ranges on all DW_TAG_subprograms) for this feature.
Differential Revision: https://reviews.llvm.org/D94064
David Blaikie [Mon, 25 Jan 2021 02:38:16 +0000 (18:38 -0800)]
Fix sign-comparison warnings in unit test EXPECTs
Chen Zheng [Mon, 18 Jan 2021 04:53:33 +0000 (23:53 -0500)]
[PowerPC] support register pressure reduction in machine combiner.
Reassociating some patterns to generate more fma instructions to
reduce register pressure.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D92071