Georgii Rymar [Wed, 13 May 2020 12:06:01 +0000 (15:06 +0300)]
[llvm-readobj] - --gnu-hash-table: do not crash when the GNU hash table goes past the EOF.
We might have a scenario where a the `GbuHashTable` variable correctly points
to a place inside the file (we validate this fact early in `parseDynamicTable`),
but nbuckets/maskwords fields are broken in the way the code tries
to read the data past the EOF. This patch fixes the issue.
Differential revision: https://reviews.llvm.org/D79853
Georgii Rymar [Mon, 27 Apr 2020 08:46:49 +0000 (11:46 +0300)]
[yaml2obj] - Introduce the "Offset" property for sections.
Currently there is no good way to set a physical offset for a section:
* We have the `ShOffset` that allows to override the `sh_offset`, but
it does not affect the real data written.
* We can use a `Filler` to create an artificial gap, but it is more like a hack
rather than a proper solution for this problem.
This patch adds the `Offset` property which allows setting physical
offsets for sections.
It also generalizes the code, so that we set sh_offset field in one place
Differential revision: https://reviews.llvm.org/D78927
Alex Zinenko [Fri, 15 May 2020 08:20:04 +0000 (10:20 +0200)]
[mlir] LinalgToStandard: add build dependency on MLIRPass
This is supposed to resolve the build problem with shared libraries.
Djordje Todorovic [Fri, 15 May 2020 07:24:02 +0000 (09:24 +0200)]
[CSInfo][ISEL] Call site info generation support for Mips
Debug entry values functionality provides debug information about
call sites and function parameters values at the call entry spot.
Condition for generating this type of information is
compiling with -g option and optimization level higher
than zero(-O0).
In ISEL phase, while lowering call instructions, collect info
about registers that forward arguments into following
function frame. We store such info into MachineFunction of
the caller function. This is used very late, when dumping DWARF
info about call site parameters.
The call site info is visible at MIR level, as callSites attribute
of MachineFunction. Also, when using unmodified parameter value
inside callee it could be described as DW_OP_entry_value expression.
To deal with callSites attribute, we should pass
-emit-call-site-info option to llc.
This patch enables functionality in clang frontend and adds
call site info generation support for MIPS targets
(mips, mipsel, mips64, mips64el).
Patch by Nikola Tesic
Differential Revision: https://reviews.llvm.org/D78105
Raphael Isemann [Fri, 15 May 2020 07:29:38 +0000 (09:29 +0200)]
[lldb] Print full Clang diagnostics when the ClangModulesDeclVendor fails to compile a module
Summary:
When the ClangModulesDeclVendor currently fails it just prints very basic and often incomplete diagnostics without any source locations:
```
(lldb) p @import Foundation
error: while importing modules:
'foo/bar.h' file not found
could not build module 'Darwin'
[...]
```
or even just
```
(lldb) p @import Foundation
error: while importing modules:
could not build module 'Darwin'
[...]
```
These diagnostics help neither the user nor us with figuring out what is the reason for the failure.
This patch wires up a full TextDiagnosticPrinter in the ClangModulesDeclVendor and makes
sure we always return the error stream to the user when we fail to compile our modules.
Fixes rdar://
63216849
Reviewers: aprantl, jdoerfert
Reviewed By: aprantl
Subscribers: JDevlieghere
Differential Revision: https://reviews.llvm.org/D79947
Akira Hatanaka [Mon, 23 Mar 2020 06:47:01 +0000 (23:47 -0700)]
[Sema] Teach -Wcast-align to compute an accurate alignment using the
alignment information on VarDecls in more cases
This commit improves upon https://reviews.llvm.org/D21099. The code that
computes the source alignment now understands array subscript
expressions, binary operators, derived-to-base casts, and several more
expressions.
rdar://problem/
59242343
Differential Revision: https://reviews.llvm.org/D78767
Michael Schellenberger Costa [Fri, 15 May 2020 07:52:24 +0000 (09:52 +0200)]
[libcxx][span] trivial whitespace fix to test commit rights
Reviewers: #libc!, miscco
Reviewed By: miscco
Subscribers: broadwaylamb, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D79986
David Sherwood [Tue, 5 May 2020 12:26:55 +0000 (13:26 +0100)]
[SVE] Fix wrong usage of getNumElements() in matchIntrinsicType
I have changed the ScalableVecArgument case in matchIntrinsicType
to create a new FixedVectorType. This means that the next case we
hit (Vector) will not assert when calling getNumElements(), since
we know that it's always a FixedVectorType. This is a temporary
measure for now, and it will be fixed properly in another patch
that refactors this code.
The changes are covered by this existing test:
CodeGen/AArch64/sve-intrinsics-fp-converts.ll
In addition, I have added a new test to ensure that we correctly
reject SVE intrinsics when called with fixed length vector types.
Differential Revision: https://reviews.llvm.org/D79416
Russell Gallop [Tue, 12 May 2020 10:54:18 +0000 (11:54 +0100)]
[ELF] Update release notes and man page for LLD time-trace
Differential Revision: https://reviews.llvm.org/D79780
Li Rong Yi [Fri, 15 May 2020 06:56:27 +0000 (06:56 +0000)]
[PowerPC] Add an intrinsic for Popcntb
Summary: This patch adds the intrinsic llvm.ppc.popcntb for the HW
instruction POPCNTB
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D79703
Djordje Todorovic [Fri, 15 May 2020 07:09:48 +0000 (09:09 +0200)]
[NFC][test] Add missing ':' after 'CHECK'
Without the ':' the check command doesn't do anything.
This typo was introduced along with the commit for the D77789.
Sourabh Singh Tomar [Fri, 15 May 2020 06:57:57 +0000 (12:27 +0530)]
Fixed bot failure after
ab699d78a26f147b
Added `target triple` to the test case, it was failing on
aarch64 bot:
http://lab.llvm.org:8011/builders/flang-aarch64-ubuntu/builds/97
Gongyu Deng [Fri, 15 May 2020 06:34:24 +0000 (08:34 +0200)]
Correct the argument list of command `breakpoint read`
Summary: Command `breakpoint read` should not accept breakpoint ids as
arguments, and in fact, it is not implemented to deal with breakpoint id
arguments either. So this patch is to correct the argument list of this
command so that the help text won't misguide users.
Reviewers: teemperor, JDevlieghere, jingham
Reviewed By: teemperor, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D79722
Yvan Roux [Fri, 15 May 2020 06:44:23 +0000 (08:44 +0200)]
[ARM][MachineOutliner] Add Machine Outliner support for ARM.
Enables Machine Outlining for ARM and Thumb2 modes. This is the first
patch of the series which adds all the basic logic for the support, and
only handles tail-calls and thunks.
The outliner can be turned on by using clang -moutline option or -mllvm
-enable-machine-outliner one (like AArch64).
Differential Revision: https://reviews.llvm.org/D76066
Sourabh Singh Tomar [Fri, 15 May 2020 06:31:51 +0000 (12:01 +0530)]
Fixed bot failure after
4042ada1c1fe4a9cd5
Added '-' in `mtriple` in test case
There was a bot failure due to this:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/6790
David Sherwood [Thu, 14 May 2020 10:18:31 +0000 (11:18 +0100)]
[CodeGen] Refactor CreateStackTemporary
I've created a new variant of CreateStackTemporary that takes
TypeSize and Align arguments, and made the older instances of
CreateStackTemporary call this new function. This refactoring is
in preparation for more patches in this area related to scalable
vectors and improving the alignment calculations.
Differential Revision: https://reviews.llvm.org/D79933
Alok Kumar Sharma [Fri, 15 May 2020 05:54:27 +0000 (11:24 +0530)]
[DebugInfo] support for DW_AT_data_location in llvm
This patch adds support for DWARF attribute DW_AT_data_location.
Summary:
Dynamic arrays in fortran are described by array descriptor and
data allocation address. Former is mapped to DW_AT_location and
later is mapped to DW_AT_data_location.
Testing:
unit test cases added (hand-written)
check llvm
check debug-info
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D79592
Sourabh Singh Tomar [Fri, 15 May 2020 05:50:52 +0000 (11:20 +0530)]
[NFCI] Removed '%' from llc in test case in
ab699d78a26f147b
Alok Kumar Sharma [Fri, 15 May 2020 05:28:29 +0000 (10:58 +0530)]
[DebugInfo] llvm rejects DWARF operator DW_OP_push_object_address
llvm rejects DWARF operator DW_OP_push_object_address.This DWARF
operator is needed for Flang to support allocatable array.
Summary:
Currently llvm rejects DWARF operator DW_OP_push_object_address.
below error is produced when llvm finds this operator.
[..]
invalid expression
!DIExpression(151)
warning: ignoring invalid debug info in pushobj.ll
[..]
There are some parts missing in support of this operator, need to
be completed.
Testing
-added a unit testcase
-check-debuginfo
-check-llvm
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D79306
Mircea Trofin [Fri, 15 May 2020 05:32:44 +0000 (22:32 -0700)]
Revert "[llvm][NFC] Cleanup uses of std::function in Inlining-related APIs"
This reverts commit
767db5be67cab5aa04d81227725765cad9620611.
Mircea Trofin [Thu, 14 May 2020 00:40:07 +0000 (17:40 -0700)]
[llvm][NFC] Cleanup uses of std::function in Inlining-related APIs
Summary:
Replacing uses of std::function pointers or refs, or Optional, to
function_ref, since the usage pattern allows that. If the function is
optional, using a default parameter value (nullptr). This led to a few
parameter reshufles, to push all optionals to the end of the parameter
list.
Reviewers: davidxl, dblaikie
Subscribers: arsenm, jvesely, nhaehnle, eraman, hiraditya, haicheng, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79917
MaheshRavishankar [Fri, 15 May 2020 04:47:50 +0000 (21:47 -0700)]
[mlir][GPUToSPIRV] Use default ABI only when none of the arguments
have abi attributes.
To ensure there is no conflict, use the default ABI only when none of
the arguments have the spv.interface_var_abi attribute. This also
implies that if one of the arguments has a spv.interface_var_abi
attribute, all of them should have it as well.
Differential Revision: https://reviews.llvm.org/D77232
Nicolas Vasilache [Fri, 15 May 2020 04:22:21 +0000 (00:22 -0400)]
[mlir][Linalg] Start a LinalgToStandard pass and move conversion to library calls.
This revision starts decoupling the include the kitchen sink behavior of Linalg to LLVM lowering by inserting a -convert-linalg-to-std pass.
The lowering of linalg ops to function calls was previously lowering to memref descriptors by having both linalg -> std and std -> LLVM patterns in the same rewrite.
When separating this step, a new issue occurred: the layout is automatically type-erased by this process. This revision therefore introduces memref casts to perform these type erasures explicitly. To connect everything end-to-end, the LLVM lowering of MemRefCastOp is relaxed because it is artificially more restricted than the op semantics. The op semantics already guarantee that source and target MemRefTypes are cast-compatible. An invalid lowering test now becomes valid and is removed.
Differential Revision: https://reviews.llvm.org/D79468
Hubert Tong [Fri, 15 May 2020 03:57:22 +0000 (23:57 -0400)]
Speculative fix for build breakage from D78403
D78403 appears responsible for breaking bots:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/12261/steps/build%20stage%201/logs/stdio
Kang Zhang [Fri, 15 May 2020 02:35:33 +0000 (02:35 +0000)]
[MachineVerifier] Use the for_range loop to instead llvm::any_of
Summary:
In the patch D78849, it uses llvm::any_of to instead of for loop to
simplify the function addRequired().
It's obvious that above code is not a NFC conversion. Because any_of
will return if any addRequired(Reg) is true immediately, but we want
every element to call addRequired(Reg).
This patch uses for_range loop to fix above any_of bug.
Reviewed By: MaskRay, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D79872
Eric Christopher [Fri, 15 May 2020 02:16:45 +0000 (19:16 -0700)]
Temporarily Revert "[Support] Make UniqueStringSaver wrap a StringSet"
as it's causing asan failures in clangd. Followed up offline
with repro instructions.
This reverts commit
29560a89ddcaf3af9b8a73d98d968a0911d21e27.
Valentin Clement [Fri, 15 May 2020 01:34:33 +0000 (21:34 -0400)]
[Flang][OpenMP] Avoid abort when collapse clause value is negative
Summary:
If the value in the collapse close is negative f18 abort without the correct error message. This PR change the size_t in name resolution to a int64_t and check appropriately for negative or zero before the privatization of induction variable.
The correct error is then catch by the OpenMP structure check.
This diff is migrated from the GitHub pull request https://github.com/flang-compiler/f18/pull/1098
Reviewers: ichoyjx, jdoerfert, sscalpone, DavidTruby
Reviewed By: ichoyjx, sscalpone, DavidTruby
Subscribers: sscalpone, klausler, yaxunl, guansong, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D77821
Jonas Devlieghere [Fri, 15 May 2020 00:57:10 +0000 (17:57 -0700)]
[lldb/Test] Modify more tests for API replay
Skip tests or parts thereof that aren't expected to work when run from a
reproducer. Also improve the doc comments in configuration.py to prevent
mistakes in the future.
Joel E. Denny [Fri, 15 May 2020 00:24:09 +0000 (20:24 -0400)]
[FileCheck] Fix isalpha/isalnum calls
D79276 caused the following builder to fail:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23489
Specifically, FileCheck dumped stack in the following tests:
LLVM :: MC/Mips/micromips-jump-pc-region.s
LLVM :: MC/Mips/mips-jump-pc-region.s
Those tests contained characters encoded as 160 but that render (at
least for me in vim) like a single space (32). Those characters
appeared between the `#` and `RUN:` on several lines, and D79276
caused FileCheck to process those lines differently: `RUN:` is a
comment directive. As a result, D79276 caused FileCheck to start
calling is `isalnum` on those characters.
The problem is that FileCheck calls `isalnum` on type `char` without
casting to `unsigned char` first, so it sign-extends 160 beyond what
`unsigned char` or `EOF` can represent. C says that has undefined
behavior. This problem is general to FileCheck's prefix parsing and
so exists independently of D79276.
524457edbc3d fixed the above tests. This patch changes FileCheck to
use LLVM's replacements for `ctype.h` functions, and it adds tests for
cases that are representative with or without D79276.
Reviewed By: jhenderson, thopre, efriedma
Differential Revision: https://reviews.llvm.org/D79810
Davide Italiano [Thu, 14 May 2020 23:48:53 +0000 (16:48 -0700)]
[LICM] When promoting loads to the preheader, drop the location.
It's really almost going to be misleading, see the example in
https://bugs.llvm.org/show_bug.cgi?id=45820
Maybe at some point we can do something fancier, but at least
this will fix a bug where we step on dead code while debugging.
Leonard Chan [Fri, 15 May 2020 00:00:11 +0000 (17:00 -0700)]
[Fuchsia] Do not enable the Z3 solver for a fuchsia toolchain
gLinux started shipping incompatible versions of Z3, which can lead to a
missing `z3.h` header when building the Z3 solver locally. This patch
disables the Z3 solver when building a clang toolchain for Fuchsia.
Differential Revision: https://reviews.llvm.org/D79974
Nico Weber [Thu, 14 May 2020 23:37:05 +0000 (19:37 -0400)]
Revert "[GlobalISel][InlineAsm] Add early return for memory inputs that need to be indirectified"
This reverts commit
887dfeec53ad5e564e9990c433e5b53f2e651dbf.
It broke irtranslator-inline-asm.ll on many bots, e.g.
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/38606/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Airtranslator-inline-asm.ll
Vedant Kumar [Thu, 14 May 2020 23:08:07 +0000 (16:08 -0700)]
llvm/test: Check in suppressions file left out of
f26823c9d
Mircea Trofin [Thu, 14 May 2020 22:42:26 +0000 (15:42 -0700)]
[llvm] Fix refactoring bug introduced in D79042
Incorrectly copied over the GetAssumptionCache snippet.
This patch also renames a variable for clarity.
Jonas Devlieghere [Thu, 14 May 2020 22:48:03 +0000 (15:48 -0700)]
[lldb/Test] Replace assertTrue with more specific checks (NFC)
Use assertEqual(a, b) instead of assertTrue(a == b) etc.
Vedant Kumar [Thu, 14 May 2020 22:13:54 +0000 (15:13 -0700)]
[test/dsymutil] Suppress LeakSanitizer on ARM dsymutil tests
Just like on X86, we're getting reports of bogus leaks from
CoreFoundation in:
[_CFXPreferences(SourceAdditions) withSourceForIdentifier:user:byHost:container:cloud:perform:]
rdar://
63238710
Stanislav Mekhanoshin [Wed, 13 May 2020 20:13:16 +0000 (13:13 -0700)]
[AMDGPU] Peephole adjacent equivalent S_SET_GPR_IDX_ON
Differential Revision: https://reviews.llvm.org/D79907
Leonard Chan [Thu, 14 May 2020 22:19:27 +0000 (15:19 -0700)]
Revert "Run Coverage pass before other *San passes under new pass manager"
This reverts commit
7d5bb94d78386e4653535c35d3e8258bf4502340.
Reverting since this leads to a linker error we're seeing on Fuchsia.
The underlying issue seems to be that inlining is run after sanitizers
and causes different comdat groups instrumented by Sancov to reference
non-key symbols defined in other comdat groups.
Will re-land this patch after a fix for that is landed.
Alexandre Rames [Thu, 14 May 2020 22:09:30 +0000 (15:09 -0700)]
[clang][VerifyDiagnosticConsumer] Support filename wildcards
Differential Revision: https://reviews.llvm.org/D72100
Alexey Bataev [Thu, 30 Apr 2020 15:27:36 +0000 (11:27 -0400)]
[OPENMP50]Codegen for uses_allocators clause.
Summary:
Predefined allocators should not be mapped at all (they are just enumeric
constants). FOr user-defined allocators need to map the traits only as
firstprivates, the allocator itself is private.
At the beginning of the target region the user-defined allocatores must
be created and then destroyed at the end of the target region:
```
omp_allocator_handle_t my_allocator = __kmpc_init_allocator(<gtid>,
/*default memhandle*/ 0, <number_of_traits>, &<traits>);
...
call void @__kmpc_destroy_allocator(<gtid>, my_allocator);
```
Reviewers: jdoerfert, aaron.ballman
Subscribers: jholewinski, yaxunl, guansong, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79257
Stanislav Mekhanoshin [Thu, 14 May 2020 18:57:19 +0000 (11:57 -0700)]
[AMDGPU] Make v16f64/v16i64 legal
This allows indirect VGPR addressing to work.
Differential Revision: https://reviews.llvm.org/D79960
Konstantin Schwarz [Thu, 14 May 2020 19:02:37 +0000 (21:02 +0200)]
[GlobalISel][InlineAsm] Add early return for memory inputs that need to be indirectified
Summary:
D78319 introduced basic support for inline asm input operands in GlobalISel.
However, that patch did not handle the case where a memory input operand still needs to
be indirectified. Later code asserts that the memory operand is already indirect.
This patch adds an early return false to trigger the SelectionDAG fallback for now.
Reviewers: arsenm, paquette
Reviewed By: arsenm
Subscribers: wdng, rovka, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79955
Cameron McInally [Thu, 14 May 2020 21:07:59 +0000 (16:07 -0500)]
[AArch64][SVE] Add some integer DestructiveBinaryComm* patterns
Add DestructiveBinaryComm* patterns for ADD, SUB, and SUBR.
Differential Revision: https://reviews.llvm.org/D76711
Stanislav Mekhanoshin [Wed, 13 May 2020 23:20:45 +0000 (16:20 -0700)]
Add v16f64 value type
We need to use it to handle <16 x double> indirect indexes
in the AMDGPU BE.
The only visible change from adding it is in ARM cost model.
To me it looks reasonable. With doubling a vector size it
quadruples the cost up to the size 8 and then it did only
double it. Now it also quadruples, which seems a logical
progression to me.
Actual AMDGPU code is to follow, this is a common part, plus
load/store legalization in the AMDGPU BE not to break what
works now.
Differential Revision: https://reviews.llvm.org/D79952
LLVM GN Syncbot [Thu, 14 May 2020 21:21:41 +0000 (21:21 +0000)]
[gn build] Port
2b7fe0863ac
shafik [Thu, 14 May 2020 21:15:51 +0000 (14:15 -0700)]
Revert "[lldb] Don't dissasemble large functions by default"
This reverts commit
f665e80c023ec52557f55d7eeaf34471e4c6fa0d.
Reverting because it breaks TestFoundationDisassembly.py
Alex Lorenz [Thu, 14 May 2020 21:11:31 +0000 (14:11 -0700)]
[clang][Preprocessor] Replace the slow translateFile call by a new, faster isMainFile check
The commit
3c28a2dc6bdc331e5a0d8097a5fa59d06682b9d0 introduced the check that checks if we're
trying to re-enter a main file when building a preamble. Unfortunately this slowed down the preamble
compilation by 80-90% in some test cases, as translateFile is really slow. This change checks
to see if the FileEntry is the main file without calling translateFile, but by using the new
isMainFile check instead. This speeds up preamble building by 1.5-2x for certain test cases that we have.
rdar://
59361291
Differential Revision: https://reviews.llvm.org/D79834
Eli Friedman [Thu, 14 May 2020 21:10:06 +0000 (14:10 -0700)]
Fix clang test failures from D77454
Wei Mi [Wed, 13 May 2020 22:11:49 +0000 (15:11 -0700)]
[llvm-profdata] Update CommandGuide
Add a bunch of SampleFDO related flags added recently into llvm-profdata to
its command guide.
Differential Revision: https://reviews.llvm.org/D79911
Eugene Zhulenev [Thu, 14 May 2020 20:29:53 +0000 (22:29 +0200)]
[MLIR] Add symbol map to mlir ExecutionEngine
Add additional symbol mapping to be able to provide custom symbols to jitted code at runtime.
Differential Revision: https://reviews.llvm.org/D79812
Diego Caballero [Thu, 14 May 2020 19:05:46 +0000 (12:05 -0700)]
[mlir][Affine] Introduce affine.vector_load and affine.vector_store
This patch adds `affine.vector_load` and `affine.vector_store` ops to
the Affine dialect and lowers them to `vector.transfer_read` and
`vector.transfer_write`, respectively, in the Vector dialect.
Reviewed By: bondhugula, nicolasvasilache
Differential Revision: https://reviews.llvm.org/D79658
Eli Friedman [Sat, 4 Apr 2020 04:56:20 +0000 (21:56 -0700)]
LoadInst should store Align, not MaybeAlign.
The fact that loads and stores can have the alignment missing is a
constant source of confusion: code that usually works can break down in
rare cases. So fix the LoadInst API so the alignment is never missing.
To reduce the number of changes required to make this work, IRBuilder
and certain LoadInst constructors will grab the module's datalayout and
compute the alignment automatically. This is the same alignment
instcombine would eventually apply anyway; we're just doing it earlier.
There's a minor risk that the way we're retrieving the datalayout
could break out-of-tree code, but I don't think that's likely.
This is the last in a series of patches, so most of the necessary
changes have already been merged.
Differential Revision: https://reviews.llvm.org/D77454
Wouter van Oortmerssen [Thu, 30 Apr 2020 18:41:39 +0000 (11:41 -0700)]
[WebAssembly] Added Debug Fixup pass
This pass changes debug_value instructions referring to stackified registers into TI_OPERAND_STACK with correct stack depth.
Ryan Mansfield [Thu, 14 May 2020 20:08:01 +0000 (13:08 -0700)]
[lldb] Update stop info override callback comment.
In D31172 GetStopInfoOverrideCallback was moved and renamed.
Differential revision: https://reviews.llvm.org/D79953
Jonas Devlieghere [Thu, 14 May 2020 19:27:26 +0000 (12:27 -0700)]
[lldb/Test] Skip test using files to synchronize.
Files written by the inferior are not captured by the reproducers and
the inferior doesn't actually run during replay.
Eli Friedman [Thu, 14 May 2020 19:59:45 +0000 (12:59 -0700)]
Infer alignment of unmarked loads in IR/bitcode parsing.
For IR generated by a compiler, this is really simple: you just take the
datalayout from the beginning of the file, and apply it to all the IR
later in the file. For optimization testcases that don't care about the
datalayout, this is also really simple: we just use the default
datalayout.
The complexity here comes from the fact that some LLVM tools allow
overriding the datalayout: some tools have an explicit flag for this,
some tools will infer a datalayout based on the code generation target.
Supporting this properly required plumbing through a bunch of new
machinery: we want to allow overriding the datalayout after the
datalayout is parsed from the file, but before we use any information
from it. Therefore, IR/bitcode parsing now has a callback to allow tools
to compute the datalayout at the appropriate time.
Not sure if I covered all the LLVM tools that want to use the callback.
(clang? lli? Misc IR manipulation tools like llvm-link?). But this is at
least enough for all the LLVM regression tests, and IR without a
datalayout is not something frontends should generate.
This change had some sort of weird effects for certain CodeGen
regression tests: if the datalayout is overridden with a datalayout with
a different program or stack address space, we now parse IR based on the
overridden datalayout, instead of the one written in the file (or the
default one, if none is specified). This broke a few AVR tests, and one
AMDGPU test.
Outside the CodeGen tests I mentioned, the test changes are all just
fixing CHECK lines and moving around datalayout lines in weird places.
Differential Revision: https://reviews.llvm.org/D78403
Kellie Medlin [Thu, 14 May 2020 19:43:51 +0000 (12:43 -0700)]
[lld] Add archive file support to Mach-O backend
With this change, basic archive files can be linked together. Input
section discovery has been refactored into a function since archive
files lazily resolve their symbols / the object files containing those
symbols.
Reviewed By: int3, smeenai
Differential Revision: https://reviews.llvm.org/D78342
Christopher Tetreault [Thu, 14 May 2020 19:39:23 +0000 (12:39 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from SystemZ
Reviewers: efriedma, david-arm, c-rhodes, jnspaulsson
Reviewed By: david-arm
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79824
Eli Friedman [Wed, 13 May 2020 18:44:03 +0000 (11:44 -0700)]
[BitcodeReader] datalayout must be specified before it is queried.
This isn't really a new invariant; it effectively already existed due to
existing DataLayout queries. But this makes it explicit.
This is technically not backward-compatible with the existing bitcode
reader, but it's backward-compatible with the output of the bitcode
writer, which is what matters in practice.
No testcase because I don't know a good way to write one: there are no
existing tools that can generate a bitcode file that would trigger the
error.
Split off from D78403.
Differential Revision: https://reviews.llvm.org/D79900
Volodymyr Sapsai [Wed, 6 May 2020 01:51:28 +0000 (18:51 -0700)]
[ObjC] Add compatibility mode for type checking of qualified id block parameters.
Commit
73152a2ec20766ac45673a129bf1f5fc97ca9bbe fixed type checking for
blocks with qualified id parameters. But there are existing APIs in
Apple SDKs relying on the old type checking behavior. Specifically,
these are APIs using NSItemProviderCompletionHandler in
Foundation/NSItemProvider.h. To keep existing code working and to allow
developers to use affected APIs introduce a compatibility mode that
enables the previous and the fixed type checking. This mode is enabled
only on Darwin platforms.
Reviewed By: jyknight, ahatanak
Differential Revision: https://reviews.llvm.org/D79511
zoecarver [Thu, 14 May 2020 19:01:55 +0000 (12:01 -0700)]
[libcxx] [NFC] Add more reinterpret_pointer_cast tests.
* Add test for inheritance.
* Test value is preserved through cast.
Benjamin Kramer [Thu, 14 May 2020 18:56:49 +0000 (20:56 +0200)]
[StringSet] Simplify code a bit. NFC.
Reid Kleckner [Thu, 14 May 2020 18:21:53 +0000 (11:21 -0700)]
[COFF] Fix var names cVStrTab->cvStrTab sXDataChunks->sxDataChunks
NFC
LLVM GN Syncbot [Thu, 14 May 2020 17:59:56 +0000 (17:59 +0000)]
[gn build] Port
42a55605034
Craig Topper [Thu, 14 May 2020 17:35:29 +0000 (10:35 -0700)]
[X86] Add support for forming vXi16 PMULH instructions from shifts.
We already form PMULH when the shift is truncated. But we can
also do it from just a shift by extending the result.
Unfortunately, I get regressions if I try to replace the truncate
combine with this as we turn the truncate into a more complicated
sequence first. Then we are unable to combine that sequence with
the extend produced at the end of this combine.
Differential Revision: https://reviews.llvm.org/D79682
Jay Foad [Fri, 1 May 2020 15:43:12 +0000 (16:43 +0100)]
[AMDGPU] New SIInsertHardClauses pass
Enable clausing of memory loads on gfx10 by adding a new pass to insert
the s_clause instructions that mark the start of each hard clause.
Differential Revision: https://reviews.llvm.org/D79792
Marius Brehler [Thu, 14 May 2020 17:49:44 +0000 (17:49 +0000)]
[mlir] Adopt changes in mlir-opt to standalone example
MLIRContext was moved with commit 6bce7d8
Differential Revision: https://reviews.llvm.org/D79946
Jonas Devlieghere [Thu, 14 May 2020 17:37:50 +0000 (10:37 -0700)]
[lldb/Test] Skip remaining 'side_effect' tests with reproducers.
The side_effect Python package bypasses the reproducer instrumentation
and therefore these tests are not expected to replay from a reproducer.
Jonas Devlieghere [Wed, 13 May 2020 20:48:41 +0000 (13:48 -0700)]
[lldb/Test] Skip TestExpressionInSyscall with reproducers
Skip this test because it relies on a timeout.
Fangrui Song [Thu, 14 May 2020 00:16:54 +0000 (17:16 -0700)]
[Driver] Pass -plugin-opt=O2 for -Os -Oz and -plugin-opt=O1 for -Og
Fixes PR42445 (compiler driver options -Os -Oz translate to
-plugin-opt=Os (Oz) which are not recognized by LLVMgold.so or LLD).
The optimization level mapping matches
CompilerInvocation.cpp:getOptimizationLevel() and SpeedLevel of
PassBuilder::OptimizationLevel::O*.
-plugin-opt=O* affects the way we construct regular LTO/ThinLTO pass
manager pipeline.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D79919
Reid Kleckner [Thu, 14 May 2020 17:31:40 +0000 (10:31 -0700)]
[LLD] Fix precomp-link.test
I had a stale directory at %t, so the test passed locally, but not
remotely. Skip the %t directory altogether.
Craig Topper [Thu, 14 May 2020 17:06:07 +0000 (10:06 -0700)]
[X86] Fix a regression caused by moving combineLoopMAddPattern to IR
When I moved combineLoopMAddPattern to an IR pass. I didn't match the behavior of canReduceVMulWidth that was used in the SelectionDAG version. canReduceVMulWidth just calls computeSignBits and assumes a truncate is always profitable. The version I put in IR just looks for constants and zext/sext. Though I neglected to check the number of bits in input of the zext/sext.
This patch adds a check for the number of input bits to the sext/zext. And it adds a special case for add/sub with zext/sext inputs which can be handled by combineTruncatedArithmetic. Match the original SelectionDAG behavior appears to be a regression in some cases if the truncate isn't removed and becomes pack and permq. So enabling only this specific case is the conservative approach.
Differential Revision: https://reviews.llvm.org/D79909
Simon Pilgrim [Thu, 14 May 2020 12:35:08 +0000 (13:35 +0100)]
TargetLowering.cpp - remove non-constant EXTRACT_SUBVECTOR/INSERT_SUBVECTOR handling. NFC.
Now that D79814 has landed, we can assume that subvector ops use constant, in-range indices.
Alex Lorenz [Wed, 13 May 2020 20:08:42 +0000 (13:08 -0700)]
[test] NFC, add missing declarations and include to test files to avoid 'implicit-function-declaration' diagnostics in the tests
Peter Collingbourne [Wed, 13 May 2020 23:38:31 +0000 (16:38 -0700)]
hwasan: Collect ring buffer statistics and include in dev note.
These statistics are intended to help us tune the scudo MTE
implementation.
Differential Revision: https://reviews.llvm.org/D79913
Reid Kleckner [Sat, 9 May 2020 13:58:15 +0000 (06:58 -0700)]
[COFF] Move type merging to TpiSource::mergeDebugT virtual method
This paves the way to doing more things in parallel, and allows us to
order type sources in dependency order. PDBs and PCH objects have to be
loaded before object files which use them.
This is a rebase of the unapplied remaining changes in
https://reviews.llvm.org/D59226. I found it very challenging to rebase
this across the LLD variable name style change. I recall there was a
tool for that, but I didn't take the time to use it.
Reviewers: aganea, akhuang
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79672
Matt Arsenault [Wed, 6 May 2020 16:05:16 +0000 (12:05 -0400)]
AMDGPU/OpenCL: Accept -nostdlib in place of -nogpulib
-nogpulib makes sense when there is a host (where -nostdlib would
apply) and offload target. Accept nostdlib when there is no offload
target as an alias.
Momchil Velikov [Thu, 14 May 2020 15:43:20 +0000 (16:43 +0100)]
Re-commit: [ARM] CMSE code generation
This patch implements the final bits of CMSE code generation:
* emit special linker symbols
* restrict parameter passing to no use memory
* emit BXNS and BLXNS instructions for returns from non-secure entry
functions, and non-secure function calls, respectively
* emit code to save/restore secure floating-point state around calls
to non-secure functions
* emit code to save/restore non-secure floating-pointy state upon
entry to non-secure entry function, and return to non-secure state
* emit code to clobber registers not used for arguments and returns
* when switching to no-secure state
Patch by Momchil Velikov, Bradley Smith, Javed Absar, David Green,
possibly others.
Differential Revision: https://reviews.llvm.org/D76518
Jay Foad [Thu, 2 Apr 2020 10:36:01 +0000 (11:36 +0100)]
[TargetLowering] Improve expansion of FSHL/FSHR
Use an extra shift-by-1 instead of a compare and select to handle the
shift-by-zero case. This sometimes saves one instruction (if the compare
couldn't be combined with a previous instruction). It also works better
on targets that don't have good select instructions.
Note that currently this change doesn't affect most targets because
expandFunnelShift is not used because funnel shift intrinsics are
lowered early in SelectionDAGBuilder. But there is work afoot to change
that; see D77152.
Differential Revision: https://reviews.llvm.org/D77301
Erich Keane [Thu, 14 May 2020 15:21:03 +0000 (08:21 -0700)]
Fix test from 5f1f4a5
My test needs a requires target clause to support inline assembly. This
patch splits out the asm tests into a separate test so we don't skip the
rest of the conditions.
Anna Thomas [Thu, 14 May 2020 14:17:12 +0000 (10:17 -0400)]
[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived pointer""
This is relanding of rGbb308b020522420413c7d3f2989a88f2fc423c56 after
speculatively fixing buildbot lit test failure which was seen on two
bots (I cannot reproduce the lit test failure locally either).
[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived
pointer
Summary:
This is a more general fix to
59029b9eef23 (D75704).
This patch does the following:
updates isKnownBaseValue to account for base pointer and
derived pointer having differing types.
This inturn allows us to populate the
lattice (States) for such derived pointers.
It also updates all states where the base and derived pointers have
differing types (vector versus scalar) and conservatively marks these
states as conflictcs.
Note that in
59029b9eef23, we were just fixing existing lattice values
and that too, only for uses of extractelement.
Reviewers: reames, skatkov, dantrushin
Reviewed By: skatkov
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D76305
Benjamin Kramer [Thu, 14 May 2020 15:11:44 +0000 (17:11 +0200)]
[Support] Make UniqueStringSaver wrap a StringSet
This is slightly more efficient while providing exactly the same
semantics.
Ehud Katz [Thu, 14 May 2020 14:56:39 +0000 (17:56 +0300)]
Revert "[StructurizeCFG] Fix region nodes ordering"
This reverts commit
897d8ee5cd693e17f95a7e84194bca4c089a520b,
due to causing an infinite loop when encountering a loop with
a sub-region with an inner loop.
Levon Ter-Grigoryan [Thu, 14 May 2020 14:05:40 +0000 (16:05 +0200)]
Moving executable module symbols parsing to target creation method.
Summary:
In our project we are using remote client-server LLDB configuration.
We want to parse as much debugging symbols as we can before debugger starts attachment to the remote process.
To do that we are passing the path of the local executable module to CreateTarget method at the client.
But, it seems that this method are not parsing the executable module symbols.
To fix this I added PreloadSymbols call for executable module to target creation method.
This patch also fixes a problem where the DynamicLoader would reset a
module when launching the target. We fix it by making sure
Platform::ResolveExecutable returns the module object obtained from the
remote platform.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D78654
Michael Schellenberger Costa [Thu, 14 May 2020 14:50:03 +0000 (10:50 -0400)]
[libcxx][span] Implement solution to LWG-3255
This implements the relaxed requirements on the std::array constructors of span,
where the type only needs to be convertible to the element type of the span.
Note that the previous tests were not sufficient, as the const array<T, n> constructor
was only tested for compile time and the array<T, N> only during runtime.
Restructure the tests so that we can test conversions as well as both constructors.
Differential Revision: https://reviews.llvm.org/D75706
Sean Fertile [Thu, 14 May 2020 14:31:01 +0000 (10:31 -0400)]
[PowerPC] Remove support for SplitCSR.
SplitCSR was only suppored for functions with CXX_FAST_TLS calling
convention. Clang only emits that calling convention for Darwin which is
no longer supported by the PowerPC backend. Another IR producer could
use the calling convention, but considering the calling convention is
meant to be an optimization and the codegen for SplitCSR can be
attrocious on Power (see the modifed lit test) it is best to remove it
and codegen CXX_FAST_TLS same as the C calling convention.
Differential Revision: https://reviews.llvm.org/D79018
Erich Keane [Wed, 13 May 2020 20:24:03 +0000 (13:24 -0700)]
Prohibit capture of _ExtInt in inline assembly.
The backends don't seem to properly handle the _ExtInt type in inline
assembly with crashes occurring in many. While the ones I tested seem to
work for powers of 2 < 64 (and some any multiple of 64 greater than
that), it seemed like a better idea to just use of this type in inline
assembly prohibited.
Anna Thomas [Thu, 14 May 2020 14:16:25 +0000 (10:16 -0400)]
Revert "[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived pointer"
This reverts commit
bb308b020522420413c7d3f2989a88f2fc423c56.
Failing a testcase.
Anna Thomas [Thu, 14 May 2020 13:15:57 +0000 (09:15 -0400)]
[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived pointer
Summary:
This is a more general fix to
59029b9eef23 (D75704).
This patch does the following:
1. updates isKnownBaseValue to account for base pointer and
derived pointer having differing types.
2. This inturn allows us to populate the
lattice (States) for such derived pointers.
3. It also updates all states where the base and derived pointers have
differing types (vector versus scalar) and conservatively marks these
states as conflictcs.
Note that in
59029b9eef23, we were just fixing existing lattice values
and that too, only for uses of extractelement.
Reviewers: reames, skatkov, dantrushin
Reviewed By: skatkov
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76305
Pavel Labath [Thu, 14 May 2020 13:55:21 +0000 (15:55 +0200)]
[lldb/PDB] Make "native" pdb tests host-independent
These test don't execute the binaries they build, and so they don't need
to build for the host. By hardcoding the target, we don't have do xfail
or skip them for targets which don't have the appropriate support in
clang(-cl).
Matt Arsenault [Sat, 2 May 2020 22:32:40 +0000 (18:32 -0400)]
lld: Let find_package(LLD) work
Install a cmake config file. Copied exactly from how clang exports.
I also wasn't sure whether the canonical capitalization is "lld" or
"LLD". The project() is still calling this lld, but most places seemed
to capitalize it.
Gabor Marton [Thu, 14 May 2020 13:49:07 +0000 (15:49 +0200)]
[analyzer] Improve PlacementNewChecker
Summary:
1. Added insufficient storage check for arrays
2. Added align support check
Based on https://reviews.llvm.org/D76229
Reviewers: aaron.ballman, lebedev.ri, NoQ, martong
Reviewed By: martong
Subscribers: xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76996
Patch by Karasev Nikita!
Xinglong Liao [Thu, 14 May 2020 13:38:25 +0000 (08:38 -0500)]
[Hexagon] Check isInstr() before getInstr() with SUnit
SUnit represent a MachineInstr in post-regalloc scheduling but SDNode
in pre-regalloc scheduling. when pass -enable-hexagon-sdnode-sched to
Hexagon backend with -O1 and above, this may cause an assertion failed.
Fixes PR45194.
Differential Revision: https://reviews.llvm.org/D76134
Gabor Marton [Thu, 14 May 2020 13:44:20 +0000 (15:44 +0200)]
Fix Z3 function calls regarding arithmetic operations
Summary:
The order of Z3_mk_fpa_mul, Z3_mk_fpa_div, Z3_mk_fpa_add and Z3_mk_fpa_sub functions' arguments is: context, rounding_mode, ast1, ast2.
See for example: https://github.com/Z3Prover/z3/blob/
a14c2a30516003cd1a60f8b7deca029033d11c78/src/api/api_fpa.cpp#L433
At function calls from LLVM the argument order was different: rounding_mode was passed as last argument.
Unfortunately these Z3_ast and other function parameter types are technically like void* which are reinterpret_cast-ed to a specific class type. So there was no type error, but the assertions fail in runtime if something goes wrong. Such a crash happened during Z3 refutation while using StaticAnalyzer.
Reviewers: Szelethus, xazax.hun, baloghadamsoftware, steakhal, martong, mikhail.ramalho
Reviewed By: martong
Subscribers: hiraditya, rnkovacs, mikhail.ramalho, martong, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79883
Patch by Tibor Brunner!
Gabor Marton [Tue, 14 Apr 2020 15:40:42 +0000 (17:40 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries
Reviewers: NoQ, Szelethus, baloghadamsoftware, balazske
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78118
Michael Schellenberger Costa [Thu, 14 May 2020 13:28:27 +0000 (09:28 -0400)]
[libc++][span] SFINAE span default constructor on Extent == 0
The default constructor of a static span requires _Extent == 0 so
SFINAE it out rather than using a static_assert
Differential Revision: https://reviews.llvm.org/D71994
Gabor Marton [Tue, 5 May 2020 14:37:10 +0000 (16:37 +0200)]
[analyzer] Make NonNullParamChecker as dependency for StdCLibraryFunctionsChecker
Summary:
If a given parameter in a FunctionDecl has a nonull attribute then the NonNull
constraint in StdCLibraryFunctionsChecker has the same effect as
NonNullParamChecker. I think it is better to emit diagnostics from the simpler
checker. By making NonNullParamChecker as a dependency, in these cases it will
be the first to emit a diagnostic and to stop the analysis on that path.
Reviewers: Szelethus, NoQ, baloghadamsoftware, balazske, steakhal
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79420
Melanie Blower [Thu, 14 May 2020 12:56:35 +0000 (05:56 -0700)]
[clang] Fix bug in #pragma float_control(push/pop)
Summary: #pragma float_control(pop) was failing to restore the expected
floating point settings because the settings were not correctly preserved
at #pragma float_control(push).
Valeriy Savchenko [Thu, 14 May 2020 10:31:01 +0000 (13:31 +0300)]
[analyzer] Modernize analyzer's Python scripts
Summary:
Fix read/write in binary format, which crashes Python 3.
Additionally, clean up redundant (as for Python 3) code and
fix a handful of flake8 warnings.
Differential Revision: https://reviews.llvm.org/D79932
Sanjay Patel [Thu, 14 May 2020 12:33:59 +0000 (08:33 -0400)]
[x86][CGP] improve sinking of splatted vector shift amount operand
Expands on the enablement of the shouldSinkOperands() TLI hook in:
D79718
The last codegen/IR test diff shows what I suspected could happen - we were
sinking all splat shift operands into a loop. But that's not what we want in
general; we only want to sink the *shift amount* operand if it is a splat.
Differential Revision: https://reviews.llvm.org/D79827