Craig Topper [Wed, 14 Oct 2020 17:17:37 +0000 (10:17 -0700)]
[X86] Add test case to demonstrate a Log2_32_Ceil that can just be Log2_32 in SimplifySetCC ctpop combine.
This combine can look through (trunc (ctpop X)). When doing this
it tries to make sure the trunc doesn't lose any information
from the ctpop. It does this by checking that the truncated type
has more bits that Log2_32_Ceil of the ctpop type. The Ceil is
unnecessary and pessimizes non-power of 2 types.
For example, ctpop of i256 requires 9 bits to represent the max
value of 256. But ctpop of i255 only requires 8 bits to represent
the max result of 255. Log2_32_Ceil of 256 and 255 both return 8
while Log2_32 returns 8 for 256 and 7 for 255.
Simon Pilgrim [Wed, 14 Oct 2020 17:14:23 +0000 (18:14 +0100)]
Revert rG25a97c3a43d7 - "[InstCombine] visitCallInst - retain undefs in vector funnel shift amounts"
This reverts commit
25a97c3a43d7bc469ec67dd4e901a507b9b11116.
We have other constant folds that fold undef funnel shift amounts to 0 - so we need to be consistent.
If we end up with regressions where we lose a splat shift amount pattern we'll have to investigate other canonicalizations, but matchFunnelShift currently protects us from that.
Konstantin Zhuravlyov [Wed, 14 Oct 2020 17:03:37 +0000 (13:03 -0400)]
AMDGPU: Update AMDHSA code object version handling
Differential Revision: https://reviews.llvm.org/D89076
Matt Arsenault [Mon, 5 Oct 2020 17:44:32 +0000 (13:44 -0400)]
InstCombine: Fix losing load properties in copy-constant-to-alloca
Preserve the alignment and metadata. Atomic loads are skipped for
this, but pass along the properties for consistency.
Matt Arsenault [Mon, 5 Oct 2020 17:50:17 +0000 (13:50 -0400)]
InstCombine: Fix infinite loop in copy-constant-to-alloca transform
This was broken by
16295d521e294b27106e51fac29957c1aac8ff89, when
instructions started being handled and not just constant
expressions. This was re-inserting an equivalent bitcast to the
original memcpy operand, which made a non-functional IR change on
every iteration.
This also fixes a secondary problem where it was inserting
addrspacecasts which may not have been legal (i.e. it changed the
source address space). Start visiting all pointer users and fail out
if we can't process them. Also start handling the relevant memory
intrinsic users. These cases can be dealt with by running
InferAddressSpaces separately.
Louis Dionne [Wed, 14 Oct 2020 16:40:59 +0000 (12:40 -0400)]
[libc++] Mark two tests as unsupported in C++03
This was dropped when I split the tests into individual source files
to make sure they would actually run (in
2908eb20ba).
Florian Hahn [Tue, 13 Oct 2020 17:47:37 +0000 (18:47 +0100)]
Recommit "[VPlan] Use VPValue def for VPMemoryInstructionRecipe."
This reverts the revert commit
710aceb645e7dba4de7053eef2c616311b9163d4
and includes a fix for a memsan failure.
Original message:
This patch turns VPMemoryInstructionRecipe into a VPValue and uses it
during VPlan construction and codegeneration instead of the plain IR
reference where possible.
Simon Pilgrim [Wed, 14 Oct 2020 16:37:07 +0000 (17:37 +0100)]
[CodeGen] Move x86 specific ms intrinsic tests into x86 target subfolder. NFCI.
Mark Schimmel [Wed, 14 Oct 2020 15:29:17 +0000 (10:29 -0500)]
Polly - specify address space when creating a pointer to a vector type
Polly incorrectly dropped the address space specified for a load instruction when it vectorized the code.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D88907
Kadir Cetinkaya [Wed, 14 Oct 2020 16:03:57 +0000 (18:03 +0200)]
[clangd] clang-format TweakTests, NFC
Irina Dobrescu [Tue, 15 Sep 2020 10:51:02 +0000 (11:51 +0100)]
Add Allocate Clause to MLIR Parallel Operation Definition
Differential Revision: https://reviews.llvm.org/D87684
Louis Dionne [Wed, 14 Oct 2020 15:59:30 +0000 (11:59 -0400)]
[libc++] Use ADDITIONAL_COMPILE_FLAGS instead of #define for _LIBCPP_DEBUG
Louis Dionne [Wed, 14 Oct 2020 14:54:59 +0000 (10:54 -0400)]
[libc++] Split off debug tests that were missed by
ce1365f8f7e into test/libcxx
Also, some tests had multiple death tests in them, so split them into
separate tests instead. The second death test would obviously never
get run, because the first one would kill the program before.
jasonliu [Wed, 14 Oct 2020 15:55:55 +0000 (15:55 +0000)]
[AIX] Turn -fdata-sections on by default in Clang
Summary:
This patch does the following:
1. Make InitTargetOptionsFromCodeGenFlags() accepts Triple as a
parameter, because some options' default value is triple dependant.
2. DataSections is turned on by default on AIX for llc.
3. Test cases change accordingly because of the default behaviour change.
4. Clang Driver passes in -fdata-sections by default on AIX.
Reviewed By: MaskRay, DiggerLin
Differential Revision: https://reviews.llvm.org/D88737
Simon Pilgrim [Wed, 14 Oct 2020 15:42:08 +0000 (16:42 +0100)]
[InstCombine] narrowRotate - canonicalize to OR(SHL,LSHR). NFCI.
Match the canonicalization code that was added to matchFunnelShift at rG02295e6d1a15
Mircea Trofin [Tue, 13 Oct 2020 16:29:15 +0000 (09:29 -0700)]
[NFC][MC] Use MCRegister in Machine{Sink|Pipeliner}.cpp
Differential Revision: https://reviews.llvm.org/D89328
Konstantin Zhuravlyov [Wed, 14 Oct 2020 15:38:58 +0000 (11:38 -0400)]
Remove Combine.td.rej file
Michael Liao [Wed, 14 Oct 2020 15:26:52 +0000 (11:26 -0400)]
Fix an apparent typo. `assert()` must not contain side-effects. NFC.
Kevin Petit [Wed, 14 Oct 2020 14:14:26 +0000 (15:14 +0100)]
[mlir][vulkan-runner] Fix buffer usage flags
The buffers are used as source or destination of transfer commands
so always add VK_BUFFER_USAGE_TRANSFER_{DST,SRC}_BIT to their usage
flags.
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Guillaume Chatelet [Wed, 14 Oct 2020 15:26:17 +0000 (15:26 +0000)]
Fix conjuntion of -Werror,-Wsuggest-override with google/benchmark
Simon Pilgrim [Wed, 14 Oct 2020 14:36:50 +0000 (15:36 +0100)]
[InstCombine] Add m_SpecificIntAllowUndef pattern matcher
m_SpecificInt doesn't accept undef elements in a vector splat value - tweak specific_intval to optionally allow undefs and add the m_SpecificIntAllowUndef variants.
Allows us to remove the m_APIntAllowUndef + comparison hack inside matchFunnelShift
Calixte Denizet [Wed, 3 Jun 2020 07:44:36 +0000 (09:44 +0200)]
[profile] Remove useless msync when dumping gcda files
Summary:
According the mmap man page (https://man7.org/linux/man-pages/man2/mmap.2.html) is only required to precisely control updates, so we can safely remove it.
Since gcda files are dumped just before to call exec** functions, dump need to be fast.
On my computer, Firefox built with --coverage needs ~1min40 to display something and in removing msync it needs ~8s.
Reviewers: void
Subscribers: #sanitizers, marco-c, sylvestre.ledru
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D81060
Pavel Labath [Wed, 14 Oct 2020 14:46:10 +0000 (16:46 +0200)]
[lldb] Fix TestGdbRemoteMemoryAllocation on windows
It appears that memory allocation actually works on windows (but it was
not fully wired up before
2c4226f8).
Pavel Labath [Wed, 14 Oct 2020 14:41:13 +0000 (16:41 +0200)]
[lldb] Remove bogus ProcessMonitor forward-decls
This class is not used in those files.
Cameron McInally [Wed, 14 Oct 2020 14:11:58 +0000 (09:11 -0500)]
[SVE] Lower fixed length VECREDUCE_FADD operation
Differential Revision: https://reviews.llvm.org/D89263
Jean Perier [Wed, 14 Oct 2020 14:35:51 +0000 (16:35 +0200)]
[flang] Rework host runtime folding and enable REAL(2) folding with it.
- Rework the host runtime table so that it is constexpr to avoid
having to construct it and to store/propagate it.
- Make the interface simpler (remove many templates and a file)
- Enable 16bits float folding using 32bits float host runtime
- Move StaticMultimapView into its own header to use it for host
folding
Reviewed By: klausler, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D88981
Louis Dionne [Wed, 14 Oct 2020 14:12:09 +0000 (10:12 -0400)]
[libc++] Remove signal-based checkpoints in libc++ tests
While this adds some convenience to the test suite, it prevents the tests
using these checkpoints from being used on systems where signals are not
available, such as some embedded systems. It will also prevent these tests
from being constexpr-friendly once e.g. std::map is made constexpr, due
to the use of statics.
Instead, one can always use a debugger to figure out exactly where a
test is failing when that isn't clear from the log output without
checkpoints.
Michael Liao [Wed, 14 Oct 2020 14:11:19 +0000 (10:11 -0400)]
Fix `-Wparentheses` warnings. NFC.
Eric Schweitz [Wed, 14 Oct 2020 00:06:39 +0000 (17:06 -0700)]
[mlir] expand the legal floating-point types in the LLVM IR dialect type check
This patch adds a couple missing LLVM IR dialect floating point types to
the legality check.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D89350
Nicolas Vasilache [Wed, 14 Oct 2020 13:50:29 +0000 (13:50 +0000)]
[mlir][Linalg] Add missing dependency
Simon Pilgrim [Wed, 14 Oct 2020 13:38:08 +0000 (14:38 +0100)]
[InstCombine] visitCallInst - retain undefs in vector funnel shift amounts
By always performing a modulo on the shift amount constants this was causing undef amounts being replaced with zero, meaning we were losing funnel shift by splat (with undef) patterns.
Tweaked the shift amount bounds check to support (passthrough) undefs, and use Constant::mergeUndefsWith to preserve the undefs after folding.
Jonas Paulsson [Wed, 14 Oct 2020 12:39:35 +0000 (14:39 +0200)]
[SystemZ] Bugfix in SystemZVectorConstantInfo
In order to correctly load an all-ones FP NaN value into a floating point
register with a VGBM, the analyzed 32/64 FP bits must first be shifted left
(into element 0 of the vector register).
SystemZVectorConstantInfo has so far relied on element replication which has
bypassed the need to do this shift, but now it is clear that this must be
done in order to handle NaNs.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D89389
Jeremy Morse [Wed, 14 Oct 2020 13:16:42 +0000 (14:16 +0100)]
[DebugInstrRef] Create DBG_INSTR_REFs in SelectionDAG
When given the -experimental-debug-variable-locations option (via -Xclang
or to llc), have SelectionDAG generate DBG_INSTR_REF instructions instead
of DBG_VALUE. For now, this only happens in a limited circumstance: when
the value referred to is not a PHI and is defined in the current block.
Other situations introduce interesting problems, addresed in later patches.
Practically, this patch hooks into InstrEmitter and if it can find a
defining instruction for a value, gives it an instruction number, and
points the DBG_INSTR_REF at that <instr, operand> pair.
Differential Revision: https://reviews.llvm.org/D85747
Haojian Wu [Wed, 14 Oct 2020 13:13:13 +0000 (15:13 +0200)]
Fix a broken build for gcc <= 7.1
we need add a "this->" inside the lambda body to workaround it. Rewrite
it to normal for-range loop.
Roman Lebedev [Wed, 14 Oct 2020 11:56:58 +0000 (14:56 +0300)]
Revert "Reland "[SCEV] Model ptrtoint(SCEVUnknown) cast not as unknown, but as zext/trunc/self of SCEVUnknown"" and it's follow-ups
While we haven't encountered an earth-shattering problem with this yet,
by now it is pretty evident that trying to model the ptr->int cast
implicitly leads to having to update every single place that assumed
no such cast could be needed. That is of course the wrong approach.
Let's back this out, and re-attempt with some another approach,
possibly one originally suggested by Eli Friedman in
https://bugs.llvm.org/show_bug.cgi?id=46786#c20
which should hopefully spare us this pain and more.
This reverts commits
1fb610429308a7c29c5065f5cc35dcc3fd69c8b1,
7324616660fc0995fa8c166e3c392361222d5dbc,
aaafe350bb65dfc24c2cdad4839059ac81899fbe,
e92a8e0c743f83552fac37ecf21e625ba3a4b11e.
I've kept&improved the tests though.
Pavel Labath [Fri, 9 Oct 2020 11:59:50 +0000 (13:59 +0200)]
[lldb-server][linux] Add ability to allocate memory
This patch adds support for the _M and _m gdb-remote packets, which
(de)allocate memory in the inferior. This works by "injecting" a
m(un)map syscall into the inferior. This consists of:
- finding an executable page of memory
- writing the syscall opcode to it
- setting up registers according to the os syscall convention
- single stepping over the syscall
The advantage of this approach over calling the mmap function is that
this works even in case the mmap function is buggy or unavailable. The
disadvantage is it is more platform-dependent, which is why this patch
only works on X86 (_32 and _64) right now. Adding support for other
linux architectures should be easy and consist of defining the
appropriate syscall constants. Adding support for other OSes depends on
the its ability to do a similar trick.
Differential Revision: https://reviews.llvm.org/D89124
Pavel Labath [Wed, 7 Oct 2020 15:35:13 +0000 (17:35 +0200)]
[lldb] Modernize PseudoTerminal::OpenFirstAvailablePrimary
replace char*+length combo with llvm::Error
Serge Guelton [Mon, 5 Oct 2020 19:35:38 +0000 (15:35 -0400)]
[flang] Make flang build compatible with LLVM dylib
Harmonize usage of LLVM components througout Flang.
Explicit LLVM Libs where used across several CMakeFIles, which led to
incompatibilities with LLVM shlibs.
Fortunately, the LLVM component system can be relied on to harmoniously handle
both cases.
Differential Revision: https://reviews.llvm.org/D87893
Kadir Cetinkaya [Tue, 13 Oct 2020 11:05:36 +0000 (13:05 +0200)]
[clangd] Disable extract variable for RHS of assignments
Differential Revision: https://reviews.llvm.org/D89307
Gabor Marton [Tue, 13 Oct 2020 13:49:43 +0000 (15:49 +0200)]
[ASTImporter] Fix crash caused by unset AttributeSpellingListIndex
During the import of attributes we forgot to set the spelling list
index. This caused a segfault when we wanted to traverse the AST
(e.g. by the dump() method).
Differential Revision: https://reviews.llvm.org/D89318
Gabor Marton [Tue, 13 Oct 2020 13:57:37 +0000 (15:57 +0200)]
[ASTImporter] Fix crash caused by unimported type of FromatAttr
During the import of FormatAttrs we forgot to import the type (e.g
`__scanf__`) of the attribute. This caused a segfault when we wanted to
traverse the AST (e.g. by the dump() method).
Differential Revision: https://reviews.llvm.org/D89319
Haojian Wu [Mon, 12 Oct 2020 11:22:13 +0000 (13:22 +0200)]
[clangd] Refine recoveryAST flags in clangd
so that we could start experiment for C.
Previously, these flags in clangd were only meaningful for C++. We need
to flip them for C, this patch repurpose these flags.
- if true, just set it.
- if false, just respect the value in clang.
this would allow us to keep flags on for C++, and optionally flip them on for C.
Differential Revision: https://reviews.llvm.org/D89233
Carl Ritson [Wed, 14 Oct 2020 10:56:38 +0000 (19:56 +0900)]
[AMDGPU] Base getSubRegFromChannel on TableGen data
Generate (at runtime) the table used to drive getSubRegFromChannel,
base on AMDGPUSubRegIdxRanges from TableGen data.
The is a step closer to it being staticly generated by TableGen and
allows getSubRegFromChannel handle all bitwidths in the mean time.
Reviewed By: rampitec, arsenm, foad
Differential Revision: https://reviews.llvm.org/D89217
Juneyoung Lee [Mon, 12 Oct 2020 07:23:18 +0000 (16:23 +0900)]
[ValueTracking] Use assume's noundef operand bundle
This patch updates `isGuaranteedNotToBeUndefOrPoison` to use `llvm.assume`'s `noundef` operand bundle.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D89219
Tim Northover [Wed, 14 Oct 2020 10:38:01 +0000 (11:38 +0100)]
Analysis: only query size of sized objects.
Recently we started looking into sret parameters, though the issue could crop
up elsewhere. If the pointee type is opaque, we should not try to compute its
size because that leads to an assertion failure.
Nicolas Vasilache [Wed, 14 Oct 2020 09:02:47 +0000 (09:02 +0000)]
[mlir][Linalg] Make a Linalg CodegenStrategy available.
This revision adds a programmable codegen strategy from linalg based on staged rewrite patterns. Testing is exercised on a simple linalg.matmul op.
Differential Revision: https://reviews.llvm.org/D89374
Simon Pilgrim [Wed, 14 Oct 2020 10:58:21 +0000 (11:58 +0100)]
[InstCombine] Add undef funnel shift amount test coverage
sameeran joshi [Wed, 14 Oct 2020 09:52:28 +0000 (15:22 +0530)]
[Flang][OpenMP] Fix issue in only a single nowait clause can appear on a sections directive.
The OpenMP 5.0 standard restricts nowait clause to appear only once on sections
directive.
See OpenMP 5.0
- 2.8.1
- point 3 in restrictions.
Added a test with fix.
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D88556
Jeremy Morse [Wed, 14 Oct 2020 10:36:50 +0000 (11:36 +0100)]
Add x86 REQUIRES to tests from
2c5f3d54c5ee / D85746
Max Kazantsev [Wed, 14 Oct 2020 10:02:53 +0000 (17:02 +0700)]
[Test] Auto-update for some tests
Rainer Orth [Wed, 14 Oct 2020 10:02:27 +0000 (12:02 +0200)]
Reland "[Support][unittests] Enforce alignment in ConvertUTFTest"
This relands commit
53b3873cf428fd78f1d92504cc20adf11181ead7. The failure
of `ConvertUTFTest.UTF16WrappersForConvertUTF16ToUTF8String` detected the
first time is fixed.
Differential Revision: https://reviews.llvm.org/D88824
Vinay Madhusudan [Wed, 14 Oct 2020 09:50:35 +0000 (15:20 +0530)]
[AArch64] Add more addv tests
Differential Revision: https://reviews.llvm.org/D89365
Jeremy Morse [Wed, 14 Oct 2020 09:47:44 +0000 (10:47 +0100)]
[DebugInstrRef] Parse debug instruction-references from/to MIR
This patch defines the MIR format for debug instruction references: it's an
integer trailing an instruction, marked out by "debug-instr-number", much
like how "debug-location" identifies the DebugLoc metadata of an
instruction. The instruction number is stored directly in a MachineInstr.
Actually referring to an instruction comes in a later patch, but is done
using one of these instruction numbers.
I've added a round-trip test and two verifier checks: that we don't label
meta-instructions as generating values, and that there are no duplicates.
Differential Revision: https://reviews.llvm.org/D85746
Evgeniy Brevnov [Tue, 15 Sep 2020 10:09:47 +0000 (17:09 +0700)]
[LV] Unroll factor is expected to be > 0
LV fails with assertion checking that UF > 0. We already set UF to 1 if it is 0 except the case when IC > MaxInterleaveCount. The fix is to set UF to 1 for that case as well.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D87679
Simon Pilgrim [Wed, 14 Oct 2020 09:35:27 +0000 (10:35 +0100)]
[InstCombine] matchFunnelShift - add support for non-uniform vectors containing undefs.
Replace m_SpecificInt with m_APIntAllowUndef to matching splats containing undefs, then use ConstantExpr::mergeUndefsWith to merge the undefs together in the result.
The undef funnel shift amounts are getting replaced with zero later on - I'll address this in a later patch, otherwise we lose potential shift by splat value patterns.
Eduardo Caldas [Wed, 14 Oct 2020 09:39:34 +0000 (09:39 +0000)]
[SyntaxTree][NFC] Nit on `replaceChildRangeLowLevel`
Eduardo Caldas [Tue, 13 Oct 2020 13:07:17 +0000 (13:07 +0000)]
[SyntaxTree] Bug fix in `MutationsImpl::addAfter`.
* Add assertions to other `MutationsImpl` member functions
* `findPrevious` is a free function
Differential Revision: https://reviews.llvm.org/D89314
Eduardo Caldas [Tue, 13 Oct 2020 09:46:14 +0000 (09:46 +0000)]
[SyntaxTree] Improve safety of `replaceChildRangeLowLevel`
* Add assertions for other preconditions.
* If nothing is modified, don't mark it.
Differential Revision: https://reviews.llvm.org/D89303
Sjoerd Meijer [Wed, 14 Oct 2020 09:04:29 +0000 (10:04 +0100)]
[LoopFlatten] Precommit new test cases. NFC.
Michał Górny [Mon, 12 Oct 2020 10:57:14 +0000 (12:57 +0200)]
[lldb] [test/Register] Add read/write tests for multithreaded process
Add a test to verify that 'register read' and 'register write' commands
work correctly in a multithreaded program, in particular that they read
or write registers for the correct thread. The tests use locking
to ensure that events are serialized and the test can execute reliably.
Differential Revision: https://reviews.llvm.org/D89248
sameeran joshi [Tue, 6 Oct 2020 18:18:08 +0000 (23:48 +0530)]
[Flang][OpenMP] Rework parser changes for OpenMP atomic construct.
`OmpStructureChecker` is supposed to work only with `parser::OmpClause`
after tablegen changes for OpenMP and OpenACC were introduced.
Hence `OmpMemoryOrderClause`, `OmpAtomicMemoryOrderClause` and similar ones were failing
to catch semantic errors, inspite of having code for semantic checks.
This patch tries to change parser for `OmpMemoryOrderClause` and similar dependent ones
and use `OmpClauseList` which resides/comes from common tablegen for OpenMP/OpenACC eventually using `parser::OmpClause`.
This patch also tries to :
1. Change `OmpCriticalDirective` in `openmp-parsers.cpp` to support `OmpClauseList`.
2. Check-flang regresses when changes were introduced due to missing semantic checks in OmpCritical, patch implements them at the minimal level to pass the regression.
3. Change tablegen to support Hint clause.
4. Adds missing source locations `CharBlock Source` in each atomic construct.
5. Remove dead code realted to `memory-order-clauses` after moving to `OmpClauseList`.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D88965
David Sherwood [Tue, 13 Oct 2020 14:57:08 +0000 (15:57 +0100)]
[SVE] Add fatal error when running out of registers for SVE tuple call arguments
When passing SVE types as arguments to function calls we can run
out of hardware SVE registers. This is normally fine, since we
switch to an indirect mode where we pass a pointer to a SVE stack
object in a GPR. However, if we switch over part-way through
processing a SVE tuple then part of it will be in registers and
the other part will be on the stack. This is wrong and we'd like
to avoid any silent ABI compatibility issues in future. For now,
I've added a fatal error when this happens until we can get a
proper fix.
Differential Revision: https://reviews.llvm.org/D89326
Aden Grue [Wed, 14 Oct 2020 08:06:20 +0000 (08:06 +0000)]
Fix typos in the documentation of dynamic values in subview ops
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D89338
Raphael Isemann [Wed, 14 Oct 2020 07:50:59 +0000 (09:50 +0200)]
[lldb] Reject redefinitions of persistent variables
Currently one can redefine a persistent variable and LLDB will just silently
ignore the second definition:
```
(lldb) expr int $i = 1
(lldb) expr int $i = 2
(lldb) expr $i
(int) $i = 1
```
This patch makes this an error and rejects the expression with the second
definition.
A nice follow up would be to refactor LLDB's persistent variables to not just be
a pair of type and name, but also contain some way to obtain the original
declaration and source code that declared the variable. That way we could
actually make a full diagnostic as we would get from redefining a variable twice
in the same expression.
Reviewed By: labath, shafik, JDevlieghere
Differential Revision: https://reviews.llvm.org/D89310
sstefan1 [Tue, 13 Oct 2020 21:01:20 +0000 (23:01 +0200)]
[Attributor][NFC] Make `createShallowWrapper()` available outside of Attributor
D85703 will need to create shallow wrappers in order to track the spmd icv. We need to make it available.
Differential Revision: https://reviews.llvm.org/D89342
Haojian Wu [Wed, 14 Oct 2020 07:57:55 +0000 (09:57 +0200)]
[clang-rename] Simplify the code of handling class paritial specializations, NFC.
Instead of collecting all specializations and doing a post-filterin, we
can just get all targeted specializations from getPartialSpecializationsizations.
Differential Revision: https://reviews.llvm.org/D89220
Luqman Aden [Wed, 14 Oct 2020 07:29:06 +0000 (00:29 -0700)]
[test][lld] Mark TLS tests as REQUIRES: x86.
Fixes http://lab.llvm.org:8011/#/builders/119/builds/92
Dominik Montada [Mon, 24 Aug 2020 09:01:05 +0000 (11:01 +0200)]
[libcxxabi,libunwind] support running tests in standalone mode
Remove check for standalone and shared library mode in libcxxabi to
allow including tests in said mode. This check prevented running the
tests in standalone mode with static libraries, which is the case for
baremetal targets.
Fix check-unwind target trying to use a non-existent llvm-lit executable
in standalone mode. Copy the HandleOutOfTreeLLVM logic from libcxxabi to
libunwind in order to make the tests work in standalone mode.
Reviewed By: ldionne, #libc_abi, #libc
Differential Revision: https://reviews.llvm.org/D86540
Evgeny Leviant [Wed, 14 Oct 2020 06:58:45 +0000 (09:58 +0300)]
[ARM.td] Make instruction definitions visible to sched models
Differential revision: https://reviews.llvm.org/D89308
Jonas Devlieghere [Wed, 14 Oct 2020 04:45:56 +0000 (21:45 -0700)]
[lldb] Remove lexical block and fix formatting LoadScriptingModule (NFC)
Jonas Devlieghere [Wed, 14 Oct 2020 04:08:37 +0000 (21:08 -0700)]
[lldb] Unconditionally strip the `.py(c)` extension when loading a module
Currently we only strip the Python extension when the file exists on
disk because we assumed that if it didn't exist it was a module.
However, with the change from D89334 this is no longer the case as we
want to be able to import a relative path to a .py as a module. Since we
always import a scripting module as a "python module" we should always
strip the extension if present.
Differential revision: https://reviews.llvm.org/D89352
Jonas Paulsson [Wed, 14 Oct 2020 06:35:38 +0000 (08:35 +0200)]
Revert "[clang] Improve handling of physical registers in inline assembly operands."
This reverts commit
c78da037783bda0f27f4d82060149166e6f0c796.
Temporarily reverted due to https://bugs.llvm.org/show_bug.cgi?id=47837.
Tony [Tue, 13 Oct 2020 02:06:33 +0000 (02:06 +0000)]
[AMDGPU] Cleanup memory legalizer interfaces
- Rename interfaces to be in terms of acquire and release.
- Improve comments.
Differential Revision: https://reviews.llvm.org/D89355
Arthur Eubanks [Wed, 7 Oct 2020 21:41:27 +0000 (14:41 -0700)]
[test][NewPM] Pin -mergereturn tests to legacy PM
Looks like this pass isn't really used and hasn't been worked on in a
loooong time.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D89010
Arthur Eubanks [Wed, 7 Oct 2020 21:40:35 +0000 (14:40 -0700)]
[LoopExtract][NewPM] Port -loop-extract to NPM
-loop-extract-single is just -loop-extract on one loop.
-loop-extract depended on -break-crit-edges and -loop-simplify in the
legacy PM, but the NPM doesn't allow specifying pass dependencies like
that, so manually add those passes to the RUN lines where necessary.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D89016
David Blaikie [Wed, 14 Oct 2020 05:00:34 +0000 (22:00 -0700)]
libDebugInfoDWARF: Don't try to parse loclist[.dwo] headers when parsing debug_info[.dwo]
There's no way to know whether there's a loclist contribution to parse
if there's no loclistx encoding - and if there is one, there's no need
to walk back from the loclist_base (or, uin the case of
info.dwo/loclist.dwo - starting at 0 in the contribution) to parse the
header, instead rely on the DWARF32/64 and address size in the CU
that's already available.
This would come up in split DWARF (non-split wouldn't try to read a
loclist header in the absence of a loclist_base) when one unit had
location lists and another does not (because the loclists.dwo section
would be non-empty in that case - in the case where it's empty the
parsing would silently skip).
Simplify the testing a bit, rather than needing a whole dwp, etc - by
creating a malformed loclists.dwo section (and use single file Split
DWARF) that would trip up any attempt to parse it - but no attempt
should be made.
Liu, Chen3 [Wed, 14 Oct 2020 02:12:59 +0000 (10:12 +0800)]
[X86][NFC] Fix RUN line bug in the testcase
Testcase added in D78699 doesn't work because the wrong RUN line in the
testcase.
Differential Revision: https://reviews.llvm.org/D89361
Dave Lee [Wed, 14 Oct 2020 00:50:02 +0000 (17:50 -0700)]
[cmake] Limit missing external lit warning to be shown once
When using a custom `LLVM_EXTERNAL_LIT`, it's possible the file may not exist at the CMake is generating the build. One example is LLDB standalone builds. When the external lit doesn't exist, a warning message is emitted, but the warning is printed once for every single lit target. This produces many redundant warnings.
This changes the warning to only be emitted once, controlled by a CACHE variable.
Other options are:
1. remove the warning
2. have callers pass an option to silence the warning if desired
See https://reviews.llvm.org/D76945 for some context.
Differential Revision: https://reviews.llvm.org/D89356
Luqman Aden [Wed, 7 Oct 2020 02:16:34 +0000 (19:16 -0700)]
[LLD] Add baseline test for TLS alignment. NFC.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D88646
Stella Laurenzo [Tue, 13 Oct 2020 16:54:22 +0000 (09:54 -0700)]
[mlir] Remove obsolete "Quantization" section from the rationale.
* It reads as more of a TODO for the future and has been long obsoleted by later work.
* One of the authors of the referenced paper called this out as "weird stuff from two years ago" when reviewing the more recent TOSA RFC.
Differential Revision: https://reviews.llvm.org/D89329
Vitaly Buka [Wed, 14 Oct 2020 03:38:56 +0000 (20:38 -0700)]
[sanitizer][NFC] Fix few cpplint warnings
David Tenty [Thu, 8 Oct 2020 18:43:19 +0000 (14:43 -0400)]
[NFC][compiler-rt] Add ppc32 to the list of arch
This should have been done when it was added to the symmetrical list in
the builtins config-ix in D87383, but it was overlooked.
Petr Hosek [Tue, 13 Oct 2020 03:40:33 +0000 (20:40 -0700)]
[CMake][Fuchsia] Start building arm64 Darwin runtimes
This enables arm64 Darwin support in Fuchsia toolchain.
Richard Smith [Wed, 14 Oct 2020 02:31:41 +0000 (19:31 -0700)]
Revert "PR47805: Use a single object for a function parameter in the caller and"
Breaks a clangd unit test.
This reverts commit
8f8b9f2cca0b73314342c721186ae9c860ca273c.
Kamil Rytarowski [Wed, 14 Oct 2020 00:13:29 +0000 (02:13 +0200)]
[compiler-rt] [lldb] Mark syscall_acquire and syscall_release as USED
Fixes build warnings on NetBSD.
Alexandre Ganea [Wed, 14 Oct 2020 01:54:00 +0000 (21:54 -0400)]
Re-land [ThinLTO] Re-order modules for optimal multi-threaded processing
This reverts
9b5b3050237db3642ed7ab1bdb3ffa2202511b99 and fixes the unwanted re-ordering when generating ThinLTO indexes.
The goal of this patch is to better balance thread utilization during ThinLTO in-process linking (in llvm-lto2 or in LLD). Before this patch, large modules would often be scheduled late during execution, taking a long time to complete, thus starving the thread pool.
We now sort modules in descending order, based on each module's bitcode size, so that larger modules are processed first. By doing so, smaller modules have a better chance to keep the thread pool active, and thus avoid starvation when the bitcode compilation is almost complete.
In our case (on dual Intel Xeon Gold 6140, Windows 10 version 2004, two-stage build), this saves 15 sec when linking `clang.exe` with LLD & -flto=thin, /opt:lldltojobs=all, no ThinLTO cache, -DLLVM_INTEGRATED_CRT_ALLOC=d:\git\rpmalloc.
Before patch: 100 sec
After patch: 85 sec
Inspired by the work done by David Callahan in D60495.
Differential Revision: https://reviews.llvm.org/D87966
Richard Smith [Tue, 13 Oct 2020 17:03:02 +0000 (10:03 -0700)]
PR47805: Use a single object for a function parameter in the caller and
callee in constant evaluation.
We previously made a deep copy of function parameters of class type when
passing them, resulting in the destructor for the parameter applying to
the original argument value, ignoring any modifications made in the
function body. This also meant that the 'this' pointer of the function
parameter could be observed changing between the caller and the callee.
This change completely reimplements how we model function parameters
during constant evaluation. We now model them roughly as if they were
variables living in the caller, albeit with an artificially reduced
scope that covers only the duration of the function call, instead of
modeling them as temporaries in the caller that we partially "reparent"
into the callee at the point of the call. This brings some minor
diagnostic improvements, as well as significantly reduced stack usage
during constant evaluation.
Erik Pilkington [Tue, 13 Oct 2020 16:40:55 +0000 (12:40 -0400)]
[SemaObjC] Fix a crash on an invalid ternary with ARC pointers
FindCompositeObjCPointerType nulls out the subexpressions on error, so bail out
instead of trying to deref them.
Vitaly Buka [Wed, 14 Oct 2020 01:08:19 +0000 (18:08 -0700)]
[sanitizer] Escape quotes in tests to fix android bot after D88361
Adrian Prantl [Wed, 14 Oct 2020 00:31:33 +0000 (17:31 -0700)]
Replace bool constants with named constants for improved readibility (NFC)
Mehdi Amini [Wed, 14 Oct 2020 00:37:10 +0000 (00:37 +0000)]
Revert "[DDR] Introduce implicit equality check for the source pattern operands with the same name."
This reverts commit
7271c1bcb96051bcd227d3fa6071a620fe238850.
This broke the gcc-5 build:
/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<const std::__cxx11::basic_string<char>, mlir::tblgen::SymbolInfoMap::SymbolInfo>::pair(llvm::StringRef&, mlir::tblgen::SymbolInfoMap::SymbolInfo)'
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^
In file included from /usr/include/c++/5/utility:70:0,
from llvm/include/llvm/Support/type_traits.h:18,
from llvm/include/llvm/Support/Casting.h:18,
from mlir/include/mlir/Support/LLVM.h:24,
from mlir/include/mlir/TableGen/Pattern.h:17,
from mlir/lib/TableGen/Pattern.cpp:14:
/usr/include/c++/5/bits/stl_pair.h:206:9: note: candidate: template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>)
pair(tuple<_Args1...>&, tuple<_Args2...>&,
^
John Demme [Tue, 13 Oct 2020 22:07:27 +0000 (22:07 +0000)]
[MLIR] Add support for defining Types in tblgen
Adds a TypeDef class to OpBase and backing generation code. Allows one
to define the Type, its parameters, and printer/parser methods in ODS.
Can generate the Type C++ class, accessors, storage class, per-parameter
custom allocators (for the storage constructor), and documentation.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D86904
Aditya Nandakumar [Wed, 14 Oct 2020 00:19:28 +0000 (17:19 -0700)]
[GISel] Add combine for constant G_PTR_ADD offsets.
https://reviews.llvm.org/D88865
This adds a single combine for GlobalISel to fold:
ptradd (inttoptr C1) C2
Into:
C1 + C2
Additionally, a small test for AArch64 is added.
Patch by pnappa.
Louis Dionne [Tue, 13 Oct 2020 19:47:31 +0000 (15:47 -0400)]
[libc++/abi] Clean up uses of <iostream> in the test suite
We used <iostream> in several places where we don't actually need the
full power of <iostream>, and where using basic `std::printf` is enough.
This is better, since `std::printf` can be supported on systems that don't
have a notion of locales, while <iostream> can't.
Adrian Prantl [Wed, 14 Oct 2020 00:00:32 +0000 (17:00 -0700)]
Move initialization of Variable::m_loc_is_const_data into constructor (NFC)
This makes it symmetric with all other flags and makes it easier to
not forget to initialize it.
https://reviews.llvm.org/D89351
Vedant Kumar [Tue, 13 Oct 2020 21:22:12 +0000 (14:22 -0700)]
[cmake] Unconditionally set the force flag when codesigning
The Darwin linker now defaults to ad hoc signing binaries when targeting
Apple Silicon. This creates a problem when configuring targets that must
be built with entitlements: we either need to add -Wl,-no_adhoc_codesign
when building the target, or sign with the force flag set to allow
replacing a pre-existing signature.
Unconditionally force-signing is the more convenient solution. This
doesn't require a ld64 version check, and it's a much less invasive
cmake change.
Patch by Fred Riss!
rdar://
70237254
Differential Revision: https://reviews.llvm.org/D89343
Vedant Kumar [Tue, 13 Oct 2020 23:20:40 +0000 (16:20 -0700)]
[llvm-cov] Warn when -arch spec is missing/invalid for universal binary (reland)
llvm-cov reports a poor error message when the -arch specifier is
missing or invalid, and a binary has multiple slices. Make the error
message more specific.
(This version of the patch avoids using llvm::none_of -- the way I used
the utility caused compile errors on many bots, possibly because the
wrong overload of `none_of` was selected.)
rdar://
40312677
Jason Molenda [Tue, 13 Oct 2020 23:39:30 +0000 (16:39 -0700)]
Remove unused build configurations from debugserver xcode project
the xcode project file for debugserver exists only to make my
life easier when I'm working only on debugserver and don't need
to build the rest of llvm/lldb. It had many build configurations
to reflect our old lldb xcode project file, which is long gone.
Removing them to simplify the configurations.
Specifically dropping CustomSwift-Debug, DebugClang, DebugPresubmission,
CustomSwift-Release, BuildAndIntegration. Keeping Debug & Release.
Vedant Kumar [Tue, 13 Oct 2020 23:32:31 +0000 (16:32 -0700)]
Revert "[llvm-cov] Warn when -arch spec is missing/invalid for universal binary"
This reverts commit
b81d4bfb44c14575130bb06c047728b69c3213aa.
It's causing some bots to fail to build due to: "error: no matching
function for call to ‘__iterator_category".
Vedant Kumar [Tue, 13 Oct 2020 23:20:40 +0000 (16:20 -0700)]
[llvm-cov] Warn when -arch spec is missing/invalid for universal binary
llvm-cov reports a poor error message when the -arch specifier is
missing or invalid, and a binary has multiple slices. Make the error
message more specific.
rdar://
40312677