Jonas Devlieghere [Tue, 23 Jun 2020 22:13:14 +0000 (15:13 -0700)]
[lldb] Fix the modules build
Fixes error: invalid operands to binary expression ('llvm::StringRef'
and 'const char [6]')
Luís Marques [Tue, 23 Jun 2020 20:21:12 +0000 (21:21 +0100)]
[RISCV][NFC] Add tests for folds of ADDIs into load/stores
This patch adds tests for folds of ADDIs into load/stores, focusing on
load/stores with nonzero offsets. When the offset is nonzero we currently
don't do the fold. A follow-up patch will improve on that.
Differential Revision: https://reviews.llvm.org/D79689
Eric Schweitz [Tue, 23 Jun 2020 15:15:09 +0000 (08:15 -0700)]
[flang] add RTBuilder.h
This is a set of type building models that is specific to the lowering
process. It provides the mechanism of mapping C(++) header file interfaces
to the MLIR+FIR type system.
It also provides some macros to build a constexpr evaluated table to
runtime functions. This code is used to build the interface tables to
various runtime support libraries.
Differential revision: https://reviews.llvm.org/D82387
David Green [Tue, 23 Jun 2020 21:24:58 +0000 (22:24 +0100)]
[ARM] Mark more integer instructions as not having side effects.
LDRD and STRD along with UBFX and SBFX are selected from DAGToDAG
transforms, so do not have tblgen patterns. They don't get marked as
having side effects so cannot be scheduled as efficiently as you would
like.
This specifically marks then as not having side effects.
Differential Revision: https://reviews.llvm.org/D82358
Richard Smith [Wed, 17 Jun 2020 21:49:03 +0000 (14:49 -0700)]
When performing a substitution into a dependent alias template, mark the
outer levels as retained rather than omitting their arguments.
This better reflects what's going on (we're performing a substitution
while still inside a template), and in theory is more correct, but I've
not found a testcase where it matters in practice (largely because we
don't allow alias templates to be declared inside a function).
Fixed AST dumping of SubstNonTypeTemplateParm[Pack]Expr to demonstrate
that we're properly substituting through dependent alias templates. (We
can't deduce properly through these yet, but we can at least produce the
right input to template argument deduction.)
No functionality change intended.
aartbik [Tue, 23 Jun 2020 21:33:38 +0000 (14:33 -0700)]
[mlir] [VectorOps] Improve vector.create_mask lowering
Use vector compares for the 1-D case. This approach scales much better
than generating insertion operations, and exposes SIMD directly to backend.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D82402
Christopher Tetreault [Tue, 23 Jun 2020 20:28:55 +0000 (13:28 -0700)]
[SVE] Remove calls to VectorType::getNumElements from AsmParser
Reviewers: efriedma, RKSimon, c-rhodes, fpetrogalli
Reviewed By: fpetrogalli
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82208
David Green [Tue, 23 Jun 2020 21:03:30 +0000 (22:03 +0100)]
[ARM] Cortex-M4 integer instructions scheduler info test. NFC
Most useful at the moment for showing where unpredicatable instructions are.
Zequan Wu [Mon, 22 Jun 2020 18:43:52 +0000 (11:43 -0700)]
[ASan][MSan] Remove EmptyAsm and set the CallInst to nomerge to avoid from merging.
Summary: `nomerge` attribute was added at D78659. So, we can remove the EmptyAsm workaround in ASan the MSan and use this attribute.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82322
Jonas Devlieghere [Tue, 23 Jun 2020 21:17:08 +0000 (14:17 -0700)]
[lldb/Lua] Fix typo: s/stdout/stderr/
This wasn't caught by the existing test, but will be covered by the
extended test that's part of D82412.
Gui Andrade [Tue, 23 Jun 2020 21:10:31 +0000 (14:10 -0700)]
test/msan/sigwait: Don't silently ignore assertion failures
Summary: As the parent process would return 0 independent of whether the child succeeded, assertions in the child would be ignored.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D82400
Ryan Santhiraraja [Tue, 23 Jun 2020 21:04:36 +0000 (22:04 +0100)]
Preserve GlobalsAA analysis result in InjectTLIMappings
InjectTLIMappings fails to preserve the analysis result of GlobalsAA. Not preserving the analysis might affect benchmark performance. This change fixes this issue.
Patch by: Ryan Santhiraraja <rsanthir@quicinc.com>
Reviewers: fpetrogalli, joerg, fhahn
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D82343
Adrian Prantl [Tue, 23 Jun 2020 20:36:06 +0000 (13:36 -0700)]
Add missing string conversions to fix a compile error in Local.h
Zhi Zhuang [Tue, 23 Jun 2020 20:30:23 +0000 (13:30 -0700)]
fix test failure for clang/test/CodeGen/builtin-expect-with-probability.cpp
Fix test case added by D79830
Rewrite the test case, which did similar thing as builtin-expect.c
does(test generated llvm intrinsic instead of test branch weights).
Currently pass by "-disable-llvm-passes" option.
Differential Revision: https://reviews.llvm.org/D82403
Nikita Popov [Tue, 23 Jun 2020 20:25:04 +0000 (22:25 +0200)]
[IR] Remove MSVC warning workaround (NFC)
While LLVM does fold this to x+1, GCC does not. As this is hot
code, let's try to avoid that.
According to
https://developercommunity.visualstudio.com/content/problem/211134/unsigned-integer-overflows-in-constexpr-functionsa.html
this spurious warning in MSVC has been fixed in Visual Studio 2019
Version 16.4. Let's see if there are any build bots running old
MSVC versions with warnings treated as errors...
Christopher Tetreault [Tue, 23 Jun 2020 19:47:37 +0000 (12:47 -0700)]
[SVE] Remove calls to VectorType::getNumElements from Bitcode
Reviewers: efriedma, evgeny777, tejohnson, david-arm, kmclaughlin
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82209
Nikita Popov [Tue, 23 Jun 2020 20:18:56 +0000 (22:18 +0200)]
[IR] Remove unnecessary uint64_t casts (NFC)
As pointed out by foad, it's not necessary to work on uint64_t
here. The values used here fit uint8_t.
Siva Chandra Reddy [Tue, 23 Jun 2020 20:11:07 +0000 (13:11 -0700)]
[libc][Obvious] Fix few typos in tests.
Florian Hahn [Tue, 23 Jun 2020 18:26:31 +0000 (19:26 +0100)]
[DSE,MSSA] Treat `store 0` after calloc as noop stores.
This patch extends storeIsNoop to also detect stores of 0 to an calloced
object. This basically ports the logic from legacy DSE to the MemorySSA
backed version.
It triggers in a few cases on MultiSource, SPEC2000, SPEC2006 with -O3
LTO:
Same hash: 218 (filtered out)
Remaining: 19
Metric: dse.NumNoopStores
Program base patch2 diff
test-suite...CFP2000/177.mesa/177.mesa.test 1.00 15.00 1400.0%
test-suite...6/482.sphinx3/482.sphinx3.test 1.00 14.00 1300.0%
test-suite...lications/ClamAV/clamscan.test 2.00 28.00 1300.0%
test-suite...CFP2006/433.milc/433.milc.test 1.00 8.00 700.0%
test-suite...pplications/oggenc/oggenc.test 2.00 9.00 350.0%
test-suite.../CINT2000/176.gcc/176.gcc.test 6.00 6.00 0.0%
test-suite.../CINT2006/403.gcc/403.gcc.test NaN 137.00 nan%
test-suite...libquantum/462.libquantum.test NaN 3.00 nan%
test-suite...6/464.h264ref/464.h264ref.test NaN 7.00 nan%
test-suite...decode/alacconvert-decode.test NaN 2.00 nan%
test-suite...encode/alacconvert-encode.test NaN 2.00 nan%
test-suite...ications/JM/ldecod/ldecod.test NaN 9.00 nan%
test-suite...ications/JM/lencod/lencod.test NaN 39.00 nan%
test-suite.../Applications/lemon/lemon.test NaN 2.00 nan%
test-suite...pplications/treecc/treecc.test NaN 4.00 nan%
test-suite...hmarks/McCat/08-main/main.test NaN 4.00 nan%
test-suite...nsumer-lame/consumer-lame.test NaN 3.00 nan%
test-suite.../Prolangs-C/bison/mybison.test NaN 1.00 nan%
test-suite...arks/mafft/pairlocalalign.test NaN 30.00 nan%
Reviewers: efriedma, zoecarver, asbirlea
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D82204
Stefan Pintilie [Tue, 23 Jun 2020 19:59:19 +0000 (14:59 -0500)]
[LLD][PowerPC] Add support for R_PPC64_PCREL34
Add support for the 34bit relocation R_PPC64_PCREL34 for PC Relative in LLD.
Walter Erquinigo [Mon, 15 Jun 2020 21:08:52 +0000 (14:08 -0700)]
Redo of Add terminateCommands to lldb-vscode protocol
Summary:
This redoes https://reviews.llvm.org/D79726 and fixes two things.
- The logic that determines whether to automatically disconnect during the tear down is not very dumb compared to the original implementation. Each test will determine whether to do that or not.
- The terminate commands and terminate event were being sent after the disconnect response was sent to the IDE. That was not good, as VSCode stops the debug session as soon as it receives a disconnect response. Now, the terminate event and terminateEvents are being executed before the disconnect response is sent. This ensures that any connection between the IDE and lldb-vscode is alive while the terminate commands are executed. Besides, it also allows displaying the output of the terminate commands on the debug console, as it's still alive.
Reviewers: clayborg, aadsm, kusmour, labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D81978
Davide Italiano [Tue, 23 Jun 2020 19:45:31 +0000 (12:45 -0700)]
Generalize TestFormattersBoolRefPtr to work on Apple Silicon.
Davide Italiano [Tue, 23 Jun 2020 19:37:45 +0000 (12:37 -0700)]
[ObjectFileMachO] Check for TARGET_EMBEDDED instead of listing architectures.
Now that Apple Silicon is a thing, we need to generalize the check.
Davide Italiano [Tue, 23 Jun 2020 19:24:53 +0000 (12:24 -0700)]
[Host] Check for TARGET_OS_EMBEDDED instead of listing architectures.
With the advent of Apple Silicon, checking for the architectures
specifically is not correct anymore. This code is only supposed to
run on embedded devices (iPhones et similia), so mark it accordingly.
Jean-Michel Gorius [Tue, 23 Jun 2020 19:24:04 +0000 (21:24 +0200)]
[mlir] Avoid pontentially ambiguous class name
Summary: The Pass class exists in both the mlir and the llvm namespaces. Use the fully qualified class name to avoid any ambiguities.
Reviewers: rriddle
Reviewed By: rriddle
Subscribers: mehdi_amini, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82371
Your Name [Tue, 23 Jun 2020 19:08:56 +0000 (00:38 +0530)]
[AMDGPU/MemOpsCluster] Implement new heuristic for computing max mem ops cluster size
Summary:
Make use of both the - (1) clustered bytes and (2) cluster length, to decide on
the max number of mem ops that can be clustered. On an average, when loads
are dword or smaller, consider `5` as max threshold, otherwise `4`. This
heuristic is purely based on different experimentation conducted, and there is
no analytical logic here.
Reviewers: foad, rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: llvm-commits, kerbowa, hiraditya, t-tye, Anastasia, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82393
Zion Nimchuk [Sat, 6 Jun 2020 20:18:52 +0000 (16:18 -0400)]
Change CMake so that we only look for Z3 when LLVM_ENABLE_Z3_SOLVER is enabled
Reviewers: mikhail.ramalho
Reviewed By: mikhail.ramalho
Subscribers: mehdi_amini, mgorny, mikhail.ramalho, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75544
Fangrui Song [Tue, 23 Jun 2020 18:06:39 +0000 (11:06 -0700)]
[ELF] Resolve relocations in .debug_* referencing (discarded symbols or ICF folded section symbols) to tombstone values
See D59553, https://lists.llvm.org/pipermail/llvm-dev/2020-May/141885.html and
https://sourceware.org/pipermail/binutils/2020-May/111357.html for
extensive discussions on a tombstone value.
See http://www.dwarfstd.org/ShowIssue.php?issue=200609.1
(Reserve an address value for "not present") for a DWARF enhancement proposal.
We resolve such relocations to a tombstone value to indicate that the address is invalid.
This solves several problems (the normal behavior is to resolve the relocation to the addend):
* For an empty function in a collected section, a pair of (0,0) can
terminate .debug_loc and .debug_ranges (as of binutils 2.34, GNU ld
resolves such a relocation to 1 to avoid the .debug_ranges issue)
* If DW_AT_high_pc is sufficiently large, the address range can collide
with a regular code range of low address (https://bugs.llvm.org/show_bug.cgi?id=41124 )
* If a text section is folded into another by ICF, we may leave entries
in multiple CUs claiming ownership of the same range of code, which can
confuse consumers.
* Debug information associated with COMDAT sections can have problems
similar to ICF, but is more complex - thus not addressed by this patch.
For pre-DWARF-v5 .debug_loc and .debug_ranges, a pair of 0 can terminate
entries (invalidating subsequent ranges).
-1 is a reserved value with special meaning (base address selection entry) which can't be used either.
Use -2 instead.
For all other .debug_*, use UINT32_MAX for 32-bit targets and UINT64_MAX
for 64-bit targets. In the code, we intentionally use
`uint64_t tombstone = UINT64_MAX` for 32-bit targets as well: this matches
SignExtend64 as used in `relocateAlloc`. (Actually UINT32_MAX does not work for R_386_32)
Note 0, we only special case `target->symbolicRel` (R_X86_64_64, R_AARCH64_ABS64, R_PPC64_ADDR64), not
short-range absolute relocations (e.g. R_X86_64_32). Only forms like DW_FORM_addr need to be special cased.
They can hold an arbitrary address (must be 64-bit on a 64-bit target). (In theory,
producers can make use of small code model to emit 32-bit relocations. This doesn't seem to be leveraged.)
Note 1, we have to ignore the addend, because we don't want to resolve
DW_AT_low_pc (which may have a non-zero addend) to -1+addend (wrap
around to a low address):
__attribute__((section(".text.x"))) void f1() { }
__attribute__((section(".text.x"))) void f2() { } // DW_AT_low_pc has a non-zero addend
Note 2, if the prevailing copy does not have debugging information while
a non-prevailing copy has (partial debug build), we don't do extra work
to attach debugging information to the prevailing definition. (clang
has a lot of debug info optimizations that are on-by-default that assume
the whole program is built with debug info).
clang -c -ffunction-sections a.cc # prevailing copy has no debug info
clang -c -ffunction-sections -g b.cc
Reviewed By: dblaikie, avl, jhenderson
Differential Revision: https://reviews.llvm.org/D81784
Walter Erquinigo [Thu, 4 Jun 2020 22:55:58 +0000 (15:55 -0700)]
[vscode] set default values for terminateDebuggee for the disconnect request
Summary:
Recently I've noticed that VSCode sometimes doesn't send the terminateDebuggee flag within the disconnectRequest,
even though lldb-vscode sets the terminateDebuggee capability correctly.
This has been causing that inferiors don't die after the debug session ends, and many users have reported issues because of this.
An easy way to mitigate this is to set better default values for the terminateDebuggee field in the disconnect request.
I'm assuming that for a launch request, the default will be true, and for attach it'll be false.
Reviewers: clayborg, labath, aadsm
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D81200
George Mitenkov [Tue, 23 Jun 2020 18:20:42 +0000 (14:20 -0400)]
[MLIR][LLVMDialect] Added bitreverse and ctpop intrinsics
Introduced `llvm.intr.bitreverse` and `llvm.intr.ctpop` LLVM bit
intrinsics to LLVM dialect. These intrinsics help with SPIR-V to
LLVM conversion, allowing a direct mapping from `spv.BitReverse`
and `spv.BitCount` respectively. Tests are added to `roundtrip.mlir`
and `llvm-intrinsics.mlir`.
Differential Revision: https://reviews.llvm.org/D82285
Mehdi Amini [Tue, 23 Jun 2020 17:30:25 +0000 (17:30 +0000)]
Fix incorrect "REQUIRE" (default_target->default_triple) introduced in
59f45a1cdb3
Adding `default_target` fixed the build by excluding these tests... but
this excluded these tests from ever running!
The correct feature check is `default_triple`
Christopher Tetreault [Tue, 23 Jun 2020 17:48:08 +0000 (10:48 -0700)]
[SVE] Remove calls to VectorType::getNumElements from FuzzMutate
Reviewers: efriedma, bkramer, kmclaughlin, sdesmalen
Reviewed By: sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82212
Raphael Isemann [Tue, 23 Jun 2020 15:10:02 +0000 (17:10 +0200)]
[lldb][NFC] Add some more tests for edge cases LLDB's builtin formatters
OSType with less than 8 bytes has special code that isn't tested yet.
The same for C-strings that don't have `const char *` type. Also we're now testing
escaping the ASCII escape sequence (\033).
Feng Liu [Mon, 22 Jun 2020 22:52:31 +0000 (15:52 -0700)]
[mlir] Added the dialect inliner to the SCF dialect
Currently no restrictions are added to the destination regions.
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82336
Xun Li [Tue, 23 Jun 2020 00:56:37 +0000 (17:56 -0700)]
[Coroutines] Fix a few failing tests
Summary:
https://reviews.llvm.org/D82029 introduced the non-throw check for final_suspend(). There are a few tests I missed in that patch.
Fixing them here.
Reviewers: #libc, lewissbaker, modocache, ldionne
Reviewed By: #libc, ldionne
Subscribers: dexonsmith, modocache, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D82338
Davide Italiano [Tue, 23 Jun 2020 17:18:54 +0000 (10:18 -0700)]
[debugserver] Initial support for Apple Silicon.
Set the correct os type in the arch triple when running macOS.
Debugserver currently always assumes macOS == x86_64. This patch
generalizes the support to make sure it works on a different
architecture.
Differential Revision: https://reviews.llvm.org/D82394
Simon Pilgrim [Tue, 23 Jun 2020 17:33:32 +0000 (18:33 +0100)]
[X86][AVX] Attempt to lower v16i32/v16f32 shuffles with lowerShuffleAsRepeatedMaskAndLanePermute
Avoids prematurely creating permps/permd variable shuffles.
Fixes PR46249
Tobias Gysi [Tue, 23 Jun 2020 17:10:44 +0000 (19:10 +0200)]
Revert "[mlir] make the bitwidth of device side index computations configurable"
This reverts commit
d10b1a38a7dfb994623f27f263b67f5fc76e08cc.
Simon Pilgrim [Tue, 23 Jun 2020 16:59:31 +0000 (17:59 +0100)]
[X86][AVX] Add v16f32 variant of PR46249 test case
Arthur Eubanks [Fri, 19 Jun 2020 23:22:00 +0000 (16:22 -0700)]
[NewPM] Attempt to run opt passes specified via -foo-pass under NPM
Summary:
In order to enable mass testing of opt under NPM, specifically passes
specified via -foo-pass.
This is gated under a new opt flag -enable-new-pm. Currently
the pass flag parser looks for legacy PM passes with the name "foo" (for
opt arg "-foo") and creates a PassInfo for each one. Here we take the
(legacy PM) pass name and try to match it with one defined in (NPM)
PassRegistry.def. Ultimately if we want all tests to pass like this,
we'll need to port all passes to NPM and register them in
PassRegistry.def under the same name as they were reigstered in the
legacy PM.
Maybe at some point we'll migrate all -foo to --passes=foo, but that
would be after the NPM switch.
Flipping on the flag causes 2XXX failures under check-llvm. By far most
of them are passes either not ported to NPM or don't have the same name
in PassRegistry.def as their old name.
Reviewers: hans, echristo, asbirlea, leonardchan
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82320
cgyurgyik [Tue, 23 Jun 2020 16:51:06 +0000 (12:51 -0400)]
Remove strcmp fuzz from CMakeList since it breaks build.
Jonas Devlieghere [Tue, 23 Jun 2020 16:23:40 +0000 (09:23 -0700)]
[lldb/Lua] Require Lua 5.3
Simon Pilgrim [Tue, 23 Jun 2020 15:55:59 +0000 (16:55 +0100)]
WithColor.h - reduce CommandLine.h include to forward declaration. NFC.
WithColor.h is one of the most common headers, we can severely reduce its frontend impact (in ClangBuildAnalyzer reports) by removing the bulky CommandLine.h include, forward declaring llvm::cl::OptionCategory and just including raw_ostream.h instead.
Simon Pilgrim [Tue, 23 Jun 2020 15:23:54 +0000 (16:23 +0100)]
[X86][AVX] Add PR46249 test case
Jonas Devlieghere [Tue, 23 Jun 2020 16:04:52 +0000 (09:04 -0700)]
[lldb/Lua] Use the debugger's output and error file for Lua's I/O library.
Add support for changing the stdout and stderr file in Lua's I/O library
and hook it up with the debugger's output and error file respectively
for the interactive Lua interpreter.
https://reviews.llvm.org/D82273
Xing GUO [Tue, 23 Jun 2020 16:02:09 +0000 (00:02 +0800)]
[ObjectYAML][DWARF] Remove unused context. NFC.
The context is unused. This patch helps remove it.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D82351
Sanjay Patel [Tue, 23 Jun 2020 15:43:35 +0000 (11:43 -0400)]
[PhaseOrdering] add test for missed vectorization; NFC (PR43745)
Either SLP or VectorCombine should be able to form vector compares
reliably on this example.
Xing GUO [Tue, 23 Jun 2020 12:41:21 +0000 (20:41 +0800)]
[ObjectYAML][ELF] Add support for emitting the .debug_pubtypes section.
This patch helps add support for emitting the .debug_pubtypes section.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D82347
Valentin Clement [Tue, 23 Jun 2020 15:48:04 +0000 (11:48 -0400)]
[openmp] Add missing dependencies for OMP.h.inc after d90443b
ergawy [Tue, 23 Jun 2020 15:38:30 +0000 (11:38 -0400)]
[MLIR][SPIRV] Extend automation script to generate coverage report.
This patch adds a new cli argument to the automation script to generate
a report of the current SPIRV spec instruction coverage. It dumps to the
standard output a YAML string with the coverage information.
Differential Revision: https://reviews.llvm.org/D82006
Erich Keane [Tue, 23 Jun 2020 15:33:44 +0000 (08:33 -0700)]
Fix test added by D79830
This clang test unfortunately depends on the actions of the optimizer,
which some of the buildbots hit.
This patch makes it so it cannot ignore the return value of 'f', so it
won't do away with the implementation.
George Mitenkov [Tue, 23 Jun 2020 15:26:44 +0000 (11:26 -0400)]
[MLIR][SPIRVToLLVM] Implementation of spv.func conversion, and return ops
This patch provides an implementation for `spv.func` conversion. The pattern
is populated in a separate method added to the pass. At the moment, the type
signature conversion only includes the supported types. The conversion pattern
also matches SPIR-V function control attributes to LLVM function attributes.
Those are modelled as `passthrough` attributes in LLVM dialect. The following
mapping are used:
- None: no attributes passed
- Inline: `alwaysinline` seems to be the right equivalent (`inlinehint` is
semantically weaker in my opinion)
- DontInline: `noinline`
- Pure and Const: I think those can be modelled as `readonly` and `readnone`
attributes respectively.
Also, 2 patterns added for return ops conversion (`spv.Return` for void return
and `spv.ReturnValue` for a single value return).
Differential Revision: https://reviews.llvm.org/D81931
Momchil Velikov [Tue, 23 Jun 2020 14:24:50 +0000 (15:24 +0100)]
[ARM] Describe defs/uses of VLLDM and VLSTM
The VLLDM and VLSTM instructions are incompletely specified. They
(potentially) write (or read, respectively) registers Q0-Q7, VPR, and
FPSCR, but the compiler is unaware of it.
In the new test case `cmse-vlldm-no-reorder.ll` case the compiler
missed an anti-dependency and reordered a `VLLDM` ahead of the
instruction, which stashed the return value from the non-secure call,
effectively clobbering said value.
This test case does not fail with upstream LLVM, because of scheduling
differences and I couldn't find a test case for the VLSTM either.
Differential Revision: https://reviews.llvm.org/D81586
Nico Weber [Tue, 23 Jun 2020 14:40:34 +0000 (10:40 -0400)]
[gn build] (semi-manually) Port
d90443b1d93
Valentin Clement [Tue, 23 Jun 2020 13:29:50 +0000 (09:29 -0400)]
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
Mikhail Maltsev [Tue, 23 Jun 2020 14:24:33 +0000 (14:24 +0000)]
[BFloat] Add convert/copy instrinsic support
This patch is part of a series implementing the Bfloat16 extension of the Armv8.6-a architecture, as detailed here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
Specifically it adds intrinsic support in clang and llvm for Arm and AArch64.
The bfloat type, and its properties are specified in the Arm Architecture Reference Manual:
https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile
The following people contributed to this patch:
- Alexandros Lamprineas
- Luke Cheeseman
- Mikhail Maltsev
- Momchil Velikov
- Luke Geeson
Differential Revision: https://reviews.llvm.org/D80928
Matt Arsenault [Fri, 12 Jun 2020 14:19:17 +0000 (10:19 -0400)]
AMDGPU/GlobalISel: Fix asserts on non-s32 sitofp/uitofp sources
The combine to form cvt_f32_ubyte0 was assuming the source type was
always 32-bit, but this needs to tolerate any legal source type.
Thomas Preud'homme [Mon, 22 Jun 2020 14:00:00 +0000 (15:00 +0100)]
[unittest, ADT] Add unit tests for itostr & utostr
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D82300
Simon Pilgrim [Tue, 23 Jun 2020 12:59:05 +0000 (13:59 +0100)]
Mangle.cpp - fix implicit Format.h dependency. NFC.
ProfileSummary was depending on other headers (notably via WithColor.h) to define format().
Louis Dionne [Tue, 23 Jun 2020 13:02:53 +0000 (09:02 -0400)]
[libc++abi] Allow code-signing executables when running the tests
Sanjay Patel [Tue, 23 Jun 2020 12:56:58 +0000 (08:56 -0400)]
[PhaseOrdering] add test for vectorizer cooperation; NFC
This would potentially change with the proposal in D81416.
Alexey Bataev [Tue, 23 Jun 2020 12:53:58 +0000 (08:53 -0400)]
[OPENMP][DOCS]Update status of supported constructs, NFC.
Alexey Bataev [Thu, 18 Jun 2020 17:34:23 +0000 (13:34 -0400)]
[OPENMP50]Codegen for scan directives in parallel for simd regions.
Summary:
Added codegen for scan directives in parallel for simd regions.
Emits the code for the directive with inscan reductions.
Original code:
```
#pragma omp parallel for simd reduction(inscan, op : ...)
for() {
<input phase>;
#pragma omp scan (in)exclusive(...)
<scan phase>
}
```
is transformed to something:
```
#pragma omp parallel
{
size num_iters = <num_iters>;
<type> buffer[num_iters];
#pragma omp for simd
for (i: 0..<num_iters>) {
<input phase>;
buffer[i] = red;
}
#pragma omp barrier
for (int k = 0; k != ceil(log2(num_iters)); ++k)
for (size cnt = last_iter; cnt >= pow(2, k); --k)
buffer[i] op= buffer[i-pow(2,k)];
#pragma omp for simd
for (0..<num_iters>) {
red = InclusiveScan ? buffer[i] : buffer[i-1];
<scan phase>;
}
}
```
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82115
Xing GUO [Tue, 23 Jun 2020 12:39:38 +0000 (20:39 +0800)]
[ObjectYAML][ELF] Add support for emitting the .debug_pubnames section.
This patch helps add support for emitting the .debug_pubnames section to yaml2elf.
Known issues:
- Current implementation doesn't support emitting multiple sets of entries.
- Doesn't support DWARF64.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D82296
Simon Pilgrim [Tue, 23 Jun 2020 12:12:18 +0000 (13:12 +0100)]
Add stddef.h to fix missing size_t type build errors.
Simon Pilgrim [Tue, 23 Jun 2020 11:49:11 +0000 (12:49 +0100)]
ProfileSummaryInfoTest.cpp - fix implicit CommandLine.h dependency. NFC.
ProfileSummaryInfoTest references cl::opt but don't include CommandLine.h.
Simon Pilgrim [Tue, 23 Jun 2020 11:41:49 +0000 (12:41 +0100)]
DwarfGenerator.cpp - fix implicit FileSystem.h dependency. NFC.
Mikhail Maltsev [Tue, 23 Jun 2020 11:28:48 +0000 (11:28 +0000)]
[ARM] BFloat MatMul Intrinsics&CodeGen
Summary:
This patch adds support for BFloat Matrix Multiplication Intrinsics
and Code Generation from __bf16 to AArch32. This includes IR intrinsics. Tests are
provided as needed.
This patch is part of a series implementing the Bfloat16 extension of
the
Armv8.6-a architecture, as detailed here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
The bfloat type and its properties are specified in the Arm
Architecture
Reference Manual:
https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile
The following people contributed to this patch:
- Luke Geeson
- Momchil Velikov
- Mikhail Maltsev
- Luke Cheeseman
- Simon Tatham
Reviewers: stuij, t.p.northover, SjoerdMeijer, sdesmalen, fpetrogalli, LukeGeeson, simon_tatham, dmgreen, MarkMurrayARM
Reviewed By: MarkMurrayARM
Subscribers: MarkMurrayARM, danielkiss, kristof.beyls, hiraditya, cfe-commits, llvm-commits, chill, miyuki
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D81740
hsmahesha [Tue, 23 Jun 2020 10:49:34 +0000 (16:19 +0530)]
[AMDGPU/MemOpsCluster] Compute `width` for `MIMG` instruction class.
Summary:
`width` computation is missing for newly added `MIMG`
instruction class. Add it.
Reviewers: foad, rampitec, arsenm
Reviewed By: foad
Subscribers: MatzeB, javed.absar, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81649
Georgii Rymar [Wed, 17 Jun 2020 14:42:55 +0000 (17:42 +0300)]
[DebugInfo/DWARF] - Do not hang when CFI are truncated.
Currently when the .eh_frame section is truncated so that
CFI instructions can't be read, it is possible to enter
an infinite loop.
It happens because `CFIProgram::parse` does not handle errors properly.
This patch fixes the issue.
Differential revision: https://reviews.llvm.org/D82017
James Henderson [Tue, 23 Jun 2020 11:33:19 +0000 (12:33 +0100)]
[DebugInfo][test] Attempt to fix big endian build bots
Commit
9782c922c broke them since it prints raw bytes, whose order will
be different dependent on the endianness of the host.
Simon Pilgrim [Tue, 23 Jun 2020 11:24:24 +0000 (12:24 +0100)]
llvm-isel-fuzzer.cpp - fix implicit CommandLine.h dependency. NFC.
llvm-isel-fuzzer uses cl::opt but don't include CommandLine.h.
Simon Pilgrim [Tue, 23 Jun 2020 11:23:29 +0000 (12:23 +0100)]
llvm-dwp.cpp - fix implicit CommandLine.h dependency. NFC.
llvm-dwp uses cl::opt + cl::list but don't include CommandLine.h.
Simon Pilgrim [Tue, 23 Jun 2020 11:20:44 +0000 (12:20 +0100)]
ModuleTest.cpp - fix implicit SourceMgr.h dependency. NFC.
ModuleTest.cpp was depending on other headers to define SMDiagnostic.
Simon Pilgrim [Tue, 23 Jun 2020 11:19:09 +0000 (12:19 +0100)]
[Analysis] Ensure we include CommandLine.h if we declare any cl::opt flags. NFC.
cgyurgyik [Tue, 23 Jun 2020 11:19:45 +0000 (07:19 -0400)]
[libc] Add fuzz test for strcmp.
Summary:
Adds a fuzz test for string comparison.
This takes in two strings with associated lengths.
Verifies each string contains at least one character, and that the last character is the null terminator.
Then, finds the first instance where one of the following does not hold:
1. i < min(size1, size2)
2. s1[i] == s2[i]
3. s1[i] != '\0'
The result of strcmp is then compared to the value of the difference between s1[i] and s2[i]. For thoroughness, the operands are reversed and also checked.
Reviewers: sivachandra, PaulkaToast
Reviewed By: sivachandra, PaulkaToast
Subscribers: mgorny, tschuett, ecnelises, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D82247
cgyurgyik [Sat, 20 Jun 2020 00:15:38 +0000 (20:15 -0400)]
Add strcmp fuzz test.
Reviewed-by: todo
Differential Revision: https://reviews.llvm.org/D82247
Aaron Ballman [Tue, 23 Jun 2020 11:14:33 +0000 (07:14 -0400)]
Handle invalid types in the nullPointerConstant AST matcher
Currently, using the nullPointerConstant AST matcher can lead to
assertions in situations where a node to be matched does not have a
valid type associated with it, such as a ParenListExpr. This patch
addresses that by saying such nodes cannot be a null pointer constant.
This addresses PR46353.
Sander de Smalen [Tue, 23 Jun 2020 08:54:04 +0000 (09:54 +0100)]
[AArch64][SVE] ACLE: Add bfloat16 to struct load/stores.
This patch contains:
- Support in LLVM CodeGen for bfloat16 types for ld2/3/4 and st2/3/4.
- New bfloat16 ACLE builtins for svld(2|3|4)[_vnum] and svst(2|3|4)[_vnum]
Reviewers: stuij, efriedma, c-rhodes, fpetrogalli
Reviewed By: fpetrogalli
Tags: #clang, #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D82187
Simon Pilgrim [Tue, 23 Jun 2020 11:11:16 +0000 (12:11 +0100)]
[Transforms] Ensure we include CommandLine.h if we declare any cl::opt flags
Simon Pilgrim [Tue, 23 Jun 2020 11:07:21 +0000 (12:07 +0100)]
SanitizerCoverage.h - fix implicit VirtualFileSystem.h dependency. NFC.
Was relying on other headers to define vfs::getRealFileSystem() for use in inline functions
Simon Pilgrim [Tue, 23 Jun 2020 11:04:05 +0000 (12:04 +0100)]
DWARFLinkerDeclContext.h - fix implicit FileSystem.h dependency. NFC.
Was relying on other headers to define sys::fs::real_path for use in CachedPathResolver::resolve inlines
Kerry McLaughlin [Tue, 23 Jun 2020 10:34:52 +0000 (11:34 +0100)]
[SVE][CodeGen] Legalisation of vsetcc with scalable types
Summary: Changes SplitVecOp_VSETCC to use getVectorElementCount()
Reviewers: sdesmalen, efriedma, dancgr
Reviewed By: efriedma
Subscribers: david-arm, tschuett, hiraditya, rkruppe, psnobl, huihuiz, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79167
Roman Lebedev [Tue, 23 Jun 2020 10:52:21 +0000 (13:52 +0300)]
[IndVarSimplify] Don't replace IV user with unsafe loop-invariant (PR45360)
Summary:
As [[ https://bugs.llvm.org/show_bug.cgi?id=45360 | PR45360 ]] reports,
with new cost-model we can sometimes end up being able to expand `udiv`/`urem` instructions.
And that exposes at least one instance of when we do that
regardless of whether or not it is safe to do.
In this particular case, it's `SimplifyIndvar::replaceIVUserWithLoopInvariant()`.
It seems to me, we simply need to check with `isSafeToExpandAt()` first.
The test isn't great. I'm not sure how to make it only run `-indvars`.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=45360 | PR45360 ]].
Reviewers: mkazantsev, reames, helloqirun
Reviewed By: mkazantsev
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82108
David Zarzycki [Tue, 23 Jun 2020 10:48:02 +0000 (06:48 -0400)]
[libcxx tests] Clang is more strict now about coroutines
As of
516803dc8685ebcc5bce38b05391958ffee22643, clang is now more
strictly enforcing the coroutine specification.
See: https://reviews.llvm.org/D82029
Chen Zheng [Fri, 19 Jun 2020 03:31:51 +0000 (23:31 -0400)]
[PowerPC] fold addi's imm operand to its imm form consumer's displacement
This patch adds a function to do following transformation:
%0:g8rc_and_g8rc_nox0 = ADDI8 %5:g8rc_and_g8rc_nox0, 144
STD killed %7:g8rc, 16, %0:g8rc_and_g8rc_nox0 :: (store 8 into %ir.8)
------>
STD killed %7:g8rc, 160, %5:g8rc_and_g8rc_nox0 :: (store 8 into %ir.8)
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D81723
Cullen Rhodes [Fri, 19 Jun 2020 12:13:00 +0000 (12:13 +0000)]
[AArch64][SVE] Guard svbfloat16_t with feature macro in ACLE
Summary:
svbfloat16_t should only be defined if the __ARM_FEATURE_SVE_BF16
feature macro is enabled, similar to the scalar bfloat16_t type. Also,
arm_bf16.h should be included in arm_sve.h when
__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is defined.
Patch also contains a fix for ld1ro intrinsic which should be guarded on
__ARM_FEATURE_SVE_BF16 rather than __ARM_FEATURE_BF16_SCALAR_ARITHMETIC,
and a fix for bfmmla test which was missing
__ARM_FEATURE_BF16_SCALAR_ARITHMETIC and -target-feature +bf16 in the
RUN line.
Reviewed By: fpetrogalli
Differential Revision: https://reviews.llvm.org/D82178
Dylan McKay [Tue, 23 Jun 2020 10:21:22 +0000 (22:21 +1200)]
Revert "[AVR] Explicitly set the address of the data section when invoking the linker"
This reverts commit
ede6005e7092ddae454e4d365d8adefeaec1f5e3.
Ayke suggests this value varies chip-by-chip, and thus it is not safe to
hardcode to 0x800100.
Proper logic for this linker parameter will have to be wired up in a
follow up patch.
Sebastian Neubauer [Fri, 29 May 2020 14:35:57 +0000 (16:35 +0200)]
[TableGen] Add error messages
Print an error instead of crashing in two places.
Differential Revision: https://reviews.llvm.org/D81074
Pavel Labath [Tue, 23 Jun 2020 09:35:08 +0000 (11:35 +0200)]
[lldb] Split ClangASTSource::CompleteType
Move the part of the code which is responsible for finding a complete
definition of the type into a separate function (FindCompleteType). This
is split off from D81561, as it's a generally useful cleanup.
No functional change.
Simon Pilgrim [Mon, 22 Jun 2020 19:03:23 +0000 (20:03 +0100)]
[X86] truncateVectorWithPACK - fix outdated comment. NFC.
We perform PACKSS/PACKUS on AVX512 targets if the calling function wants to.
Simon Pilgrim [Mon, 22 Jun 2020 18:45:48 +0000 (19:45 +0100)]
[DAG] visitSIGN_EXTEND_INREG - rename EVT variable. NFCI.
We had a EVT type variable called EVT, which isn't a good idea....
Paul Walker [Mon, 18 May 2020 18:12:38 +0000 (19:12 +0100)]
[SVE] Code generation for fixed length vector loads & stores.
Summary:
This patch adds base support for code generating fixed length
vector operations targeting a known SVE vector length. To achieve
this we lower fixed length vector operations to equivalent scalable
vector operations, whereby SVE predication is used to limit the
elements processed to those present within the fixed length vector.
Specifically this patch implements load and store operations, which
get lowered to their masked counterparts thusly:
V = load(Addr) =>
V = extract_fixed_vector(masked_load(make_pred(V.NumElts), Addr))
store(V, (Addr)) =>
masked_store(insert_fixed_vector(V), make_pred(V.NumElts), Addr))
Reviewers: rengolin, efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80385
Dylan McKay [Fri, 19 Jun 2020 11:26:00 +0000 (23:26 +1200)]
[AVR] Rewrite the function calling convention.
Summary:
The previous version relied on the standard calling convention using
std::reverse() to try to force the AVR ABI. But this only works for
simple cases, it fails for example with aggregate types.
This patch rewrites the calling convention with custom C++ code, that
implements the ABI defined in https://gcc.gnu.org/wiki/avr-gcc.
To do that it adds a few 16-bit pseudo registers for unaligned argument
passing, such as R24R23. For example this function:
define void @fun({ i8, i16 } %a)
will pass %a.0 in R22 and %a.1 in R24R23.
There are no instructions that can use these pseudo registers, so a new
register class, DREGSMOVW, is defined to make them apart.
Also the ArgCC_AVR_BUILTIN_DIV is no longer necessary, as it is
identical to the C++ behavior (actually the clobber list is more strict
for __div* functions, but that is currently unimplemented).
Reviewers: dylanmckay
Subscribers: Gaelan, Sh4rK, indirect, jwagen, efriedma, dsprenkels, hiraditya, Jim, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68524
Patch by Rodrigo Rivas Costa.
Mikael Holmen [Tue, 23 Jun 2020 09:28:02 +0000 (11:28 +0200)]
Silence gcc warning about extra ";" [NFC]
Kai Luo [Tue, 23 Jun 2020 09:14:25 +0000 (09:14 +0000)]
[PowerPC][NFC] Add tests for variadic functions on PPC64
James Henderson [Wed, 17 Jun 2020 10:29:29 +0000 (11:29 +0100)]
[DebugInfo] Print line table extended opcode bytes if parsing fails
Previously, if there was an error whilst parsing the operands of an
extended opcode, the operands would be treated as zero and printed. This
could potentially be slightly confusing. This patch changes the
behaviour to print the raw bytes instead.
Reviewed by: ikudrin
Differential Revision: https://reviews.llvm.org/D81570
Simon Pilgrim [Tue, 23 Jun 2020 08:43:09 +0000 (09:43 +0100)]
ProfileSummary.cpp - fix implicit Format.h dependency. NFC.
ProfileSummary was depending on other headers (notably WithColor.h) to define format().
Simon Pilgrim [Tue, 23 Jun 2020 08:41:14 +0000 (09:41 +0100)]
StatepointLowering.cpp - fix implicit CommandLine.h dependency. NFC.
StatepointLowering defines a cl::opt but don't include CommandLine.h.
Simon Pilgrim [Tue, 23 Jun 2020 08:31:38 +0000 (09:31 +0100)]
LowLevelTypeImpl.h - fix implicit Debug.h dependency. NFC.
LowLevelType was depending on other headers (notably WithColor.h) to define dbgs().