Kazu Hirata [Mon, 11 Oct 2021 18:06:44 +0000 (11:06 -0700)]
[Sema] Use llvm::is_contained (NFC)
peter klausler [Mon, 4 Oct 2021 19:40:35 +0000 (12:40 -0700)]
[flang][NFC] Document behavior for nonspecified/ambiguous cases
Add explicit documentation for a couple of cases where the Fortran
standard has been observed to be ambiguous or nonspecific and we've
had to choose the behavior of the implementation from some possible
alternatives (and may be distinct from other implementations).
Differential Revision: https://reviews.llvm.org/D111446
Kostya Kortchinsky [Fri, 8 Oct 2021 21:12:34 +0000 (14:12 -0700)]
[scudo] Skip AllocAfterFork test on machines with low max_map_count
Reducing the number of iterations in that test with D111342 helped,
but the failure still occured flakily when the test is ran as part
of a large test suite.
Reducing further the number of iterations might not be good enough,
so we will skip the test if the `max_map_count` variable can be
read, and if lower than a given threshold.
Differential Revision: https://reviews.llvm.org/D111465
Joe Nash [Mon, 4 Oct 2021 14:56:30 +0000 (10:56 -0400)]
[AMDGPU] Support shared literals in FMAMK/FMAAK
These instructions should allow src0 to be a literal with the same
value as the mandatory other literal. Enable it by introducing an
operand that defers adding its value to the MI when decoding till
the mandatory literal is parsed.
Reviewed By: dp, foad
Differential Revision: https://reviews.llvm.org/D111067
Change-Id: I22b0ae0d35bad17b6f976808e48bffe9a6af70b7
Arthur Eubanks [Mon, 11 Oct 2021 17:19:43 +0000 (10:19 -0700)]
[docs] Mention in release notes that we now support 2^32 alignment
Missed in D110451.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D111472
Arthur Eubanks [Mon, 11 Oct 2021 17:16:30 +0000 (10:16 -0700)]
[llc] Support -time-trace in llc
Mostly copied from opt.cpp.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D111466
Philip Reames [Mon, 11 Oct 2021 16:32:25 +0000 (09:32 -0700)]
[SCEV] Extend trip count to avoid overflow by default
As a brief reminder, an "exit count" is the number of times the backedge executes before some event. It can be zero if we exit before the backedge is reached. A "trip count" is the number of times the loop header is entered if we branch into the loop. In general, TC = BTC + 1 and thus a zero trip count is ill defined
There is a cornercases which we don't handle well. Let's assume i8 for our examples to keep things simple. If BTC = 255, then the correct trip count is 256. However, 256 is not representable in i8.
In theory, code which needs to reason about trip counts is responsible for checking for this cornercase, and either bailing out, or handling it correctly. Historically, we don't have a great track record about actually doing so.
When reviewing D109676, I found myself asking a basic question. Was there any good reason to preserve the current wrap-to-zero behavior when converting from backedge taken counts to trip counts? After reviewing existing code, I could not find a single case which appears to correctly and precisely handle the overflow case.
This patch changes the default behavior to extend instead of wrap. That is, if the result might be 256, we return a value of i9 type to ensure we interpret the count correctly. I did leave the legacy behavior as an option since a) loop-flatten stops triggering if I extend due to weirdly specific pattern matching I didn't understand and b) we could reasonably use the mode if we'd externally established a lack of overflow.
I want to emphasize that this change is *not* NFC. There are two call sites (one in ScalarEvolution.cpp, one in LoopCacheAnalysis.cpp) which are switched to the extend semantics. The former appears imprecise (but correct) for a constant 255 BTC. The later appears incorrect, though I don't have a test case.
Differential Revision: https://reviews.llvm.org/D110587
Craig Topper [Mon, 11 Oct 2021 16:43:51 +0000 (09:43 -0700)]
[RISCV] Require tail policy argument to builtins to be an integer constant expression
The IR intrinsics use ImmArg for the policy operand so this needs to be enforced as a constant in the frontend.
Differential Revision: https://reviews.llvm.org/D110779
Lang Hames [Mon, 11 Oct 2021 16:53:05 +0000 (09:53 -0700)]
[ORC] Fix an 80 column violation.
Fangrui Song [Mon, 11 Oct 2021 16:46:31 +0000 (09:46 -0700)]
[ELF] Demote !isUsedInRegularObj lazy symbol
I think D79300 has fixed the D51892 (`__i686.get_pc_thunk.bx`) issue, so
we can bring back rL330869.
D79300 says `would error undefined symbol instead of the more relevant discarded section`
but it doesn't reproduce now.
This avoids a quirk in `isUndefWeak()`.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D111365
Victor Campos [Wed, 8 Sep 2021 13:58:20 +0000 (14:58 +0100)]
[Clang][ARM][AArch64] Add support for Armv9-A, Armv9.1-A and Armv9.2-A
armv9-a, armv9.1-a and armv9.2-a can be targeted using the -march option
both in ARM and AArch64.
- Armv9-A maps to Armv8.5-A.
- Armv9.1-A maps to Armv8.6-A.
- Armv9.2-A maps to Armv8.7-A.
- The SVE2 extension is enabled by default on these architectures.
- The cryptographic extensions are disabled by default on these
architectures.
The Armv9-A architecture is described in the Arm® Architecture Reference
Manual Supplement Armv9, for Armv9-A architecture profile
(https://developer.arm.com/documentation/ddi0608/latest).
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D109517
Tommi Pisto [Mon, 11 Oct 2021 16:19:17 +0000 (09:19 -0700)]
[ORC] Add static and dynamic library generator support to C API.
Adds LLVMOrcCreateStaticLibrarySearchGeneratorForPath and
LLVMOrcCreateDynamicLibrarySearchGeneratorForPath functions to create generators
for static and dynamic libraries.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D108535
AndreyChurbanov [Mon, 11 Oct 2021 16:25:00 +0000 (19:25 +0300)]
[OpenMP] libomp: add OpenMP 5.1 memory allocation routines.
Aligned allocation routines added.
Fortran interfaces added for all allocation routines.
Differential Revision: https://reviews.llvm.org/D110923
hyeongyu kim [Mon, 11 Oct 2021 16:00:32 +0000 (01:00 +0900)]
[SimpleLoopUnswitch] Re-fix introduction of UB when hoisted condition may be undef or poison
https://bugs.llvm.org/show_bug.cgi?id=27506
https://bugs.llvm.org/show_bug.cgi?id=31652
https://bugs.llvm.org/show_bug.cgi?id=51043
Problems with SimpleLoopUnswitch cause the bug reports above.
```
while (...) {
if (C) { A }
else { B }
}
Into:
C' = freeze(C)
if (C') {
while (...) { A }
} else {
while (...) { B }
}
```
This problem can be solved by adding a freeze on hoisted branches(above transform) and has been solved by D29015.
However, D29015 is now reverted by performance regression(https://github.com/llvm/llvm-project/commit/
2b5a8976514de326bb84f0913d9d451089c11d22)
It is not the first time that an added freeze has caused performance regression.
SimplifyCFG also had a problem with UB caused by branching-on-undef, which was solved by adding freeze to the branching condition. (D104569)
Performance regression occurred in D104569, and patches such as D105344 and D105392 were written to minimize it.
This patch will correct the SimpleLoopUnswitch as D104569 handles the SimplyCFG while minimizing performance loss by introducing patches like D105344 and D105392(This patch was rebased with the author's permission)
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D106041
Alex Zinenko [Mon, 11 Oct 2021 15:21:44 +0000 (17:21 +0200)]
[mlir] add user-level documentation for Python bindings
Until now, we only had documentation oriented towards developers of the
bindings. Provide some documentation for users of the bindings that don't want
or need to understand the inner workings.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D111540
Hans Wennborg [Fri, 8 Oct 2021 12:21:50 +0000 (14:21 +0200)]
[MS compat] Handle #pragma fenv_access like #pragma STDC FENV_ACCESS (PR50694)
This adds support for the MSVC spelling of the pragma in -fms-extensions
mode.
Differential revision: https://reviews.llvm.org/D111440
Michał Górny [Fri, 8 Oct 2021 16:09:19 +0000 (18:09 +0200)]
[lldb] [DynamicRegisterInfo] Support setting from vector<Register>
Add an overload of DynamicRegisterInfo::SetRegisterInfo() that accepts
a std::vector<Register> as an argument. This moves the conversion
from DRI::Register to RegisterInfo directly into DynamicRegisterInfo,
and avoids the necessity of creating fully-compatible intermediate
RegisterInfo instances.
While the new method could technically reuse AddRegister(), the ultimate
goal is to replace AddRegister() with SetRegisterInfo() entirely.
Differential Revision: https://reviews.llvm.org/D111435
Michał Górny [Thu, 7 Oct 2021 13:59:34 +0000 (15:59 +0200)]
[lldb] [ABI/AArch64] Add pseudo-regs if missing
Create pseudo-registers on the AArch64 target if they are not provided
by the remote server. This is the case for gdbserver. The created
registers are:
- 32-bit wN partials for 64-bit xN registers
- double precision floating-point dN registers (overlapping with vN)
- single precision floating-point sN registers (overlapping with vN)
Differential Revision: https://reviews.llvm.org/D109876
Michał Górny [Thu, 7 Oct 2021 13:54:32 +0000 (15:54 +0200)]
[lldb] [Target] Make addSupplementaryRegister() work on Register vector
Move DynamicRegisterInfo::AddSupplementaryRegister() into a standalone
function working on std::vector<DynamicRegisterInfo::Register>.
Differential Revision: https://reviews.llvm.org/D111295
Michał Górny [Tue, 5 Oct 2021 12:58:10 +0000 (14:58 +0200)]
[lldb] [ABI] Apply AugmentRegisterInfo() to DynamicRegisterInfo::Registers
Call ABI::AugmentRegisterInfo() once with a vector of all defined
registers rather than calling it for every individual register. Move
and rename RemoteRegisterInfo from gdb-remote to
DynamicRegisterInfo::Register, and use this class when augmenting
registers.
Differential Revision: https://reviews.llvm.org/D111142
Raphael Isemann [Mon, 11 Oct 2021 14:34:41 +0000 (16:34 +0200)]
[Object] Deduplicate the three createError functions
The Object library currently has three identical functions that translate a
Twine into a parser error. Until recently these functions have coexisted
peacefully, but since D110320 Clang with enabled modules is now diagnosing that
we have several definitions of `createError` in Object.
This patch just merges them all and puts them into Object's `Error.h` where the
error code for `parse_failed` is also defined which seems cleaner and unbreaks
the bots.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D111541
Eric Schweitz [Mon, 11 Oct 2021 14:26:42 +0000 (16:26 +0200)]
[fir] Add fir.convert canonicalization patterns
Add rewrite patterns for fir.convert op canonicalization.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D111537
Co-authored-by: Valentin Clement <clementval@gmail.com>
Simon Pilgrim [Mon, 11 Oct 2021 13:41:14 +0000 (14:41 +0100)]
[X86][AVX] Ensure we retain zero elements in select(pshufb,pshufb) -> or(pshufb,pshufb) fold (PR52122)
The select(pshufb,pshufb) -> or(pshufb,pshufb) fold uses getConstVector to create the refreshed pshufb masks, which treats all negative indices as undef.
PR52122 shows that if we were selecting an element that the PSHUFB has set to zero we must set it back to 0x80 when we recreate the PSHUFB mask and not just leave it as SM_SentinelZero
Raphael Isemann [Mon, 11 Oct 2021 13:23:07 +0000 (15:23 +0200)]
[lldb][NFC] Remove unnecessary reference from ParseChildMembers's default_accessibility parameter
Eric Schweitz [Mon, 11 Oct 2021 13:40:41 +0000 (15:40 +0200)]
[fir] Clean up InitFIR.h
Clean up InitFIR.h file.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D111539
Co-authored-by: Valentin Clement <clementval@gmail.com>
Simon Pilgrim [Mon, 11 Oct 2021 12:30:10 +0000 (13:30 +0100)]
[X86][AVX] Add test case for PR52122
Raphael Isemann [Mon, 11 Oct 2021 12:23:27 +0000 (14:23 +0200)]
[lldb][NFCI] Refactor out attribute parsing from DWARFASTParserClang::ParseSingleMember
D68422 introduced `ParsedDWARFTypeAttributes` which encapsulated attribute
parsing and storage into its own small struct. This patch is doing the same for
the member type attribute parsing. One utility class is parsing normal member
attributes and the other is parsing the dedicated Objective-C property
attributes.
Right now the patch just makes the `ParseSingleMember` function a bit shorter,
but the bigger benefit is that we can now split up the function into Objective-C
property parsing and parsing of normal members (struct/class members and
Objective-C ivars). The only shared code between those two parsing logic is the
normal member attribute parsing.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D111494
Ben Dunbobbin [Mon, 11 Oct 2021 12:10:52 +0000 (13:10 +0100)]
[LLD] [TEST] Add test case for patching an absolute relocation to a weak undef
I noticed that we had this case in our internal testsuite but couldn't find it in LLD's tests.
This adds that case.
Differential Revision: https://reviews.llvm.org/D110716
Michał Górny [Sat, 9 Oct 2021 16:02:08 +0000 (18:02 +0200)]
[lldb] [test] Rewrite g/p/G/P tests not to rely on hardcoded ARM regs
Rewrite the register reading/writing tests to use explicit qRegisterInfo
packets rather than relying on ARM registers being hardcoded in LLDB.
While at it, use x86_64 for tests -- since it was easier for me to get
the register lists from that architecture.
Differential Revision: https://reviews.llvm.org/D111496
Eric Schweitz [Mon, 11 Oct 2021 12:05:22 +0000 (14:05 +0200)]
[fir] Update clang-tidy for the Optimizer directory
Update .clang-tidy file with the value used in fir-dev.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: rovka
Differential Revision: https://reviews.llvm.org/D111525
Co-authored-by: Valentin Clement <clementval@gmail.com>
Andrzej Warzynski [Thu, 7 Oct 2021 11:33:07 +0000 (11:33 +0000)]
[flang][driver] Add actions that execute despite semantic errors
This patch adds a new abstract class for frontend actions:
`PrescanAndSemaDebugAction`. It's almost identical to
`PrescanAndSemaAction`, but in the presence of semantic errors it does
not skip the corresponding `ExecuteAction` specialisation. Instead, it
runs it as if there were no semantic errors. This class is for developer
actions only (i.e. front-end driver options).
The new behaviour does not affect the return code from `flang-new -fc1`
when the input file is semantically incorrect. The return code is
inferred from the number of driver diagnostics generated in
`CompilerInstance::ExecuteAction` and this patch does not change that.
More specifically, the semantic errors are still reported and hence the
driver is able to correctly report that the compilation has failed (with
a non-zero return code).
This new base class is meant for debug actions only and
`DebugDumpAllAction` is updated to demonstrate the new behaviour. With
this change, `flang-new -fc1 -fdebug-dump-all` dumps the parse tree and
symbols for all input files, regardless of whether any semantic errors
were found.
This patch addresses https://bugs.llvm.org/show_bug.cgi?id=52097.
Differential Revision: https://reviews.llvm.org/D111308
Raphael Isemann [Mon, 11 Oct 2021 11:35:15 +0000 (13:35 +0200)]
[lldb] Add support for DW_AT_calling_convention to the DWARF parser
This adds support for parsing DW_AT_calling_convention in the DWARF parser.
The generic DWARF parsing code already support extracting this attribute from A
DIE and TypeSystemClang already offers a parameter to add a calling convention
to a function type (as the PDB parser supports calling convention parsing), so
this patch just converts the DWARF enum value to the Clang enum value and adds a
few tests.
There are two tests in this patch.:
* A unit test for the added DWARF parsing code that should run on all platforms.
* An API tests that covers the whole expression evaluation machinery by trying
to call functions with non-standard calling conventions. The specific subtests
are target specific as some calling conventions only work on e.g. win32 (or, if
they work on other platforms they only really have observable differences on a
specific target). The tests are also highly compiler-specific, so if GCC or
Clang tell us that they don't support a specific calling convention then we just
skip the test.
Note that some calling conventions are supported by Clang but aren't implemented
in LLVM (e.g. `pascal`), so there we just test that if this ever gets
implemented in LLVM that LLDB works too. There are also some more tricky/obscure
conventions that are left out such as the different swift* conventions, some
planned Obj-C conventions (`Preserve*`), AAPCS* conventions (as the DWARF->Clang
conversion is ambiguous for AAPCS and APPCS-VFP) and conventions only used for
OpenCL etc.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D108629
Raphael Isemann [Mon, 11 Oct 2021 10:39:54 +0000 (12:39 +0200)]
[lldb] Don't print to stderr in TypeSystemClang::GetBuiltinTypeForDWARFEncodingAndBitSize
The current code just prints to the System's 'error log' which is usually stderr
(+ some other log backend). Printing to stderr however just interferes with
LLDB's console UI, so when this code is triggered during for example command
completion it just breaks the LLDB console interface until the next redraw.
Instead just use the normal LLDB log which is by default hidden and is what
users usually attach to bug reports.
The only known bug that triggers this is
https://bugs.llvm.org/show_bug.cgi?id=46775
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D111149
Bradley Smith [Fri, 8 Oct 2021 14:23:29 +0000 (14:23 +0000)]
[AArch64][SVE] Ensure LowerEXTRACT_SUBVECTOR is not called for illegal types
The lowering for EXTRACT_SUBVECTOR should not be called during type
legalization, only as part of lowering, hence return SDValue() when
called on illegal types.
This also adds missing tests for extracting fixed types from illegal
scalable types.
Differential Revision: https://reviews.llvm.org/D111412
Pavel Labath [Fri, 8 Oct 2021 11:14:33 +0000 (13:14 +0200)]
[lldb] Make char[N] formatters respect the end of the array (PR44649)
I believe this is a more natural behavior, and it also matches what gdb
does.
Differential Revision: https://reviews.llvm.org/D111399
Michał Górny [Fri, 8 Oct 2021 14:25:21 +0000 (16:25 +0200)]
[lldb] [DynamicRegisterInfo] Remove non-const GetRegisterInfoAtIndex()
Differential Revision: https://reviews.llvm.org/D111408
Michał Górny [Fri, 8 Oct 2021 09:54:25 +0000 (11:54 +0200)]
[lldb] [ConnectionFileDescriptorPosix] Combine m_read_sp & m_write_sp
Combine m_read_sp and m_write_sp into a single m_io_sp. In all
currently existing code paths, they are pointing to the same object
anyway.
Differential Revision: https://reviews.llvm.org/D111396
Muhammad Omair Javaid [Mon, 11 Oct 2021 09:34:41 +0000 (14:34 +0500)]
[LLDB] Remove xfail decorator TestInferiorAssert.py AArch64/Linux
TestInferiorAssert.py test_inferior_asserting_disassemble passes after
upgrading LLDB AArch64/Linux buildbot to Ubuntu Focal.
Qiu Chaofan [Mon, 11 Oct 2021 09:38:04 +0000 (17:38 +0800)]
[Clang] Enable IC/IF mode for __ibm128
As for 128-bit floating points on PowerPC, compiler should have three
machine modes:
- IFmode, always IBM extended double
- KFmode, always IEEE 754R 128-bit floating point
- TFmode, matches the semantics for long double
This commit adds support for IF mode with its complex variant, IC mode.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D109950
Andrew Savonichev [Thu, 29 Jul 2021 11:16:05 +0000 (14:16 +0300)]
[AArch64] Emit AssertZExt for i1 arguments
AAPCS requires i1 argument to be zero-extended to 8-bits by the
caller. Emit a new AArch64ISD::ASSERT_ZEXT_BOOL hint (or AssertZExt
for GlobalISel) to enable some optimization opportunities. In
particular, when the argument is forwarded to the callee, we can avoid
zero-extension and use it as-is.
Differential Revision: https://reviews.llvm.org/D107160
Clement Courbet [Mon, 11 Oct 2021 08:42:08 +0000 (10:42 +0200)]
[BasicAA][NFC] Improve comment.
David Sherwood [Wed, 4 Aug 2021 07:10:51 +0000 (08:10 +0100)]
[LoopVectorize] Permit vectorisation of more select(cmp(), X, Y) reduction patterns
This patch adds further support for vectorisation of loops that involve
selecting an integer value based on a previous comparison. Consider the
following C++ loop:
int r = a;
for (int i = 0; i < n; i++) {
if (src[i] > 3) {
r = b;
}
src[i] += 2;
}
We should be able to vectorise this loop because all we are doing is
selecting between two states - 'a' and 'b' - both of which are loop
invariant. This just involves building a vector of values that contain
either 'a' or 'b', where the final reduced value will be 'b' if any lane
contains 'b'.
The IR generated by clang typically looks like this:
%phi = phi i32 [ %a, %entry ], [ %phi.update, %for.body ]
...
%pred = icmp ugt i32 %val, i32 3
%phi.update = select i1 %pred, i32 %b, i32 %phi
We already detect min/max patterns, which also involve a select + cmp.
However, with the min/max patterns we are selecting loaded values (and
hence loop variant) in the loop. In addition we only support certain
cmp predicates. This patch adds a new pattern matching function
(isSelectCmpPattern) and new RecurKind enums - SelectICmp & SelectFCmp.
We only support selecting values that are integer and loop invariant,
however we can support any kind of compare - integer or float.
Tests have been added here:
Transforms/LoopVectorize/AArch64/sve-select-cmp.ll
Transforms/LoopVectorize/select-cmp-predicated.ll
Transforms/LoopVectorize/select-cmp.ll
Differential Revision: https://reviews.llvm.org/D108136
David Spickett [Mon, 11 Oct 2021 08:29:25 +0000 (09:29 +0100)]
[libcxx][pretty printers] Disable u16string tests
Due to reported failures in a local build.
FAIL: Something is wrong in the test framework.
Converting character sets: Invalid argument.
(was enabled in https://reviews.llvm.org/D111138)
Valentin Clement [Mon, 11 Oct 2021 08:09:31 +0000 (10:09 +0200)]
[fir] Add the abstract result conversion pass
Add pass that convert abstract result to function argument.
This pass is needed before the conversion to LLVM IR.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D111146
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Clement Courbet [Mon, 11 Oct 2021 07:49:00 +0000 (09:49 +0200)]
re-land "[AA] Teach BasicAA to recognize basic GEP range information."
Now that PR52104 is fixed.
Muhammad Omair Javaid [Mon, 11 Oct 2021 07:53:05 +0000 (07:53 +0000)]
[LLDB] Skip TestScriptedProcess on Arm/AArch64 Linux
This is failing on Arm and AArch64 Linux buildbots since the time it was
comitted.
https://lab.llvm.org/buildbot/#/builders/96/builds/12628
Differential Revision: https://reviews.llvm.org/D107585
Clement Courbet [Thu, 7 Oct 2021 15:29:02 +0000 (17:29 +0200)]
[LoopIdiom] Fix store size SCEV type.
We were using the type of the loop back edge count to represent the
store size. This failed for small loop counts (e.g. in the added test,
the loop count was an i2).
Use the index type instead.
Fixes PR52104.
Differential Revision: https://reviews.llvm.org/D111401
Andrew Browne [Mon, 11 Oct 2021 07:28:47 +0000 (00:28 -0700)]
[DFSan] Fix flakey release_shadow_space.c accounting for Origin chains.
Test sometimes fails on buildbot (after two non-Origins executions):
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4620, after mmap: 107020, after mmap+set label: 209424, after fixed map: 4624, after another mmap+set label: 209424, after munmap: 4624
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4620, after mmap: 107020, after mmap+set label: 209424, after fixed map: 4624, after another mmap+set label: 209424, after munmap: 4624
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4620, after mmap: 107020, after mmap+set label: 317992, after fixed map: 10792, after another mmap+set label: 317992, after munmap: 10792
release_shadow_space.c.tmp: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/dfsan/release_shadow_space.c:91: int main(int, char **): Assertion `after_fixed_mmap <= before + delta' failed.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D111522
Vitaly Buka [Mon, 11 Oct 2021 05:47:02 +0000 (22:47 -0700)]
[NFC][sanitizer] Add a few consts
Vitaly Buka [Mon, 11 Oct 2021 04:57:12 +0000 (21:57 -0700)]
[NFC][sanitizer] Clang-format sanitizer_flat_map.h
Vitaly Buka [Sun, 10 Oct 2021 19:45:47 +0000 (12:45 -0700)]
[NFC][sanitizer] Add constexpr to FlatMap::size
Vitaly Buka [Sun, 10 Oct 2021 19:37:31 +0000 (12:37 -0700)]
[NFC][sanitizer] Rename ByteMap to Map
Vitaly Buka [Sun, 10 Oct 2021 19:33:49 +0000 (12:33 -0700)]
[NFC] Allow to include sanitizer_allocator_bytemap.h
Uday Bondhugula [Sat, 2 Oct 2021 06:51:31 +0000 (12:21 +0530)]
[MLIR] Fix affine loop unroll corner case for full unroll
Fix affine loop unroll for zero trip count loops. Add missing check.
Differential Revision: https://reviews.llvm.org/D111375
Lang Hames [Mon, 11 Oct 2021 04:09:29 +0000 (21:09 -0700)]
[ORC] Add TaskDispatcher::shutdown calls to TaskDispatchTest.cpp unit tests.
These calls were left out of
4d7cea3d2e8. In the InPlaceDispatcher test case
the operation is a no-op, but it's good form to include it. In the
DynamicThreadPoolTaskDispatcher test the shutdown call is required to ensure
that we don't exit the test (and tear down the dispatcher) before the thread
running the dispatch has completed.
Lang Hames [Sun, 10 Oct 2021 22:49:08 +0000 (15:49 -0700)]
[ORC] Add optional RunPolicy to ExecutorProcessControl::callWrapperAsync.
The callWrapperAsync and callSPSWrapperAsync methods take a handler object
that is run on the return value of the call when it is ready. The new RunPolicy
parameters allow clients to control how these handlers are run. If no policy is
specified then the handler will be packaged as a GenericNamedTask and dispatched
using the ExecutorProcessControl's TaskDispatch member. Callers can use the
ExecutorProcessControl::RunInPlace policy to cause the handler to be run
directly instead, which may be preferrable for simple handlers, or they can
write their own policy object (e.g. to dispatch as some other kind of Task,
rather than GenericNamedTask).
Lang Hames [Mon, 11 Oct 2021 03:25:44 +0000 (20:25 -0700)]
[examples] Fix LLJITWithRemoteDebugging example after
f3411616896.
Esme-Yi [Mon, 11 Oct 2021 02:52:20 +0000 (02:52 +0000)]
[XCOFF] Improve error message context.
Summary: This patch improves the error message context of the
XCOFF interfaces by providing more details.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D110320
Qiu Chaofan [Mon, 11 Oct 2021 02:44:08 +0000 (10:44 +0800)]
[Clang] [PowerPC] Fix header include typo in smmintrin.h
The SSE4 header (smmintrin.h) should include SSSE3 (tmmintrin.h) instead
of SSE2 (emmintrin.h).
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D111482
Lang Hames [Mon, 11 Oct 2021 02:32:54 +0000 (19:32 -0700)]
[ORC] Add dependence on pthreads library to ORC.
f3411616896 introduced a dependence (for builds with LLVM_ENABLE_THREADS) on
pthreads. This commit updates the CMakeLists.txt file to include a LINK_LIBS
entry for pthreads.
LLVM GN Syncbot [Mon, 11 Oct 2021 02:15:38 +0000 (02:15 +0000)]
[gn build] Port
f34116168964
LLVM GN Syncbot [Mon, 11 Oct 2021 02:15:37 +0000 (02:15 +0000)]
[gn build] Port
3df094d31eac
Lang Hames [Mon, 11 Oct 2021 02:11:46 +0000 (19:11 -0700)]
[ORC] Add missing headers.
These were accidentally left out of
f3411616896.
Arthur O'Dwyer [Thu, 29 Jul 2021 03:40:29 +0000 (23:40 -0400)]
[libc++] [P1614] Implement std::compare_three_way.
Differential Revision: https://reviews.llvm.org/D110735
Lang Hames [Sat, 9 Oct 2021 00:12:06 +0000 (17:12 -0700)]
[ORC] Add TaskDispatch API and thread it through ExecutorProcessControl.
ExecutorProcessControl objects will now have a TaskDispatcher member which
should be used to dispatch work (in particular, handling incoming packets in
the implementation of remote EPC implementations like SimpleRemoteEPC).
The GenericNamedTask template can be used to wrap function objects that are
callable as 'void()' (along with an optional name to describe the task).
The makeGenericNamedTask functions can be used to create GenericNamedTask
instances without having to name the function object type.
In a future patch ExecutionSession will be updated to use the
ExecutorProcessControl's dispatcher, instead of its DispatchTaskFunction.
Arthur Eubanks [Tue, 5 Oct 2021 07:05:37 +0000 (00:05 -0700)]
[NFC][llvm-reduce] Cleanup types
Use Module& wherever possible.
Since every reduction immediately turns Chunks into an Oracle, directly pass Oracle instead.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D111122
Amara Emerson [Sun, 10 Oct 2021 22:32:58 +0000 (15:32 -0700)]
[AArch64][GlobalISel] Legalize G_VECREDUCE_XOR. Treated same as other bitwise reductions.
Wenlei He [Fri, 8 Oct 2021 04:53:04 +0000 (21:53 -0700)]
[llvm-profdata] Allow overlap/similarity comparison to use custom hot threshold cutoff
Allow overlap/similarity comparison to use custom hot threshold cutoff, instead of using hard coded 990000 as hot cutoff.
Differential Revision: https://reviews.llvm.org/D111385
Wenlei He [Fri, 8 Oct 2021 04:27:17 +0000 (21:27 -0700)]
[llvm-profgen] Deduplicate PID when processing perf input
When parsing mmap to retrieve PID, deduplicate them before passing PID list to perf script. Perf script would error out when there's duplicated PID in the input, however raw perf data may main duplicated PID for large binary where more than one mmap is needed to load executable segment.
Differential Revision: https://reviews.llvm.org/D111384
Sylvestre Ledru [Sun, 10 Oct 2021 20:25:33 +0000 (22:25 +0200)]
clang release notes: improve the wording
Lang Hames [Sun, 10 Oct 2021 19:56:37 +0000 (12:56 -0700)]
[ORC] Reorder callWrapperAsync and callSPSWrapperAsync parameters.
The callee address is now the first parameter and the 'SendResult' function
the second. This change improves consistentency with the non-async functions
where the callee is the first address and the return value the second.
Lang Hames [Fri, 8 Oct 2021 20:59:48 +0000 (13:59 -0700)]
Revert "Add missing include after
dfd74db9"
This reverts commit
dd384d2814094bf5d3ab44f917f759fa24a41158.
dfd74db9 was reverted in
8fe3d9df0ed, so this is no longer needed.
Dawid Jurczak [Sun, 10 Oct 2021 17:52:33 +0000 (19:52 +0200)]
[DSE] Re-enable calloc transformation with extra care (PR25892)
Transformation from malloc+memset to calloc is always correct and in many situations
it brings significant observable benefits in terms of execution speed and memory consumption [1][2].
Unfortunately there are cases when producing calloc cause performance drops [3].
As discussed here: https://reviews.llvm.org/D103009 it's possible to differentiate between those 2 scenarios.
If optimizer is able to prove that after malloc call it's _very_ likely to reach memset branch then after
calloc emission we shouldn't observe any performance hits. Therefore finding "null pointer check" pattern
before memset basic block sounds like good justification for performing transformation.
Also that method was already suggested by GCC folks [4]. Main reason for change is that for now
to be safe we check for post dominance relation which is way too conservative approach making transformation
"almost" disabled in practice. This patch tends to enable transformation again but with extra care.
[1] https://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc
[2] https://vorpus.org/blog/why-does-calloc-exist/
[3] http://smalldatum.blogspot.com/2017/11/a-new-optimization-in-gcc-5x-and-mysql.html
[4] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83022
Differential Revision: https://reviews.llvm.org/D110021
Sylvestre Ledru [Sun, 10 Oct 2021 19:28:24 +0000 (21:28 +0200)]
clang release notes: document the -Wbool-operation improvement
Reviewed By: xbolva00
Differential Revision: https://reviews.llvm.org/D111215
Nico Weber [Sun, 10 Oct 2021 19:14:46 +0000 (15:14 -0400)]
clang: Add range-based CFG::try_blocks()
..and use it. No behavior change.
Nico Weber [Sun, 10 Oct 2021 18:32:51 +0000 (14:32 -0400)]
clang: Convert two loops to for-each
And rewrap a line at 80 columns while here. No behavior change.
Joe Loser [Sun, 10 Oct 2021 18:46:35 +0000 (14:46 -0400)]
[libc++][test] Replace a TEST_NOEXCEPT_FALSE with noexcept(false). NFC.
Replace `TEST_NOEXCEPT_FALSE` directly with `noexcept(false)` in
optional hash test which is only run in C++17 or later.
`TEST_NOEXCEPT_FALSE` is only useful in C++03 context where `noexcept`
isn't supported by clang. `TEST_NOEXCEPT_FALSE` now only has one remaining use
in `hash_unique_ptr.pass.cpp`.
Joe Loser [Sun, 10 Oct 2021 18:35:00 +0000 (14:35 -0400)]
[libc++] Remove empty namespace std in type_traits. NFCI.
There is an empty `namespace std` in `type_traits` which was originally
used when `std::byte` was added in
c97d8aa86650ed795bf75a7dd735ecfaef3b8f55. At some point, the bitwise operators
on `std::byte` got relocated but this empty namespace was left around.
Remove it.
Reviewed By: Quuxplusone, Mordante, #libc
Differential Revision: https://reviews.llvm.org/D111512
Jean Perier [Sun, 10 Oct 2021 18:18:45 +0000 (20:18 +0200)]
[fir] Add character conversion pass
Upstream the character conversion pass.
Translates entities of one CHARACTER KIND to another.
By default the translation is to naively zero-extend or truncate a code
point to fit the destination size.
This patch is part of the upstreaming effort from fir-dev branch.
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D111405
Joe Loser [Sun, 10 Oct 2021 16:53:35 +0000 (12:53 -0400)]
[libc++][NFC] Replace tab with whitespace in comment
There is a stray tab character in a comment block. Replace the tab
character with a space for consistency with other comments.
Kazu Hirata [Sun, 10 Oct 2021 15:52:14 +0000 (08:52 -0700)]
[Basic] Use llvm::is_contained (NFC)
Sanjay Patel [Sun, 10 Oct 2021 15:26:03 +0000 (11:26 -0400)]
[InstCombine] move fold for "(X-Y) == 0"; NFC
This consolidates related folds that all have a
similar use restriction that may not be necessary.
Sanjay Patel [Sun, 10 Oct 2021 15:13:46 +0000 (11:13 -0400)]
[InstCombine] add tests for (X - Y) == 0; NFC
Sanjay Patel [Sun, 10 Oct 2021 14:58:58 +0000 (10:58 -0400)]
[InstCombine] canonicalize "(C2 - Y) > C" as (Y + ~C2) < ~C
The test diffs show that we have better analysis/folds for 'add'
(although we should at least have the simplifications
independently, so we don't have the one-use restriction).
This is related to solving regressions that would appear in
transforms related to D111410, and that is part of a series
of enhancements that may eventually helpi solve PR34047.
https://alive2.llvm.org/ce/z/3tB9KG
define i1 @src(i8 %x, i8 %C, i8 %C2) {
%sub = sub nuw i8 %C2, %x
%r = icmp slt i8 %sub, %C
ret i1 %r
}
define i1 @tgt(i8 %x, i8 %C, i8 %C2) {
%Cnot = xor i8 %C, -1
%C2not = xor i8 %C2, -1
%add = add nuw i8 %x, %C2not
%r = icmp sgt i8 %add, %Cnot
ret i1 %r
}
Sanjay Patel [Sun, 10 Oct 2021 14:41:28 +0000 (10:41 -0400)]
[InstCombine] add test for or-of-icmps; NFC
Chen Zheng [Sun, 10 Oct 2021 14:39:20 +0000 (14:39 +0000)]
[PowerPC] update test case using the scripts; nfc
Mark de Wever [Sun, 10 Oct 2021 12:21:01 +0000 (14:21 +0200)]
[libc++][nfc] Remove a duplicated include.
Dávid Bolvanský [Sun, 10 Oct 2021 09:34:03 +0000 (11:34 +0200)]
[NFC] Added tests for PR52056
william woodruff [Sun, 10 Oct 2021 04:10:22 +0000 (09:40 +0530)]
[BitcodeAnalyzer] allow a motivated user to dump BLOCKINFO
This adds the `--dump-blockinfo` flag to `llvm-bcanalyzer`, allowing a sufficiently motivated user to dump (parts of) the `BLOCKINFO_BLOCK` block. The default behavior is unchanged, and `--dump-blockinfo` only takes effect in the same context as other flags that control dump behavior (i.e., requires that `--dump` is also passed).
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D107536
Amara Emerson [Sun, 10 Oct 2021 03:43:21 +0000 (20:43 -0700)]
[GlobalISel] Fix the stores of truncates -> wide store combine for non-evenly dividing type sizes.
If the wide store we'd generate is not a multiple of the memory type of the
narrow stores (e.g. s48 and s32), we'd assert. Fix that.
william woodruff [Sun, 10 Oct 2021 00:44:08 +0000 (06:14 +0530)]
[clang] Fix JSON AST output when a filter is used
Without this, the combination of `-ast-dump=json` and `-ast-dump-filter FILTER` produces invalid JSON: the first line is a string that says `Dumping $SOME_DECL_NAME: `.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D108441
Med Ismail Bennani [Sun, 10 Oct 2021 01:28:36 +0000 (03:28 +0200)]
[lldb/test] Disable 'TestScriptedProcess.py' on macOS
This is disabling 'TestScriptedProcess.py' on macOS since it fails on
Green Dragon: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/35974
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Joe Loser [Sat, 9 Oct 2021 21:20:19 +0000 (17:20 -0400)]
[libc++][test] Remove empty {ind.move.subsumption.compile.pass.cpp}
`{ind.move.subsumption.compile.pass.cpp}` was accidentally commited in
https://reviews.llvm.org/D102639. Per the conversation on Discord in
Amy Zhuang [Sat, 9 Oct 2021 19:40:13 +0000 (12:40 -0700)]
[mlir] Vectorize induction variables
1. Add support to vectorize induction variables of loops that are
not mapped to any vector dimension in SuperVectorize pass.
2. Fix a bug in getForInductionVarOwner.
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D111370
mydeveloperday [Sat, 9 Oct 2021 18:34:30 +0000 (19:34 +0100)]
[clang-format][NFC] improve the visual of the "clang-formatted %"
NOTE: some files are being removed from those files that are clang-formatted
which means some lack of formatting is slipping through the net on reviews
Mehdi Amini [Sat, 9 Oct 2021 17:56:23 +0000 (17:56 +0000)]
Fix a comment at call-site to match the declared parameter (NFC)
(clang-tidy warning)
Ron Lieberman [Sat, 9 Oct 2021 16:51:53 +0000 (12:51 -0400)]
[libomptarget][amdgpu][NFC] tweak a comment
Kazu Hirata [Sat, 9 Oct 2021 16:38:15 +0000 (09:38 -0700)]
[IR] Remove arg_operands and getNumArgOperands (NFC)
The last uses were removed on Oct 8, 2021 in commit
46ef2e0bf995d8db4cbdf69f3d1bbc2487030ba0.
This is a relanding of
b2ee408dde374d6a27a34746fd7c7b5bab97ea89.
Sanjay Patel [Sat, 9 Oct 2021 15:34:48 +0000 (11:34 -0400)]
[InstCombine] enhance icmp with sub folds
There were 2 related but over-specified folds for:
C1 - X == C
One allowed multi-use but was limited to equal constants.
The other allowed different constants but disallowed multi-use.
This combines the 2 folds into a more general match.
The test diffs show the multi-use cases that were falling
through the cracks.
https://alive2.llvm.org/ce/z/4_hEt2
define i1 @src(i8 %x, i8 %subC, i8 %C) {
%s = sub i8 %subC, %x
%r = icmp eq i8 %s, %C
ret i1 %r
}
define i1 @tgt(i8 %x, i8 %subC, i8 %C) {
%newC = sub i8 %subC, %C
%isneg = icmp eq i8 %x, %newC
ret i1 %isneg
}
Sanjay Patel [Fri, 8 Oct 2021 20:30:55 +0000 (16:30 -0400)]
[InstCombine] add tests for icmp of negated op; NFC