Sanjay Patel [Tue, 3 Mar 2020 21:28:57 +0000 (16:28 -0500)]
[AArch64] add tests for nnan/ninf/undef FP simplifications; NFC
Vedant Kumar [Tue, 3 Mar 2020 21:30:27 +0000 (13:30 -0800)]
test: Adjust no-dbg-value-after-terminator.mir to use `not --crash`
Matthias Kramm [Tue, 3 Mar 2020 21:20:48 +0000 (13:20 -0800)]
[mlir][Tutorial] Make parsing an empty file print a better error.
Summary:
Previously, we would, for an empty file, print the somewhat confusing
Assertion `tok == curTok [...]' failed.
With this change, we now print
Parse error [...]: expected 'def' [...]
This only affects the parser from chapters 1-6, since the more advanced
chapter 7 parser is actually able to generate an empty module from an
empty file. Nonetheless, this commit also adds the additional check to
the chapter 7 parser, for consistency.
Differential Revision: https://reviews.llvm.org/D75534
River Riddle [Tue, 3 Mar 2020 21:02:02 +0000 (13:02 -0800)]
[mlir] Generate CmpFPredicate as an EnumAttr in tablegen
Summary: This allows for attaching the attribute to CmpF as a proper argument, and thus enables the removal of a bunch of c++ code.
Differential Revision: https://reviews.llvm.org/D75539
Reid Kleckner [Tue, 3 Mar 2020 21:17:47 +0000 (13:17 -0800)]
Port ubsan nullability.c test to Windows
Two issues:
- Need to add env prefix to be compatible with the lit internal shell
- Need to quote the colon in Windows paths with '"%t.supp"'
Alex Langford [Tue, 3 Mar 2020 21:14:18 +0000 (13:14 -0800)]
[lldb] Delete some commented out code in ClangASTSource.cpp
Sanjay Patel [Tue, 3 Mar 2020 21:14:10 +0000 (16:14 -0500)]
[PowerPC] adjust test to avoid getting zapped completely; NFC
div-by-0 -> Inf
The math ops are 'fast' so 'ninf' applies and the whole thing is undef.
Vedant Kumar [Tue, 3 Mar 2020 19:27:09 +0000 (11:27 -0800)]
[MachineVerifier] Remove placement rule exception for debug entry values
There should not be an exception allowing debug entry values to be
placed after a terminator.
Differential Revision: https://reviews.llvm.org/D75559
Vedant Kumar [Tue, 3 Mar 2020 19:08:48 +0000 (11:08 -0800)]
[LiveDebugValues] Do not insert DBG_VALUEs after a MBB terminator
This fixes a miscompile that happened because a DBG_VALUE interfered
with the MachineOutliner's liveness analysis.
Inserting a DBG_VALUE after a terminator breaks predicates on MBB such
as isReturnBlock(). And the resulting DBG_VALUE cannot be "live".
I plan to introduce a MachineVerifier check for this situation in a
follow up.
rdar://
59859175
Testing: check-llvm, LNT build with a stage2 compiler & entry values
enabled
Differential Revision: https://reviews.llvm.org/D75548
Nathan Ridge [Mon, 23 Dec 2019 18:38:04 +0000 (13:38 -0500)]
[clangd] Handle go-to-definition in macro invocations where the target appears in the expansion multiple times
Fixes https://github.com/clangd/clangd/issues/234
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72041
George Rokos [Tue, 3 Mar 2020 20:26:40 +0000 (12:26 -0800)]
[clang-offload-wrapper] Lower priority of __tgt_register_lib in favor of __tgt_register_requires
Lower priority of __tgt_register_lib in order to make sure that __tgt_register_requires is called before loading a libomptarget plugin.
We want to know beforehand which requirements the user has asked for so that upon loading the plugin libomptarget can report how many devices there are that can satisfy these requirements.
Differential Revision: https://reviews.llvm.org/D75223
Alex Zinenko [Tue, 3 Mar 2020 20:26:00 +0000 (21:26 +0100)]
[mlir] Format AffineOps.td. NFC
Drop trailing spaces and reflow text to fit 80 columns.
Craig Topper [Tue, 3 Mar 2020 20:16:01 +0000 (12:16 -0800)]
[X86] Match vpmullq latency to uops.info. Correct port usage for 512-bit memory form
uops.info says these should be 15 cycle instructions. Uops.info also shows the 512-bit form uses port 0 and 5 for both register and memory. We had memory using 0 and 1.
Differential Revision: https://reviews.llvm.org/D75549
Jacques Pienaar [Tue, 3 Mar 2020 20:01:54 +0000 (12:01 -0800)]
[mlir][ods] Add query for derived attribute
For ODS generated operations enable querying whether there is a derived
attribute with a given name.
Rollforward of commit 5aa57c2 without using llvm::is_contained.
Stefan Stipanovic [Tue, 3 Mar 2020 19:43:16 +0000 (20:43 +0100)]
Revert "Revert "[lldb/Docs] Mark both Python 3.6 and 3.8 as supported on Windows""
This reverts commit
78a734e2792061921ab7fb8f9059d1fb673e158f.
Stefan Stipanovic [Tue, 3 Mar 2020 19:42:05 +0000 (20:42 +0100)]
Revert "[OpenMP] Adding InaccessibleMemOnly and InaccessibleMemOrArgMemOnly for runtime calls."
This reverts commit
9989b859efccafacb0cc1f8d393d8b9fc49f4037.
Stefan Stipanovic [Tue, 3 Mar 2020 19:41:18 +0000 (20:41 +0100)]
Revert "[lldb/Docs] Mark both Python 3.6 and 3.8 as supported on Windows"
This reverts commit
3270ea9042eaa2bf9ab12d4a6ceefaae73c5152a.
Stefan Stipanovic [Tue, 3 Mar 2020 19:32:22 +0000 (20:32 +0100)]
[OpenMP] Adding InaccessibleMemOnly and InaccessibleMemOrArgMemOnly for runtime calls.
Summary: Attempt to add more attributes for runtime calls.
Reviewers: jdoerfertA, ggeorgakoudis, lebedev.ri, dreachem
Subscribers:
Jonas Devlieghere [Tue, 3 Mar 2020 19:24:11 +0000 (11:24 -0800)]
[lldb/Docs] Mark both Python 3.6 and 3.8 as supported on Windows
Haibo told me he didn't have any issues with Python 3.8 and I was able
to confirm that. Even though we don't have bot running with 3.8, I think
it safe to mark it as supported in the docs.
Alexey Bataev [Tue, 3 Mar 2020 18:22:35 +0000 (13:22 -0500)]
[OPENMP50]Support 'update' clause for 'depobj' directive.
Added basic support (parsing/sema/serialization) for 'update' clause in
'depobj' directive.
Raphael Isemann [Tue, 3 Mar 2020 18:30:20 +0000 (10:30 -0800)]
[lldb][NFC] Remove some commented out code in TypeSystemClang
Summary: I don't see why we want to keep that code around.
Reviewers: #lldb, JDevlieghere
Reviewed By: #lldb, JDevlieghere
Subscribers: davide
Differential Revision: https://reviews.llvm.org/D75496
Craig Topper [Tue, 3 Mar 2020 18:17:18 +0000 (10:17 -0800)]
[X86] Always emit an integer vbroadcast_load from lowerBuildVectorAsBroadcast regardless of AVX vs AVX2
If we go with D75412, we no longer depend on the scalar type directly. So we don't need to avoid using i64. We already have AVX1 fallback patterns with i32 and i64 scalar types so we don't need to avoid using integer types on AVX1.
Differential Revision: https://reviews.llvm.org/D75413
Craig Topper [Tue, 3 Mar 2020 18:14:47 +0000 (10:14 -0800)]
[X86] Directly emit VBROADCAST_LOAD from constant pool in lowerBuildVectorAsBroadcast
Also add a DAG combine to combine different sized broadcasts from
constant pool to avoid a regression.
Differential Revision: https://reviews.llvm.org/D75412
LLVM GN Syncbot [Tue, 3 Mar 2020 18:25:30 +0000 (18:25 +0000)]
[gn build] Port
c84532a70aa
Whitney Tsang [Tue, 3 Mar 2020 17:38:19 +0000 (17:38 +0000)]
[LoopNest]: Analysis to discover properties of a loop nest.
Summary: This patch adds an analysis pass to collect loop nests and
summarize properties of the nest (e.g the nest depth, whether the nest
is perfect, what's the innermost loop, etc...).
The motivation for this patch was discussed at the latest meeting of the
LLVM loop group (https://ibm.box.com/v/llvm-loop-nest-analysis) where we
discussed
the unimodular loop transformation framework ( “A Loop Transformation
Theory and an Algorithm to Maximize Parallelism”, Michael E. Wolf and
Monica S. Lam, IEEE TPDS, October 1991). The unimodular framework
provides a convenient way to unify legality checking and code generation
for several loop nest transformations (e.g. loop reversal, loop
interchange, loop skewing) and their compositions. Given that the
unimodular framework is applicable to perfect loop nests this is one
property of interest we expose in this analysis. Several other utility
functions are also provided. In the future other properties of interest
can be added in a centralized place.
Authored By: etiotto
Reviewer: Meinersbur, bmahjour, kbarton, Whitney, dmgreen, fhahn,
reames, hfinkel, jdoerfert, ppc-slack
Reviewed By: Meinersbur
Subscribers: bryanpkc, ppc-slack, mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D68789
Jon Chesterfield [Tue, 3 Mar 2020 18:24:51 +0000 (18:24 +0000)]
[libomptarget][nfc][amdgcn] Simplify assert_fail implementation
Fangrui Song [Tue, 3 Mar 2020 18:01:51 +0000 (10:01 -0800)]
Craig Topper [Tue, 3 Mar 2020 17:54:14 +0000 (09:54 -0800)]
[X86] Connect accidentally dead code in a avx512 fmadd intrinsic test case.
Justin Bogner [Tue, 3 Mar 2020 17:43:36 +0000 (09:43 -0800)]
Restore `REQUIRES: default_triple` to a test
This was accidentally removed as part of
7683a084de6 "Remove lit
feature object-emission"
7683a084de6 Remove lit feature object-emission
Jonathan Coe [Tue, 3 Mar 2020 17:15:56 +0000 (17:15 +0000)]
[clang-format] Allow nested [] in C# attributes
Summary: Keep track of unpaired [] when identifying C# attribute lines
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D75455
Lang Hames [Tue, 3 Mar 2020 17:32:49 +0000 (09:32 -0800)]
[ORC] Make sure we add initializers to the SymbolFlags map for objects.
Lang Hames [Tue, 3 Mar 2020 16:27:56 +0000 (08:27 -0800)]
[ORC] Remove an out-of-date FIXME
Alex Zinenko [Tue, 3 Mar 2020 12:21:51 +0000 (13:21 +0100)]
[mlir] support reductions in loop to std conversion
Summary:
Introduce support for converting loop.for operations with loop-carried values
to a CFG in the standard dialect. This is achieved by passing loop-carried
values as block arguments to the loop condition block. This block dominates
both the loop body and the block immediately following the loop, so the
arguments of this block are remain visible there.
Differential Revision: https://reviews.llvm.org/D75513
Sterling Augustine [Mon, 2 Mar 2020 22:09:33 +0000 (14:09 -0800)]
Promote nameless lambda used by dl_iterate_phdr to named function to clean up control flow inside findUnwindSections. Also, expose the data structure
to allow use by a future replacment function.
Summary: [Refactor] Promote nameless lambda to fully named function, allowing easy replacement in following patch.
Subscribers: krytarowski, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D75480
Fangrui Song [Fri, 28 Feb 2020 05:57:40 +0000 (21:57 -0800)]
[MCDwarf] Generate DWARF v5 .debug_rnglists for assembly files
```
// clang -c -gdwarf-5 a.s -o a.o
.section .init; ret
.text; ret
```
.debug_info contains DW_AT_ranges and llvm-dwarfdump will report
a verification error because .debug_rnglists does not exist (not
implemented).
This patch generates .debug_rnglists for assembly files.
emitListsTableHeaderStart() in DwarfDebug.cpp can be shared with
MCDwarf.cpp. Because CodeGen depends on MC, I move the function to
MCDwarf.cpp
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D75375
Tyker [Tue, 3 Mar 2020 16:42:57 +0000 (17:42 +0100)]
Joerg Sonnenberger [Tue, 3 Mar 2020 15:13:52 +0000 (16:13 +0100)]
Add module for llvm/Bitstream
Nathan James [Tue, 3 Mar 2020 16:39:32 +0000 (16:39 +0000)]
[clang-tidy] Change checks to use new isLanguageVersionSupported restriction
Summary: Modifies all checks that are language version dependent to use `isLanguageVersionSupported`
Reviewers: jdoerfert, lebedev.ri, aaron.ballman, gribozavr2, Eugene.Zelenko
Reviewed By: gribozavr2
Subscribers: wuzish, nemanjai, xazax.hun, hiraditya, kbarton, steven_wu, dexonsmith, arphaman, lebedev.ri, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75340
Pierre-vh [Mon, 2 Mar 2020 17:06:06 +0000 (17:06 +0000)]
[debuginfo-tests][dexter] Add --builder gcc support for POSIX
Differential Revision: https://reviews.llvm.org/D75339
Craig Topper [Tue, 3 Mar 2020 15:43:08 +0000 (07:43 -0800)]
[DAGCombiner][X86] Improve narrowExtractedVectorLoad to handle cases where the element size isn't byte sized by the subvector is.
Summary:
Follow up from D75377. If the subvector is byte sized and the
index is aligned to the subvector size, we can shrink the load.
Reviewers: spatel, RKSimon
Reviewed By: RKSimon
Subscribers: dbabokin, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75434
Craig Topper [Tue, 3 Mar 2020 06:28:43 +0000 (22:28 -0800)]
[X86] Don't count the chain uses when forming broadcast loads in lowerBuildVectorAsBroadcast.
The build_vector needs to be the only user of the data, but the
chain will likely have another use. So we can't make sure the
build_vector is the only user of the node.
Chris Bowler [Tue, 3 Mar 2020 16:25:41 +0000 (11:25 -0500)]
[PowerPC][NFC] Add missing expected output for AIX int stack arg test.
The expected output is erroneous and will be corrected alongside a fix
to ensure stack arguments are widened to register width before writing
to the parameter save area.
Chris Bowler [Tue, 3 Mar 2020 15:38:29 +0000 (10:38 -0500)]
[PowerPC][NFC] Lexically order expected output for AIX stack arg test.
Alex Zinenko [Tue, 3 Mar 2020 09:58:33 +0000 (10:58 +0100)]
[mlir] ExecutionEngine: fix assertion on the error path
MLIR ExecutionEngine and derived tools (e.g., mlir-cpu-runner) would trigger an
assertion inside ORC JIT while ExecutionEngine is being destructed after a
failed linking due to a missing function definition. The reason for this is the
JIT lookup that may return an Error referring to strings stored internally by
the JIT. If the Error outlives the ExecutionEngine, it would want have a
dangling reference, which is currently caught by an assertion inside JIT thanks
to hand-rolled reference counting. Rewrap the error message into a string
before returning.
Differential Revision: https://reviews.llvm.org/D75508
Alex Zinenko [Mon, 2 Mar 2020 14:18:41 +0000 (15:18 +0100)]
[mlir] error out on unsupported attribute kinds in LLVM global translation
Some attribute kinds are not supported as "value" attributes of
`llvm.mlir.constant` when translating to LLVM IR. We were correctly reporting
an error, but continuing the translation using an "undef" value instead,
leading to a surprising mix of error messages and output IR. Abort the
translation after the error is reported.
Differential Revision: https://reviews.llvm.org/D75450
LLVM GN Syncbot [Tue, 3 Mar 2020 15:41:46 +0000 (15:41 +0000)]
[gn build] Port
ae4d39c9e4a
Jonas Paulsson [Fri, 21 Feb 2020 01:42:51 +0000 (17:42 -0800)]
[SystemZ] Copy Access registers and CC with the correct register class.
On SystemZ there are a set of "access registers" that can be copied in and
out of 32-bit GPRs with special instructions. These instructions can only
perform the copy using low 32-bit parts of the 64-bit GPRs. However, the
default register class for 32-bit integers is GRX32, which also contains the
high 32-bit part registers.
In order to never end up with a case of such a COPY into a high reg, this
patch adds a new simple pre-RA pass that selects such COPYs into target
instructions.
This pass also handles COPYs from CC (Condition Code register), and COPYs to
CC can now also be emitted from a high reg in copyPhysReg().
Fixes: https://bugs.llvm.org/show_bug.cgi?id=44254
Review: Ulrich Weigand.
Differential Revision: https://reviews.llvm.org/D75014
Pavel Labath [Tue, 3 Mar 2020 15:23:00 +0000 (16:23 +0100)]
[lldb] Add detailed tests for the "disassemble" command
While we have some tests for this command already, they are very vague.
This is not surprising -- it's hard to make strict assertions about the
assembly if your input is a c++ source file. This means that the tests
can more-or-less only detect when the command breaks completely, and not
when there is a subtle change in meaning due to e.g. a code refactor --
which is something that I am getting ready to do.
This tests in this patch create binaries with well known data (via assembler
and yaml2obj). This means that we are able to make precise assertions
about the text that lldb is supposed to print. As some of the features
of this command are only available with a real process, I use a minidump
core file to create a sufficiently realistic process object.
Francesco Petrogalli [Mon, 2 Mar 2020 22:13:47 +0000 (22:13 +0000)]
[llvm][CodeGen][SVE] Constrain prefetch intrinsic argument to immediate values.
Summary:
The argument that sets the prefetch type of a prefetch intrinsic must
be an immediate value.
Reviewers: andwar, sdesmalen, efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75482
Sam Parker [Tue, 3 Mar 2020 15:19:57 +0000 (15:19 +0000)]
[RDA][ARM] collectKilledOperands across multiple blocks
Use MIOperand in collectLocalKilledOperands to make the search
global, as we already have to search for global uses too. This
allows us to delete more dead code when tail predicating.
Differential Revision: https://reviews.llvm.org/D75167
Sam McCall [Tue, 3 Mar 2020 14:57:39 +0000 (15:57 +0100)]
[clangd] Propagate versions into DraftStore, assigning where missing. NFC
This prepares for propagating versions through the server so diagnostics
etc can be versioned.
Sam Parker [Thu, 27 Feb 2020 10:54:08 +0000 (10:54 +0000)]
[ARM][RDA] Allow multiple killed users
In RDA, check against the already decided dead instructions when
looking at users. This allows an instruction to be removed if it
has multiple users, but they're all dead.
This means that IT instructions can be considered killed once all
the itstate using instructions are dead.
Differential Revision: https://reviews.llvm.org/D75245
diggerlin [Tue, 3 Mar 2020 15:02:40 +0000 (10:02 -0500)]
[AIX][XCOFF] Fix XCOFFObjectWriter assertion failure with alignment-related gap and improve text section output testing
SUMMARY:
1.if there is a gap between the end virtual address of one section and the beginning virtual address of the next section, the XCOFFObjectWriter.cpp will hit a assert.
2.as discussed in the patch https://reviews.llvm.org/D66969,
since implemented the function description. We can output the raw object data for function.
we need to create a test for raw text section content and test section header for xcoff object file.
Reviewer: daltenty,hubert.reinterpretcast,jasonliu
Differential Revision: https://reviews.llvm.org/D71845
Sid Manning [Fri, 21 Feb 2020 19:36:41 +0000 (13:36 -0600)]
[hexagon] Add default paths to support musl target
Pickup the default crt and libs when the target is musl.
Resubmitting after updating the testcase.
Differential Revision: https://reviews.llvm.org/D75139
Alexander Belyaev [Tue, 3 Mar 2020 14:26:10 +0000 (15:26 +0100)]
[MLIR] Add explicit initial values for loop.parallel op.
Differential Revision: https://reviews.llvm.org/D75206
Nicolas Vasilache [Mon, 2 Mar 2020 14:59:01 +0000 (09:59 -0500)]
[mlir] Add padding to 1-D Vector in CRunnerUtils.h
Summary:
This revision fixes a -Wzero-length-array compile error that
caused
e459596917a72f11bd8251a81bdb521401abdd3d which reverted
78f9e5d098af95610f4542ee41479d7931261066.
Also fixes a struct vs class mismatch that broke compilation with
-Werror for Windows that caused
57397eba7a8a7525cee69e10ad90697ff74bb521.
This revision adds padding for 1-D Vector in the common case of x86
execution with a stadard data layout. This supports properly interfacing
codegen with arrays of e.g. `vector<9xf32>`.
Such vectors are already assumed padded to the next power of 2 by LLVM
codegen with the default x86 data layout:
```
define void @test_vector_add_1d_2_3(<3 x float>* nocapture readnone %0,
<3 x float>* nocapture readonly %1, i64 %2, i64 %3, i64 %4, <3 x float>*
nocapture readnone %5, <3 x float>* nocapture readonly %6, i64 %7, i64
%8, i64 %9, <3 x float>* nocapture readnone %10, <3 x float>* nocapture
%11, i64 %12, i64 %13, i64 %14) local_unnamed_addr {
%16 = getelementptr <3 x float>, <3 x float>* %6, i64 1
%17 = load <3 x float>, <3 x float>* %16, align 16
%18 = getelementptr <3 x float>, <3 x float>* %1, i64 1
%19 = load <3 x float>, <3 x float>* %18, align 16
%20 = fadd <3 x float> %17, %19
%21 = getelementptr <3 x float>, <3 x float>* %11, i64 1
```
The pointer addressing a `vector<3xf32>` is assumed aligned `@16`.
Similarly, the pointer addressing a `vector<65xf32>` is assumed aligned
`@512`.
This revision allows using objects such as `vector<3xf32>` properly with
the standard x86 data layout used in the JitRunner. Integration testing
is done out of tree, at the moment such testing fails without this
change.
Differential Revision: https://reviews.llvm.org/D75459
Nicolas Vasilache [Tue, 3 Mar 2020 03:47:16 +0000 (22:47 -0500)]
[mlir] Hotfix - Fix Windows build
This revision adds a static `mlir_c_runner_utils_static` library
for the sole purpose of being linked into `mlir_runner_utils` on
Windows.
It was previously reported that:
```
`add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)`
produces *only* a dll on windows, the linking of mlir_runner_utils fails
because target_link_libraries is looking for a .lib file as opposed to a
.dll file. I think this may be a case where either we need to use
LINK_LIBS or explicitly build a static lib as well, but I haven't tried
either yet.
```
LLVM GN Syncbot [Tue, 3 Mar 2020 14:16:22 +0000 (14:16 +0000)]
[gn build] Port
613f791131e
Benjamin Kramer [Tue, 3 Mar 2020 14:13:38 +0000 (15:13 +0100)]
[llvm-ar] Remove unused variable. NFC.
Clement Courbet [Tue, 3 Mar 2020 14:09:17 +0000 (15:09 +0100)]
[ExpandMemCmp][NFC] Regenerate tests.
Whitney Tsang [Tue, 3 Mar 2020 14:06:13 +0000 (14:06 +0000)]
Revert "[LoopNest]: Analysis to discover properties of a loop nest."
This reverts commit
3a063d68e3c97136d10a2e770f389e6c13c3b317.
Broke the build with modules enabled:
http://green.lab.llvm.org/green/job/lldb-cmake/10655/console .
Jonas Paulsson [Thu, 27 Feb 2020 16:59:37 +0000 (08:59 -0800)]
[SystemZ] Bugfix for backchain with packed-stack
The incoming back chain slot was implicitly allocated whenever a GPR was
saved in SystemZFrameLowering::getRegSpillOffset(), but in cases where no
GPRs were saved/restored this did not take effect.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D75367
Clement Courbet [Tue, 3 Mar 2020 13:44:00 +0000 (14:44 +0100)]
[ExpandMemCmp] Add more tests to show missing constant folding.
Sam McCall [Tue, 3 Mar 2020 13:53:49 +0000 (14:53 +0100)]
[clangd] Remove unused getDocument() API
gbreynoo [Tue, 3 Mar 2020 13:42:57 +0000 (13:42 +0000)]
[llvm-ar] Fix llvm-ar response file reading on Windows
Response files where not being correctly read on Windows, this change
fixes the issue and adds some tests.
Differential Revision: https://reviews.llvm.org/D69665
Balazs Benics [Tue, 3 Mar 2020 09:57:06 +0000 (10:57 +0100)]
[analyzer][taint] Add isTainted debug expression inspection check
Summary:
This patch introduces the `clang_analyzer_isTainted` expression inspection
check for checking taint.
Using this we could query the analyzer whether the expression used as the
argument is tainted or not. This would be useful in tests, where we don't want
to issue warning for all tainted expressions in a given file
(like the `debug.TaintTest` would do) but only for certain expressions.
Example usage:
```lang=c++
int read_integer() {
int n;
clang_analyzer_isTainted(n); // expected-warning{{NO}}
scanf("%d", &n);
clang_analyzer_isTainted(n); // expected-warning{{YES}}
clang_analyzer_isTainted(n + 2); // expected-warning{{YES}}
clang_analyzer_isTainted(n > 0); // expected-warning{{YES}}
int next_tainted_value = n; // no-warning
return n;
}
```
Reviewers: NoQ, Szelethus, baloghadamsoftware, xazax.hun, boga95
Reviewed By: Szelethus
Subscribers: martong, rnkovacs, whisperity, xazax.hun,
baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy,
Charusso, cfe-commits, boga95, dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74131
Jonas Paulsson [Thu, 20 Feb 2020 04:09:31 +0000 (20:09 -0800)]
[SystemZ] Also accept ISD::USUBO in shouldFormOverflowOp().
Forming subtract with overflow is beneficial on SystemZ, just like additions.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D75290
LLVM GN Syncbot [Tue, 3 Mar 2020 13:33:01 +0000 (13:33 +0000)]
[gn build] Port
3a063d68e3c
LLVM GN Syncbot [Tue, 3 Mar 2020 13:33:01 +0000 (13:33 +0000)]
[gn build] Port
3755039c99d
Kadir Cetinkaya [Sun, 1 Mar 2020 15:05:12 +0000 (16:05 +0100)]
[clangd] Get rid of getTokenRange helper
Summary:
Reviewers: sammccall
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75474
Kadir Cetinkaya [Sun, 1 Mar 2020 15:04:07 +0000 (16:04 +0100)]
[clangd] Make use of token buffers in semantic highlighting
Reviewers: hokein, sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75447
Kadir Cetinkaya [Tue, 3 Mar 2020 07:56:57 +0000 (08:56 +0100)]
[clang][Syntax] Add spelledTokenAt helper to TokenBuffer
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75503
Whitney Tsang [Mon, 2 Mar 2020 20:23:25 +0000 (20:23 +0000)]
[LoopNest]: Analysis to discover properties of a loop nest.
Summary: This patch adds an analysis pass to collect loop nests and
summarize properties of the nest (e.g the nest depth, whether the nest
is perfect, what's the innermost loop, etc...).
The motivation for this patch was discussed at the latest meeting of the
LLVM loop group (https://ibm.box.com/v/llvm-loop-nest-analysis) where we
discussed
the unimodular loop transformation framework ( “A Loop Transformation
Theory and an Algorithm to Maximize Parallelism”, Michael E. Wolf and
Monica S. Lam, IEEE TPDS, October 1991). The unimodular framework
provides a convenient way to unify legality checking and code generation
for several loop nest transformations (e.g. loop reversal, loop
interchange, loop skewing) and their compositions. Given that the
unimodular framework is applicable to perfect loop nests this is one
property of interest we expose in this analysis. Several other utility
functions are also provided. In the future other properties of interest
can be added in a centralized place.
Authored By: etiotto
Reviewer: Meinersbur, bmahjour, kbarton, Whitney, dmgreen, fhahn,
reames, hfinkel, jdoerfert, ppc-slack
Reviewed By: Meinersbur
Subscribers: bryanpkc, ppc-slack, mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D68789
Tyker [Tue, 3 Mar 2020 12:24:16 +0000 (13:24 +0100)]
[AssumeBundles] Add API to fill a map from operand bundles of an llvm.assume.
Summary: This patch adds a new way to query operand bundles of an llvm.assume that is much better suited to some users like the Attributor that need to do many queries on the operand bundles of llvm.assume. Some modifications of the IR like replaceAllUsesWith can cause information in the map to be outdated, so this API is more suited to analysis passes and passes that don't make modification that could invalidate the map.
Reviewers: jdoerfert, sstefan1, uenoku
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75020
Florian Hahn [Tue, 3 Mar 2020 10:28:53 +0000 (10:28 +0000)]
[VPlan] Add getPlan() to VPBlockBase.
This patch adds a getPlan accessor to VPBlockBase, which finds the entry
block of the plan containing the block and returns the plan set for this
block.
VPBlockBase contains a VPlan pointer, but it should only be set for
the entry block of a plan. This allows moving blocks without updating
the pointer for each moved block and in the future we might introduce a
parent relationship between plans and blocks, similar to the one in LLVM IR.
Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D74445
Pavel Labath [Tue, 3 Mar 2020 12:58:56 +0000 (13:58 +0100)]
[lldb] Have Disassembler::ParseInstructions take a Target&
Instead of a ExecutionContext*. All it needs is the target so it can
read the memory.
This removes some defensive checks from the function. I've added
equivalent checks to the callers in cases where a non-null target
pointer was not guaranteed to be available.
Stephan Herhut [Mon, 2 Mar 2020 17:05:42 +0000 (18:05 +0100)]
[MLIR][GPU] Add error checking to loop.parallel to gpu transform.
Summary:
Instead of crashing on malformed input, the pass now produces error
messages.
Differential Revision: https://reviews.llvm.org/D75468
serge-sans-paille [Tue, 3 Mar 2020 12:27:36 +0000 (13:27 +0100)]
Fix UB in compiler-rt base64 implementation
As a follow-up to
1454c27b60447d969d0c1ecaf20b2186fe9d85ec
Pavel Labath [Tue, 3 Mar 2020 12:09:35 +0000 (13:09 +0100)]
[lldb] Add lldbTarget -> llvmMC dependency
The ABI class uses llvm::MCRegisterInfo.
David Green [Tue, 3 Mar 2020 11:30:49 +0000 (11:30 +0000)]
[ARM] Add some postinc LSR tests. NFC
Sam McCall [Tue, 3 Mar 2020 11:44:40 +0000 (12:44 +0100)]
[clangd] Use structured PublishDiagnosticsParams. NFC
Sam McCall [Tue, 3 Mar 2020 11:25:46 +0000 (12:25 +0100)]
[clangd] Send InitializeResult.serverInfo
LLVM GN Syncbot [Tue, 3 Mar 2020 11:18:38 +0000 (11:18 +0000)]
[gn build] Port
1454c27b604
serge-sans-paille [Tue, 3 Mar 2020 10:10:38 +0000 (11:10 +0100)]
Syndicate, test and fix base64 implementation
llvm/Support/Base64, fix its implementation and provide a decent test suite.
Previous implementation code was using + operator instead of | to combine
results, which is a problem when shifting signed values. (0xFF << 16) is
implicitly converted to a (signed) int, and thus results in 0xffff0000,
h is
negative. Combining negative numbers with a + in that context is not what we
want to do.
This is a recommit of
5a1958f2673f8c771e406a7e309e160b432c9a79 with UB removved.
This fixes https://github.com/llvm/llvm-project/issues/149.
Differential Revision: https://reviews.llvm.org/D75057
Sam McCall [Tue, 3 Mar 2020 11:12:14 +0000 (12:12 +0100)]
[clangd] Handle `initialized` notification (no-op to suppress log message)
David Green [Tue, 3 Mar 2020 09:26:00 +0000 (09:26 +0000)]
[LoopVectorizer] Add reduction tests for inloop reductions. NFC
Also adds a force-reduction-intrinsics option for testing, for forcing
the generation of reduction intrinsics even when the backend is not
requesting them.
Unnar Freyr Erlendsson [Tue, 3 Mar 2020 10:22:33 +0000 (11:22 +0100)]
[lldb] Treat RangeDataVector as an augmented binary search tree
Summary:
Since RangeDataVector is assumed to always be sorted we can treat it as
an flattened BST and augment it with additional information about the
ranges belonging to each "subtree". By storing the maximum endpoint in
every subtree we can query for intervals in O(log n) time.
Reviewers: labath, teemperor
Reviewed By: labath
Subscribers: jarin, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74759
Hans Wennborg [Tue, 3 Mar 2020 10:21:11 +0000 (11:21 +0100)]
Pavel Labath [Mon, 2 Mar 2020 14:24:56 +0000 (15:24 +0100)]
[lldb] Make sure we don't drop asynchronous output when sourcing files
Summary:
If a command from a sourced file produces asynchronous output, this
output often does not make its way to the user. This happens because the
asynchronous output machinery relies on the iohandler stack to ensure
the output does not interfere with the things the iohandler is doing.
However, if this happens near the end of the command stream then by the
time the asynchronous output is produced we may already have already
started tearing down the sourcing session. Specifically, we may already
pop the relevant iohandler, leaving the stack empty.
This patch makes sure this kind of output gets printed by adding a
fallback to IOHandlerStack::PrintAsync to print the output directly if
the stack is empty. This is safe because if we have no iohandlers then
there is nothing to synchronize.
Reviewers: JDevlieghere, clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D75454
Clement Courbet [Tue, 3 Mar 2020 10:06:37 +0000 (11:06 +0100)]
[ExpandMemCmp][NFC] Fix typo in comment.
Hans Wennborg [Tue, 3 Mar 2020 08:45:14 +0000 (09:45 +0100)]
Revert
abb00753 "build: reduce CMake handling for zlib" (PR44780)
and follow-ups:
a2ca1c2d "build: disable zlib by default on Windows"
2181bf40 "[CMake] Link against ZLIB::ZLIB"
1079c68a "Attempt to fix ZLIB CMake logic on Windows"
This changed the output of llvm-config --system-libs, and more
importantly it broke stand-alone builds. Instead of piling on more fix
attempts, let's revert this to reduce the risk of more breakages.
Sjoerd Meijer [Tue, 3 Mar 2020 09:58:38 +0000 (09:58 +0000)]
Revert "[Driver] Default to -fno-common for all targets"
This reverts commit
0a9fc9233e172601e26381810d093e02ef410f65.
Going to look at the asan failures.
I find the failures in the test suite weird, because they look
like compile time test and I don't understand how that can be
failing, but will have a brief look at that too.
Nathan James [Tue, 3 Mar 2020 09:58:14 +0000 (09:58 +0000)]
[clangd] DefineOutline won't copy virtual specifiers on methods
Summary:
The define out of line refactor tool previously would copy the `virtual`, `override` and `final` specifier into the out of line method definition.
This results in malformed code as those specifiers aren't allowed outside the class definition.
Reviewers: hokein, kadircet
Reviewed By: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D75429
Jim Lin [Tue, 3 Mar 2020 08:52:20 +0000 (16:52 +0800)]
[AVR] Fix incorrect register state for LDRdPtr
Summary:
LDRdPtr expanded from LDWRdPtr shouldn't define its second operand(SrcReg).
The second operand is its source register.
Add -verify-machineinstrs into command line of testcases can trigger this error.
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75437
Stephan Herhut [Tue, 3 Mar 2020 09:16:08 +0000 (10:16 +0100)]
Revert "[mlir][ods] Add query for derived attribute"
This reverts commit
5aa57c28120127ee526ba702646f5e7239ef08f3.
The source code generated due to this ods change does not compile,
as it passes to few arguments to llvm::is_contained.
Sjoerd Meijer [Tue, 3 Mar 2020 09:12:43 +0000 (09:12 +0000)]
[Driver] Default to -fno-common for all targets
This makes -fno-common the default for all targets because this has performance
and code-size benefits and is more language conforming for C code.
Additionally, GCC10 also defaults to -fno-common and so we get consistent
behaviour with GCC.
With this change, C code that uses tentative definitions as definitions of a
variable in multiple translation units will trigger multiple-definition linker
errors. Generally, this occurs when the use of the extern keyword is neglected
in the declaration of a variable in a header file. In some cases, no specific
translation unit provides a definition of the variable. The previous behavior
can be restored by specifying -fcommon.
As GCC has switched already, we benefit from applications already being ported
and existing documentation how to do this. For example:
- https://gcc.gnu.org/gcc-10/porting_to.html
- https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
Differential revision: https://reviews.llvm.org/D75056
Georgii Rymar [Fri, 21 Feb 2020 11:10:23 +0000 (14:10 +0300)]
[obj2yaml] - Dump allocatable SHT_STRTAB, SHT_SYMTAB and SHT_DYNSYM sections.
Sometimes we need to dump an object and build it again from a YAML
description produced. The problem is that obj2yaml does not dump some
of sections, like string tables and symbol tables.
Because of that yaml2obj implicitly creates them and sections created
are not placed at their original locations. They are added to the end of a section list.
That makes a preparing test cases task harder than it can be.
This patch teaches obj2yaml to dump parts of allocatable SHT_STRTAB, SHT_SYMTAB
and SHT_DYNSYM sections to print placeholders for them.
This also allows to preserve usefull parameters, like virtual address.
Differential revision: https://reviews.llvm.org/D74955
Roman Lebedev [Tue, 3 Mar 2020 08:27:11 +0000 (11:27 +0300)]
[NFC][InstCombine] Add test with non-CSE'd casts of load
in @t0 we can still change type of load and get rid of casts.
Georgii Rymar [Wed, 26 Feb 2020 13:59:43 +0000 (16:59 +0300)]
[obj2yaml] - Split sections dumping to a new ELFDumper<ELFT>::dumpSections() method.
ELFDumper<ELFT>::dump() is too large and deserves splitting.
Differential revision: https://reviews.llvm.org/D75172
Siva Chandra Reddy [Tue, 3 Mar 2020 07:31:03 +0000 (23:31 -0800)]
[libc] Add `errno_h` as a dependency to `sigaddset` and `sigemptyset`.
Summary: The bots are catching this missing dependency.
Reviewers: PaulkaToast, abrachet
Subscribers: mgorny, MaskRay, tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D75502