Roman Lebedev [Wed, 24 Mar 2021 09:47:51 +0000 (12:47 +0300)]
[NFC][PhaseOrdering] Add a testcase for additional LICM before LoopRotate (D99249/D99204)
Vladislav Vinogradov [Tue, 23 Mar 2021 08:45:24 +0000 (11:45 +0300)]
[mlir][NFC] Replace `getMemorySpaceAsInt` with `getMemorySpace` where possible
Use new `MemRefType::getMemorySpace` method with generic Attribute
in cases, where there is no specific logic around the memory space.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D99154
Ta-Wei Tu [Wed, 24 Mar 2021 10:21:13 +0000 (18:21 +0800)]
[NFC] Improve debug message and test description in 4c1f74a
Ta-Wei Tu [Wed, 24 Mar 2021 10:07:34 +0000 (18:07 +0800)]
[LoopFlatten] Fix invalid assertion (PR49571)
The `InductionPHI` is not necessarily the increment instruction, as
demonstrated in pr49571.ll.
This patch removes the assertion and instead bails out from the
`LoopFlatten` pass if that happens.
This fixes https://bugs.llvm.org/show_bug.cgi?id=49571
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D99252
Ta-Wei Tu [Wed, 24 Mar 2021 09:58:12 +0000 (17:58 +0800)]
[NFC] Remove redundant `struct` prefix
Reviewed By: SjoerdMeijer, fhahn
Differential Revision: https://reviews.llvm.org/D99251
Martin Storsjö [Tue, 23 Mar 2021 16:42:32 +0000 (18:42 +0200)]
[libcxx] [test] Add return values after assert(false) in some experimental tests
When building in MSVC mode (in release mode), the assert(false) don't
make the end of the function unreachable, so add return statements to
silence compiler warnings (treated as errors).
Also change 'virtual' into 'override', which was requested in review,
as these files require C++11.
Differential Revision: https://reviews.llvm.org/D99214
Raphael Isemann [Wed, 24 Mar 2021 09:35:58 +0000 (10:35 +0100)]
[lldb] Add llgs_test decorator back to TestAutoInstallMainExecutable
This got removed in
68bb51acd572735d80d20adb2c2fc51a5cbbd88e and this enabled
the test on macOS (where it just causes lldb-server to crash). Re-adding the
decorator to get the tests passing again.
Jason Molenda [Wed, 24 Mar 2021 09:18:17 +0000 (02:18 -0700)]
Handle a LC_NOTE main bin spec for user process corefiles
I was playing around with main bin spec LC_NOTEs and noticed
a small oversight in the parsing of user process corefile notes.
Nigel Perks [Fri, 12 Feb 2021 13:02:35 +0000 (13:02 +0000)]
[XCore][Test] XFAIL tests requiring 8-byte stack alignment.
XCore default subtarget does not support 8-byte stack alignment. These failures
can be seen on builder clang-xcore-ubuntu-20-x64 on staging buildbot.
Differential Revision: https://reviews.llvm.org/D99092
Yvan Roux [Wed, 24 Mar 2021 09:06:04 +0000 (10:06 +0100)]
[AArch64][ASAN] Re-enable fgets_fputs.cpp test.
Now that AArch64 mapping symbols are correctly handled by
llvm-symbolizer this test can be re-enabled on that target.
Andy Wingo [Tue, 23 Mar 2021 15:13:54 +0000 (16:13 +0100)]
[WebAssembly][MC] Record limit constraints for table sizes
This commit adds a full WasmTableType to MCSymbolWasm, differing from
the current situation (just an ElemType) in that it additionally records
a WasmLimits.
We add support for specifying the limits in .S files also, via the
following syntax variations:
.tabletype SYM, ELEMTYPE
.tabletype SYM, ELEMTYPE, MINSIZE
.tabletype SYM, ELEMTYPE, MINSIZE, MAXSIZE
Depends on D99186.
Differential Revision: https://reviews.llvm.org/D99191
Mehdi Amini [Wed, 24 Mar 2021 08:25:25 +0000 (08:25 +0000)]
Add a mechanism for Dialects to provide a fallback for OpInterface
This mechanism makes it possible for a dialect to not register all
operations but still answer interface-based queries.
This can useful for dialects that are "open" or connected to an external
system and still interoperate with the compiler. It can also open up the
possibility to have a more extensible compiler at runtime: the compiler
does not need a pre-registration for each operation and the dialect can
inject behavior dynamically.
Reviewed By: rriddle, jpienaar
Differential Revision: https://reviews.llvm.org/D93085
Balázs Kéri [Wed, 24 Mar 2021 07:42:29 +0000 (08:42 +0100)]
[clang][ASTImporter] Add import of DeducedTemplateSpecializationType.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D99188
Andy Wingo [Tue, 23 Mar 2021 13:46:32 +0000 (14:46 +0100)]
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC.
This patch renames the "Initial" member of WasmLimits to the name used
in the spec, "Minimum".
In the core WebAssembly specification, the Limits data type has one
required "min" member and one optional "max" member, indicating the
minimum required size of the corresponding table or memory, and the
maximum size, if any.
Although the WebAssembly spec does instantiate locally-defined tables
and memories with the initial size being equal to the minimum size, it
can't impose such a requirement for imports. It doesn't make sense to
require an initial size for a memory import, for example. The compiler
can only sensibly express the minimum and maximum sizes.
See
https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits
for a related discussion that agrees that the right name of "initial" is
"minimum" when querying the type of a table or memory from JavaScript.
(Of course it still makes sense for JS to speak in terms of an initial
size when it explicitly instantiates memories and tables.)
Differential Revision: https://reviews.llvm.org/D99186
Fangrui Song [Wed, 24 Mar 2021 06:37:43 +0000 (23:37 -0700)]
[Driver] Bring back i586-linxu-gnu
This is used by Fuchsia for a Debian jessie based sysroot.
Jason Molenda [Wed, 24 Mar 2021 06:34:22 +0000 (23:34 -0700)]
Update SafeMachO.h to #undefine more names
Depending on include order, these can cause build errors when
including the llvm MachO.h where these are defined as enums.
Update the list to include some more names.
Jim Lin [Wed, 24 Mar 2021 06:29:23 +0000 (14:29 +0800)]
[RISCV] Add HasStdExtD predicate to copysign from double and to double patterns
Copysign from double and to double patterns have lack of HasStdExtD predicate.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D99234
Alex Orlov [Wed, 24 Mar 2021 06:21:32 +0000 (10:21 +0400)]
* Fix demangling of optional template-args for vendor extended type qualifier.
This fixes https://bugs.llvm.org/show_bug.cgi?id=48009 bug.
Reviewed By: erik.pilkington, krisb
Differential Revision: https://reviews.llvm.org/D98687
Fangrui Song [Wed, 24 Mar 2021 06:12:18 +0000 (23:12 -0700)]
[Driver] Gnu.cpp: remove unneeded getMultiarchTriple normalization
Michael Kruse [Wed, 24 Mar 2021 05:54:37 +0000 (00:54 -0500)]
[Polly] Port DeadCodeElim to the NewPM.
Chuanqi Xu [Wed, 24 Mar 2021 05:58:54 +0000 (13:58 +0800)]
[NFC] [Support] Fix unconsistent comment with codes for ExtendSigned
Nemanja Ivanovic [Wed, 24 Mar 2021 05:25:03 +0000 (00:25 -0500)]
[PowerPC] Make altivec.h work with AIX which has no __int128
There are a number of functions in altivec.h that use
vector __int128 which isn't supported on AIX. Those functions
need to be guarded for targets that don't support the type.
Furthermore, the functions that produce quadword instructions
without using the type need a builtin. This patch adds the
macro guards to altivec.h using the __SIZEOF_INT128__ which
is only defined on targets that support the __int128 type.
Max Kazantsev [Wed, 24 Mar 2021 04:03:21 +0000 (11:03 +0700)]
[NFC] Fix comment describing what EdgeBundles is
The original comment says the same thing twice, and does not mention that
edges entering the block are also in the same bundle (which seems true from
what the underlying code is doing).
Differential Revision: https://reviews.llvm.org/D99144
Reviewed By: RKSimon
Serguei Katkov [Wed, 24 Mar 2021 03:19:52 +0000 (10:19 +0700)]
[RegAlloc] Fix "ran out of regs" with uses in statepoint
Statepoint instruction is known to have a variable and big number of operands.
It is possible that Register Allocator will split live intervals in the way that all
physical registers are occupied by "zero-length" live intervals which are marked
as not-spillable.
While intervals are marked as not-spillable in the moment of creation when they are
really zero-length it is possible that in future as part of re-materialization there will
need for physical register between def and use of such tiny interval (the use is not
related to this interval at all).
As all physical registers are assigned to not-spillable intervals there is not avaialbe
registers and RA reports an error.
The idea of the fix is avoid marking tiny live intervals where there is a use in statepoint
instruction in var args section. Such interval may be perfectly spilled and folded to
operand of statepoint.
Reviewers: reames, dantrushin, qcolombet, dsanders, dmgreen
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D98766
Craig Topper [Wed, 24 Mar 2021 02:34:39 +0000 (19:34 -0700)]
[X86] Bale out of X86FastISel::X86SelectCmp for vectors.
None of the code in this function was written to handle
vectors. Most of the cases already fail for vectors for one
reason or another. The exception is an optimization that
detects identical operands. This can be triggered by vectors,
but the code always creates a 0 or 1 constants in a scalar
register which is incorrect for vectors.
Fixes PR49706.
Zequan Wu [Wed, 24 Mar 2021 03:12:09 +0000 (20:12 -0700)]
Revert "[Driver] Bring back "Clean up Debian multiarch /usr/include/<triplet> madness" and restore i586-linux-gnu"
This breaks bots in chromium goma building.
This reverts commit
424bf5d8918f6356f1b8e99205c5fc8b4783ca22.
Zakk Chen [Thu, 18 Mar 2021 03:25:32 +0000 (20:25 -0700)]
[RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.
Support Complex type transformer to define more complexity legal type.
Overall our downstream implementation there are only four instructions need to
use complex type transformer, it's not a common case.
I still feel using a string for prototypes is simple and clear.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D98848
Vitaly Buka [Wed, 24 Mar 2021 02:11:11 +0000 (19:11 -0700)]
[NFC] Clang-format includes
Yang Fan [Wed, 24 Mar 2021 01:56:36 +0000 (09:56 +0800)]
[InstSimplify] Fix unused variable warning (NFC)
GCC warning:
```
/llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp: In function ‘llvm::Value* SimplifyWithOpReplaced(llvm::Value*, llvm::Value*, llvm::Value*, const llvm::SimplifyQuery&, bool, unsigned int)’:
/llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp:3993:15: warning: unused variable ‘SI’ [-Wunused-variable]
3993 | if (auto *SI = dyn_cast<SelectInst>(I))
| ^~
```
Hansang Bae [Thu, 11 Mar 2021 23:34:06 +0000 (17:34 -0600)]
[OpenMP] Misc. changes that add or remove pointer/bound checks
-- Added or moved checks to appropriate places.
-- Removed ineffective null check where the pointer is already being
dereferenced around the code.
-- Initialized variables that can be used without definitions.
-- Added call to dlclose/FreeLibrary in OMPT tool activation.
-- Added a new build compiler definition.
Differential Revision: https://reviews.llvm.org/D98584
Richard Smith [Tue, 23 Mar 2021 23:41:05 +0000 (16:41 -0700)]
Support #__private_macro and #__public_macro in local submodule
visibility mode.
Richard Smith [Tue, 23 Mar 2021 22:45:40 +0000 (15:45 -0700)]
Improve const-correctness. NFC.
Bruno Cardoso Lopes [Tue, 23 Mar 2021 23:13:29 +0000 (16:13 -0700)]
[CGAtomic] Lift stronger requirements on cmpxch and support acquire failure mode
- Fix `emitAtomicCmpXchgFailureSet` to support release/acquire (succ/fail) memory order.
- Remove stronger checks for cmpxch.
Effectively, this addresses http://wg21.link/p0418
Differential Revision: https://reviews.llvm.org/D98995
Choongwoo Han [Tue, 23 Mar 2021 22:59:45 +0000 (15:59 -0700)]
[Coverage] Load records immediately
The current implementation keeps buffers generated for each object file
until it completes loading of all files. This approach requires a lot of memory
if there are a lot of huge object files. Thus, make it to load coverage records
immediately rather than waiting for other binaries to be loaded.
This reduces memory usage of llvm-cov from >128GB to 5GB when
loading Chromium binaries in Windows.
Additional testing: check-profile, check-llvm
Differential Revision: https://reviews.llvm.org/D99110
Shoaib Meenai [Tue, 23 Mar 2021 23:16:02 +0000 (16:16 -0700)]
[lld] Fix test to work with and without a vendor string
Amara Emerson [Tue, 23 Mar 2021 23:11:45 +0000 (16:11 -0700)]
[AArch64][GlobalISel] Add test for G_FSHR legalization.
Amara Emerson [Tue, 23 Mar 2021 22:56:03 +0000 (15:56 -0700)]
[AArch64][GlobalISel] Lower G_FSHL and G_FSHR.
Codegen isn't as good as we need it, but that'll be done later.
Rob Suderman [Tue, 23 Mar 2021 01:22:30 +0000 (18:22 -0700)]
[mlir][tosa] Add tosa.argmax to linalg lowering
Tosa's argmax lowering is representable as a linalg.indexed_generic
operation. Include the lowering to this type for both integer and
floating point types.
Differential Revision: https://reviews.llvm.org/D99137
Jingu Kang [Mon, 22 Mar 2021 10:12:39 +0000 (10:12 +0000)]
[ValueTracking] Handle increasing mul recurrence in isKnownNonZero()
Differential Revision: https://reviews.llvm.org/D99069
Julian Lettner [Tue, 23 Mar 2021 22:09:13 +0000 (15:09 -0700)]
[Sanitizer] Remove refactoring leftover [NFC]
Rafael Auler [Wed, 3 Mar 2021 22:31:57 +0000 (14:31 -0800)]
Add register size info back to MCRegisterClass
This patch addresses the removal of register size information done in
commit c8b782c.
Without this change, there is no viable option to get register size
information outside libTarget. We need this information to run
analysis that know the register size from the MC layer, used by
BOLT.
Discussion D50285 and D47199.
Reviewed By: kparzysz
Differential Revision: https://reviews.llvm.org/D97891
Vy Nguyen [Tue, 23 Mar 2021 21:51:52 +0000 (17:51 -0400)]
[lld-macho] Fixed lld-version expectation in test so it works on Fuchsia.
On Fuchsia, it's called Fuchsia LLD
Differential Revision: https://reviews.llvm.org/D99217
Matteo Favaro [Tue, 23 Mar 2021 21:31:25 +0000 (21:31 +0000)]
[MSSA] Extending IsGuaranteedLoopInvariant to support an instruction defined in the entry block
As mentioned in [[ https://reviews.llvm.org/D96979 | D96979 ]], I'm extending the **IsGuaranteedLoopInvariant** check also to the `MemorySSA.cpp` file.
@fhahn For now I didn't unify the function into `MemorySSA.h` because, as you mentioned, it's not directly MSSA related. I'm open to suggestions to find a better place so we can improve the unification process.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D97155
Shafik Yaghmour [Tue, 23 Mar 2021 21:31:40 +0000 (14:31 -0700)]
[NFC][LLDB] Removing extra semicolons to silence -Wc++98-compat-extra-semi diagnostics
Alexey Bataev [Tue, 23 Mar 2021 20:22:58 +0000 (13:22 -0700)]
[Analysis]Add getPointersDiff function to improve compile time.
Added getPointersDiff function to LoopAccessAnalysis and used it instead
direct calculatoin of the distance between pointers and/or
isConsecutiveAccess function in SLP vectorizer to improve compile time
and detection of stores consecutive chains.
Part of D57059
Differential Revision: https://reviews.llvm.org/D98967
Rob Suderman [Fri, 19 Mar 2021 23:04:50 +0000 (16:04 -0700)]
[mlir][tosa] Add tosa.pad to linalg.pad operation
Lowers from tosa's pad op to the linalg equivalent for floating,
integer, and quantized values.
Differential Revision: https://reviews.llvm.org/D98990
Vy Nguyen [Tue, 23 Mar 2021 21:14:27 +0000 (17:14 -0400)]
Revert "[lld-macho][nfc] minor clean up, follow up to D98559"
This reverts commit
1bc33eb6a32bdb193a8b838df823b4563450f6b3.
tests failed on windows
River Riddle [Tue, 23 Mar 2021 20:44:14 +0000 (13:44 -0700)]
[mlir][Pattern] Add better support for using interfaces/traits to match root operations in rewrite patterns
To match an interface or trait, users currently have to use the `MatchAny` tag. This tag can be quite problematic for compile time for things like the canonicalizer, as the `MatchAny` patterns may get applied to *every* operation. This revision adds better support by bucketing interface/trait patterns based on which registered operations have them registered. This means that moving forward we will only attempt to match these patterns to operations that have this interface registered. Two simplify defining patterns that match traits and interfaces, two new utility classes have been added: OpTraitRewritePattern and OpInterfaceRewritePattern.
Differential Revision: https://reviews.llvm.org/D98986
Chris Lattner [Tue, 23 Mar 2021 05:15:39 +0000 (22:15 -0700)]
[ODS] Implement a new 'hasCanonicalizeMethod' bit for cann patterns.
This provides a simplified way to implement 'matchAndRewrite' style
canonicalization patterns for ops that don't need the full power of
RewritePatterns. Using this style, you can implement a static method
with a signature like:
```
LogicalResult AssertOp::canonicalize(AssertOp op, PatternRewriter &rewriter) {
return success();
}
```
instead of dealing with defining RewritePattern subclasses. This also
adopts this for a few canonicalization patterns in the std dialect to
show how it works.
Differential Revision: https://reviews.llvm.org/D99143
Fangrui Song [Tue, 23 Mar 2021 20:32:30 +0000 (13:32 -0700)]
[test] Add --sysroot= to make gcc-toolchain.cpp stable
Matt Morehouse [Tue, 23 Mar 2021 18:57:12 +0000 (11:57 -0700)]
[HWASan] Refactor in preparation for x86 aliasing mode. NFC
Reviewed By: vitalybuka, eugenis
Differential Revision: https://reviews.llvm.org/D98373
Nikita Popov [Tue, 23 Mar 2021 20:18:30 +0000 (21:18 +0100)]
[BasicAA] Handle assumes with operand bundles
This fixes a regression reported on D99022: If a call has operand
bundles, then the inaccessiblememonly attribute on the function
will be ignored, as operand bundles can affect modref behavior in
the general case. However, for assume operand bundles in particular
this is not the case.
Adjust getModRefBehavior() to always report inaccessiblememonly
for assumes, regardless of presence of operand bundles.
Nikita Popov [Tue, 23 Mar 2021 20:07:36 +0000 (21:07 +0100)]
[BasicAA] Add test for assume with operand bundles (NFC)
Alexey Bataev [Tue, 23 Mar 2021 20:17:26 +0000 (13:17 -0700)]
Revert "[Analysis]Add getPointersDiff function to improve compile time."
This reverts commit
065a14a12d2694f26f4e894641f5ab8cfc5da8bd to
investigate and fix crash in SLP vectorizer.
Rob Suderman [Mon, 22 Mar 2021 21:38:39 +0000 (14:38 -0700)]
[mlir][tosa] Add tosa.tile to linalg.generic lowering
Tiling operations are generic operations with modified indexing. Updated to to
linalg lowerings to perform this lowering.
Differential Revision: https://reviews.llvm.org/D99113
Vy Nguyen [Tue, 23 Mar 2021 19:54:01 +0000 (15:54 -0400)]
[lld-macho][nfc] minor clean up, follow up to D98559
Differential Revision: https://reviews.llvm.org/D99210
natashaknk [Tue, 23 Mar 2021 20:00:38 +0000 (13:00 -0700)]
[mlir][tosa] Add tosa.matmul and tosa.fully_connected lowering
Adds lowerings for matmul and fully_connected. Only supports 2D tensors for inputs and weights, and 1D tensors for bias.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D99211
Alexey Bataev [Fri, 19 Mar 2021 14:19:17 +0000 (07:19 -0700)]
[Analysis]Add getPointersDiff function to improve compile time.
Added getPointersDiff function to LoopAccessAnalysis and used it instead
direct calculatoin of the distance between pointers and/or
isConsecutiveAccess function in SLP vectorizer to improve compile time
and detection of stores consecutive chains.
Part of D57059
Differential Revision: https://reviews.llvm.org/D98967
Amara Emerson [Tue, 23 Mar 2021 18:31:13 +0000 (11:31 -0700)]
[AArch64][GlobalISel] Lower G_CTLZ_ZERO_UNDEF.
This adds some missing legalizer tests, which uncovered a v2s64 selection
test that wasn't working since there's no legalization or instruction for that.
Craig Topper [Tue, 23 Mar 2021 19:20:04 +0000 (12:20 -0700)]
[ValueTracking] Teach canCreateUndefOrPoison that ctpop does not create undef or poison.
This select of ctpop with 0 pattern can get left behind after
loop idiom recognize converts a loop to ctpop. LLVM 10 was able
to optimize this, but LLVM 11 and later is not. The difference
seems to be that some select transforms are now limited based
on canCreateUndefOrPoison.
Teaching canCreateUndefOrPoison about ctpop restores the
LLVM 10 codegen.
Differential Revision: https://reviews.llvm.org/D99207
Petr Hosek [Wed, 10 Mar 2021 19:21:41 +0000 (11:21 -0800)]
[libcxxabi] Use cxx-headers target to consume libcxx headers
Rather than including libc++ include dir, use the cxx-headers target.
Differential Revision: https://reviews.llvm.org/D98367
Matt Morehouse [Tue, 23 Mar 2021 18:21:08 +0000 (11:21 -0700)]
[sanitizer] Implement MapDynamicShadowAndAliases.
The function works like MapDynamicShadow, except that it creates aliased
memory to the right of the shadow. The main use case is for HWASan
aliasing mode, which gets fast IsAlias() checks by exploiting the fact
that the upper bits of the shadow base and aliased memory match.
Reviewed By: vitalybuka, eugenis
Differential Revision: https://reviews.llvm.org/D98369
Vy Nguyen [Tue, 23 Mar 2021 02:05:46 +0000 (22:05 -0400)]
Revert "Revert "Revert "Revert "Revert "Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)""""""
This reverts commit
4876ba5b2d6a1264ec73e5cf3fcad083f6927d19.
Third-attemp relanding D98559, new change:
- explicitly cast enum to underlying type to avoid ambiguity (workaround to clang's bug).
Louis Dionne [Tue, 23 Mar 2021 18:15:28 +0000 (14:15 -0400)]
[libc++] Remove old cache file that was left behind by accident
Peter Collingbourne [Mon, 22 Mar 2021 19:29:51 +0000 (12:29 -0700)]
scudo: Preserve no-memtag attribute on cached secondary allocations.
Differential Revision: https://reviews.llvm.org/D99103
Arthur O'Dwyer [Fri, 19 Mar 2021 17:55:28 +0000 (13:55 -0400)]
[C++20] [P1825] Fix bugs with implicit-move from variables of reference type.
Review D88220 turns out to have some pretty severe bugs, but I *think*
this patch fixes them.
Paper P1825 is supposed to enable implicit move from "non-volatile objects
and rvalue references to non-volatile object types." Instead, what was committed
seems to have enabled implicit move from "non-volatile things of all kinds,
except that if they're rvalue references then they must also refer to non-volatile
things." In other words, D88220 accidentally enabled implicit move from
lvalue object references (super yikes!) and also from non-object references
(such as references to functions).
These two cases are now fixed and regression-tested.
Differential Revision: https://reviews.llvm.org/D98971
Arthur O'Dwyer [Mon, 22 Mar 2021 21:38:28 +0000 (17:38 -0400)]
[libc++] Simpler Python script for generating a graph of libc++'s header dependencies
My attempts to play around with the old graph_header_deps.py were mostly fruitless;
I needed to modify it in various ways to make it work, and then even when I got it
working, it generated pretty ugly graphs.
Old graph_header_deps.py (after my local changes to simplify the usage)
(producing https://i.imgur.com/zATrsaP.jpg )
mkdir foo
time ./graph_header_deps.py --libcxx-only -o foo --clang-command ~/llvm-project/build/bin/clang++
dot -Tpng < foo/all_headers.dot > old.png
file old.png
real 0m37.453s
old.png: PNG image data, 25882 x 3035, 8-bit/color RGBA, non-interlaced
New graph_header_deps.py
(producing https://i.imgur.com/ZU0G52U.png )
time ./graph_header_deps.py | dot -Tpng > new.png
file new.png
real 0m1.063s
new.png: PNG image data, 6162 x 1344, 8-bit/color RGBA, non-interlaced
Differential Revision: https://reviews.llvm.org/D99124
Fangrui Song [Tue, 23 Mar 2021 18:11:26 +0000 (11:11 -0700)]
[test] Enable check-lsan on aarch64-*-linux
`check-lsan` passed on an aarch64-*-linux machine.
Unsupport `many_tls_keys_pthread.cpp` for now: it requires GetTls to include
`specific_1stblock` and `specific` in `struct pthread`.
Differential Revision: https://reviews.llvm.org/D98985
Louis Dionne [Tue, 23 Mar 2021 18:09:52 +0000 (14:09 -0400)]
[libc++] NFC: nodebug => no-debug in the CI configurations
Alex Zinenko [Tue, 23 Mar 2021 17:59:12 +0000 (18:59 +0100)]
[mlir] silence -Wunused-variable in release mode in Linalg transforms
Jonas Devlieghere [Tue, 23 Mar 2021 17:52:01 +0000 (10:52 -0700)]
[dsymutil] Only look for ThinLTO suffixes if we failed to find symbol.
Only look for symbols with the ThinLTO suffix if we fail to find the
symbol.
Tony [Tue, 23 Mar 2021 15:27:51 +0000 (15:27 +0000)]
[NFC][AMDGPU] Reserve AMD GPU ELF machine number 0x41
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D99196
Nicolas Vasilache [Tue, 23 Mar 2021 17:17:30 +0000 (17:17 +0000)]
[MLIR][Linalg] Hoist padding across multiple levels of tiling
This revision introduces proper backward slice computation during the hoisting of
PadTensorOp. This allows hoisting padding even across multiple levels of tiling.
Such hoisting requires the proper handling of loop bounds that may depend on enclosing
loop variables.
Differential revision: https://reviews.llvm.org/D98965
Paul Robinson [Thu, 18 Mar 2021 15:28:38 +0000 (08:28 -0700)]
Document -fcrash-diagnostics-dir
This was added in LLVM 7.0 but without help text or other docs.
Differential Revision: https://reviews.llvm.org/D98873
Marek Kurdej [Tue, 23 Mar 2021 16:15:07 +0000 (17:15 +0100)]
[libc++] [C++20] [P0482] Add missing tests and synopses for char8_t.
Left to finish P0482:
* <cuchar> header.
* Parts of <memory_resource> concerning char8_t. Also, tests for hash<pmr::*string>.
Reviewed By: ldionne, #libc, Quuxplusone
Differential Revision: https://reviews.llvm.org/D99184
Marek Kurdej [Tue, 23 Mar 2021 16:13:15 +0000 (17:13 +0100)]
[libc++] Add missing test_macros.h include in tests using TEST_STD_VER.
Siva Chandra [Mon, 22 Mar 2021 18:59:49 +0000 (18:59 +0000)]
[runtimes] Add the libc project to the list of runtimes.
This is possible as the default libc build now works under runtimes build.
Differential Revision: https://reviews.llvm.org/D99101
Adrian Prantl [Tue, 23 Mar 2021 01:09:46 +0000 (18:09 -0700)]
Teach DWARFExpression about DWARF 4+ Location Descriptions
DWARFExpression implements the DWARF2 expression model that left
ambiguity on whether the result of an expression was a value or an
address. This patch implements the DWARF location description model
introduces in DWARF 4 and sets the result Value's kind accordingly, if
the expression comes from a DWARF v4+ compile unit. The nomenclature
is taken from DWARF 5, chapter 2.6 "Location Descriptions".
Differential Revision: https://reviews.llvm.org/D98996
Alex Zinenko [Tue, 23 Mar 2021 13:04:52 +0000 (14:04 +0100)]
[mlir] verify that operand/result_segment_sizes attributes have i32 element
This is an assumption that is made in numerous places in the code. In
particular, in the code generated by mlir-tblgen for operand/result accessors
in ops with attr-sized operand or result lists. Make sure to verify this
assumption.
Note that the operation traits are verified before running the custom op
verifier, which can expect the trait verifier to have passed, but some traits
may be verified before the AttrSizedOperand/ResultTrait and should not make
such assumptions.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D99183
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:30 +0000 (16:22 +0000)]
[lldb/Plugins] Add ScriptedProcess Process Plugin
This patch introduces Scripted Processes to lldb.
The goal, here, is to be able to attach in the debugger to fake processes
that are backed by script files (in Python, Lua, Swift, etc ...) and
inspect them statically.
Scripted Processes can be used in cooperative multithreading environments
like the XNU Kernel or other real-time operating systems, but it can
also help us improve the debugger testing infrastructure by writting
synthetic tests that simulates hard-to-reproduce process/thread states.
Although ScriptedProcess is not feature-complete at the moment, it has
basic execution capabilities and will improve in the following patches.
rdar://
65508855
Differential Revision: https://reviews.llvm.org/D95713
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:26 +0000 (16:22 +0000)]
[lldb/bindings] Add Python ScriptedProcess base class to lldb module
In order to facilitate the writting of Scripted Processes, this patch
introduces a `ScriptedProcess` python base class in the lldb module.
The base class holds the python interface with all the - abstract -
methods that need to be implemented by the inherited class but also some
methods that can be overwritten.
This patch also provides an example of a Scripted Process with the
`MyScriptedProcess` class.
rdar://
65508855
Differential Revision: https://reviews.llvm.org/D95712
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:18 +0000 (16:22 +0000)]
[lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess
This patch adds a ScriptedProcess interface to the ScriptInterpreter and
more specifically, to the ScriptInterpreterPython.
This interface will be used in the C++ `ScriptProcess` Process Plugin to
call the script methods.
At the moment, not all methods are implemented, they will upstreamed in
upcoming patches.
This patch also adds helper methods to the ScriptInterpreter to
convert `SBAPI` Types (SBData & SBError) to `lldb_private` types
(DataExtractor & Status).
rdar://
65508855
Differential Revision: https://reviews.llvm.org/D95711
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:07 +0000 (16:22 +0000)]
[lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch
This patch adds a new command options to the CommandObjectProcessLaunch
for scripted processes.
Among the options, the user need to specify the class name managing the
scripted process. The user can also use a key-value dictionary holding
arbitrary data that will be passed to the managing class.
This patch also adds getters and setters to `SBLaunchInfo` for the
class name managing the scripted process and the dictionary.
rdar://
65508855
Differential Review: https://reviews.llvm.org/D95710
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Nancy Wang [Tue, 23 Mar 2021 17:09:05 +0000 (13:09 -0400)]
[SystemZ][z/OS] fix lit test related to alignment
This patch is to fix lit test case failure relate to alignment, on z/OS, maximum alignment value for 64 bit mode is 16 and also fixed clang/test/Layout/itanium-union-bitfield.cpp, attribute ((aligned(4))) is needed for bit-field member in Union for z/OS because single bit-field has one byte alignment, this will make sure size and alignment will be correct value on z/OS.
Differential Revision: https://reviews.llvm.org/D98793
Matt Morehouse [Tue, 23 Mar 2021 16:31:19 +0000 (09:31 -0700)]
[sanitizer] Support dynamic premapped R/W range in primary allocator.
The main use case for this change is HWASan aliasing mode, which premaps
the alias space adjacent to the dynamic shadow. With this change, the
primary allocator can allocate from the alias space instead of a
separate region.
Reviewed By: vitalybuka, eugenis
Differential Revision: https://reviews.llvm.org/D98293
Jay Foad [Tue, 23 Mar 2021 16:54:01 +0000 (16:54 +0000)]
[AMDGPU] Simplify AMDGPUAnnotateUniformValues::visitBranchInst. NFC.
A BranchInst is always the terminator of its containing BasicBlock.
Nathan James [Tue, 23 Mar 2021 16:40:01 +0000 (16:40 +0000)]
[NFC] Enable RVALUE_REFERENCE_THIS on MSVC 2019
In https://reviews.llvm.org/D72948 This was enabled for all MSVC but reverted as it was determined not to work on some 2017 versions.
The issue is assumed to be fixed on 2019 so enable for 2019 and newer.
Some testing could be done to determine which version of MSVC 2017 support this feature but its safer right now to leave it at 2019.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D98809
Nathan James [Tue, 23 Mar 2021 16:38:44 +0000 (16:38 +0000)]
[ASTMatchers][NFC] Use SmallVector when building variadic matcher descriptor
Saves having to manually deallocate storage and keeps InnerArgs will have good cache locality.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D99106
Arnamoy Bhattacharyya [Tue, 23 Mar 2021 16:24:57 +0000 (12:24 -0400)]
[flang][driver] Add -fintrinsic-modules-path option
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D97080
Martin Storsjö [Tue, 23 Mar 2021 11:23:16 +0000 (13:23 +0200)]
[libcxx] Consistently set CMAKE_STATIC_LIBRARY_PREFIX regardless of LIBCXX_ENABLE_STATIC
CMAKE_STATIC_LIBRARY_PREFIX affects the naming of all static libs (in
MSVC configurations), including c++experimental, which only is produced
as static regardless of LIBCXX_ENABLE_STATIC.
Differential Revision: https://reviews.llvm.org/D99176
Andrzej Warzynski [Tue, 23 Mar 2021 16:02:58 +0000 (16:02 +0000)]
[flang][cmake] Fix variable reference (${var} instead of var)
This is used for out-of-tree Flang builds when FLANG_BUILD_NEW_DRIVER is
set.
Joe Nash [Mon, 22 Mar 2021 18:34:55 +0000 (14:34 -0400)]
[AMDGPU] Refactor DPPCombine
NFC. Extract IsShrinkable into a helper function, and
make Subtarget a member variable.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D99099
Change-Id: If4bc97a88a9ae4eb1df47e717345d46a6ed515bf
Craig Topper [Tue, 23 Mar 2021 15:32:00 +0000 (08:32 -0700)]
[RISCV] Use selectImm for RV32. NFC
Previously we used selectImm for RV64 and isel patterns for
RV32. This should be NFC, but will allow RV32 and RV64 to share
improvements in the future. For example, it might be useful to
use BSETI from Zbs to make single bit constants.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D98877
Jay Foad [Tue, 23 Mar 2021 14:02:25 +0000 (14:02 +0000)]
[AMDGPU] Set SchedRW on real instructions
Coyp SchedRW from pseudos to real instructions so that llvm-mca has
access to it. This is NFC for normal compiler codegen, which schedules
pseudos not real instructions.
Add an llvm-mca test for some high latency double-precision instructions
as a smoke test.
Differential Revision: https://reviews.llvm.org/D99187
Stefan Gränitz [Tue, 23 Mar 2021 15:27:40 +0000 (16:27 +0100)]
[lli] Workaround missing architecture support in LazyCallThroughManager for non-lazy mode
Next attempt to prevent PowerPC/s390x/etc. failures when landing D98931.
Sanjay Patel [Tue, 23 Mar 2021 15:32:37 +0000 (11:32 -0400)]
[PhaseOrdering] add AVX attribute to make test less fragile; NFC
This doesn't change anything currently, but as discussed in
D98981 and D98152, some tests may fail to vectorize because
the cost model becomes more accurate as we switch over to
using min/max intrinsics.
Florian Hahn [Tue, 23 Mar 2021 15:28:58 +0000 (15:28 +0000)]
[LV] Add 'fast' flag to test to make sure it will be vectorized.
This makes the test more robust with respect to when LV checks if the
floating point instructions in a loop can be vectorized.
Roman Lebedev [Tue, 23 Mar 2021 15:22:30 +0000 (18:22 +0300)]
[SimplifyCFG] 'Fold branch to common dest': don't overestimate the cost
`FoldBranchToCommonDest()` has a certain budget (`-bonus-inst-threshold=`)
for bonus instruction duplication. And currently it calculates the cost
as-if it will actually duplicate into each predecessor.
But ignoring the budget, it won't always duplicate into each predecessor,
there are some correctness and profitability checks.
So when calculating the cost, we should first check into which blocks
will we *actually* duplicate, and only then use that block count
to do budgeting.
Roman Lebedev [Tue, 23 Mar 2021 15:08:23 +0000 (18:08 +0300)]
[NFC][SimplifyCFG] 'Fold branch to common dest': add test for cost overestimation
We should not count the cost of duplication into predecessors into which
we won't ultimately duplicate.
Andrzej Warzynski [Mon, 22 Mar 2021 17:04:01 +0000 (17:04 +0000)]
[flang][cmake] Improve how CLANG_DIR is handled
* Added a sanity check with `Clang_FOUND` to verify that find_package
succeeded
* Made sure that find_package won't use any of CMake's standard paths
to guarantee that only the path provided with CLANG_DIR is considered
(implemented through NO_DEFAULT_PATH)
* Made the call to get_filename_component more explicit (so that it is
clear what the base directory is)
* Updated comments to clarify what CLANG_DIR means
Differential Revision: https://reviews.llvm.org/D99088