Jonas Devlieghere [Wed, 31 Jul 2019 03:26:10 +0000 (03:26 +0000)]
[StringList] Change LongestCommonPrefix API
When investigating a completion bug I got confused by the API.
LongestCommonPrefix finds the longest common prefix of the strings in
the string list. Instead of returning that string through an output
argument, just return it by value.
llvm-svn: 367384
JF Bastien [Wed, 31 Jul 2019 03:22:08 +0000 (03:22 +0000)]
[NFC] Remove LLVM_ALIGNAS
Summary: The minimum compilers support all have alignas, and we don't use LLVM_ALIGNAS anywhere anymore. This also removes an MSVC diagnostic which, according to the comment above, isn't relevant anymore.
Reviewers: rnk
Subscribers: mgorny, jkorous, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D65458
llvm-svn: 367383
Zi Xuan Wu [Wed, 31 Jul 2019 02:56:00 +0000 (02:56 +0000)]
[PowerPC] Eliminate loads/swap feeding swap/store for vector type by using big-endian load/store
In PowerPC, there is instruction to load vector in big endian element order when it's in little endian target.
So we can combine vector load + reverse into big endian load to eliminate the swap instruction.
Also combine vector reverse + store into big endian store.
llvm-svn: 367382
Stanislav Mekhanoshin [Wed, 31 Jul 2019 01:07:10 +0000 (01:07 +0000)]
[AMDGPU] Fix high occupancy calculation and print it
We had couple places which still return 10 as a maximum
occupancy. Fixed.
Also print comment about occupancy as compiler see it.
Differential Revision: https://reviews.llvm.org/D65423
llvm-svn: 367381
Dan Liew [Wed, 31 Jul 2019 00:59:10 +0000 (00:59 +0000)]
[asan_symbolize] More debugging output
When a line fails to match the stackframe regex we now report
it in the log.
rdar://problem/
49476995
llvm-svn: 367380
Dan Liew [Wed, 31 Jul 2019 00:59:10 +0000 (00:59 +0000)]
[asan_symbolize] Add `--skip-uuid-validation` option to `ModuleMapPlugIn`.
This option disables the validation of binary UUIDs. This is useful
in environments where the `otool` binary is not available.
rdar://problem/
49476995
llvm-svn: 367379
Dan Liew [Wed, 31 Jul 2019 00:59:09 +0000 (00:59 +0000)]
[asan_symbolize] Provide better error message when extracting the UUID of a binary fails
rdar://problem/
49476995
llvm-svn: 367378
Jonas Devlieghere [Wed, 31 Jul 2019 00:47:00 +0000 (00:47 +0000)]
[TableGen] Move helpers into LLDBTableGenUtils.
Instead of polluting the LLDBTableGenBackends header with helpers used
by both emitters, move them into a separate files.
llvm-svn: 367377
Matt Arsenault [Wed, 31 Jul 2019 00:30:37 +0000 (00:30 +0000)]
GlobalISel: Replace artifact combiner checks with assert
It has bothered me for a while that these guard against cases that
should never happene, so replace these with asserts.
llvm-svn: 367376
Jonas Devlieghere [Wed, 31 Jul 2019 00:20:55 +0000 (00:20 +0000)]
[TableGen] Include vector
Fixes "no member named 'vector' in namespace 'std'" compile error.
llvm-svn: 367375
Amy Huang [Wed, 31 Jul 2019 00:16:13 +0000 (00:16 +0000)]
[MS] Emit S_HEAPALLOCSITE debug info in SelectionDAG
Summary: This emits labels around heapallocsite calls in SelectionDAG.
Reviewers: rnk
Subscribers: MatzeB, aprantl, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61105
llvm-svn: 367374
Matt Arsenault [Wed, 31 Jul 2019 00:14:43 +0000 (00:14 +0000)]
TableGen: Add MinAlignment predicate
AMDGPU uses some custom code predicates for testing alignments.
I'm still having trouble comprehending the behavior of predicate bits
in the PatFrag hierarchy. Any attempt to abstract these properties
unexpectdly fails to apply them.
llvm-svn: 367373
Francis Visoiu Mistrih [Wed, 31 Jul 2019 00:13:51 +0000 (00:13 +0000)]
Reland: [Remarks] Add an LLVM-bitstream-based remark serializer
Add a new serializer, using a binary format based on the LLVM bitstream
format.
This format provides a way to serialize the remarks in two modes:
1) Separate mode: the metadata is separate from the remark entries.
2) Standalone mode: the metadata and the remark entries are in the same
file.
The format contains:
* a meta block: container version, container type, string table,
external file path, remark version
* a remark block: type, remark name, pass name, function name, debug
file, debug line, debug column, hotness, arguments (key, value, debug
file, debug line, debug column)
A string table is required for this format, which will be dumped in the
meta block to be consumed before parsing the remark blocks.
On clang itself, we noticed a size reduction of 13.4x compared to YAML,
and a compile-time reduction of between 1.7% and 3.5% on CTMark.
Differential Revision: https://reviews.llvm.org/D63466
Original llvm-svn: 367364
Revert llvm-svn: 367370
llvm-svn: 367372
Alex Lorenz [Wed, 31 Jul 2019 00:12:00 +0000 (00:12 +0000)]
NFCI, optimize layout of FileEntry
The reordering of the UID field makes the size of a
FileEntry 8 bytes smaller on 64bit platforms.
llvm-svn: 367371
Francis Visoiu Mistrih [Wed, 31 Jul 2019 00:01:34 +0000 (00:01 +0000)]
Revert "[Remarks] Add an LLVM-bitstream-based remark serializer"
This reverts commit r367364.
Breaks some bots: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-gn/builds/3161/steps/annotate/logs/stdio
llvm-svn: 367370
Matt Arsenault [Tue, 30 Jul 2019 23:56:30 +0000 (23:56 +0000)]
GlobalISel: Add G_ATOMICRMW_{FADD|FSUB}
llvm-svn: 367369
Alex Langford [Tue, 30 Jul 2019 23:48:03 +0000 (23:48 +0000)]
[SymbolFilePDB] Fix windows bots after rL367360
SymbolFilePDB tests were using GetTypeSystemForLanguage but weren't
changed to accomodate the use of an llvm::Expected. I adjusted them
accordingly.
llvm-svn: 367368
Erik Pilkington [Tue, 30 Jul 2019 23:38:18 +0000 (23:38 +0000)]
[Sema] Actually map a variable template specialization from pattern to instantiation
We were previously just using a specialization in the class template instead of
creating a new specialization in the class instantiation.
Fixes llvm.org/PR42779.
Differential revision: https://reviews.llvm.org/D65359
llvm-svn: 367367
Nico Weber [Tue, 30 Jul 2019 23:38:09 +0000 (23:38 +0000)]
gn build: Merge r367364
llvm-svn: 367366
Wei Mi [Tue, 30 Jul 2019 23:14:56 +0000 (23:14 +0000)]
[DAGCombiner] Add an option to control whether or not to enable store merging.
Add an option to control whether or not to enable store merging in dag combiner
so we can workaround some bugs more easily.
Differential Revision: https://reviews.llvm.org/D65482
llvm-svn: 367365
Francis Visoiu Mistrih [Tue, 30 Jul 2019 23:11:57 +0000 (23:11 +0000)]
[Remarks] Add an LLVM-bitstream-based remark serializer
Add a new serializer, using a binary format based on the LLVM bitstream
format.
This format provides a way to serialize the remarks in two modes:
1) Separate mode: the metadata is separate from the remark entries.
2) Standalone mode: the metadata and the remark entries are in the same
file.
The format contains:
* a meta block: container version, container type, string table,
external file path, remark version
* a remark block: type, remark name, pass name, function name, debug
file, debug line, debug column, hotness, arguments (key, value, debug
file, debug line, debug column)
A string table is required for this format, which will be dumped in the
meta block to be consumed before parsing the remark blocks.
On clang itself, we noticed a size reduction of 13.4x compared to YAML,
and a compile-time reduction of between 1.7% and 3.5% on CTMark.
Differential Revision: https://reviews.llvm.org/D63466
llvm-svn: 367364
Jonas Devlieghere [Tue, 30 Jul 2019 22:50:37 +0000 (22:50 +0000)]
[TableGen] Reuse typedef across emitters (NFC)
This moves the std::map typedef into the header so it can be reused by
all the emitter implementations.
llvm-svn: 367363
Reid Kleckner [Tue, 30 Jul 2019 22:49:11 +0000 (22:49 +0000)]
Remove cmake checks for MSVC 1900 / VS 2013
Our minimum Visual C++ version is 19.10 from Visual Studio 2017.
llvm-svn: 367362
Jan Korous [Tue, 30 Jul 2019 22:18:04 +0000 (22:18 +0000)]
[clangd][NFC] Fix typo in comment
llvm-svn: 367361
Alex Langford [Tue, 30 Jul 2019 22:12:34 +0000 (22:12 +0000)]
[Symbol] Use llvm::Expected when getting TypeSystems
Summary:
This commit achieves the following:
- Functions used to return a `TypeSystem *` return an
`llvm::Expected<TypeSystem *>` now. This means that the result of a call
is always checked, forcing clients to move more carefully.
- `TypeSystemMap::GetTypeSystemForLanguage` will either return an Error or a
non-null pointer to a TypeSystem.
Reviewers: JDevlieghere, davide, compnerd
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D65122
llvm-svn: 367360
JF Bastien [Tue, 30 Jul 2019 22:08:38 +0000 (22:08 +0000)]
[NFC] Improve cmake diagnostic when checking atomics
llvm-svn: 367359
Alex Langford [Tue, 30 Jul 2019 21:22:17 +0000 (21:22 +0000)]
[SymbolFile] SymbolFileDWARF::ParseLineTable should lock its module
As of svn rL367298, SymbolFileDWARF locks the module in many cases where
it needs to parse some aspect of the DWARF symbol file.
SymbolFileDWARF::ParseLineTable needs to lock the module because
SymbolVendor::ParseLineTable no longer locks it.
llvm-svn: 367358
Craig Topper [Tue, 30 Jul 2019 21:00:24 +0000 (21:00 +0000)]
[X86] Fix mistake in comment. NFC
The code is matching sext not zext.
llvm-svn: 367357
Roman Lebedev [Tue, 30 Jul 2019 20:47:59 +0000 (20:47 +0000)]
[benchmark] Fix win32 link on case-sensitive fs
Summary: This fixes cross-builds with MinGW from case-sensitive file-systems (on Linux)
This is a cherry-pick from
https://github.com/google/benchmark/pull/840
https://github.com/google/benchmark/commit/
8e48105d465c586068dd8e248fe75a8971c6ba3a
Original patch by: @jschueller (Julien Schueller) !
Differential Revision: https://reviews.llvm.org/D61371
llvm-svn: 367356
Stanislav Mekhanoshin [Tue, 30 Jul 2019 20:45:15 +0000 (20:45 +0000)]
[AMDGPU] Print register pressure for agpr and vgpr separately
Differential Revision: https://reviews.llvm.org/D65476
llvm-svn: 367355
Jan Korous [Tue, 30 Jul 2019 20:39:39 +0000 (20:39 +0000)]
[clangd][NFC] Typo in comment
llvm-svn: 367354
Sam McCall [Tue, 30 Jul 2019 20:38:11 +0000 (20:38 +0000)]
Revert "[NFC][clang] Refactor getCompilationPhases()+Types.def step 3."
This reverts commit
d2254dbf21a3243233b75294ef901086199df1b9.
This (unintentionally?) changed behavior, disallowing e.g. -x objective-c++-header
llvm-svn: 367353
Alina Sbirlea [Tue, 30 Jul 2019 20:10:33 +0000 (20:10 +0000)]
[MemorySSA] Extend allowed behavior for simplified instructions.
Summary:
LoopRotate may simplify instructions, leading to the new instructions not having memory accesses created for them.
Allow this behavior, by allowing the new access to be null when the template is null, and looking upwards for the proper defined access when dealing with simplified instructions.
Reviewers: george.burgess.iv
Subscribers: jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65338
llvm-svn: 367352
Rainer Orth [Tue, 30 Jul 2019 20:04:53 +0000 (20:04 +0000)]
[Driver] Support -fsanitize=function on Solaris/x86
UBSan-Standalone-x86_64 :: TestCases/TypeCheck/Function/function.cpp currently
FAILs on Solaris/x86_64:
clang-9: error: unsupported option '-fsanitize=function' for target 'x86_64-pc-solaris2.11'
AFAICS, there's nothing more to do then enable that sanitizer in the driver (for x86 only),
which is what this patch does, together with updating another testcase.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64488
llvm-svn: 367351
JF Bastien [Tue, 30 Jul 2019 20:01:46 +0000 (20:01 +0000)]
[NFC] simplify Darwin environment handling
The previous code detected conflicts through copy-pasta, this versions
uses a 'loop'.
llvm-svn: 367350
Michael Liao [Tue, 30 Jul 2019 19:52:01 +0000 (19:52 +0000)]
[NVPTX] Fix PR41651
Summary:
- Use the passed `DL` directly as retrieving data layout from CS by
checking the called function is not reliable. Under indirect function
call, there is no called function.
Subscribers: jholewinski, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65468
llvm-svn: 367349
Jonas Devlieghere [Tue, 30 Jul 2019 19:34:26 +0000 (19:34 +0000)]
[dsymutil] Pass LinkOptions by value instead of const ref.
When looping over the difference architectures in a fat binary, we
modify the link options before dispatching the link step to a different
thread. Passing the options by cont reference is not thread safe, as we
might modify its fields before the whole sturct is copied over.
Given that the link options are already stored in the DwarfLinker, we
can easily fix this by passing a copy of the link options instead of a
reference, which would just get copied later on.
llvm-svn: 367348
Stanislav Mekhanoshin [Tue, 30 Jul 2019 19:29:33 +0000 (19:29 +0000)]
[AMDGPU] Reserve all AGPRs on targets which do not have them
Differential Revision: https://reviews.llvm.org/D65471
llvm-svn: 367347
Erik Pilkington [Tue, 30 Jul 2019 19:21:20 +0000 (19:21 +0000)]
[Parser] Lambda capture lists can start with '*'
Fixes llvm.org/PR42778
llvm-svn: 367346
Puyan Lotfi [Tue, 30 Jul 2019 19:03:17 +0000 (19:03 +0000)]
[NFC][clang] Refactor getCompilationPhases()+Types.def step 3.
Dropping the 'u' entry and the entire Flags table from Types.def.
Now it'll be a bit easier to tablegenify this.
Differential Revision: https://reviews.llvm.org/D65308
llvm-svn: 367345
Austin Kerbow [Tue, 30 Jul 2019 18:49:16 +0000 (18:49 +0000)]
[AMDGPU/GlobalISel] Add llvm.amdgcn.fdiv.fast legalization.
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: volkan, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64966
llvm-svn: 367344
Jonas Hahnfeld [Tue, 30 Jul 2019 18:37:28 +0000 (18:37 +0000)]
[OpenMP] Rename last file to cpp and remove LIBOMP_CFLAGS
All other files are already C++ and the build system has always
passed '-x c++' for C files, effectively compiling them as C++.
To stay warning free we need one fix in ittnotify_static.{c,cpp}:
The variable dll_path can be written to, so it must not be const.
GCC complained with -Wcast-qual and I think it's right.
Differential Revision: https://reviews.llvm.org/D65285
llvm-svn: 367343
Hideto Ueno [Tue, 30 Jul 2019 18:35:29 +0000 (18:35 +0000)]
[FunctionAttrs] Annotate "willreturn" for AssumeLikeInst
Summary:
In D37215, AssumeLikeInstruction are regarded as `willreturn`. In this patch, annotation is added to those which don't have `willreturn` now(`sideeffect, object_size, experimental_widenable_condition`).
Reviewers: jdoerfert, nikic, sstefan1
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65455
llvm-svn: 367342
Nico Weber [Tue, 30 Jul 2019 18:19:13 +0000 (18:19 +0000)]
gn build: Update comment I failed to update in r367340 / D65462
llvm-svn: 367341
Nico Weber [Tue, 30 Jul 2019 18:16:55 +0000 (18:16 +0000)]
gn build: Fix check-clang-tools after r362702.
r362702 added a test that requires clang-tidy to be linked
into libclang, so add that to the gn build.
Differential Revision: https://reviews.llvm.org/D65462
llvm-svn: 367340
Thomas Lively [Tue, 30 Jul 2019 18:08:39 +0000 (18:08 +0000)]
[WebAssembly] Do not emit tail calls with return type mismatch
Summary:
return_call and return_call_indirect are only valid if the return
types of the callee and caller match. We were previously not enforcing
that, which was producing invalid modules.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65246
llvm-svn: 367339
Jonas Devlieghere [Tue, 30 Jul 2019 18:06:38 +0000 (18:06 +0000)]
[Reproducers] Fix incorrect help message
The help message mentioned the `log` command (probably because I copied
it from there originally).
llvm-svn: 367338
Reid Kleckner [Tue, 30 Jul 2019 17:58:22 +0000 (17:58 +0000)]
Remove cache for macro arg stringization
Summary:
The cache recorded the wrong expansion location for all but the first
stringization. It seems uncommon to stringize the same macro argument
multiple times, so this cache doesn't seem that important.
Fixes PR39942
Reviewers: vsk, rsmith
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65428
llvm-svn: 367337
JF Bastien [Tue, 30 Jul 2019 17:21:30 +0000 (17:21 +0000)]
[NFC] remove obsolete comment
LLVM_ALIGNAS was removed from this class in http://llvm.org/r338099 but the comment was left there. The class is still sommewhat relevant despite the comment, let's keep it there with its one use.
llvm-svn: 367336
Florian Hahn [Tue, 30 Jul 2019 17:04:58 +0000 (17:04 +0000)]
Revert [GVN] Preserve loop related analysis/canonical forms.
This reverts r367332 (git commit
2d7227ec3ac91f36fc32b1c21e72e2f1f5d030ad)
llvm-svn: 367335
Francis Visoiu Mistrih [Tue, 30 Jul 2019 16:56:45 +0000 (16:56 +0000)]
[Docs] Fix sphinx warning in OCamlLangImpl5.rst
The path to the image was outdated.
http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/33865/steps/docs-llvm-html/logs/stdio
llvm/docs/tutorial/OCamlLangImpl5.rst:173: WARNING: image file not readable: tutorial/LangImpl05-cfg.png
llvm-svn: 367334
Tom Roeder [Tue, 30 Jul 2019 16:49:28 +0000 (16:49 +0000)]
[clang-tidy] Fix the documentation for linuxkernel-must-use-errs.
Summary:
This changes ReleaseNotes.txt to have the first sentence of the full
documentation from linuxkernel-must-use-errs.rst.
This addresses a comment from the review of rL367071 in
https://reviews.llvm.org/D59963.
Reviewers: Eugene.Zelenko
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65343
llvm-svn: 367333
Florian Hahn [Tue, 30 Jul 2019 16:43:39 +0000 (16:43 +0000)]
[GVN] Preserve loop related analysis/canonical forms.
LoopInfo can be easily preserved by passing it to the functions that
modify the CFG (SplitCriticalEdge and MergeBlockIntoPredecessor.
SplitCriticalEdge also preserves LoopSimplify and LCSSA form when when passing in
LoopInfo. The test case shows that we preserve LoopSimplify and
LoopInfo. Adding addPreservedID(LCSSAID) did not preserve LCSSA for some
reason.
Also I am not sure if it is possible to preserve those in the new pass
manager, as they aren't analysis passes.
Reviewers: reames, hfinkel, davide, jdoerfert
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D65137
llvm-svn: 367332
Jonas Devlieghere [Tue, 30 Jul 2019 16:42:47 +0000 (16:42 +0000)]
[dotest] Remove multiprocessing
Now that the Xcode project is removed, I want to focus on dotest as a
test framework, and remove its driver capabilities for which we already
rely on llvm's lit. Removing multiprocessing is the first step in that
direction.
Differential revision: https://reviews.llvm.org/D65311
llvm-svn: 367331
JF Bastien [Tue, 30 Jul 2019 16:31:06 +0000 (16:31 +0000)]
[NFC] Remove uses of LLVM_ALIGNAS
It's not useful anymore: we mandate C++11, and already use alignas in a bunch of places.
llvm-svn: 367330
Michael Liao [Tue, 30 Jul 2019 16:11:48 +0000 (16:11 +0000)]
[Support] Workaround a GCC 4.8 bug on constant expression evaluation.
Summary:
- The following stripped code trigger a gcc-4.8 bug. To work that
around, move the alignment evaluation into template parameter.
```
// https://godbolt.org/z/58p5_X
//
enum { aligned = 0, unaligned = 1 };
template <typename T, int alignment> struct PickAlignment {
enum { value = alignment == 0 ? alignof(T) : alignment };
};
template <typename ValueType, std::size_t Alignment> struct packed {
private:
struct {
alignas(
PickAlignment<ValueType, Alignment>::value) char buffer[sizeof(int)];
} Value;
};
using ule16_t = packed<uint16_t, unaligned>;
ule16_t x;
```
- Also, replace `alignas` with `LLVMALIGN_AS` to improve the compiler
compatibility.
Reviewers: jfb
Subscribers: dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65452
llvm-svn: 367329
Francis Visoiu Mistrih [Tue, 30 Jul 2019 16:01:40 +0000 (16:01 +0000)]
[Remarks] Add two serialization modes for remarks: separate and standalone
The default mode is separate, where the metadata is serialized
separately from the remarks.
Another mode is the standalone mode, where the metadata is serialized
before the remarks, on the same stream.
llvm-svn: 367328
Kit Barton [Tue, 30 Jul 2019 15:58:43 +0000 (15:58 +0000)]
[LoopFusion] Extend use of OptimizationRemarkEmitter
Summary:
This patch extends the use of the OptimizationRemarkEmitter to provide
information about loops that are not fused, and loops that are not eligible for
fusion. In particular, it uses the OptimizationRemarkAnalysis to identify loops
that are not eligible for fusion and the OptimizationRemarkMissed to identify
loops that cannot be fused.
It also reuses the statistics to provide the messages used in the
OptimizationRemarks. This provides common message strings between the
optimization remarks and the statistics.
I would like feedback on this approach, in general. If people are OK with this,
I will flesh out additional remarks in subsequent commits.
Subscribers: hiraditya, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63844
llvm-svn: 367327
Matt Arsenault [Tue, 30 Jul 2019 15:56:43 +0000 (15:56 +0000)]
AMDGPU: Avoid emitting "true" predicates
Empty condition strings are considerde always true. This removes a lot
of clutter from the generated matcher tables.
This shrinks the source size of AMDGPUGenDAGISel.inc from 7.3M to
6.1M.
llvm-svn: 367326
Roman Lebedev [Tue, 30 Jul 2019 15:46:03 +0000 (15:46 +0000)]
[DivRemPairs] Add srem-of-srem tests (PR42823, D65298, D65451)
The @srem_of_srem_expanded case exposed a RAUW pitfall in D65298.
Right now these don't appear to fail verification,
so it should be safe to precommit them.
https://reviews.llvm.org/D65298
https://bugs.llvm.org/show_bug.cgi?id=42823
https://reviews.llvm.org/D65451
llvm-svn: 367325
Sean Fertile [Tue, 30 Jul 2019 15:37:01 +0000 (15:37 +0000)]
Address post commit review comments on revision 366727.
Addresses number of comment made on D64652 after commiting:
- Reorders function decls in the TargetLoweringObjectFileXCOFF class.
- Fix comment in MCSectionXCOFF to include description of external reference
csects.
- Convert several llvm_unreachables to report_fatal_error
- Convert several dyn_casts to casts as they are expected not to fail.
- Avoid copying DataLayout object.
llvm-svn: 367324
David Major [Tue, 30 Jul 2019 15:32:49 +0000 (15:32 +0000)]
[COFF][ARM64] Reorder handling of aarch64 MSVC builtins
In `CodeGenFunction::EmitAArch64BuiltinExpr()`, bulk move all of the aarch64 MSVC-builtin cases to an earlier point in the function (the `// Handle non-overloaded intrinsics first` switch block) in order to avoid an unreachable in `GetNeonType()`. The NEON type-overloading logic is not appropriate for the Windows builtins.
Fixes https://llvm.org/pr42775
Differential Revision: https://reviews.llvm.org/D65403
llvm-svn: 367323
Roman Lebedev [Tue, 30 Jul 2019 15:28:22 +0000 (15:28 +0000)]
[InstCombine] Fold "x ?% y ==/!= 0" to "x & (y-1) ==/!= 0" iff y is power-of-two
Summary:
I have stumbled into this by accident while preparing to extend backend `x s% C ==/!= 0` handling.
While we did happen to handle this fold in most of the cases,
the folding is indirect - we fold `x u% y` to `x & (y-1)` (iff `y` is power-of-two),
or first turn `x s% -y` to `x u% y`; that does handle most of the cases.
But we can't turn `x s% INT_MIN` to `x u% -INT_MIN`,
and thus we end up being stuck with `(x s% INT_MIN) == 0`.
There is no such restriction for the more general fold:
https://rise4fun.com/Alive/IIeS
To be noted, the fold does not enforce that `y` is a constant,
so it may indeed increase instruction count.
This is consistent with what `x u% y`->`x & (y-1)` already does.
I think it makes sense, it's at most one (simple) extra instruction,
while `rem`ainder is really much more un-simple (and likely **very** costly).
Reviewers: spatel, RKSimon, nikic, xbolva00, craig.topper
Reviewed By: RKSimon
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65046
llvm-svn: 367322
Mehdi Amini [Tue, 30 Jul 2019 15:25:14 +0000 (15:25 +0000)]
Ask confirmation when `git llvm push` will push multiple commits
This can reduce unexpectedly pushing more than expected by the user.
Differential Revision: https://reviews.llvm.org/D64893
llvm-svn: 367321
Mehdi Amini [Tue, 30 Jul 2019 15:25:11 +0000 (15:25 +0000)]
Fix `git llvm` script when no arguments are supplied on Python 3
Instead of displaying a help message, it was issuing an error message:
AttributeError: 'Namespace' object has no attribute 'func'
https://bugs.python.org/issue16308 has more information on the bug.
llvm-svn: 367320
Eric Fiselier [Tue, 30 Jul 2019 15:11:41 +0000 (15:11 +0000)]
add more information to benchmark test failures
llvm-svn: 367319
Simon Pilgrim [Tue, 30 Jul 2019 15:06:09 +0000 (15:06 +0000)]
[X86] SimplifyDemandedVectorEltsForTargetNode should be calling resolveTargetShuffleInputs not getTargetShuffleMask
Add TODO comment.
llvm-svn: 367318
Nico Weber [Tue, 30 Jul 2019 14:32:47 +0000 (14:32 +0000)]
libcxx: Define __STDCPP_THREADS__ to 1, not to __cplusplus.
[cpp.predefined]p2:
__STDCPP_THREADS__
Defined, and has the value integer literal 1, if and only if a program
can have more than one thread of execution .
Also define it only if it's not defined already, since it's supposed
to be defined by the compiler.
Also move it from thread to __config (which requires setting it only
if _LIBCPP_HAS_NO_THREADS is not defined).
Part of PR33230. The intent is to eventually make the compiler define
this instead.
llvm-svn: 367316
Hans Wennborg [Tue, 30 Jul 2019 14:17:58 +0000 (14:17 +0000)]
gn build: Use rebase_path on filename args to libcxx/utils/gen_link_script.py
$ ninja -j800
[1/5] ACTION //libcxx/src:cxx_linker_script(//llvm/utils/gn/build/toolchain:stage2_unix)
FAILED: lib/libc++.so
python ../libcxx/utils/gen_link_script.py --input //build.gn/lib/libc++.so.0 --output //build.gn/lib/libc++.so c++abi unwind
GENERATING SCRIPT: 'INPUT(libc++.so.0 -lc++abi -lunwind)' as file //build.gn/lib/libc++.so
Traceback (most recent call last):
File "../libcxx/utils/gen_link_script.py", line 57, in <module>
sys.exit(main())
File "../libcxx/utils/gen_link_script.py", line 50, in main
with open(args.output, 'w') as f:
IOError: [Errno 2] No such file or directory: '//build.gn/lib/libc++.so'
ninja: build stopped: subcommand failed.
Differential revision: https://reviews.llvm.org/D65449
llvm-svn: 367314
Haojian Wu [Tue, 30 Jul 2019 14:17:45 +0000 (14:17 +0000)]
[clangd] Fix a regression in rL366996.
Summary: That patch made the tweak always annotate the whole file by accident.
Reviewers: jvikstrom
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D65443
llvm-svn: 367313
Aaron Ballman [Tue, 30 Jul 2019 13:42:19 +0000 (13:42 +0000)]
Add typedef declaration information to the JSON AST dump.
When dumping a desugared QualType and the type is a type alias, also print out the id for the type alias declaration.
llvm-svn: 367312
Sam Elliott [Tue, 30 Jul 2019 13:40:51 +0000 (13:40 +0000)]
[RISCV] Attempt to make rv{32,64}i-aliases-invalid.s less flaky
These tests have been disabled on Linux and Windows due to failing
there. I think that could be down to a race condition between stdout
and stderr, so I have disabled output to stdout.
For the moment, only re-enable on linux, because I don't have a windows
machine to test on.
llvm-svn: 367311
George Rimar [Tue, 30 Jul 2019 13:37:02 +0000 (13:37 +0000)]
[llvm-objcopy] - Stop using Inputs/alloc-symtab.o
Initially Inputs/alloc-symtab.o was added in D42222.
It contains an allocatable .symtab section. Today
we are able to create such sections using yaml2obj.
Later people started using this input for no solid reason in their tests.
Now multiple of tests are using it.
(And those tests do not need such a specific case actually).
In this patch I removed this binary and rewrote the few tests.
Differential revision: https://reviews.llvm.org/D65278
llvm-svn: 367310
Raphael Isemann [Tue, 30 Jul 2019 13:11:59 +0000 (13:11 +0000)]
[lldb][NFC] Fix import-std-module tests that relied on fix-its to pass
These tests currently pass, but they rely on fix-its in our expression
parser to pass because they have some typos.
llvm-svn: 367309
Raphael Isemann [Tue, 30 Jul 2019 12:31:24 +0000 (12:31 +0000)]
[lldb] Fix crash when tab-completing in multi-line expr
Summary:
Tab completing inside the multiline expression command can cause LLDB to crash. The easiest way
to do this is to go inside a frame with at least one local variable and then try to complete:
(lldb) expr
1. a[tab]
Reason for this was some mixup when we calculate the cursor position. Obviously we should calculate
the offset inside the string by doing 'end - start', but we are doing 'start - end' (which causes the offset to
become -1 which will lead to some out-of-bounds reading).
Fixes rdar://
51754005
I don't see any way to test this as the *multiline* expression completion is completely untested at the moment
and I don't think we have any existing code for testing infrastructure for it.
Reviewers: shafik, davide, labath
Reviewed By: labath
Subscribers: abidh, lldb-commits, davide, clayborg, labath
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D64995
llvm-svn: 367308
Raphael Isemann [Tue, 30 Jul 2019 12:20:03 +0000 (12:20 +0000)]
[lldb][NFC] Check in crashing test case
llvm-svn: 367307
Simon Pilgrim [Tue, 30 Jul 2019 11:35:13 +0000 (11:35 +0000)]
[X86][AVX] SimplifyDemandedVectorElts - handle extraction from X86ISD::SUBV_BROADCAST source (PR42819)
PR42819 showed an issue that we couldn't handle the case where we demanded a 'sub-sub-vector' of the SUBV_BROADCAST 'sub-vector' source.
This patch recognizes these cases and extracts the sub-sub-vector instead of trying to broadcast to a type smaller than the 'sub-vector' source.
llvm-svn: 367306
Rainer Orth [Tue, 30 Jul 2019 10:38:41 +0000 (10:38 +0000)]
[Driver] Define _FILE_OFFSET_BITS=64 on Solaris
make check-all currently fails on x86_64-pc-solaris2.11 when building with GCC 9:
Undefined first referenced
symbol in file
_ZN11__sanitizer14internal_lseekEimi SANITIZER_TEST_OBJECTS.sanitizer_libc_test.cc.i386.o
_ZN11__sanitizer23MapWritableFileToMemoryEPvmim SANITIZER_TEST_OBJECTS.sanitizer_libc_test.cc.i386.o
ld: fatal: symbol referencing errors
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [projects/compiler-rt/lib/sanitizer_common/tests/CMakeFiles/TSanitizer-i386-Test.dir/build.make:92: projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-i386-Test] Error 1
While e.g. __sanitizer::internal_lseek is defined in sanitizer_solaris.cc, g++ 9
predefines _FILE_OFFSET_BITS=64 while clang++ currently does not.
This patch resolves this inconsistency by following the gcc lead, which allows
make check-all to finish successfully.
There's one caveat: gcc defines _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE for C++ only, while clang has long been doing it for
all languages. I'd like to keep it this way because those macros do is to make
declarations of fseek/ftello (_LARGEFILE_SOURCE) resp. the 64-bit versions
of largefile functions (*64 with _LARGEFILE64_SOURCE) visible additionally.
However, _FILE_OFFSET_BITS=64 changes all affected functions to be largefile-aware.
I'd like to restrict this to C++, just like gcc does.
To avoid a similar inconsistence with host compilers that don't predefine _FILE_OFFSET_BITS=64
(e.g. clang < 9, gcc < 9), this needs a compantion patch https://reviews.llvm.org/D64483.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64482
llvm-svn: 367305
Rainer Orth [Tue, 30 Jul 2019 10:33:20 +0000 (10:33 +0000)]
[CMake] Define _FILE_OFFSET_BITS=64 on Solaris
This is the compantion patch to https://reviews.llvm.org/D64482, needed to ensure
that builds with host compilers that don't yet predefine _FILE_OFFSET_BITS=64 on
Solaris succeed by always making the host and freshly built clang consistent.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64483
llvm-svn: 367304
Kadir Cetinkaya [Tue, 30 Jul 2019 10:26:51 +0000 (10:26 +0000)]
[clangd] Ignore diags from builtin files
Summary:
This fixes a case where we show diagnostics on arbitrary lines, in an
internal codebase.
Open for ideas on unittesting this.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64863
llvm-svn: 367303
Stefan Granitz [Tue, 30 Jul 2019 10:21:28 +0000 (10:21 +0000)]
[lldb][docs] Update documentation for monorepo and CMake caches
Summary: The lldb build system made good progress in the last months, but documentation was still lacking behind. Here's a patch to catch up.
Reviewers: JDevlieghere, jingham, labath, stella.stamenova, teemperor, jryans, kastiglione, xiaobai, compnerd, zturner
Reviewed By: labath, stella.stamenova, jryans
Subscribers: clayborg, amccarth, friss, lldb-commits, #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D65330
llvm-svn: 367302
Sander de Smalen [Tue, 30 Jul 2019 10:14:39 +0000 (10:14 +0000)]
[AArch64] Disable __ARM_FEATURE_SVE without ACLE.
The Arm C Language Extensions for SVE document specifies that
__ARM_FEATURE_SVE should be set when the compiler supports SVE and
implements all the extensions described in the document.
This is currently not yet the case, so the feature should be disabled
until the compiler can provide all the extensions as described.
Reviewers: c-rhodes, rengolin, rovka, ktkachov
Reviewed By: rengolin
Differential Revision: https://reviews.llvm.org/D65404
llvm-svn: 367301
Pavel Labath [Tue, 30 Jul 2019 08:42:42 +0000 (08:42 +0000)]
PECOFF: Fix a "memset clearing an object of non-trivial type" warning
This time, the warning pointed to an actual problem, because the
coff_opt_header structure contained a std::vector. I guess this happened
to work because the all-zero state was a valid representation of an
empty vector, but its not a good idea to rely on that.
I remove the memset, and have the structure clear its members in the
constructor instead.
llvm-svn: 367299
Pavel Labath [Tue, 30 Jul 2019 08:20:05 +0000 (08:20 +0000)]
SymbolVendor: Move locking into the Symbol Files
Summary:
The last bit of functionality in SymbolVendor passthrough functions is
the locking the module mutex. While it may be nice doing the locking in
a central place, we weren't really succesful in doing that right now,
because some SymbolFile function could still be called without going
through the SymbolVendor. This meant in SymbolFileDWARF (the only
battle-tested symbol file implementation) roughly a half of the
functions was taking additional locks and another half was asserting
that the lock is already held. By making the SymbolFile responsible for
locking, we can at least make the situation in SymbolFileDWARF more
consistent.
Reviewers: clayborg, JDevlieghere, jingham, jdoerfert
Subscribers: aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D65329
llvm-svn: 367298
Sam Parker [Tue, 30 Jul 2019 08:14:28 +0000 (08:14 +0000)]
[ARM][LowOverheadLoops] Enable by default
The code is now in a good enough state to pass the bunch of tests that
I have run (after fixing the bugs), so let's enable it by default.
Differential Revision: https://reviews.llvm.org/D65277
llvm-svn: 367297
Sam Parker [Tue, 30 Jul 2019 08:08:44 +0000 (08:08 +0000)]
[ARM][LowOverheadLoops] Revert non-header LE target
Revert the hardware loop upon finding a LoopEnd that doesn't target
the loop header, instead of asserting a failure.
Differential Revision: https://reviews.llvm.org/D65268
llvm-svn: 367296
Rainer Orth [Tue, 30 Jul 2019 08:05:14 +0000 (08:05 +0000)]
[builtins][test] XFAIL two SPARC tests
Two SPARC builtins tests are currently FAILing due to codegen bugs:
Builtins-sparc-sunos :: divtc3_test.c
Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c
Builtins-sparcv9-sunos :: divtc3_test.c
I'd like to XFAIL them to reduce testsuite noise.
Done as follows, tested on sparcv9-sun-solaris2.11 and x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64796
llvm-svn: 367295
Roman Lebedev [Tue, 30 Jul 2019 08:00:49 +0000 (08:00 +0000)]
[NFC][X86][AArch64] Revisit test coverage for X s% C == 0 fold - add tests for negative divisors, INT_MIN divisors
As discussed in the review, that fold is only valid for positive
divisors, so while we can negate negative divisors,
we have to special-case INT_MIN.
llvm-svn: 367294
Rainer Orth [Tue, 30 Jul 2019 07:59:43 +0000 (07:59 +0000)]
[ASan][test] XFAIL AddressSanitizer-*-sunos :: TestCases/intercept-rethrow-exception.cc on Solaris
AddressSanitizer-*-sunos :: TestCases/intercept-rethrow-exception.cc currently FAILs
on Solaris. This happens because std::rethrow_exception cannot be intercepted, as
detailed in Bug 42703.
To account for this and reduce testsuite noise, this patch XFAILs the test.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D65056
llvm-svn: 367293
Cullen Rhodes [Tue, 30 Jul 2019 07:47:48 +0000 (07:47 +0000)]
[AArch64][AsmParser] Remove SVE and SVE2 from ARMTargetParser
Summary:
Patch removes SVE and SVE2 features from ARMTargetParser as these
features are not supported on ARM.
Reviewed By: rengolin
Differential Revision: https://reviews.llvm.org/D65385
llvm-svn: 367292
Michal Gorny [Tue, 30 Jul 2019 07:47:22 +0000 (07:47 +0000)]
[lldb] [test/lldb-vscode] Use realpath to match vscode behavior
Compare the directory paths returned by lldb-vscode against realpaths
rather than apparent paths. This matches lldb-vscode behavior
and therefore fixes test failures when one of the parent directories
of the source tree is a symlink.
Differential Revision: https://reviews.llvm.org/D65432
llvm-svn: 367291
Michal Gorny [Tue, 30 Jul 2019 07:47:16 +0000 (07:47 +0000)]
[lldb] [test/lldb-vscode] Use os.path.dirname() [NFC]
Replace os.path.split()[0] with os.path.dirname(). Suggested by Pavel
Labath in D65432.
llvm-svn: 367290
Roman Lebedev [Tue, 30 Jul 2019 07:44:58 +0000 (07:44 +0000)]
Revert "[DivRemPairs] Handling for expanded-form rem - recomposition (PR42673)"
test-suite/MultiSource/Benchmarks/DOE-ProxyApps-C/miniGMG broke:
Only PHI nodes may reference their own value!
%sub33 = srem i32 %sub33, %ranks_in_i
This reverts commit r367288.
llvm-svn: 367289
Roman Lebedev [Tue, 30 Jul 2019 07:10:00 +0000 (07:10 +0000)]
[DivRemPairs] Handling for expanded-form rem - recomposition (PR42673)
Summary:
While `-div-rem-pairs` pass can decompose rem in div+rem pair when div-rem pair
is unsupported by target, nothing performs the opposite fold.
We can't do that in InstCombine or DAGCombine since neither of those has access to TTI.
So it makes most sense to teach `-div-rem-pairs` about it.
If we matched rem in expanded form, we know we will be able to place div-rem pair
next to each other so we won't regress the situation.
Also, we shouldn't decompose rem if we matched already-decomposed form.
This is surprisingly straight-forward otherwise.
https://bugs.llvm.org/show_bug.cgi?id=42673
Reviewers: spatel, RKSimon, efriedma, ZaMaZaN4iK, bogner
Reviewed By: bogner
Subscribers: bogner, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65298
llvm-svn: 367288
Roman Lebedev [Tue, 30 Jul 2019 07:09:41 +0000 (07:09 +0000)]
[APInt] Introduce clearLowBits()
Summary: Equivalent to `x & -2^K`.
Reviewers: RKSimon, craig.topper
Reviewed By: RKSimon, craig.topper
Subscribers: dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65369
llvm-svn: 367287
Michael Pozulp [Tue, 30 Jul 2019 07:05:27 +0000 (07:05 +0000)]
Revert "[llvm-objdump] Add warning messages if disassembly + source for problematic inputs"
This reverts r367284 (git commit
b1cbe51bdf44098c74f5c74b7bcd8c041a7c6772).
My changes to LLVMSymbolizer caused a test to fail:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29488
llvm-svn: 367286
Michal Gorny [Tue, 30 Jul 2019 06:12:03 +0000 (06:12 +0000)]
[lldb] [test] Mark newly running test XFAIL on NetBSD
The test was not previously run due to decorator bug (fixed in r366903).
It is not a regression and is probably related to the other failing
test, so just disable it.
llvm-svn: 367285
Michael Pozulp [Tue, 30 Jul 2019 05:28:26 +0000 (05:28 +0000)]
[llvm-objdump] Add warning messages if disassembly + source for problematic inputs
Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905
Reviewers: jhenderson, rupprecht, grimar
Reviewed By: jhenderson, grimar
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62462
llvm-svn: 367284
Zi Xuan Wu [Tue, 30 Jul 2019 05:22:03 +0000 (05:22 +0000)]
[NFC][PowerPC] Add test case for D65063
llvm-svn: 367283
JF Bastien [Tue, 30 Jul 2019 04:03:33 +0000 (04:03 +0000)]
[NFC] use C++11 in AlignOf.h, remove AlignedCharArray
I removed all uses of AlignedCharArray since the minimum MSVC version can handle
alignas on char arrays correctly. We can therefore remove AlignedCharArray.
This patch also updates AlignedCharArrayUnion to use C++11.
llvm-svn: 367282