Matt Arsenault [Wed, 1 Jul 2020 22:13:51 +0000 (18:13 -0400)]
RegAllocGreedy: Use TargetInstrInfo already in the class
Matt Arsenault [Wed, 1 Jul 2020 18:46:07 +0000 (14:46 -0400)]
AMDGPU: Fix missing tracksRegLiveness in tests
I have no idea why this is considered optional, or why it's not the
default. Also add uses of the copied registers for more useful
liveness testing.
Stanislav Mekhanoshin [Wed, 1 Jul 2020 19:08:22 +0000 (12:08 -0700)]
[AMDGPU] Limit promote alloca to vector with VGPR budget
Allow only up to 1/4 of available VGPRs for the vectorization
of any given alloca.
Differential Revision: https://reviews.llvm.org/D82990
clementval [Wed, 1 Jul 2020 22:49:07 +0000 (18:49 -0400)]
Revert "[flang][openmp] Use common Directive and Clause enum from llvm/Frontend"
This reverts commit
7f1e7767952233d1b6af1feef1371d127de5fa50.
Roman Lebedev [Mon, 29 Jun 2020 19:15:28 +0000 (22:15 +0300)]
[NFC][ScalarEvolution] Add udiv-disguised-as-sdiv test
Much like
25521150d7b577f6f1b402826f2afbb0ec5fb59b,
but with division instead of remainder.
See https://reviews.llvm.org/D82721
Craig Topper [Wed, 1 Jul 2020 22:20:53 +0000 (15:20 -0700)]
Revert "[X86] Enable multibyte NOPs in 64-bit mode for padding/alignment."
Looks like lld tests need updates too
This reverts commit
3367e9dac56024147bbd916c40bfe6a4ee61079b.
Ben Shi [Wed, 1 Jul 2020 21:35:46 +0000 (22:35 +0100)]
[RISCV][NFC] Pre-commit tests for D82660
Jonas Devlieghere [Wed, 1 Jul 2020 21:41:04 +0000 (14:41 -0700)]
[lldb/API] Add missing LLDB_RECORD_RESULT
Nikita Popov [Wed, 1 Jul 2020 21:35:06 +0000 (23:35 +0200)]
[InstSimplify] Move assume icmp test (NFC)
Move this test from InstCombine into InstSimplify.
Ryan Prichard [Wed, 1 Jul 2020 21:30:25 +0000 (14:30 -0700)]
[compiler-rt][Android] Use correct builtins library name for tests
The builtins library name is special on Android:
* There is an "-android" suffix.
* For the compiler-rt i386 architecture, Android targets i686 (in the
triple and in the builtins library filename)
With this change, check-builtins works with Android.
Reviewed By: compnerd
Differential Revision: https://reviews.llvm.org/D82149
peter klausler [Wed, 1 Jul 2020 18:45:38 +0000 (11:45 -0700)]
[flang] Implement cross-set EQUIVALENCE impossibility checking
Implement cross-set EQUIVALENCE impossibility checking; fixes
an infinite loop on an erroneous test. Also fix substring
reference offset calculations in EQUIVALENCE discovered to
be incorrect during testing.
Reviewed By: tskeith
Differential Revision: https://reviews.llvm.org/D82993
Sergey Dmitriev [Mon, 29 Jun 2020 23:11:16 +0000 (16:11 -0700)]
[CallGraph] Add support for callback call sites
Summary:
This patch changes call graph analysis to recognize callback call sites
and add an artificial 'reference' call record from the broker function
caller to the callback function in the call graph. A presence of such
reference enforces bottom-up traversal order for callback functions in
CG SCC pass manager because callback function logically becomes a callee
of the broker function caller.
Reviewers: jdoerfert, hfinkel, sstefan1, baziotis
Reviewed By: jdoerfert
Subscribers: hiraditya, kuter, sstefan1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82572
Anatoly Trosinenko [Wed, 1 Jul 2020 20:42:50 +0000 (23:42 +0300)]
Test commit
Test the commit access to LLVM repository.
Gabriel Matute [Wed, 1 Jul 2020 20:40:48 +0000 (20:40 +0000)]
[libTooling] Fix `maybeExtendRange` to support `CharRange`s.
Currently, `maybeExtendRange` takes a `CharSourceRange`, but only works
correctly for the `TokenRange` case. This change adds proper support for the
`CharRange` case.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D82901
Fangrui Song [Wed, 1 Jul 2020 20:37:20 +0000 (13:37 -0700)]
[ELF] Don't resolve a relocation in .debug_line referencing an ICF folded symbol to the tombstone value
After D81784, we resolve a relocation in .debug_* referencing an ICF folded
section symbol to a tombstone value.
Doing this for .debug_line has a problem (https://reviews.llvm.org/D81784#2116925 ):
.debug_line may describe folded lines as having addresses UINT64_MAX or
some wraparound small addresses.
```
int foo(int x) {
return x; // line 2
}
int bar(int x) {
return x; // line 6
}
```
```
Address Line Column File ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x00000000002016c0 1 0 1 0 0 is_stmt
0x00000000002016c7 2 9 1 0 0 is_stmt
prologue_end
0x00000000002016ca 2 2 1 0 0
0x00000000002016cc 2 2 1 0 0 end_sequence
// UINT64_MAX and wraparound small addresses
0xffffffffffffffff 5 0 1 0 0 is_stmt
0x0000000000000006 6 9 1 0 0 is_stmt
prologue_end
0x0000000000000009 6 2 1 0 0
0x000000000000000b 6 2 1 0 0 end_sequence
0x00000000002016d0 9 0 1 0 0 is_stmt
0x00000000002016df 10 6 1 0 0 is_stmt prologue_end
0x00000000002016e6 11 11 1 0 0 is_stmt
...
```
These entries can confuse debuggers:
gdb before 2020-07-01 (binutils-gdb
a8caed5d7faa639a1e6769eba551d15d8ddd9510 "Recognize -1 as a tombstone value in .debug_line")
(can't continue due to a breakpoint in an invalid region of memory):
```
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x6
```
lldb (breakpoint has no effect):
```
(lldb) b 6
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
```
This patch special cases .debug_line to not use the tombstone value,
restoring the previous behavior: .debug_line will have entries with the
same addresses (ICF) but different line numbers. A breakpoint on line 2
or 6 will trigger on both functions.
Reviewed By: dblaikie, jhenderson
Differential Revision: https://reviews.llvm.org/D82828
Tony [Wed, 1 Jul 2020 20:21:58 +0000 (20:21 +0000)]
[AMDGPU] Update DWARF proposal
- Add reference to implicit conversion description.
Eric Schweitz [Wed, 1 Jul 2020 19:34:55 +0000 (12:34 -0700)]
[flang] Add the Runtime.h to prepare for more code being upstreamed.
This is the header file for lowering Fortran statements that depend on
the Fortran runtime support library. The implementation of the lowering
of these constructs will follow in a subsequent diff.
Differential revision: https://reviews.llvm.org/D82991
Valentin Clement [Wed, 1 Jul 2020 19:58:14 +0000 (15:58 -0400)]
[flang][openmp] Use common Directive and Clause enum from llvm/Frontend
Summary:
This patch is removing the custom enumeration for OpenMP Directives and Clauses and replace them
with the newly tablegen generated one from llvm/Frontend. This is a first patch and some will follow to share the same
infrastructure where possible. The next patch should use the clauses allowance defined in the tablegen file.
Reviewers: jdoerfert, DavidTruby, sscalpone, kiranchandramohan, ichoyjx
Reviewed By: DavidTruby, ichoyjx
Subscribers: ichoyjx, mgorny, yaxunl, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D82906
Eric Schweitz [Mon, 29 Jun 2020 21:15:59 +0000 (14:15 -0700)]
[clang-tidy] Allows the prevailing include header guard in Flang to be recognized rather than flagged as a violation in phabricator.
Differential revision: https://reviews.llvm.org/D82807
Craig Topper [Wed, 1 Jul 2020 18:56:56 +0000 (11:56 -0700)]
[X86] Speculatively apply the same fix from
361853c96f46848d2ad0739dfa7613e62e7fb530 to PromoteIntOp_MGATHER.
The UpdateNodeOperands here is also subject to CSE.
Eli Friedman [Wed, 1 Jul 2020 18:54:18 +0000 (11:54 -0700)]
[IR] Add classof methods to ConstantExpr subclasses.
I didn't notice these were missing when I wrote 1544019.
Craig Topper [Wed, 1 Jul 2020 18:40:07 +0000 (11:40 -0700)]
[LegalizeTypes] Properly handle the case when UpdateNodeOperands in PromoteIntOp_MLOAD triggers CSE instead of updating the node in place.
The caller can't handle the node having multiple results like a
masked load does. So we need to detect the case and do our own
result replacement.
Fixes PR46532.
Nikita Popov [Sun, 28 Jun 2020 12:47:29 +0000 (14:47 +0200)]
[LVI][CVP] Handle (x | y) < C style conditions
InstCombine may convert conditions like (x < C) && (y < C) into
(x | y) < C (for some C). This patch teaches LVI to recognize that
in this case, it can infer either x < C or y < C along the edge.
This fixes the issue reported at
https://github.com/rust-lang/rust/issues/73827.
Differential Revision: https://reviews.llvm.org/D82715
Gui Andrade [Wed, 1 Jul 2020 18:27:49 +0000 (18:27 +0000)]
[Sanitizers] Disable sysmsg interceptors on Android
Xun Li [Wed, 1 Jul 2020 18:08:26 +0000 (11:08 -0700)]
[Coroutines] Fix test breakage in D82928
Summary: The test file in D82928 generated temp files within the test directory, causing test failures. Fix it.
Reviewers: modocache, fhahn
Reviewed By: modocache
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82986
Adrian Prantl [Wed, 1 Jul 2020 18:03:10 +0000 (11:03 -0700)]
debugserver: Return a nullptr in GetPlatformString()
This un-breaks the testsuite after https://reviews.llvm.org/D82616
Adrian Prantl [Wed, 1 Jul 2020 18:06:15 +0000 (11:06 -0700)]
Revert "Revert "Improve the detection of iOS/tvOS/watchOS simulator binaries in""
This reverts commit
98c3a38a1967ece4e70891aa188c51e29ca0f8d3.
zoecarver [Wed, 1 Jul 2020 17:57:45 +0000 (10:57 -0700)]
[CodeGen] Add public function to emit C++ destructor call.
Adds `CodeGen::getCXXDestructorImplicitParam`, to retrieve a C++ destructor's implicit parameter (after the "this" pointer) based on the ABI in the given CodeGenModule.
This will allow other frontends (Swift, for example) to easily emit calls to object destructors with correct ABI semantics and calling convetions.
This is needed for Swift C++ interop. Here's the corresponding Swift change: https://github.com/apple/swift/pull/32291
Differential Revision: https://reviews.llvm.org/D82392
Matt Arsenault [Wed, 1 Jul 2020 17:42:13 +0000 (13:42 -0400)]
AMDGPU: Convert AGPR copy test to generated checks
Matt Arsenault [Wed, 1 Jul 2020 14:55:37 +0000 (10:55 -0400)]
AMDGPU: Support commuting register and global operand
Matt Arsenault [Wed, 1 Jul 2020 13:11:53 +0000 (09:11 -0400)]
AMDGPU: Fix handling of target flags when commuting instruction
If the original register operand had a subregister, it wasn't getting
cleared. This resulted in reinterpreted the subreg index as
unrecognized target flags, which produced unparseable MIR.
Matt Arsenault [Wed, 1 Jul 2020 02:27:34 +0000 (22:27 -0400)]
AMDGPU: Clear subreg when folding immediate copies
This was getting reinterpreted as operand target flags, and appearing
as as <unknown target flag>, resulting in unparseable MIR.
Craig Topper [Wed, 1 Jul 2020 17:56:31 +0000 (10:56 -0700)]
[X86] Enable multibyte NOPs in 64-bit mode for padding/alignment.
The default CPU used by llvm-mc doesn't have the NOPL feature, but
if we know we're compiling in 64-bit mode we should be able to
use nopl.
David Sherwood [Tue, 30 Jun 2020 06:23:52 +0000 (07:23 +0100)]
[CodeGen] Fix warnings in DAGCombiner::visitSCALAR_TO_VECTOR
In visitSCALAR_TO_VECTOR we try to optimise cases such as:
scalar_to_vector (extract_vector_elt %x)
into vector shuffles of %x. However, it led to numerous warnings
when %x is a scalable vector type, so for now I've changed the
code to only perform the combination on fixed length vectors.
Although we probably could change the code to work with scalable
vectors in certain cases, without a proper profit analysis it
doesn't seem worth it at the moment.
This change fixes up one of the warnings in:
llvm/test/CodeGen/AArch64/sve-merging-stores.ll
I've also added a simplified version of the same test to:
llvm/test/CodeGen/AArch64/sve-fp.ll
which already has checks for no warnings.
Differential Revision: https://reviews.llvm.org/D82872
Jonas Devlieghere [Wed, 1 Jul 2020 17:42:49 +0000 (10:42 -0700)]
Revert "Improve the detection of iOS/tvOS/watchOS simulator binaries in"
This reverts commit
0da0437b2afbd8ebef6b11f114cca33b118e7639 to unbreak
the following tests:
lldb-api.tools/lldb-server.TestAppleSimulatorOSType.py
lldb-api.tools/lldb-server.TestGdbRemoteAttach.py
lldb-api.tools/lldb-server.TestGdbRemoteProcessInfo.py
lldb-api.tools/lldb-server.TestGdbRemoteRegisterState.py
lldb-api.tools/lldb-server.TestGdbRemoteThreadsInStopReply.py
lldb-api.tools/lldb-server.TestLldbGdbServer.py
Gui Andrade [Wed, 1 Jul 2020 17:33:01 +0000 (17:33 +0000)]
sanitizer_common_interceptors: Fix lint errors
Florian Hahn [Wed, 1 Jul 2020 17:20:01 +0000 (18:20 +0100)]
[AArch64] Remove unnecessary CostKindCheck (NFC).
Simplification suggested post-commit.
Xun Li [Wed, 1 Jul 2020 00:07:45 +0000 (17:07 -0700)]
[Coroutines] Fix code coverage for coroutine
Summary:
Previously, source-based coverage analysis does not work properly for coroutine.
This patch adds processing of coroutine body and co_return in the coverage analysis, so that we can handle them properly.
For coroutine body, we should only look at the actual function body and ignore the compiler-generated things; for co_return, we need to terminate the region similar to return statement.
Added a test, and confirms that it now works properly. (without this patch, the statement after the if statement will be treated wrongly)
Reviewers: lewissbaker, modocache, junparser
Reviewed By: modocache
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82928
Zixu Wang [Wed, 1 Jul 2020 16:58:09 +0000 (09:58 -0700)]
Test commit
Testing commit access to llvm-project.
Yonghong Song [Wed, 1 Jul 2020 14:51:55 +0000 (07:51 -0700)]
[BPF] Fix a BTF gen bug related to a pointer struct member
Currently, BTF generation stops at pointer struct members
if the pointee type is a struct. This is to avoid bloating
generated BTF size. The following is the process to
correctly record types for these pointee struct types.
- During type traversal stage, when a struct member, which
is a pointer to another struct, is encountered,
the pointee struct type, keyed with its name, is
remembered in a Fixup map.
- Later, when all type traversal is done, the Fixup map
is scanned, based on struct name matching, to either
resolve as pointing to a real already generated type
or as a forward declaration.
Andrii discovered a bug if the struct member pointee struct
is anonymous. In this case, a struct with empty name is
recorded in Fixup map, and later it happens another anonymous
struct with empty name is defined in BTF. So wrong type
resolution happens.
To fix the problem, if the struct member pointee struct
is anonymous, pointee struct type will be generated in
stead of being put in Fixup map.
Differential Revision: https://reviews.llvm.org/D82976
James Y Knight [Sat, 16 May 2020 03:43:30 +0000 (23:43 -0400)]
Change the INLINEASM_BR MachineInstr to be a non-terminating instruction.
Before this instruction supported output values, it fit fairly
naturally as a terminator. However, being a terminator while also
supporting outputs causes some trouble, as the physreg->vreg COPY
operations cannot be in the same block.
Modeling it as a non-terminator allows it to be handled the same way
as invoke is handled already.
Most of the changes here were created by auditing all the existing
users of MachineBasicBlock::isEHPad() and
MachineBasicBlock::hasEHPadSuccessor(), and adding calls to
isInlineAsmBrIndirectTarget or mayHaveInlineAsmBr, as appropriate.
Reviewed By: nickdesaulniers, void
Differential Revision: https://reviews.llvm.org/D79794
Yuanfang Chen [Wed, 1 Jul 2020 02:10:01 +0000 (19:10 -0700)]
[NFC] Clean up uses of MachineModuleInfoWrapperPass
Nikita Popov [Wed, 1 Jul 2020 16:35:25 +0000 (18:35 +0200)]
[CVP] Use different number in test (NFC)
To make it clear that this is not intended to be specific to
mask / bit tests.
Eric Astor [Wed, 1 Jul 2020 16:39:28 +0000 (12:39 -0400)]
[ms] [llvm-ml] Use default RIP-relative addressing for x64 MASM.
Summary:
When parsing 64-bit MASM, treat memory operands with unspecified base register as RIP-based.
Documented in several places, including https://software.intel.com/en-us/articles/introduction-to-x64-assembly: "Unfortunately, MASM does not allow this form of opcode, but other assemblers like FASM and YASM do. Instead, MASM embeds RIP-relative addressing implicitly."
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D73227
Guillaume Chatelet [Wed, 1 Jul 2020 16:23:52 +0000 (16:23 +0000)]
[Alignment][NFC] Use Align for BPFAbstractMemberAccess::RecordAlignment
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82962
Hiroshi Yamauchi [Mon, 15 Jun 2020 16:37:07 +0000 (09:37 -0700)]
[InstCombine] Don't let an alignment assume prevent new/delete removals.
Remove allocations with alignment assume.
Differential Revision: https://reviews.llvm.org/D81854
David Green [Wed, 1 Jul 2020 14:28:44 +0000 (15:28 +0100)]
[Outliner] Set nounwind for outlined functions
This prevents the outlined functions from pulling in a lot of unnecessary code
in our downstream libraries/linker. Which stops outlining making codesize
worse in c++ code with no-exceptions.
Differential Revision: https://reviews.llvm.org/D57254
Xing GUO [Wed, 1 Jul 2020 15:17:18 +0000 (23:17 +0800)]
[DWARFYAML][debug_abbrev] Emit 0 byte for terminating abbreviations.
The abbreviations for a given compilation unit end with an entry
consisting of a 0 byte for the abbreviation code.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D82933
Simon Pilgrim [Wed, 1 Jul 2020 14:46:43 +0000 (15:46 +0100)]
Make dyn_cast results explicitly auto* instead of just auto.
Noticed by clang-tidy llvm-qualified-auto warning.
Simon Pilgrim [Wed, 1 Jul 2020 13:04:01 +0000 (14:04 +0100)]
Pass DebugLoc::appendInlinedAt DebugLoc arg by const reference not value.
Noticed by clang-tidy performance-unnecessary-value-param warning.
Pengxuan Zheng [Tue, 30 Jun 2020 21:32:37 +0000 (14:32 -0700)]
[RISCV] Add mcountinhibit CSR
Summary:
The mcountinhibit CSR is defined in the ratified 1.11 version of the privileged
spec.
Reviewers: apazos, asb, lenary, luismarques
Reviewed By: asb
Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, sameer.abuasal, evandro, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82913
LuÃs Marques [Wed, 1 Jul 2020 15:24:15 +0000 (16:24 +0100)]
[RISCV] Temporarily move riscv-expand-pseudo pass to PreEmitPass2
The pass to split atomic and non-atomic RISC-V pseudo-instructions was itself
split into two passes in D79635 / commit rG2cb0644f90b7, with the splitting of
non-atomic instructions being moved to the PreSched2 phase. A comment was
added to D79635 detailing a case where this caused problems, so this commit
moves the non-atomic split pass back to the PreEmitPass2 phase. This allows
the bulk of the changes from D79635 to remain committed, while addressing the
the reported problem (the pass split is now almost NFC). Once the root problem
is fixed we can move the (non-atomic) instruction splitting pass back to
earlier in the pipeline.
Raphael Isemann [Wed, 1 Jul 2020 15:00:12 +0000 (17:00 +0200)]
[lldb] Replace StringConvert with llvm::to_integer when parsing integer values in CommandObjects
Summary:
This replaces the current use of LLDB's own `StringConvert` with LLVM's
`to_integer` which has a less error-prone API and doesn't use special 'error
values' to designate parsing problems.
Where needed I also added missing error handling code that prints a parsing
error instead of continuing with the error value returned from `StringConvert`
(which either gave a cryptic error message or just took the error value
performed an incorrect action with it. For example, `frame recognizer delete -1`
just deleted the frame recognizer at index 0).
Reviewers: #lldb, labath
Reviewed By: labath
Subscribers: labath, abidh, JDevlieghere
Differential Revision: https://reviews.llvm.org/D82297
LuÃs Marques [Wed, 1 Jul 2020 15:01:40 +0000 (16:01 +0100)]
Revert "[RISCV] Temporarily move riscv-expand-pseudo pass to PreEmitPass2"
This reverts commit
05a20a9e9aba301a828bcbd72b0ed724755752d1.
Pavel Labath [Wed, 1 Jul 2020 14:55:34 +0000 (16:55 +0200)]
[lldb] Attempt to fix TestLimitDebugInfo on windows
The test fails due to link errors. I believe this change should fix
that.
Kazushi (Jam) Marukawa [Sat, 27 Jun 2020 10:08:09 +0000 (19:08 +0900)]
[VE] Support symbol with offset value
Summary: Support symbol with offset value as a VEMCExpr.
Reviewers: simoll, k-ishizaka
Reviewed By: simoll
Subscribers: hiraditya, llvm-commits
Tags: #llvm, #ve
Differential Revision: https://reviews.llvm.org/D82734
Sam McCall [Tue, 30 Jun 2020 17:30:35 +0000 (19:30 +0200)]
[clangd] Fix race in FileIndex that sometimes temporarily lost updates.
Summary:
FileIndex was built out of threadsafe components, so update() didn't have data
races, but wasn't actually correct.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82891
LuÃs Marques [Wed, 1 Jul 2020 14:17:31 +0000 (15:17 +0100)]
[RISCV] Temporarily move riscv-expand-pseudo pass to PreEmitPass2
The pass to split atomic and non-atomic RISC-V pseudo-instructions was itself
split into two passes in D79635 / commit rG2cb0644f90b7, with the splitting of
non-atomic instructions being moved to the PreSched2 phase. A comment was
added to D79635 detailing a case where this caused problems, so this commit
moves the non-atomic split pass back to the PreEmitPass2 phase. This allows
the bulk of the changes from D79635 to remain committed, while addressing the
the reported problem (the pass split is now almost NFC). Once the root problem
is fixed we can move the (non-atomic) instruction splitting pass back to
earlier in the pipeline.
Erich Keane [Wed, 1 Jul 2020 14:34:25 +0000 (07:34 -0700)]
Limit x86 test to require target to fix buildbot (from
2831a317b)
The modification of the features apparently requires the backend to be
instantiated, so make sure this is required to fix the ARM build bots.
Guillaume Chatelet [Wed, 1 Jul 2020 14:32:30 +0000 (14:32 +0000)]
[Alignment] TargetLowering::hasPairedLoad must use Align for RequiredAlignment
As per documentation of `hasPairLoad`:
"`RequiredAlignment` gives the minimal alignment constraints that must be met to be able to select this paired load."
In this sense, `0` is strictly equivalent to `1`. We make this obvious by using `Align` instead of unsigned.
There is only one implementor of this interface.
Differential Revision: https://reviews.llvm.org/D82958
Guillaume Chatelet [Wed, 1 Jul 2020 14:31:56 +0000 (14:31 +0000)]
[Alignment][NFC] Transition and simplify calls to DL::getABITypeAlignment
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82956
Guillaume Chatelet [Wed, 1 Jul 2020 14:31:21 +0000 (14:31 +0000)]
[Alignment][NFC] Migrate TargetTransformInfo::CreateVariableSizedObject to Align
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82939
rojamd [Wed, 1 Jul 2020 14:17:00 +0000 (10:17 -0400)]
[cmake][Windows] Add libpath to CMAKE_MODULE_LINKER_FLAGS too
Followup to
b8000c0ce845, the library path needs to go in
CMAKE_MODULE_LINKER_FLAGS too, for the sake of a few files
like LLVMHello.dll.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D82888
Erich Keane [Tue, 23 Jun 2020 19:14:09 +0000 (12:14 -0700)]
Implement AVX ABI Warning/error
The x86-64 "avx" feature changes how >128 bit vector types are passed,
instead of being passed in separate 128 bit registers, they can be
passed in 256 bit registers.
"avx512f" does the same thing, except it switches from 256 bit registers
to 512 bit registers.
The result of both of these is an ABI incompatibility between functions
compiled with and without these features.
This patch implements a warning/error pair upon an attempt to call a
function that would run afoul of this. First, if a function is called
that would have its ABI changed, we issue a warning.
Second, if said call is made in a situation where the caller and callee
are known to have different calling conventions (such as the case of
'target'), we instead issue an error.
Differential Revision: https://reviews.llvm.org/D82562
David Sherwood [Fri, 26 Jun 2020 12:54:55 +0000 (13:54 +0100)]
[CodeGen] Fix up warnings in visitEXTRACT_SUBVECTOR
It's perfectly valid to do certain DAG combines where we extract
subvectors from a concat vector when we have scalable vector types.
However, we can do this in a way that avoids generating compiler
warnings by replacing calls to getVectorNumElements() with
getVectorMinNumElements(). Due to the way subvector extracts are
designed to work with scalable vector types this is ok.
This eliminates some warnings from existing tests in this file:
llvm/test/CodeGen/AArch64/sve-intrinsics-loads.ll
Differential Revision: https://reviews.llvm.org/D82655
Raphael Isemann [Wed, 1 Jul 2020 13:58:09 +0000 (15:58 +0200)]
[lldb] Fix NSDate test after Scalar change
The formatter was requesting an unsigned integer from the ValueObject,
but CFAbsoluteTime is a signed double, so in the NSDate test the formatter
actually just printed the 'error value' date which is the Cocoa epoch. This
started failing after the recent Scalar changes.
This patch just changes the logic to use a signed value which fits to the data
we try to read and avoids this issue.
Nicolas Vasilache [Wed, 1 Jul 2020 13:40:20 +0000 (09:40 -0400)]
[mlir][Linalg] Add an option to use Alloca instead of malloc/free pairs.
Summary: A relevant test is also added.
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82959
Pavel Labath [Tue, 23 Jun 2020 09:34:58 +0000 (11:34 +0200)]
[lldb] Add basic -flimit-debug-info support to expression evaluator
Summary:
This patch adds support for evaluation of expressions referring to types
which were compiled in -flimit-debug-info (a.k.a -fno-standalone-debug)
in clang. In this mode it's possible that the debug information needed
to fully describe a c++ type is not present in a single shared library
-- for example debug info for a base class or a member of a type can
only be found in another shared library. This situation is not
currently handled well within lldb as we are limited to searching within
a single shared library (lldb_private::Module) when searching for the
definition of these types.
The way that this patch gets around this limitation is by doing the
search at a later stage -- during the construction of the expression ast
context. This works by having the parser (currently SymbolFileDWARF, but
a similar approach is probably needed for PDBs too) mark a type as
"forcefully completed". What this means is that the parser has marked
the type as "complete" in the module ast context (as this is necessary
to e.g. derive classes from it), but its definition is not really there.
This is done via a new field on the ClangASTMetadata struct.
Later, when we are importing such a type into the expression ast, we
check this flag. If the flag is set, we try to find a better definition
for the type in other shared libraries. We do this by initiating a
new lookup for the "forcefully completed" classes, which then imports the
type from a module with a full definition.
This patch only implements this handling for base classes, but other
cases (members, array element types, etc.). The changes for that should
be fairly simple and mostly revolve around marking these types as
"forcefully completed" at an approriate time -- the importing logic is
generic already.
Another aspect, which is also not handled by this patch is viewing these
types via the "frame variable" command. This does not use the AST
importer and so it will need to handle these types on its own -- that
will be the subject of another patch.
Differential Revision: https://reviews.llvm.org/D81561
Alexey Bataev [Wed, 1 Jul 2020 12:41:14 +0000 (08:41 -0400)]
Revert "[StackSafety,NFC] Remove unneded constexpr"
This reverts commit
38470baa542bde038340b7d10a0ed2c25fac1bfa because it
breaks builds with lld and gold linkers.
Nathan James [Wed, 1 Jul 2020 12:40:18 +0000 (13:40 +0100)]
[clang-tidy] fix cppcoreguidelines-init-variables with catch variables
Ignore catch statement var decls.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82924
Georgii Rymar [Wed, 1 Jul 2020 09:58:20 +0000 (12:58 +0300)]
[llvm-readobj] - Simplify the symbols.test
We are able to use YAML macros to avoid having
4 independent YAML descriptions.
Differential revision: https://reviews.llvm.org/D82942
Simon Pilgrim [Wed, 1 Jul 2020 12:07:35 +0000 (13:07 +0100)]
Pass DIEnumerator APInt args by const reference not value.
Noticed by clang-tidy performance-unnecessary-value-param warning.
Stefan Pintilie [Wed, 1 Jul 2020 12:08:41 +0000 (07:08 -0500)]
[PowerPC] Fix for PC Relative call protocol
The situation where the caller uses a TOC and the callee does not
but is marked as clobbers the TOC (st_other=1) was not being compiled
correctly if both functions where in the same object file.
The call site where we had `callee` was missing a nop after the call.
This is because it was assumed that since the two functions where in
the same DSO they would be sharing a TOC. This is not the case if the
callee uses PC Relative because in that case it may clobber the TOC.
This patch makes sure that we add the cnop correctly so that the
linker has a place to restore the TOC.
Reviewers: sfertile, NeHuang, saghir
Differential Revision: https://reviews.llvm.org/D81126
Simon Pilgrim [Wed, 1 Jul 2020 11:37:47 +0000 (12:37 +0100)]
Pass stripNonLineTableDebugInfo remapDebugLoc lambda DebugLoc arg by const reference not value.
Noticed by clang-tidy performance-unnecessary-value-param warning.
Simon Pilgrim [Wed, 1 Jul 2020 11:12:34 +0000 (12:12 +0100)]
[X86][SSE] Fix targetShrinkDemandedConstant constant vector sign extensions
D82257/rG3521ecf1f8a3 was incorrectly sign-extending a constant vector from the lsb, this is fine if all the constant elements are 'allsignbits' in the active bits, but if only some of the elements are, then we are corrupting the constant values for those elements.
This fix ensures we sign extend from the msb of the active/demanded bits instead.
gbreynoo [Wed, 1 Jul 2020 10:57:30 +0000 (11:57 +0100)]
[llvm-size] Output REL, RELA and STRTAB sections when allocatable
gnu size has a number of special cases regarding REL, RELA and STRTAB
sections being considered in size output. To avoid unnecessary
complexity this commit makes llvm size outputs these sections in cases
they have the SHF_ALLOC flag.
Differential Revision: https://reviews.llvm.org/D82479
Simon Pilgrim [Wed, 1 Jul 2020 10:40:46 +0000 (11:40 +0100)]
[X86][SSE] Add test showing incorrect sign-extension by targetShrinkDemandedConstant
Simon Pilgrim [Wed, 1 Jul 2020 10:27:31 +0000 (11:27 +0100)]
Fix Wdocumentation warnings by only tagging a param id once per doxygen comment block. NFC.
Simon Pilgrim [Wed, 1 Jul 2020 10:25:59 +0000 (11:25 +0100)]
Fix Wdocumentation warnings due to outdated parameter list. NFC.
Simon Pilgrim [Tue, 30 Jun 2020 17:03:16 +0000 (18:03 +0100)]
AttrBuilder::merge/remove - use const& for iterator values in for-range loops.
Noticed by clang-tidy performance-for-range-copy warning.
Sam Elliott [Wed, 1 Jul 2020 10:55:07 +0000 (11:55 +0100)]
[RISCV] Implement Hooks to avoid chaining SELECT
Summary:
This implements two hooks that attempt to avoid control flow for RISC-V. RISC-V
will lower SELECTs into control flow, which is not a great idea.
The hook `hasMultipleConditionRegisters()` turns off the following
DAGCombiner folds:
select(C0|C1, x, y) <=> select(C0, x, select(C1, x, y))
select(C0&C1, x, y) <=> select(C0, select(C1, x, y), y)
The second hook `setJumpIsExpensive` controls a flag that has a similar purpose
and is used in CodeGenPrepare and the SelectionDAGBuilder.
Both of these have the effect of ensuring more logic is done before fewer jumps.
Note: with the `B` extension, we may be able to lower select into a conditional
move instruction, so at some point these hooks will need to be guarded based on
enabled extensions.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D79268
Sam Elliott [Wed, 1 Jul 2020 10:54:56 +0000 (11:54 +0100)]
[RISCV][NFC] Add Test for (select (or B1, B2), X, Y)
Summary:
As shown, LLVM is keen to avoid logic and introduce selects (in DAGCombiner, and
other places). This leads to control flow on RISC-V which we should attempt to
avoid.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D79267
Adam Balogh [Wed, 1 Jul 2020 10:52:12 +0000 (12:52 +0200)]
[Analyzer] Quick fix for broken tests on Windows
Kirill Bobyrev [Wed, 1 Jul 2020 10:45:41 +0000 (12:45 +0200)]
[clangd] Set gRPC deadlines to all remote index requests
Summary: "TL;DR: Always set a deadline.", https://grpc.io/blog/deadlines/
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82844
Med Ismail Bennani [Tue, 30 Jun 2020 14:37:48 +0000 (16:37 +0200)]
[lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI)
This patch improves the error reporting for SBBreakpoint::AddName by
adding a new method `SBBreakpoint::AddNameWithErrorHandling` that returns
a SBError instead of a boolean.
This way, if the breakpoint naming failed in the backend, the client
(i.e. Xcode), will be able to report the reason of that failure to the
user.
rdar://
64765461
Differential Revision: https://reviews.llvm.org/D82879
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Wed, 1 Jul 2020 10:41:32 +0000 (12:41 +0200)]
Revert "[lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI)"
This reverts commit
56bb1d1755ae38b4e7a67f775978b18a601f215f.
Med Ismail Bennani [Tue, 30 Jun 2020 14:37:48 +0000 (16:37 +0200)]
[lldb/api] Improve error reporting in SBBreakpoint::AddName (NFCI)
This patch improves the error reporting for SBBreakpoint::AddName by
adding a new method `SBBreakpoint::AddNameWithErrorHandling` that returns
a SBError instead of a boolean.
This way, if the breakpoint naming failed in the backend, the client
(i.e. Xcode), will be able to report the reason of that failure to the
user.
rdar://
64765461
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Daniel Kiss [Wed, 1 Jul 2020 09:15:52 +0000 (11:15 +0200)]
[Driver][ARM] parse version of arm/thumb architecture correctly
Summary:
If you execute the following commandline multiple times, the behavior was not always the same:
clang++ --target=thumbv7em-none-windows-eabi-coff -march=armv7-m -mcpu=cortex-m7 -o temp.obj -c -x c++ empty.cpp
Most of the time the compilation succeeded, but sometimes clang reported this error:
clang++: error: the target architecture 'thumbv7em' is not supported by the target 'thumbv7em-none-windows-eabi'
The cause of the inconsistent behavior was the uninitialized variable Version.
With these commandline arguments, the variable Version was not set by getAsInteger(),
because it cannot parse a number from the substring "7em" (of "thumbv7em").
To get a consistent behaviour, it's enough to initialize the variable Version to zero.
Zero is smaller than 7, so the comparison will be true.
Then the command always fails with the error message seen above.
By using consumeInteger() instead of getAsInteger() we get 7 from the substring "7em"
and the command does not fail.
Reviewers: compnerd, danielkiss
Reviewed By: danielkiss
Subscribers: danielkiss, kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75453
Vitaly Buka [Wed, 1 Jul 2020 07:38:43 +0000 (00:38 -0700)]
[StackSafety,NFC] Remove expensive assert
Differential Revision: https://reviews.llvm.org/D80908
Vitaly Buka [Wed, 1 Jul 2020 07:32:36 +0000 (00:32 -0700)]
[StackSafety,NFC] Remove unneded constexpr
Differential Revision: https://reviews.llvm.org/D80908
Petar Avramovic [Wed, 1 Jul 2020 09:50:59 +0000 (11:50 +0200)]
AMDGPU/GlobalISel: Select init_exec intrinsic
Change imm with timm in pattern for SI_INIT_EXEC_LO and
remove regbank mappings for non register operands.
Differential Revision: https://reviews.llvm.org/D82885
Kerry McLaughlin [Wed, 1 Jul 2020 09:00:35 +0000 (10:00 +0100)]
[AArch64][SVE] Add reg+imm addressing mode for unpredicated loads
Reviewers: efriedma, sdesmalen, david-arm
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82893
Sam McCall [Wed, 1 Jul 2020 09:28:15 +0000 (11:28 +0200)]
[clangd] Fix name conflict again, unbreak GCC. NFC
Georgii Rymar [Tue, 30 Jun 2020 14:14:45 +0000 (17:14 +0300)]
[llvm-readobj] - Don't crash when checking the number of dynamic symbols.
When we deriving the number of symbols from the DT_HASH table, we can crash when
calculate the number of symbols in the symbol table when SHT_DYNSYM
has sh_entsize == 0.
The patch fixes the issue.
Differential revision: https://reviews.llvm.org/D82877
Georgii Rymar [Tue, 30 Jun 2020 12:47:05 +0000 (15:47 +0300)]
[llvm-readobj] - Simplify and refine hash table tests
Now we are able to have default values for macros in YAML descriptions.
I've applied it for hash table tests and also fixed few copy-paste issues
in their comments.
Differential revision: https://reviews.llvm.org/D82870
David Stenberg [Wed, 1 Jul 2020 07:45:56 +0000 (09:45 +0200)]
[DebugInfo] Do not emit entry values for composite locations
Summary:
This is a fix for PR45009.
When working on D67492 I made DwarfExpression emit a single
DW_OP_entry_value operation covering the whole composite location
description that is produced if a register does not have a valid DWARF
number, and is instead composed of multiple register pieces. Looking
closer at the standard, this appears to not be valid DWARF. A
DW_OP_entry_value operation's block can only be a DWARF expression or a
register location description, so it appears to not be valid for it to
hold a composite location description like that.
See DWARFv5 sec. 2.5.1.7:
"The DW_OP_entry_value operation pushes the value that the described
location held upon entering the current subprogram. It has two
operands: an unsigned LEB128 length, followed by a block containing a
DWARF expression or a register location description (see Section
2.6.1.1.3 on page 39)."
Here is a dwarf-discuss mail thread regarding this:
http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/2020-March/004610.html
There was not a strong consensus reached there, but people seem to lean
towards that operations specified under 2.6 (e.g. DW_OP_piece) may not
be part of a DWARF expression, and thus the DW_OP_entry_value operation
can't contain those.
Perhaps we instead want to emit a entry value operation per each
DW_OP_reg* operation, e.g.:
- DW_OP_entry_value(DW_OP_regx sub_reg0),
DW_OP_stack_value,
DW_OP_piece 8,
- DW_OP_entry_value(DW_OP_regx sub_reg1),
DW_OP_stack_value,
DW_OP_piece 8,
[...]
The question then becomes how the call site should look; should a
composite location description be emitted there, and we then leave it up
to the debugger to match those two composite location descriptions?
Another alternative could be to emit a call site parameter entry for
each sub-register, but firstly I'm unsure if that is even valid DWARF,
and secondly it seems like that would complicate the collection of call
site values quite a bit. As far as I can tell GCC does not emit any
entry values / call sites in these cases, so we do not have something to
compare with, but the former seems like the more reasonable approach.
Currently when trying to emit a call site entry for a parameter composed
of multiple DWARF registers a (DwarfRegs.size() == 1) assert is
triggered in addMachineRegExpression(). Until the call site
representation is figured out, and until there is use for these entry
values in practice, this commit simply stops the invalid DWARF from
being emitted.
Reviewers: djtodoro, vsk, aprantl
Reviewed By: djtodoro, vsk
Subscribers: jyknight, hiraditya, fedor.sergeev, jrtc27, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D75270
Guillaume Chatelet [Wed, 1 Jul 2020 08:49:28 +0000 (08:49 +0000)]
[Alignment][NFC] Migrate MachineFrameInfo::CreateSpillStackObject to Align
iThis patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82934
Pavel Labath [Wed, 1 Jul 2020 08:18:02 +0000 (10:18 +0200)]
[lldb] Scalar re-fix UB in float->int conversions
The refactor in
48ca15592f1 reintroduced UB when converting out-of-bounds
floating point numbers to integers -- the behavior for ULongLong() was
originally fixed in r341685, but did not survive my refactor because I
based my template code on one of the methods which did not have this
fix.
This time, I apply the fix to all float->int conversions, instead of
just the "double->unsigned long long" case. I also use a slightly
simpler version of the code, with fewer round-trips
(APFloat->APSInt->native_int vs
APFloat->native_float->APInt->native_int).
I also add some unit tests for the conversions.
Sam Parker [Wed, 1 Jul 2020 08:20:25 +0000 (09:20 +0100)]
[NFC][ARM] Add test.
Tony [Wed, 1 Jul 2020 08:17:28 +0000 (08:17 +0000)]
[AMDGPU] Correct AMDGPUUsage.rst DW_AT_LLVM_lane_pc example
- Correct typo of DW_OP_xaddr to DW_OP_addrx in AMDGPUUsage.rst for
DW_AT_LLVM_lane_pc example.
Change-Id: I1b0ee2b24362a0240388e4c2f044c1d4883509b9