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
Awanish Pandey [Tue, 3 Mar 2020 07:37:26 +0000 (13:07 +0530)]
[DebugInfo][DWARF5]: Added support for debuginfo generation for defaulted parameters
This patch adds support for dwarf emission/dumping part of debuginfo
generation for defaulted parameters.
Reviewers: probinson, aprantl, dblaikie
Reviewed By: aprantl, dblaikie
Differential Revision: https://reviews.llvm.org/D73462
Sameer Sahasrabuddhe [Fri, 28 Feb 2020 17:17:35 +0000 (22:47 +0530)]
[AMDGPU] add generated checks for some LIT tests
This is in prepration for further changes that affect these tests.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D75403
Alok Kumar Sharma [Tue, 3 Mar 2020 04:20:13 +0000 (09:50 +0530)]
[DebugInfo] Avoid generating duplicate llvm.dbg.value
Summary:
This is to avoid generating duplicate llvm.dbg.value instrinsic if it already exists after the Instruction.
Before inserting llvm.dbg.value instruction, LLVM checks if the same instruction is already present before the instruction to avoid duplicates.
Currently it misses to check if it already exists after the instruction.
flang generates IR like this.
%4 = load i32, i32* %i1_311, align 4, !dbg !42
call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
When this IR is processed in llvm, it ends up inserting duplicates.
%4 = load i32, i32* %i1_311, align 4, !dbg !42
call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
call void @llvm.dbg.value(metadata i32 %4, metadata !35, metadata !DIExpression()), !dbg !33
We have now updated LdStHasDebugValue to include the cases when instruction is already
followed by same dbg.value instruction we intend to insert.
Now,
Definition and usage of function LdStHasDebugValue are deleted.
RemoveRedundantDbgInstrs is called for the cleanup of duplicate dbg.value's
Testing:
Added unit test for validation
check-llvm
check-debuginfo (the debug info integration tests)
Reviewers: aprantl, probinson, dblaikie, jmorse, jini.susan.george
SouraVX, awpandey, dstenb, vsk
Reviewed By: aprantl, jmorse, dstenb, vsk
Differential Revision: https://reviews.llvm.org/D74030
Eric Christopher [Tue, 3 Mar 2020 04:12:12 +0000 (20:12 -0800)]
Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
Due to Werror breakage.
This reverts commits
a68235d583fccb465694fdfd72eeb8d45d3369c0 and
bcee8982a2931960ca29a9e95e3d10355e7393ab.
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.
```
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.
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
David Blaikie [Tue, 3 Mar 2020 03:30:03 +0000 (19:30 -0800)]
DebugInfo: Separate different debug_macinfo contributions & print the offset of a contribution
Juneyoung Lee [Sat, 29 Feb 2020 13:00:44 +0000 (22:00 +0900)]
[LICM] Allow freeze to hoist/sink out of a loop
Summary: This patch allows LICM to hoist/sink freeze instructions out of a loop.
Reviewers: reames, fhahn, efriedma
Reviewed By: reames
Subscribers: jfb, lebedev.ri, hiraditya, asbirlea, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75400
Shengchen Kan [Tue, 3 Mar 2020 03:10:54 +0000 (11:10 +0800)]
Temporarily Revert [X86] Not track size of the boudaryalign fragment during the layout
Summary: This reverts commit
2ac19feb1571960b8e1479a451b45ab56da7034e.
This commit causes some test cases to run fail when branch is aligned.
Nico Weber [Tue, 3 Mar 2020 02:01:50 +0000 (21:01 -0500)]
fix typo
Fred Riss [Tue, 3 Mar 2020 01:52:30 +0000 (17:52 -0800)]
[lldb/GDBRemote] Fix obvious typo in error message.
It's unlikely that `errno` is the value the user wants to see in this
error message.
Fangrui Song [Sun, 1 Mar 2020 20:06:51 +0000 (12:06 -0800)]
[LTO] onfig::addSaveTemps: clear ResolutionFile upon an error
Otherwise ld.lld -save-temps will crash when writing to ResolutionFile.
llvm-lto2 -save-temps does not crash because it exits immediately.
Reviewed By: evgeny777
Differential Revision: https://reviews.llvm.org/D75426
Fred Riss [Thu, 6 Feb 2020 05:47:33 +0000 (21:47 -0800)]
[lldb/API] NFC: Reformat and simplify SBThread::GetStopDescription()
Summary:
This gets rid of some nesting and of the raw char* variable that caused
the memory management bug we hit recently.
This commit also removes the fallback code which should trigger when
the StopInfo provides no stop description. All currently implemented
StopInfos have a `GetDescription()` method that shouldn't return an
empty description.
Reviewers: JDevlieghere, labath, mib
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74157
Jim Lin [Mon, 2 Mar 2020 10:46:22 +0000 (18:46 +0800)]
[AVR] Add missing ROLLOOP and RORLOOP into getTargetNodeName
Cyndy Ishida [Tue, 3 Mar 2020 00:58:14 +0000 (16:58 -0800)]
[llvm][MachO] fix adding weak def syms
the weak defined symbol flag was missing from the call site for adding
symbols which didn't cause issues because it invoked the default
parameter.
Vedant Kumar [Tue, 3 Mar 2020 00:56:17 +0000 (16:56 -0800)]
[LiveDebugValues] Prevent some misuse of LocIndex::fromRawInteger, NFC
Make it a compile-time error to pass an int/unsigned/etc to
fromRawInteger.
Hopefully this prevents errors of the form:
```
for (unsigned ID : getVarLocs()) {
auto VL = LocMap[LocIndex::fromRawInteger(ID)];
...
```
Erik Pilkington [Tue, 3 Mar 2020 00:30:16 +0000 (16:30 -0800)]
[Sema] Fix a crash when attaching comments to an implicit decl
When an implicitly generated decl was the first entry in the group, we
attempted to lookup comments with an empty FileID, leading to crashes. Avoid
this by trying to use the other declarations in the group, and then bailing out
if none are valid.
rdar://
59919733
Differential revision: https://reviews.llvm.org/D75483
Huihui Zhang [Tue, 3 Mar 2020 00:11:50 +0000 (16:11 -0800)]
[ARM][ConstantIslands] Fix stack mis-alignment caused by undoLRSpillRestore.
Summary:
It is not safe for ARMConstantIslands to undoLRSpillRestore. PrologEpilogInserter is
the one to ensure stack alignment, taking into consideration LR is spilled or not.
For noreturn function with StackAlignment 8 (function contains call/alloc),
undoLRSpillRestore cause stack be mis-aligned. Fixing stack alignment in
ARMConstantIslands doesn't give us much benefit, as undo LR spill/restore only
occur in large function with near branches only, also doesn't have callee-saved LR spill.
Reviewers: t.p.northover, rengolin, efriedma, apazos, samparker, ostannard
Reviewed By: ostannard
Subscribers: dmgreen, ostannard, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75288
Petr Hosek [Tue, 3 Mar 2020 00:07:18 +0000 (16:07 -0800)]
[libcxx] Drop -D option from libtool when merging archives
This is a follow up to D74108. This option is not supported by older
versions of libtool so remove it. We keep the -s option to build the
index.
Jonas Devlieghere [Mon, 2 Mar 2020 23:53:59 +0000 (15:53 -0800)]
[lldb/Utility] Use emplace_back instead of push_back (NFC)
Use emplace_back to allow for in-place construction of the
BroadcastEventSpec instead of copying it.
Greg Clayton [Mon, 2 Mar 2020 23:37:27 +0000 (15:37 -0800)]
Fix GSYM tests to run the yaml files and fix test failures on some machines.
YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Also fixed an issue where strings for files in the file table could be added in opposite order due to parameters to function calls not having a strong ordering, which caused tests to fail. Added new arch specfic directories so when targets are not enabled, we continue to function just fine.
Differential Revision: https://reviews.llvm.org/D75390
Raphael Isemann [Mon, 2 Mar 2020 22:45:53 +0000 (14:45 -0800)]
[lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make it deterministic
Summary:
Currently `SymbolFileDWARF::TypeSet` is a typedef to a `std::set<Type *>`.
In `SymbolFileDWARF::GetTypes` we iterate over a TypeSet variable when finding
types so that logic is non-deterministic as it depends on the actual pointer address values.
This patch changes the `TypeSet` to a `llvm::UniqueVector` which always iterates in
the order in which we inserted the types into the list.
Reviewers: JDevlieghere, aprantl
Reviewed By: JDevlieghere
Subscribers: mgrang, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D75481
Philip Reames [Mon, 2 Mar 2020 22:57:11 +0000 (14:57 -0800)]
Use range-for in MCAssembler [NFC]
Davide Italiano [Mon, 2 Mar 2020 22:55:05 +0000 (14:55 -0800)]
[docs] Use 0 as version placeholder instead of a made up number.
While here, explain that this is not really used. Probably NFC.
Eric Christopher [Mon, 2 Mar 2020 22:44:38 +0000 (14:44 -0800)]
Temporarily Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
as it broke the Werror build:
.../sources/llvm-project/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h:85:16: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
char padding[detail::nextPowerOf2<sizeof(T[Dim])>() - sizeof(T[Dim])];
^~~~~~~~~~~~~~~
This reverts commit
78f9e5d098af95610f4542ee41479d7931261066.
Philip Reames [Mon, 2 Mar 2020 21:21:53 +0000 (13:21 -0800)]
[BranchAlign] Fix bug w/nop padding for SS manipulation
X86 has several instructions which are documented as enabling interrupts exactly one instruction *after* the one which changes the SS segment register. Inserting a nop between these two instructions allows an interrupt to arrive before the execution of the following instruction which changes semantic behaviour.
The list of instructions is documented in "Table 24-3. Format of Interruptibility State" in Volume 3c of the Intel manual. They basically all come down to different ways to write to the SS register.
Differential Revision: https://reviews.llvm.org/D75359
Sumanth Gundapaneni [Mon, 2 Mar 2020 22:32:19 +0000 (16:32 -0600)]
Update LSR's logic that identifies a post-increment SCEV value.
One of the checks has been removed as it seem invalid.
The LoopStep size is always almost a 32-bit.
Differential Revision: https://reviews.llvm.org/D75079
Jordan Rupprecht [Mon, 2 Mar 2020 22:23:17 +0000 (14:23 -0800)]
Add default case to fix -Wswitch errors
Jonas Devlieghere [Mon, 2 Mar 2020 22:01:55 +0000 (14:01 -0800)]
[lldb/Docs] Remove the version from the home page
Craig Topper [Mon, 2 Mar 2020 22:12:16 +0000 (14:12 -0800)]
[TargetLowering] Fix what look like copy/paste mistakes in compare with infinity handling SimplifySetCC.
I expect that the isCondCodeLegal checks should match that CC of
the node that we're going to create.
Rewriting to a switch to minimize repeated mentions of the same
constants.
Teresa Johnson [Mon, 2 Mar 2020 21:09:56 +0000 (13:09 -0800)]
Revert "Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP""
This reverts commit
80d0a137a5aba6998fadb764f1e11cb901aae233, and the
follow on fix in
873c0d0786dcf22f4af39f65df824917f70f2170. It is
causing test failures after a multi-stage clang bootstrap. See
discussion on D73242 and D75201.
Joerg Sonnenberger [Mon, 2 Mar 2020 17:24:11 +0000 (18:24 +0100)]
Explicitly include <cassert> when using assert
Depending on the OS used, a module-enabled build can fail due to the
special handling <cassert> gets as textual header.
Luboš Luňák [Mon, 2 Mar 2020 21:31:37 +0000 (22:31 +0100)]
Revert "[clang] detect switch fallthrough marked by a comment (PR43465)"
This reverts commit
398b4ed87d488b42032c8d0304324dce76ba9b66.
As requested in https://bugs.llvm.org/show_bug.cgi?id=43465#c37 .
Jacques Pienaar [Mon, 2 Mar 2020 21:26:16 +0000 (13:26 -0800)]
[mlir][ods] Add query for derived attribute
For ODS generated operations enable querying whether there is a derived
attribute with a given name.
Greg Clayton [Mon, 2 Mar 2020 21:07:58 +0000 (13:07 -0800)]
Revert "Fix GSYM tests to run the yaml files and fix test failures on some machines."
This reverts commit
57688350adea307e7bccb83b68a5b7333de31fd7.
Need to conditionalize for ARM targets, this is failing on machines that don't have ARM targets.
Greg Clayton [Mon, 2 Mar 2020 20:40:46 +0000 (12:40 -0800)]
Fix GSYM tests to run the yaml files and fix test failures on some machines.
YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Also fixed an issue where strings for files in the file table could be added in opposite order due to parameters to function calls not having a strong ordering, which caused tests to fail.
Differential Revision: https://reviews.llvm.org/D75390
Hiroshi Yamauchi [Thu, 27 Feb 2020 18:49:04 +0000 (10:49 -0800)]
[PSI] Add the isCold query support with a given percentile value.
Summary: This follows up D67377 that added the isHot side.
Reviewers: davidxl
Subscribers: eraman, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75283
Alexandre Ganea [Mon, 2 Mar 2020 20:41:47 +0000 (15:41 -0500)]
[Clang] Fix Hurd toolchain test on a two-stage build with ThinLTO
A two-stage ThinLTO build previously failed the clang/test/Driver/hurd.c test because of a static_cast in "tools::gnutools::Linker::ConstructJob()" which wrongly converted an instance of "clang::driver::toolchains::Hurd" into that of "clang::driver::toolchains::Linux". ThinLTO would later devirtualize the "ToolChain.getDynamicLinker(Args)" call and use "Linux::getDynamicLinker()" instead, causing the test to generate a wrong "-dynamic-linker" linker flag (/lib/ld-linux.so.2 instead of /lib/ld.so)
Fixes PR45061.
Differential Revision: https://reviews.llvm.org/D75373
Alexey Bataev [Mon, 2 Mar 2020 15:25:58 +0000 (10:25 -0500)]
[LIBOMPTARGET]Lower priority of global constructor/destructor to silence the warning from gcc.
Summary: fixed the warning from gcc since prios 0-100 are reserved for the internal use.
Reviewers: grokos
Subscribers: kkwli0, caomhin, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D75458
Stanislav Mekhanoshin [Fri, 28 Feb 2020 20:28:45 +0000 (12:28 -0800)]
Extend LaneBitmask to 64 bit
This is needed for D74873, AMDGPU going to have 16 bit subregs
and the largest tuple is 32 VGPRs, which results in 64 lanes.
Differential Revision: https://reviews.llvm.org/D75378
Sid Manning [Mon, 2 Mar 2020 20:08:57 +0000 (14:08 -0600)]
Revert "Add default paths to support musl target"
This reverts commit
637767665141ae48c7a0558903bb29e03bf5ad6f.
Need to fix the testcase.
Vedant Kumar [Mon, 2 Mar 2020 19:45:02 +0000 (11:45 -0800)]
[test/compiler-rt] Disable ubsan/TestCases/Misc/nullability.c on Android
It looks like the suppression file isn't being copied over to the
device.
Vedant Kumar [Mon, 2 Mar 2020 19:37:19 +0000 (11:37 -0800)]
[Coverage] Collect all function records in an object (D69471 followup)
After the format change from D69471, there can be more than one section
in an object that contains coverage function records. Look up each of
these sections and concatenate all the records together.
This re-enables the instrprof-merging.cpp test, which previously was
failing on OSes which use comdats.
Thanks to Jeremy Morse, who very kindly provided object files from the
bot I broke to help me debug.
Alexey Bataev [Mon, 2 Mar 2020 19:21:20 +0000 (14:21 -0500)]
[OPENMP50]Support 'destroy' clause on 'depobj' directives.
Added basic support (parsing/sema/serialization) for 'destroy' clause in
depobj directives.
Sid Manning [Fri, 21 Feb 2020 19:36:41 +0000 (13:36 -0600)]
Add default paths to support musl target
Pickup the default crt and libs when the target is musl.
Differential Revision: https://reviews.llvm.org/D75139
Erik Pilkington [Mon, 2 Mar 2020 18:27:41 +0000 (10:27 -0800)]
[Sema] Look through OpaqueValueExpr when checking implicit conversions
Specifically, this fixes a false-positive in -Wobjc-signed-char-bool.
rdar://
57372317
Differential revision: https://reviews.llvm.org/D75387
Petr Hosek [Thu, 6 Feb 2020 03:42:18 +0000 (19:42 -0800)]
[libcxx] When merging archives, build index even on Darwin
We always want to build the table of contents. Additionally, we also
set the flag to make the output deterministic which is already the
default for llvm-ar.
Differential Revision: https://reviews.llvm.org/D74108
Raphael Isemann [Mon, 2 Mar 2020 18:24:59 +0000 (10:24 -0800)]
[lldb] Remove checks behind LLDB_CONFIGURATION_DEBUG from TypeSystemClang
Summary:
This function is (supposed) to be a list of asserts that just do a generic sanity check
on declarations we return. Right now this function is hidden behind the
LLDB_CONFIGURATION_DEBUG macro which means it will *only* be run in
debug builds (but not Release+assert builds and so on).
As we have not a single CI running in Debug build, failures in VerifyDecl are hidden
from us until someone by accident executes the tests in Debug mode on their own machine.
This patch removes the `ifdef`'s for LLDB_CONFIGURATION_DEBUG and puts
the `getAccess()` call in `VerifyDecl` behind a `#ifndef NDEBUG` to make sure
that this function is just an empty function with internal linkage when NDEBUG
is defined (so compilers should just optimize away the calls to it).
Reviewers: aprantl
Reviewed By: aprantl
Subscribers: shafik, abidh, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D75330
Jessica Paquette [Mon, 2 Mar 2020 18:49:18 +0000 (10:49 -0800)]
[AArch64][MachineOutliner] Don't outline CFI instructions
CFI instructions can only safely be outlined when the outlined call is a tail
call, or when the outlined frame is fixed up.
For the sake of correctness, disable outlining from CFI instructions.
Add machine-outliner-cfi.mir to test this.
Simon Pilgrim [Mon, 2 Mar 2020 18:22:58 +0000 (18:22 +0000)]
Fix shadow variable warning. NFC.
Simon Pilgrim [Mon, 2 Mar 2020 18:10:15 +0000 (18:10 +0000)]
Fix 'unsigned variable can never be negative' cppcheck warning. NFCI.
Alexey Bataev [Fri, 28 Feb 2020 14:52:15 +0000 (09:52 -0500)]
[OPENMP50]Add basic support for depobj construct.
Added basic parsing/sema/serialization support for depobj directive.