Florian Hahn [Tue, 13 Apr 2021 07:24:24 +0000 (08:24 +0100)]
[SimplifyCFG] Allow hoisting terminators only with HoistCommonInsts=false.
As a side-effect of the change to default HoistCommonInsts to false
early in the pipeline, we fail to convert conditional branch & phis to
selects early on, which prevents vectorization for loops that contain
conditional branches that effectively are selects (or if the loop gets
vectorized, it will get vectorized very inefficiently).
This patch updates SimplifyCFG to perform hoisting if the only
instruction in both BBs is an equal branch. In this case, the only
additional instructions are selects for phis, which should be cheap.
Even though we perform hoisting, the benefits of this kind of hoisting
should by far outweigh the negatives.
For example, the loop in the code below will not get vectorized on
AArch64 with the current default, but will with the patch. This is a
fundamental pattern we should definitely vectorize. Besides that, I
think the select variants should be easier to use for reasoning across
other passes as well.
https://clang.godbolt.org/z/sbjd8Wshx
```
double clamp(double v) {
if (v < 0.0)
return 0.0;
if (v > 6.0)
return 6.0;
return v;
}
void loop(double* X, double *Y) {
for (unsigned i = 0; i < 20000; i++) {
X[i] = clamp(Y[i]);
}
}
```
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D100329
Sven van Haastregt [Tue, 13 Apr 2021 09:27:37 +0000 (10:27 +0100)]
[OpenCL][NFC] Rename isOpenCLVersionContainedInMask
Drop the double occurrence of "is".
Kadir Cetinkaya [Tue, 13 Apr 2021 08:26:03 +0000 (10:26 +0200)]
Revert "Revert "[clangd] Provide a way to disable external index""
This reverts commit
c2ad7c23707cece995ee9070283a72c4afc8c0fe while
adding the handling for the new enum value into the switch statement.
Michał Górny [Thu, 8 Apr 2021 22:18:09 +0000 (00:18 +0200)]
[lldb] [gdb-remote client] Refactor handling qSupported
Refactor the qSupported handler to split the reply into an array,
and identify features within the array rather than searching the string
for partial matches. While at it, use StringRef.split() to process
the compression list instead of reinventing the wheel.
Switch the arguments to MaybeEnableCompression() to use an ArrayRef
of StringRefs to simplify parameter passing from GetRemoteQSupported().
Differential Revision: https://reviews.llvm.org/D100146
Tobias Gysi [Tue, 13 Apr 2021 08:37:40 +0000 (08:37 +0000)]
[mlir][linalg] lower index operations during linalg to loop lowering.
The patch extends the linalg to loop lowering pass to replace all linalg index operations by the induction variables of the generated loop nests.
Differential Revision: https://reviews.llvm.org/D100364
Pavel Labath [Tue, 13 Apr 2021 08:55:56 +0000 (10:55 +0200)]
Revert "[lldb] [Process] Watch for fork/vfork notifications" and associated followups
This commit has caused the following tests to be flaky:
TestThreadSpecificBpPlusCondition.py
TestExitDuringExpression.py
The exact cause is not known yet, but since both tests deal with
threads, my guess is it has something to do with the tracking of
creation of new threads (which the commit touches upon).
This reverts the following commits:
d01bff8cbdc98fb8751f7bf10af19b47ae5c445d,
ba62ebc48e8c424ce3a78ba01acda679d536dd47,
e761b6b4c58d4f7ae1073d925d7cb321d68ee93a,
a345419ee03095c8cdfbe1c2728467c4da8fa0a4.
David Spickett [Fri, 9 Apr 2021 13:23:26 +0000 (13:23 +0000)]
[lldb] Require x86 for unwind no-return test
The core file used is built for i386 so we
need the x86 backend to be able to load it.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D100195
David Spickett [Fri, 9 Apr 2021 13:11:31 +0000 (13:11 +0000)]
[lldb][Arm/AArch64] Add basic disassemble tests for Arm/AArch64
Previously the test would fail if you built on Arm/AArch64
but did not have the x86 llvm backend enabled.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D100192
David Spickett [Fri, 9 Apr 2021 13:14:31 +0000 (13:14 +0000)]
[lldb] Require x86 backend for a bunch of DWARF tests
By moving them into a folder with a local lit config
requiring x86. All these tests use x86 target triples.
There are two tests that require target-x86_64 because
they run program files (instead of just needing the backend).
Those are moved to the x86 folder also but their REQUIRES are
unchanged.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D100193
Marek Kurdej [Tue, 13 Apr 2021 08:32:16 +0000 (10:32 +0200)]
[libc++] Fix test synopses and remove unused includes.
Ricky Taylor [Thu, 11 Mar 2021 20:37:57 +0000 (20:37 +0000)]
[M68k] Implement AsmParser
This is a work-in-progress implementation of an assembler for M68k.
Outstanding work:
- Updating existing tests assembly syntax
- Writing new tests for the assembler (and disassembler)
I've left those until there's consensus that this approach is okay (I hope that's okay!).
Questions I'm aware of:
- Should this use Motorola or gas syntax? (At the moment it uses Motorola syntax.)
- The disassembler produces a table at runtime for disassembly generated from the code beads. Is this okay? (This is less than ideal but as I mentioned in my llvm-dev post, it's quite complicated to write a table-gen parser for code beads.)
Depends on D98519
Depends on D98532
Depends on D98534
Depends on D98535
Depends on D98536
Differential Revision: https://reviews.llvm.org/D98537
Alexey Bader [Tue, 13 Apr 2021 05:00:21 +0000 (08:00 +0300)]
[NFC][SYCL] Drop idle triple component from regression tests.
Pavel Labath [Tue, 13 Apr 2021 07:25:37 +0000 (09:25 +0200)]
[lldb] Replace NativeProcess delegate list with a single delegate
In all this time, we've never used more than one delegate. The logic to
support multiple delegates is therefore untested, and becomes
particularly unwieldy once we need to support multiple processes.
Just remove it.
KareemErgawy-TomTom [Tue, 13 Apr 2021 06:26:12 +0000 (08:26 +0200)]
[MLIR][LinAlg] Implement detensoring cost-modelling.
This patch introduces the neccessary infrastructure changes to implement
cost-modelling for detensoring. In particular, it introduces the
following changes:
- An extension to the dialect conversion framework to selectively
convert sub-set of non-entry BB arguments.
- An extension to branch conversion pattern to selectively convert
sub-set of a branche's operands.
- An interface for detensoring cost-modelling.
- 2 simple implementations of 2 different cost models.
This sets the stage to explose cost-modelling for detessoring in an
easier way. We still need to come up with better cost models.
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D99945
Thomas Lively [Tue, 13 Apr 2021 07:06:25 +0000 (00:06 -0700)]
[WebAssembly] Test i64x2.abs encoding
This test was disabled despite the instruction having been implemented for a
long time. This commit just enables the test.
Differential Revision: https://reviews.llvm.org/D100345
Craig Topper [Tue, 13 Apr 2021 06:27:44 +0000 (23:27 -0700)]
[RISCV] Rename RISCVISD::SHFLI to RISCVISD::SHFL and don't require the second operand to be an immediate.
Prep work for adding intrinsics in the future.
Left an assert that the input is constant in ReplaceNodeResults,
as the intrinsic shouldn't go through that path.
Freddy Ye [Tue, 13 Apr 2021 06:33:08 +0000 (14:33 +0800)]
[compiler-rt][X86] fix build fail after "[X86] Support -march=rocketlake"
This copy error will cause a failed builder on sanitizer-x86_64-linux
Christopher Di Bella [Tue, 13 Apr 2021 05:15:10 +0000 (05:15 +0000)]
[libcxx][NFC] tweaks `incrementable_traits` per review
One suggestion was missed and is being patched now.
Christopher Di Bella [Tue, 23 Mar 2021 03:55:52 +0000 (03:55 +0000)]
[libcxx] adds `std::incrementable_traits` to <iterator>
Implements parts of:
- P0896R4 The One Ranges Proposal
Depends on D99041
Differential Revision: https://reviews.llvm.org/D99141
Jonas Devlieghere [Tue, 13 Apr 2021 04:09:58 +0000 (21:09 -0700)]
[lldb] Fix replaying TestMemoryRead.py from reproducer
Remap the external file to the one embedded in the reproducer.
Amy Huang [Tue, 13 Apr 2021 03:02:41 +0000 (20:02 -0700)]
Revert "Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands""
This change causes an assert / segmentation fault in LTO builds.
This reverts commit
f2e4f3eff3c9135d92840016f8ed4540cdd1313b.
Serguei Katkov [Fri, 9 Apr 2021 08:39:55 +0000 (15:39 +0700)]
[GreedyRA ORE] Add debug location for function level report
Reviewers: reames, MatzeB, anemet, thegameg
Reviewed By: thegameg
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100168
Chen Zheng [Tue, 13 Apr 2021 01:28:31 +0000 (21:28 -0400)]
[PowerPC] stop reverse mem op generation for some cases.
We should consider the feeder user number when we do reverse memory
operation transformation. Otherwise, we may get negative impact.
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D100166
Evgeniy Brevnov [Tue, 13 Apr 2021 01:22:35 +0000 (08:22 +0700)]
[NARY][NFC] Use hasNUsesOrMore instead of getNumUses since it's more
efficient.
Eugene Zhulenev [Mon, 12 Apr 2021 17:48:02 +0000 (10:48 -0700)]
[mlir] Async: add automatic reference counting at async.runtime operations level
Depends On D95311
Previous automatic-ref-counting pass worked with high level async operations (e.g. async.execute), however async values reference counting is a runtime implementation detail.
New pass mostly relies on the save liveness analysis to place drop_ref operations, and does better verification of CFG with different liveIn sets in block successors.
This is almost NFC change. No new reference counting ideas, just a cleanup of the previous version.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D95390
Freddy Ye [Tue, 13 Apr 2021 01:24:34 +0000 (09:24 +0800)]
[X86] Support -march=rocketlake
Reviewed By: skan, craig.topper, MaskRay
Differential Revision: https://reviews.llvm.org/D100085
Geoffrey Martin-Noble [Tue, 13 Apr 2021 00:01:30 +0000 (17:01 -0700)]
[MLIR] Add a switch operation to the standard dialect
This is similar to the definition of llvm.switch, providing
unstructured branch-based control flow. It differs from the LLVM
operation in that it accepts any signless integer (not only an i32),
takes no branch weights (the same as the Branch and CondBranch ops),
and has a slightly different syntax for the default case that includes
it in the list of cases with an explicit `default` keyword.
Also included are several canonicalizers.
See https://llvm.discourse.group/t/rfc-add-std-switch-and-scf-switch/3090
Reviewed By: rriddle, bondhugula
Differential Revision: https://reviews.llvm.org/D99925
LLVM GN Syncbot [Tue, 13 Apr 2021 01:35:58 +0000 (01:35 +0000)]
[gn build] Port
e96df3e531f5
Jonas Devlieghere [Tue, 13 Apr 2021 01:31:37 +0000 (18:31 -0700)]
[lldb] Disable TestLaunchProcessPosixSpawn.py with reproducers
Gulfem Savrun Yeniceri [Tue, 29 Dec 2020 21:32:13 +0000 (21:32 +0000)]
[Passes] Add relative lookup table converter pass
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in:
https://bugs.llvm.org/show_bug.cgi?id=45244
This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly.
Differential Revision: https://reviews.llvm.org/D94355
Emilio Cota [Tue, 13 Apr 2021 01:20:02 +0000 (18:20 -0700)]
[mlir] Use MCJIT to fix integration tests
Since
c42c67ad ('Re-apply "[lli] Make -jit-kind=orc the default JIT
engine"'), ORC is the default JIT. Unfortunately, ORC seems to
ignore the --entry-function flag, which breaks all tests that
use the flag, namely the AMX and X86Vector integration tests.
This has been reported in PR#49906
(https://bugs.llvm.org/show_bug.cgi?id=49906).
Work around this by explicitly selecting MCJIT.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D100344
Ahmed Bougacha [Tue, 13 Apr 2021 01:03:54 +0000 (18:03 -0700)]
Revert "[lldb] [gdb-remote client] Refactor handling qSupported"
This reverts commit
3842de49f6551f597b4c7c78caa8ba7003755cec.
It fails to build, with errors such as:
GDBRemoteCommunicationClient.cpp:1005:20:
error: no viable overloaded '='
avail_name = compression;
Nick Desaulniers [Tue, 13 Apr 2021 00:51:16 +0000 (17:51 -0700)]
[JumpThreading] merge debug info when merging select+br
Jump threading can replace select then unconditional branch with
conditional branch, but when doing so loses debug info.
This destructive transform is eventually leading to a failed Verifier
run during full LTO builds of the Linux kernel with CFI and KCOV
enabled, as reported in PR39531.
ModuleSanitizerCoveragePass will insert calls to
__sanitizer_cov_trace_pc, and sometimes split critical edges,
using whatever debug info may or may not exist for the branch for
the added libcall. Since we can inline calls to
__sanitizer_cov_trace_pc due to LTO, this can lead to the error
observed in PR39531 when the debug info isn't propagated to
the libcall, because of prior destructive transforms that failed to
retain debug info.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D100137
Pirama Arumuga Nainar [Tue, 13 Apr 2021 00:13:27 +0000 (17:13 -0700)]
[compiler-rt][aarch64] Add PAC-RET/BTI property to hwasan_interceptors_vfork.S
D100143 added similar annotations but missed this file.
Differential Revision: https://reviews.llvm.org/D100354
Arthur Eubanks [Thu, 18 Mar 2021 04:26:26 +0000 (21:26 -0700)]
[Evaluator] Look through invariant.group intrinsics
Turning on -fstrict-vtable-pointers in Chrome caused an extra global
initializer. Turns out that a llvm.strip.invariant.group intrinsic was
causing GlobalOpt to fail to step through some simple code.
We can treat *.invariant.group uses as simply their operand.
Value::stripPointerCastsForAliasAnalysis() does exactly this. This
should be safe because the Evaluator does not skip memory accesses due
to invariants or alias analysis.
However, we don't want to leak that we've stripped arbitrary pointer
casts to users of Evaluator, so we bail out if we evaluate a function to
any constant, since we may have looked through *.invariant.group calls
and aliasing pointers cannot be arbitrarily substituted.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D98843
Nick Desaulniers [Mon, 12 Apr 2021 22:55:53 +0000 (15:55 -0700)]
[SantizerCoverage] handle missing DBG MD when inserting libcalls
Instruction::getDebugLoc can return an invalid DebugLoc. For such cases
where metadata was accidentally removed from the libcall insertion
point, simply insert a DILocation with line 0 scoped to the caller. When
we can inline the libcall, such as during LTO, then we won't fail a
Verifier check that all calls to functions with debug metadata
themselves must have debug metadata.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D100158
Nathan James [Mon, 12 Apr 2021 22:32:12 +0000 (23:32 +0100)]
[clang-tidy] Add <utility> include to misc-uniqueptr-reset-release
This is the only remaining check that creates `std::move` includes but doesn't add a `<utility>` include.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D97683
Michał Górny [Thu, 8 Apr 2021 22:18:09 +0000 (00:18 +0200)]
[lldb] [gdb-remote client] Refactor handling qSupported
Refactor the qSupported handler to split the reply into an array,
and identify features within the array rather than searching the string
for partial matches. While at it, use StringRef.split() to process
the compression list instead of reinventing the wheel.
Switch the arguments to MaybeEnableCompression() to use an ArrayRef
of StringRefs to simplify parameter passing from GetRemoteQSupported().
Differential Revision: https://reviews.llvm.org/D100146
Yuanfang Chen [Mon, 12 Apr 2021 21:16:25 +0000 (14:16 -0700)]
Reland "Revert "[InstCombine] when calling conventions are compatible, don't convert the call to undef idiom""
This reverts commit
a3fabc79ae9d7dd76545b2abc2a3bfb66c6d3175 (relands
f4d682d6ce6c5b3a41a0acf297507c82f5c21eef with fix for the compile-time
regression issue).
Sterling Augustine [Mon, 12 Apr 2021 21:17:49 +0000 (14:17 -0700)]
Revert "[clangd] Provide a way to disable external index"
This reverts commit
63bc9e443502ab6def2dec0b5ffe64a522f801cc.
This breaks llvm-project/clang-tools-extra/clangd/tool/ClangdMain.cpp:570:11:
with error: enumeration value 'None' not handled in switch [-Werror,-Wswitch]
Florian Hahn [Mon, 12 Apr 2021 19:05:39 +0000 (20:05 +0100)]
[PhaseOrdering] Add test for SimplifyCFG and LV interaction.
Florian Hahn [Mon, 12 Apr 2021 16:58:59 +0000 (17:58 +0100)]
[SimplifyCFG] Add test requiring only hoisting a branch.
Fangrui Song [Mon, 12 Apr 2021 21:28:23 +0000 (14:28 -0700)]
[ARM] Fix -Wmissing-field-initializers
Lei Zhang [Mon, 12 Apr 2021 21:08:22 +0000 (17:08 -0400)]
[mlir][spirv] Fix runtime array stride when emulating bitwidth
The stride should be calculated with the converted array element
type, not the original input type.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D100337
Jian Cai [Mon, 12 Apr 2021 20:54:13 +0000 (13:54 -0700)]
Fix up build failures after
cfce5b26a888cb979d65252275df1f977dc1e6c8
Build log: https://lab.llvm.org/buildbot/#/builders/37/builds/3538
Differential Revision: https://reviews.llvm.org/D98916
Lei Zhang [Mon, 12 Apr 2021 20:50:24 +0000 (16:50 -0400)]
[mlir][spirv] Allow bitwidth emulation on runtime arrays
Runtime arrays are converted from memrefs with unknown
dimensions.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D100335
Nikita Popov [Mon, 12 Apr 2021 20:54:26 +0000 (22:54 +0200)]
Revert "[InstCombine] when calling conventions are compatible, don't convert the call to undef idiom"
This reverts commit
f4d682d6ce6c5b3a41a0acf297507c82f5c21eef.
This caused a significant compile-time regression:
https://llvm-compile-time-tracker.com/compare.php?from=
4b7bad9eaea2233521a94f6b096aaa88dc584e23&to=
f4d682d6ce6c5b3a41a0acf297507c82f5c21eef&stat=instructions
Possibly this is due to overeager parsing of target triples.
Lei Zhang [Mon, 12 Apr 2021 20:38:04 +0000 (16:38 -0400)]
[mlir] Move memref.subview patterns to MemRef/Transforms/
These patterns have been used as a prerequisite step for lowering
to SPIR-V. But they don't involve SPIR-V dialect ops; they are
pure memref/vector op transformations. Given now we have a dedicated
MemRef dialect, moving them to Memref/Transforms/, which is a more
suitable place to host them, to allow used by others.
This commit just moves code around and renames patterns/passes
accordingly. CMakeLists.txt for existing MemRef libraries are
also improved along the way.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D100326
Julian Lettner [Sat, 10 Apr 2021 01:02:39 +0000 (18:02 -0700)]
[TSan] Allow test contents to be copied before execution
Allow test contents to be copied before execution by using
`%ld_flags_rpath_so`, `%ld_flags_rpath_exe`, and `%dynamiclib`
substitutions.
rdar://
76302416
Differential Revision: https://reviews.llvm.org/D100240
Sanjay Patel [Mon, 12 Apr 2021 20:16:19 +0000 (16:16 -0400)]
[InstCombine] fold shift+trunc signbit check
https://alive2.llvm.org/ce/z/6vQvrP
This solves:
https://llvm.org/PR49866
Sanjay Patel [Mon, 12 Apr 2021 20:00:50 +0000 (16:00 -0400)]
[InstCombine] add tests for shift+trunc signbit check; NFC
Daniele Castagna [Mon, 12 Apr 2021 20:15:14 +0000 (13:15 -0700)]
[clang-rename] Handle designated initializers.
clang Tooling, and more specifically Refactoring/Rename, have support
code to extract source locations given a Unified Symbol Resolution set.
This support code is used by clang-rename and other tools that might not
be in the tree.
Currently field designated initializer are not supported.
So, renaming S::a to S::b in this code:
S s = { .a = 10 };
will not extract the field designated initializer for a (the 'a' after the
dot).
This patch adds support for field designated initialized to
RecursiveSymbolVisitor and RenameLocFinder that is used in
createRenameAtomicChanges.
Differential Revision: https://reviews.llvm.org/D100310
Jonas Devlieghere [Mon, 12 Apr 2021 18:25:24 +0000 (11:25 -0700)]
[lldb] Disable Shell/Subporcess with reproducers
peter klausler [Mon, 12 Apr 2021 17:10:38 +0000 (10:10 -0700)]
[flang] Correct TypeCode::IsLogical()
F18 is using the type codes for C's "least" int types to encode
the various kinds of Fortran's LOGICAL intrinsic type; update
the IsLogical() predicate accordingly. (This member function
isn't yet used anywhere, so this patch is nearly an NFC.)
Differential Revision: https://reviews.llvm.org/D100323
jasonliu [Mon, 12 Apr 2021 19:22:12 +0000 (19:22 +0000)]
[libc++] add `inline` for __open's definition in ifstream and ofstream
Summary:
When building with gcc on AIX, it seems that gcc does not like the
`always_inline` without the `inline` keyword.
So adding the inline keywords in for __open in ifstream and ofstream.
That will also make it consistent with __open in basic_filebuf
(it seems we added `inline` there before for gcc build as well).
Differential Revision: https://reviews.llvm.org/D99422
Lei Zhang [Mon, 12 Apr 2021 19:09:49 +0000 (15:09 -0400)]
[mlir][spirv] Put debug-only variable in LLVM_DEBUG
This avoids paying the cost when building in release.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D100325
Jian Cai [Mon, 12 Apr 2021 19:00:01 +0000 (12:00 -0700)]
[ARM] support symbolic expression as immediate in memory instructions
Currently the ARM backend only accpets constant expressions as the
immediate operand in load and store instructions. This allows the
result of symbolic expressions to be used in memory instructions. For
example,
0:
.space 2048
strb r2, [r0, #(.-0b)]
would be assembled into the following instructions.
strb r2, [r0, #2048]
This only adds support to ldr, ldrb, str, and strb in arm mode to
address the build failure of Linux kernel for now, but should facilitate
adding support to similar instructions in the future if the need arises.
Link:
https://github.com/ClangBuiltLinux/linux/issues/1329
Reviewed By: peter.smith, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D98916
Sanjay Patel [Mon, 12 Apr 2021 18:51:51 +0000 (14:51 -0400)]
[PassManager][PhaseOrdering] lower expects before running simplifyCFG
Retry of
330619a3a623 that includes a clang test update.
Original commit message:
If we run passes before lowering llvm.expect intrinsics to metadata,
then those passes have no way to act on the hints provided by llvm.expect.
SimplifyCFG is the known offender, and we made it smarter about profile
metadata in D98898 <https://reviews.llvm.org/D98898>.
In the motivating example from https://llvm.org/PR49336 , this means we
were ignoring the recommended method for a programmer to tell the compiler
that a compare+branch is expensive. This change appears to solve that case -
the metadata survives to the backend, the compare order is as expected in IR,
and the backend does not do anything to reverse it.
We make the same change to the old pass manager to keep things synchronized.
Differential Revision: https://reviews.llvm.org/D100213
Sean Perry [Mon, 12 Apr 2021 19:03:27 +0000 (15:03 -0400)]
Enable creation of large response file on z/OS
Most text processing commands (eg. grep, awk) have a maximum line length limit on z/OS. The current method of using cc -E & grep fails on z/OS because of this limit. I'm changing the command to create the long line in the response file to use python. This avoids the possibility of any tools blocking the generation of the large response file. This also eliminates the need for the extra file.
Reviewed By: abhina.sreeskantharajan
Differential Revision: https://reviews.llvm.org/D100197
Arthur Eubanks [Fri, 9 Apr 2021 21:13:29 +0000 (14:13 -0700)]
[NewPM] Fix -print-changed when a -filter-print-funcs function is removed
-filter-print-funcs -print-changed was crashing after the filter func
was removed by a pass with
Assertion failed: After.find("*** IR Dump") == 0 && "Unexpected banner format."
We weren't printing the banner because when we have -filter-print-funcs,
we print each function separately, letting the print function filter out
unwanted functions.
Reviewed By: jamieschmeiser
Differential Revision: https://reviews.llvm.org/D100237
David Tenty [Mon, 12 Apr 2021 18:47:42 +0000 (14:47 -0400)]
[AIX] Tweak test XFAIL from D99815
the test fails on AIX host, not necessarily just the target.
Emily Shi [Fri, 9 Apr 2021 00:49:22 +0000 (17:49 -0700)]
[compiler-rt] add SANITIZER_OSX
This will allow us to make osx specific changes easier. Because apple silicon macs also run on aarch64, it was easy to confuse it with iOS.
rdar://
75302812
Reviewed By: yln
Differential Revision: https://reviews.llvm.org/D100157
eopXD [Mon, 12 Apr 2021 12:22:58 +0000 (17:52 +0530)]
[mlir][affine] Fix unfolded bounding maps for affine.for
Loop bounds of affine.for didn't perform foldings like affine.load, affine.store.
Bound maps shall be more composed, leaving most affine.apply become dead.
This resolves the bug listed on https://bugs.llvm.org/show_bug.cgi?id=45203
Differential Revision: https://reviews.llvm.org/D99323
Richard Smith [Mon, 12 Apr 2021 18:39:08 +0000 (11:39 -0700)]
Fix documentation typo.
Mara Sophie Grosch [Mon, 12 Apr 2021 18:19:51 +0000 (14:19 -0400)]
[libc++] Move checks for newlib to actually work
The checks did not work in __config, since no header defining
`_NEWLIB_VERSION` was included before. This patch moves the two
checks for newlib to the headers that actually need it - and after
they already include relevant headers.
Differential Revision: https://reviews.llvm.org/D79888
Sanjay Patel [Mon, 12 Apr 2021 17:58:01 +0000 (13:58 -0400)]
Revert "[PassManager][PhaseOrdering] lower expects before running simplifyCFG"
This reverts commit
330619a3a623d623944c58ebc06cbb83ac0e58af.
There are clang tests that also need to be updated.
Arthur Eubanks [Sat, 10 Apr 2021 18:59:04 +0000 (11:59 -0700)]
[Inliner] Propagate SROA analysis through invariant group intrinsics
SROA can handle invariant group intrinsics, let the inliner know that
for better heuristics when the intrinsics are present.
This fixes size issues in a couple files when turning on
-fstrict-vtable-pointers in Chrome.
Reviewed By: rnk, mtrofin
Differential Revision: https://reviews.llvm.org/D100249
Hamza Sood [Mon, 12 Apr 2021 17:47:14 +0000 (10:47 -0700)]
Replace uses of std::iterator with explicit using
This patch removes all uses of `std::iterator`, which was deprecated in C++17.
While this isn't currently an issue while compiling LLVM, it's useful for those using LLVM as a library.
For some reason there're a few places that were seemingly able to use `std` functions unqualified, which no longer works after this patch. I've updated those places, but I'm not really sure why it worked in the first place.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D67586
Fraser Cormack [Thu, 8 Apr 2021 10:22:46 +0000 (11:22 +0100)]
[RISCV] Support vector SET[U]LT and SET[U]GE with splatted immediates
This patch adds more optimized codegen for the above SETCC forms,
by matching the '.vi' vector forms when the immediate is a 5-bit signed
immediate plus 1. The immediate can be decremented and the corresponding
SET[U]LE or SET[U]GT forms can be matched.
This work was left as a TODO from D94168.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D100096
Arjun P [Mon, 12 Apr 2021 17:31:15 +0000 (23:01 +0530)]
[MLIR] PresburgerSet emptiness check: remove assertions that there are no symbols
Symbols are now supported in the integer emptiness check. Remove some outdated assertions checking that there are no symbols.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D100327
Aart Bik [Mon, 12 Apr 2021 16:28:41 +0000 (09:28 -0700)]
[mlir] introduce "encoding" attribute to tensor type
This CL introduces a generic attribute (called "encoding") on tensors.
The attribute currently does not carry any concrete information, but the type
system already correctly determines that tensor<8xi1,123> != tensor<8xi1,321>.
The attribute will be given meaning through an interface in subsequent CLs.
See ongoing discussion on discourse:
[RFC] Introduce a sparse tensor type to core MLIR
https://llvm.discourse.group/t/rfc-introduce-a-sparse-tensor-type-to-core-mlir/2944
A sparse tensor will look something like this:
```
// named alias with all properties we hold dear:
#CSR = {
// individual named attributes
}
// actual sparse tensor type:
tensor<?x?xf64, #CSR>
```
I see the following rough 5 step plan going forward:
(1) introduce this format attribute in this CL, currently still empty
(2) introduce attribute interface that gives it "meaning", focused on sparse in first phase
(3) rewrite sparse compiler to use new type, remove linalg interface and "glue"
(4) teach passes to deal with new attribute, by rejecting/asserting on non-empty attribute as simplest solution, or doing meaningful rewrite in the longer run
(5) add FE support, document, test, publicize new features, extend "format" meaning to other domains if useful
Reviewed By: stellaraccident, bondhugula
Differential Revision: https://reviews.llvm.org/D99548
Emilio Cota [Mon, 12 Apr 2021 17:15:35 +0000 (19:15 +0200)]
[mlir] Rename AVX512 dialect to X86Vector
We will soon be adding non-AVX512 operations to MLIR, such as AVX's rsqrt. In https://reviews.llvm.org/D99818 several possibilities were discussed, namely to (1) add non-AVX512 ops to the AVX512 dialect, (2) add more dialects (e.g. AVX dialect for AVX rsqrt), and (3) expand the scope of the AVX512 to include these SIMD x86 ops, thereby renaming the dialect to something more accurate such as X86Vector.
Consensus was reached on option (3), which this patch implements.
Reviewed By: aartbik, ftynse, nicolasvasilache
Differential Revision: https://reviews.llvm.org/D100119
MaheshRavishankar [Mon, 12 Apr 2021 15:49:45 +0000 (08:49 -0700)]
[mlir][Linalg] Disable const -> linalg.generic when fused op is illegal.
Fusing a constant with a linalg.generic operation can result in the
fused operation being illegal since the loop bound computation
fails. Avoid such fusions.
Differential Revision: https://reviews.llvm.org/D100272
Mitch Phillips [Mon, 12 Apr 2021 16:49:28 +0000 (09:49 -0700)]
[asan] Replaceable new/delete is unsupported in Windows.
Mark the test as unsupported to bring the bot online. Could probably be
permanently fixed by using one of the workarounds already present in
compiler-rt.
Alexander Kornienko [Mon, 12 Apr 2021 16:28:01 +0000 (18:28 +0200)]
Fix nits.
Jens Massberg [Mon, 12 Apr 2021 16:25:29 +0000 (18:25 +0200)]
[clang-tidy] Add option to ignore macros in readability-function-cognitive-complexity check.
(this was originally part of https://reviews.llvm.org/D96281 and has been split off into its own patch)
If a macro is used within a function, the code inside the macro
doesn't make the code less readable. Instead, for a reader a macro is
more like a function that is called. Thus the code inside a macro
shouldn't increase the complexity of the function in which it is called.
Thus the flag 'IgnoreMacros' is added. If set to 'true' code inside
macros isn't considered during analysis.
This isn't perfect, as now the code of a macro isn't considered at all,
even if it has a high cognitive complexity itself. It might be better if
a macro is considered in the analysis like a function and gets its own
cognitive complexity. Implementing such an analysis seems to be very
complex (if possible at all with the given AST), so we give the user the
option to either ignore macros completely or to let the expanded code
count to the calling function's complexity.
See the code example from vgeof (originally added as note in https://reviews.llvm.org/D96281)
bool doStuff(myClass* objectPtr){
if(objectPtr == nullptr){
LOG_WARNING("empty object");
return false;
}
if(objectPtr->getAttribute() == nullptr){
LOG_WARNING("empty object");
return false;
}
use(objectPtr->getAttribute());
}
The LOG_WARNING macro itself might have a high complexity, but it do not make the
the function more complex to understand like e.g. a 'printf'.
By default 'IgnoreMacros' is set to 'false', which is the original behavior of the check.
Reviewed By: lebedev.ri, alexfh
Differential Revision: https://reviews.llvm.org/D98070
Tim Keith [Mon, 12 Apr 2021 16:40:51 +0000 (09:40 -0700)]
[flang] Fix narrowing warning on macos
With clang 11 on macos we were getting this warning:
```
flang/runtime/random.cpp:61:30: error: non-constant-expression cannot be narrowed from type 'unsigned long long' to 'runtime::GeneratedWord' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
GeneratedWord word{(generator() - generator.min()) & rangeMask};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flang/runtime/random.cpp:99:5: note: in instantiation of function template specialization 'runtime::Generate<double, 53>' requested here
Generate<CppTypeFor<TypeCategory::Real, 8>, 53>(harvest);
^
```
Changing the type of `rangeMask` fixes it.
Differential Revision: https://reviews.llvm.org/D100320
Artem Belevich [Thu, 8 Apr 2021 20:12:10 +0000 (13:12 -0700)]
Allow applying attributes to subset of allowed subjects.
Differential Revision: https://reviews.llvm.org/D100136
Yuanfang Chen [Thu, 1 Apr 2021 07:10:43 +0000 (00:10 -0700)]
[InstCombine] when calling conventions are compatible, don't convert the call to undef idiom
D24453 enabled libcalls simplication for ARM PCS. This may cause
caller/callee calling conventions mismatch in some situations such as
LTO. This patch makes instcombine aware that the compatible calling
conventions differences are benign (not emitting undef idom).
Differential Revision: https://reviews.llvm.org/D99773
Arthur O'Dwyer [Mon, 5 Apr 2021 18:56:03 +0000 (14:56 -0400)]
[libc++] Implement D2351R0 "Mark all library static cast wrappers as [[nodiscard]]"
These [[nodiscard]] annotations are added as a conforming extension;
it's unclear whether the paper will actually be adopted and make them
mandatory, but they do seem like good ideas regardless.
https://isocpp.org/files/papers/D2351R0.pdf
This patch implements the paper's effect on:
- std::to_integer, std::to_underlying
- std::forward, std::move, std::move_if_noexcept
- std::as_const
- std::identity
The paper also affects (but libc++ does not yet have an implementation of):
- std::bit_cast
Differential Revision: https://reviews.llvm.org/D99895
Arthur O'Dwyer [Sun, 11 Apr 2021 22:38:24 +0000 (18:38 -0400)]
[libc++] [test] Detect an improperly noexcept'ed __decay_copy.
`__decay_copy` is used by `std::thread`'s constructor to copy its arguments
into the new thread. If `__decay_copy` claims to be noexcept, but then
copying the argument does actually throw, we'd call std::terminate instead
of passing this test. (And I've verified that adding an unconditional `noexcept`
to `__decay_copy` does indeed fail this test.)
Differential Revision: https://reviews.llvm.org/D100277
Sanjay Patel [Mon, 12 Apr 2021 16:20:32 +0000 (12:20 -0400)]
[PassManager][PhaseOrdering] lower expects before running simplifyCFG
If we run passes before lowering llvm.expect intrinsics to metadata,
then those passes have no way to act on the hints provided by llvm.expect.
SimplifyCFG is the known offender, and we made it smarter about profile
metadata in D98898.
In the motivating example from https://llvm.org/PR49336 , this means we
were ignoring the recommended method for a programmer to tell the compiler
that a compare+branch is expensive. This change appears to solve that case -
the metadata survives to the backend, the compare order is as expected in IR,
and the backend does not do anything to reverse it.
We make the same change to the old pass manager to keep things synchronized.
Differential Revision: https://reviews.llvm.org/D100213
David Green [Mon, 12 Apr 2021 16:23:02 +0000 (17:23 +0100)]
[ARM] Add a number of intrinsics for MVE lane interleaving
Add a number of intrinsics which natively lower to MVE operations to the
lane interleaving pass, allowing it to efficiently interleave the lanes
of chucks of operations containing these intrinsics.
Differential Revision: https://reviews.llvm.org/D97293
Stephen Tozer [Thu, 11 Mar 2021 15:01:37 +0000 (15:01 +0000)]
Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands"
The causes of the previous build errors have been fixed in revisions
aa3e78a59fdf3b211be72f1b3221af831665e67d, and
140757bfaaa00110a92d2247a910c847e6e3bcc8
This reverts commit
f40976bd01032f4905dde361e709166704581077.
Louis Dionne [Fri, 9 Apr 2021 15:41:28 +0000 (11:41 -0400)]
[libc++] Divorce the std Lit feature from the -std=XXX compiler flag
After this patch, we can use `--param std=c++20` even if the compiler only
supports -std=c++2a. The test suite will handle that for us. The only Lit
feature that isn't fully baked will always be the "in development" one,
since we don't know exactly what year the standard will be ratified in.
This is another take on https://reviews.llvm.org/D99789.
Differential Revision: https://reviews.llvm.org/D100210
LLVM GN Syncbot [Mon, 12 Apr 2021 15:51:13 +0000 (15:51 +0000)]
[gn build] Port
6a1ac88fc19a
LLVM GN Syncbot [Mon, 12 Apr 2021 15:51:12 +0000 (15:51 +0000)]
[gn build] Port
26beecfe470b
LLVM GN Syncbot [Mon, 12 Apr 2021 15:51:11 +0000 (15:51 +0000)]
[gn build] Port
0b439e4cc9db
Louis Dionne [Mon, 12 Apr 2021 15:49:43 +0000 (11:49 -0400)]
[libc++] NFC: Remove duplicate synopsis from <__string>
Louis Dionne [Fri, 9 Apr 2021 16:58:00 +0000 (12:58 -0400)]
[libc++] Split std::get_temporary_buffer out of <memory>
Differential Revision: https://reviews.llvm.org/D100216
Louis Dionne [Fri, 9 Apr 2021 16:48:34 +0000 (12:48 -0400)]
[libc++] Split std::allocator out of <memory>
Differential Revision: https://reviews.llvm.org/D100216
Louis Dionne [Fri, 9 Apr 2021 16:44:26 +0000 (12:44 -0400)]
[libc++] Split auto_ptr out of <memory>
Differential Revision: https://reviews.llvm.org/D100216
Kristof Beyls [Mon, 12 Apr 2021 15:07:02 +0000 (17:07 +0200)]
[docs] Add Windows/COFF call info
Simon Pilgrim [Mon, 12 Apr 2021 14:31:48 +0000 (15:31 +0100)]
[InstCombine] Regenerate select-ctlz-to-cttz.ll tests
Correctly test !range metadata
Simon Pilgrim [Mon, 12 Apr 2021 13:56:10 +0000 (14:56 +0100)]
[X86] Fold cmpeq/ne(trunc(logic(x)),0) --> cmpeq/ne(logic(x),0)
Fixes the issues noted in PR48768, where the and/or/xor instruction had been promoted to avoid i8/i16 partial-dependencies, but the test against zero had not.
We can almost certainly relax this fold to work for any truncation, although it breaks a number of existing folds (notable movmsk folds which tend to rely on the truncate to determine the demanded bits/elts in the source vector).
There is a reverse combine in TargetLowering.SimplifySetCC so we must wait until after legalization before attempting this.
Daniel Kiss [Mon, 12 Apr 2021 15:02:16 +0000 (17:02 +0200)]
[compiler-rt][aarch64] Add PAC-RET/BTI support to HWASAN.
Support for -mbranch-protection.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D100143
Kadir Cetinkaya [Thu, 8 Apr 2021 13:50:50 +0000 (15:50 +0200)]
[clangd] Provide a way to disable external index
Users can reset any external index set by previous fragments by
putting a `None` for the external block, e.g:
```
Index:
External: None
```
Differential Revision: https://reviews.llvm.org/D100106
Wang, Pengfei [Mon, 12 Apr 2021 14:08:27 +0000 (22:08 +0800)]
[X86][AMX] Hoist ldtilecfg
The previous code calculated the first ldtilecfg by dominating all AMX registers' def. This may result in the ldtilecfg being inserted into a loop.
This patch try to calculate the nearest point where all shapes of AMX registers are reachable.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D99010
David Green [Mon, 12 Apr 2021 14:28:13 +0000 (15:28 +0100)]
[ARM] Add FP handling for MVE lane interleaving
FP16 to FP32 converts can be handled in MVE lane interleaving, much like
the sext/zext lowering we do. This expands the pass with fpext and
fptrunc handling, and basic fp operations allowing more efficient
lowering of fp vectors.
Differential Revision: https://reviews.llvm.org/D97292
Nathan James [Mon, 12 Apr 2021 14:13:59 +0000 (15:13 +0100)]
[NFC] Remove redundant string copy