Eduardo Caldas [Wed, 1 Jul 2020 13:58:18 +0000 (13:58 +0000)]
Add parenthesized expression to SyntaxTree
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82960
River Riddle [Thu, 2 Jul 2020 05:24:36 +0000 (22:24 -0700)]
[mlir][OpFormatGen] Add support for resolving variadic types from non-variadic
This enables better support for traits such as SameOperandsAndResultType, and other situations in which a variadic operand may be resolved from a non-variadic.
Differential Revision: https://reviews.llvm.org/D83011
Nico Weber [Thu, 2 Jul 2020 04:02:09 +0000 (00:02 -0400)]
ld64.lld: Add janky support for tbd files
With this, a simple hello world links against libSystem.tbd and the
old ld64.lld linker kind of works again with newer SDKs.
The motivation here is to have an arm64 cross linker that's good
enough to be able to run simple configure link checks on non-mac
systems for generating config.h files. Once -flavor darwinnew can
link arm64, we'll switch to that.
Nico Weber [Thu, 2 Jul 2020 04:04:51 +0000 (00:04 -0400)]
lld/MachO: Remove a useless temporary
Fred Riss [Thu, 2 Jul 2020 02:54:11 +0000 (19:54 -0700)]
[lldb/build.py] Always pass an SDK to the compiler on Darwin
On macOS 11, system libraries which are part of the shared cache
are not present on the filesystem anymore. This causes issues
with build.py, because it fails to link binaries with libSystem
or libc++.
The real issue is that build.py was not passing an SDK to the
compiler. The script accepts an argument for the SDK, but it
is currently unused. This patch just threads the SDK through
to the compile and link steps and this fixes a bunch of Shell
test failures on very recent macOS builds.
Fred Riss [Fri, 13 Mar 2020 23:28:23 +0000 (16:28 -0700)]
[lldb/ObjC] Add support for direct selector references
On macOS 11 (and other aligned OSs), the shared cache method
lists get an additional optimization which removes one level
of indirection to get to the selector.
This patch supports this new optimization. Both codepaths are
covered byt the existing Objective-C tests.
Fred Riss [Wed, 26 Feb 2020 22:57:50 +0000 (14:57 -0800)]
[lldb/ObjCRuntime] Implement support for small method lists
On macOS 11 (and other aligned Apple OSs), the Objective-C runtime
has a new optimization which saves memory by making the method
lists smaller.
This patch adds support for this new method list encoding (while
also keeping backward compatibility). This is implicitely covered
by some existing Objective-C tests.
Pushpinder Singh [Wed, 17 Jun 2020 04:06:48 +0000 (00:06 -0400)]
[AMDGPU] Control num waves per EU for implicit work-group size
Summary:
If amdgpu-flat-work-group-size is not specified in LLVM IR, the backend
uses default value of 1024. For this, minimum waves per EU should be 4.
However, backend is still setting minimum value to 1 instead of calculated
value. This is not observed normally as frontend always provide
amdgpu-flat-work-group-size attribute.
Reviewers: rampitec, b-sumner, sameerds, msearles
Reviewed By: rampitec
Subscribers: qcolombet, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81991
Jez Ng [Mon, 15 Jun 2020 22:00:27 +0000 (15:00 -0700)]
[lld-macho] Make sure ZeroFill sections are at the end of their segments
Summary:
ld64 does this, and references an internal rdar:// number as an explanation. No
idea what that rdar issue is, but in practice, it seems that not putting a BSS
section at the end can cause subsequent sections in the same segment to be
overwritten with zeroes.
Reviewers: #lld-macho
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81888
Biplob Mishra [Thu, 2 Jul 2020 00:48:44 +0000 (19:48 -0500)]
[PowerPC]Implement Vector Shift Double Bit Immediate Builtins
Implement Vector Shift Double Bit Immediate Builtins in LLVM/Clang.
* vec_sldb ();
* vec_srdb ();
Differential Revision: https://reviews.llvm.org/D82440
Valentin Clement [Thu, 2 Jul 2020 00:57:11 +0000 (20:57 -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: jholewinski, cfe-commits, dblaikie, MaskRay, ymandel, ichoyjx, mgorny, yaxunl, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #flang, #clang
Differential Revision: https://reviews.llvm.org/D82906
Xiang1 Zhang [Thu, 2 Jul 2020 00:36:45 +0000 (08:36 +0800)]
[X86-64] Support Intel AMX instructions
Summary:
INTEL ADVANCED MATRIX EXTENSIONS (AMX).
AMX is a new programming paradigm, it has a set of 2-dimensional registers
(TILES) representing sub-arrays from a larger 2-dimensional memory image and
operate on TILES.
Spec can be found in Chapter 3 here https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
Reviewers: LuoYuanke, annita.zhang, pengfei, RKSimon, xiangzhangllvm
Reviewed By: xiangzhangllvm
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82705
Lei Huang [Thu, 2 Jul 2020 00:36:19 +0000 (19:36 -0500)]
[PowerPC][NFC] Update doc for FeatureISA3_1/FeatureISA3_0 definitions
Tim Keith [Thu, 2 Jul 2020 00:28:00 +0000 (17:28 -0700)]
[flang] Add more support for alternate returns
Add `hasAlternateReturns` to `evaluate::ProcedureRef`.
Add `HasAlternateReturns` to test subprogram symbols.
Fix `label01.F90` test: It was checking that "error: " didn't appear in
the output. But that was erroneously matching a warning that ends
"would be in error:". So change it to check for ": error: " instead.
Differential Revision: https://reviews.llvm.org/D83007
Anil Mahmud [Wed, 1 Jul 2020 19:16:27 +0000 (14:16 -0500)]
[PowerPC] Exploit xxspltiw and xxspltidp instructions
Exploits the VSX Vector Splat Immediate Word and
VSX Vector Splat Immediate Double Precision instructions:
xxspltiw XT,IMM32
xxspltidp XT,IMM32
Differential Revision: https://reviews.llvm.org/D82911
Thomas Raoux [Thu, 2 Jul 2020 00:08:08 +0000 (17:08 -0700)]
[mlir][spirv] Add support for lowering scf.for scf/if with return value
This allow lowering to support scf.for and scf.if with results. As right now
spv region operations don't have return value the results are demoted to
Function memory. We create one allocation per result right before the region
and store the yield values in it. Then we can load back the value from
allocation to be able to use the results.
Differential Revision: https://reviews.llvm.org/D82246
Thomas Raoux [Wed, 1 Jul 2020 23:54:26 +0000 (16:54 -0700)]
[mlir][NFC] Move conversion of scf to spir-v ops in their own file
Move patterns for scf to spir-v ops in their own file/folder.
Differential Revision: https://reviews.llvm.org/D82914
Tim Keith [Wed, 1 Jul 2020 23:51:44 +0000 (16:51 -0700)]
[flang][NFC] Get formatting in sync with latest clang-format
flang/module only contains Fortran files and one is a .h so disable
formatting on that directory.
Differential Revision: https://reviews.llvm.org/D82989
Fangrui Song [Wed, 1 Jul 2020 23:40:31 +0000 (16:40 -0700)]
[gcov] Move llvm_writeout_files from atexit to a static destructor
atexit registered functions run earlier so `__attribute__((destructor))`
annotated functions cannot be tracked.
Set a priority of 100 (compatible with GCC 7 onwards) to track
destructors and destructors whose priorities are greater than 100.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7970
Reviewed By: calixte, marco-c
Differential Revision: https://reviews.llvm.org/D82253
Douglas Yung [Wed, 1 Jul 2020 23:34:57 +0000 (16:34 -0700)]
Revert "Update lto.ll test after
3367e9da enabled multibyte NOPs in 64-bit mode."
This reverts commit
79f6a814ab9383094a5ffea75bb7aca55292ff15.
Didn't notice that someone had reverted the commit that caused the problem.
Douglas Yung [Wed, 1 Jul 2020 23:25:25 +0000 (16:25 -0700)]
Update lto.ll test after
3367e9da enabled multibyte NOPs in 64-bit mode.
This should fix the PS4 linux build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/70409
Nico Weber [Wed, 1 Jul 2020 23:20:05 +0000 (19:20 -0400)]
typo fixes to cycle bots
Xun Li [Wed, 1 Jul 2020 23:06:31 +0000 (16:06 -0700)]
clang CoverageMapping tests bot cleanup
Summary:
D82928 generated unexpected tmp files in the CoverageMapping test directory. This patch cleans it up and remove the file in the test bots.
It will be revered after a week.
Reviewers: thakis
Reviewed By: thakis
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82992
Roman Lebedev [Wed, 1 Jul 2020 22:59:16 +0000 (01:59 +0300)]
[NFCI] Actually provide correct check lines in sdiv.ll
Matt Arsenault [Wed, 1 Jul 2020 20:34:51 +0000 (16:34 -0400)]
AMDGPU: Set more mov flags on V_ACCVGPR_{READ|WRITE}_B32
This fixes extra copies when materializing constants in AGPRs. This
made it a lot harder to trigger the spilling in spill-agpr.ll
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.