Vitaly Buka [Tue, 21 May 2019 20:24:42 +0000 (20:24 +0000)]
[asan] clang-format parent patch
llvm-svn: 361305
Vitaly Buka [Tue, 21 May 2019 20:23:10 +0000 (20:23 +0000)]
[asan] Replace assignments with internal_memcpy ErrorDescription
For consistency with nearby code and to avoid interceptors during reports.
llvm-svn: 361304
Roman Lebedev [Tue, 21 May 2019 20:14:54 +0000 (20:14 +0000)]
[NFC][X86][AArch64] Add tests for sinking of add/sub by constant through add/sub
Looks we can transform all 8 variants of the pattern:
https://rise4fun.com/Alive/auH
This comes up as an issue on the path towards
https://bugs.llvm.org/show_bug.cgi?id=41952
llvm-svn: 361303
Leonard Chan [Tue, 21 May 2019 20:12:00 +0000 (20:12 +0000)]
Remove unicode character from test
llvm-svn: 361302
Richard Smith [Tue, 21 May 2019 20:10:52 +0000 (20:10 +0000)]
Fix test failures after r361278 on non-Darwin platforms and when
CLANG_DEFAULT_STDLIB is defined to libstdc++.
llvm-svn: 361301
Richard Smith [Tue, 21 May 2019 20:10:50 +0000 (20:10 +0000)]
[c++20] P0780R2: Support pack-expansion of init-captures.
This permits an init-capture to introduce a new pack:
template<typename ...T> auto x = [...a = T()] { /* a is a pack */ };
To support this, the mechanism for allowing ParmVarDecls to be packs has
been extended to support arbitrary local VarDecls.
llvm-svn: 361300
Yi-Hong Lyu [Tue, 21 May 2019 19:42:57 +0000 (19:42 +0000)]
[PowerPC][NFC] Add a tests for Reordering CSR reloads in epilogue to follow the same order as CSR saves in the prologue
llvm-svn: 361299
Gheorghe-Teodor Bercea [Tue, 21 May 2019 19:42:01 +0000 (19:42 +0000)]
[OpenMP] Add support for registering requires directives with the runtime
Summary:
This patch adds support for the registration of the requires directives with the runtime.
Each requires directive clause will enable a particular flag to be set.
The set of flags is passed to the runtime to be checked for compatibility with other such flags coming from other object files.
The registration function is called whenever OpenMP is present even if a requires directive is not present. This helps detect cases in which requires directives are used inconsistently.
Reviewers: ABataev, AlexEichenberger, caomhin
Reviewed By: ABataev, AlexEichenberger
Subscribers: jholewinski, guansong, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60568
llvm-svn: 361298
Richard Smith [Tue, 21 May 2019 19:41:19 +0000 (19:41 +0000)]
Fix test to put its outputs into the temp directory.
llvm-svn: 361297
Alexandre Ganea [Tue, 21 May 2019 19:40:28 +0000 (19:40 +0000)]
[DebugInfo] Don't emit checksums when compiling a preprocessed CPP
Fixes PR41215
Differential Revision: https://reviews.llvm.org/D60283
llvm-svn: 361296
Alexandre Ganea [Tue, 21 May 2019 19:35:06 +0000 (19:35 +0000)]
Fix LLDB warnings when compiling with Clang 8.0
Differential Revision: https://reviews.llvm.org/D62021
llvm-svn: 361295
Gheorghe-Teodor Bercea [Tue, 21 May 2019 19:35:02 +0000 (19:35 +0000)]
[OpenMP][libomptarget] Enable requires flags for target libraries.
Summary:
Target link variables are currently implemented by creating a copy of the variables on the device side and unified memory never gets exploited.
When the prgram uses the:
```
#pragma omp requires unified_shared_memory
```
directive in conjunction with a declare target link, the linked variable is no longer allocated on the device and the host version is used instead.
This behavior is overridden by performing an explicit mapping.
A Clang side patch is required.
Reviewers: ABataev, AlexEichenberger, grokos, Hahnfeld
Reviewed By: AlexEichenberger, grokos, Hahnfeld
Subscribers: Hahnfeld, jfb, guansong, jdoerfert, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D60223
llvm-svn: 361294
Stanislav Mekhanoshin [Tue, 21 May 2019 19:32:41 +0000 (19:32 +0000)]
Fix register coalescer failure to prune value
Register coalescer fails for the test in the patch with the assertion in
JoinVals::ConflictResolution `DefMI != nullptr'. It attempts to join
live intervals for two adjacent instructions and erase the copy:
%2:vreg_256 = COPY %1
%3:vreg_256 = COPY killed %1
The LI needs to be adjusted to kill subrange for the erased instruction
and extend the subrange of the original def. That was done for the main
interval only but not for the subrange. As a result subrange had a VNI
pointing to the erased slot resulting in the above failure.
Differential Revision: https://reviews.llvm.org/D62162
llvm-svn: 361293
Leonard Chan [Tue, 21 May 2019 19:30:25 +0000 (19:30 +0000)]
Fix for sphinx bot warning
llvm-svn: 361292
Don Hinton [Tue, 21 May 2019 19:25:54 +0000 (19:25 +0000)]
[cmake] Don't use VERSION_GREATER_EQUAL in cmake versions prior to 3.72.
llvm-svn: 361291
Michael Kruse [Tue, 21 May 2019 19:18:26 +0000 (19:18 +0000)]
[DeLICM] Use polly::singleton to allow empty result.
isl_map_from_union_map cannot determine the map's space if the union_map
is empty. polly::singleton was designed for this case. We pass the
expected map space to avoid crashing in isl_map_from_union_map.
This fixes an issue found by the aosp buildbot. Thanks to Eli Friedman
for the reproducer.
llvm-svn: 361290
Leonard Chan [Tue, 21 May 2019 19:17:19 +0000 (19:17 +0000)]
[Intrinsic] Signed Fixed Point Saturation Multiplication Intrinsic
Add an intrinsic that takes 2 signed integers with the scale of them provided
as the third argument and performs fixed point multiplication on them. The
result is saturated and clamped between the largest and smallest representable
values of the first 2 operands.
This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.
Differential Revision: https://reviews.llvm.org/D55720
llvm-svn: 361289
Craig Topper [Tue, 21 May 2019 19:03:45 +0000 (19:03 +0000)]
[X86] Remove an unneeded ZERO_EXTEND creation from LowerINTRINSIC_W_CHAIN. NFC
We were trying to ZERO_EXTEND from an i8 X86ISD::SETCC to i8 again.
llvm-svn: 361288
Sanjay Patel [Tue, 21 May 2019 18:53:53 +0000 (18:53 +0000)]
[SelectionDAG] fold insert subvector of undef into undef
DAGCombiner simplifies this more liberally as:
// If inserting an UNDEF, just return the original vector.
if (N1.isUndef())
return N0;
So there's no way to make this visible in output AFAIK, but
doing this at node creation time should be slightly more efficient.
llvm-svn: 361287
Don Hinton [Tue, 21 May 2019 18:51:21 +0000 (18:51 +0000)]
[cmake] Try to make cmake happy and fix bots.
llvm-svn: 361286
Yitzhak Mandelbaum [Tue, 21 May 2019 18:48:58 +0000 (18:48 +0000)]
[LibTooling] Address post-commit feedback for r361152
Fixes a redundant dependency and moves another to its proper place.
Reviewers: thakis
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62201
llvm-svn: 361285
Sanjay Patel [Tue, 21 May 2019 18:28:22 +0000 (18:28 +0000)]
[SelectionDAG] remove redundant code; NFCI
getNode() squashes concatenation of undefs via FoldCONCAT_VECTORS():
// Concat of UNDEFs is UNDEF.
if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
return DAG.getUNDEF(VT);
llvm-svn: 361284
Alexey Bataev [Tue, 21 May 2019 18:20:08 +0000 (18:20 +0000)]
[OPENMP]Use the attributes for dso locality when building for device.
Currently, we ignore all dso locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds.
llvm-svn: 361283
Don Hinton [Tue, 21 May 2019 18:15:01 +0000 (18:15 +0000)]
[cmake] Bug in r361281: make include optional and fix typo which might make a difference on some systems.
llvm-svn: 361282
Clement Courbet [Tue, 21 May 2019 17:58:42 +0000 (17:58 +0000)]
[MergeICmps] Make sorting strongly stable on the rhs.
Summary:
Because the sort order was not strongly stable on the RHS, whether the
chain could merge would depend on the order of the blocks in the Phi.
EXPENSIVE_CHECKS would shuffle the blocks before sorting, resulting in
non-deterministic merging.
Reviewers: gchatelet
Subscribers: hiraditya, llvm-commits, RKSimon
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62193
llvm-svn: 361281
Don Hinton [Tue, 21 May 2019 17:56:45 +0000 (17:56 +0000)]
[cmake] Add custom command to touch archives on Darwin so ninja won't rebuild them.
Summary:
clang and newer versions of ninja use high-resolutions timestamps, but
older versions of libtool on Darwin don't, so the archive will often
get an older timestamp than the last object that was added or updated.
To fix this, we add a custom command to touch the archive after it's
been built so that ninja won't rebuild it unnecessarily the next time
it's run.
Reviewed By: beanz
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62172
llvm-svn: 361280
Nick Desaulniers [Tue, 21 May 2019 17:55:26 +0000 (17:55 +0000)]
[Bugpoint] fix use-after-move. NFC
Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
6".
Note that author also states:
"Note that the loop doesn't actually execute at all."
This is not true, but the author can be forgiven; there's two distinct
variables with very similar identifiers:
MiscompiledFunctions
MisCompFunctions
Reviewers: echristo, srhines, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62113
llvm-svn: 361279
Louis Dionne [Tue, 21 May 2019 17:48:04 +0000 (17:48 +0000)]
[clang][Darwin] Refactor header search path logic into the driver
Summary:
This commit moves the logic for determining system, resource and C++
header search paths from CC1 to the driver. This refactor has already
been made for several platforms, but Darwin had been left behind.
This refactor tries to implement the previous search path logic with
perfect accuracy. In particular, the order of all include paths inside
CC1 and all paths that were skipped because nonexistent are conserved
after the refactor. This change was also tested against a code base
of significant size and revealed no problems.
Reviewers: jfb, arphaman
Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61963
llvm-svn: 361278
Jan Kratochvil [Tue, 21 May 2019 17:38:56 +0000 (17:38 +0000)]
Remove `SymbolFileDWARF *` when there is already `DWARFUnit *`
In D61502#
1503247 @clayborg suggested that SymbolFileDWARF *dwarf2Data is
really redundant in all the calls with also having DWARFUnit *cu. So remove it.
One `SymbolFileDWARF *` nullptr check
(DWARFDebugInfoEntry::GetDIENamesAndRanges) could be removed, other two nullptr
checks (DWARFDebugInfoEntry::GetName and DWARFDebugInfoEntry::AppendTypeName)
need to stay in place (now for `DWARFUnit *`).
Differential Revision: https://reviews.llvm.org/D62011
llvm-svn: 361277
Jonas Devlieghere [Tue, 21 May 2019 17:31:51 +0000 (17:31 +0000)]
[Dsymutil] Remove redundant argument (NFC)
The dwarf streamer already holds a copy of the link options, so there's
no need to pass them as an argument.
llvm-svn: 361276
Chris Bieneman [Tue, 21 May 2019 17:30:59 +0000 (17:30 +0000)]
[CMake] One more stab at fixing BUILD_SHARED_LIBS
If clang's libraries are build SHARED, we need to grab their `PRIVATE_LINK_LIBRARIES` properties and add those to clang_shared's interface.
llvm-svn: 361275
Aaron Ballman [Tue, 21 May 2019 17:24:49 +0000 (17:24 +0000)]
Do not use the incorrect attribute spelling list index when translating a no_sanitize_foo attribute into a no_sanitize("foo") attribute.
This fixes a crash when AST pretty printing declarations marked with no_sanitize_memory.
llvm-svn: 361274
Sam Clegg [Tue, 21 May 2019 17:16:33 +0000 (17:16 +0000)]
Revert "[WebAssembly] Add __start_/_stop_ symbols for data sections"
This reverts commit
7804dbddccba412087a15cab8db4412939700952.
This change broke a bunch of tests of the WebAssembly waterfall.
Will hopefully reland with increased test coverage.
llvm-svn: 361273
Chris Bieneman [Tue, 21 May 2019 16:29:31 +0000 (16:29 +0000)]
[docs] Add new document on building distributions
Summary:
This document is an attempt to provide a guide for best practices for using the LLVM build system to generate distributable LLVM-based tools.
Most of the document is geared toward distributions of LLVM-based toolchains, but much of it also applies to distributing other LLVM-based tools and libraries.
Reviewers: tstellar, phosek, jroelofs, hans, sylvestre.ledru
Reviewed By: tstellar
Subscribers: smeenai, dschuff, arphaman, winksaville, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62040
llvm-svn: 361272
Chris Bieneman [Tue, 21 May 2019 15:56:17 +0000 (15:56 +0000)]
Fix BUILD_SHARED_LIBS for clang which broke in D61909
llvm_add_library ignores `BUILD_SHARED_LIBS` `STATIC` is explicitly specified. This restores the `BUILD_SHARED_LIBS` behavior to the clang build.
llvm-svn: 361271
Simon Pilgrim [Tue, 21 May 2019 15:20:24 +0000 (15:20 +0000)]
[X86][SSE] computeKnownBitsForTargetNode - add X86ISD::ANDNP support
Fixes PACKSS-PSHUFB shuffle regressions mentioned on D61692
llvm-svn: 361270
Alexey Bataev [Tue, 21 May 2019 15:11:58 +0000 (15:11 +0000)]
[OPENMP][NVPTX]Mark more functions as always_inline for better
performance.
Internally generated functions must be marked as always_inlines in most
cases. Patch marks some extra reduction function + outlined parallel
functions as always_inline for better performance, but only if the
optimization is requested.
llvm-svn: 361269
Sanjay Patel [Tue, 21 May 2019 14:47:38 +0000 (14:47 +0000)]
[DAGCombiner] prevent unsafe reassociation of FP ops
There are no FP callers of DAGCombiner::reassociateOps() currently,
but we can add a fast-math check to make sure this API is not being
misused.
This was noted as a potential risk (and that risk might increase) with:
D62191
llvm-svn: 361268
Nico Weber [Tue, 21 May 2019 14:41:27 +0000 (14:41 +0000)]
gn build: Merge r361264
llvm-svn: 361267
Fangrui Song [Tue, 21 May 2019 14:40:38 +0000 (14:40 +0000)]
[ELF] Deleted unused ComdatGroups member variable left by D61854
llvm-svn: 361266
Aaron Ballman [Tue, 21 May 2019 14:38:29 +0000 (14:38 +0000)]
Add support for dumping AST comment nodes to JSON.
llvm-svn: 361265
Ilya Biryukov [Tue, 21 May 2019 14:37:41 +0000 (14:37 +0000)]
[Syntax] Rename TokensTest to SyntaxTests. NFC
To be more consistent with conventions used in the codebase. The new
name will be a better fit when more bits of the syntax library land.
llvm-svn: 361264
Clement Courbet [Tue, 21 May 2019 14:24:46 +0000 (14:24 +0000)]
Revert r361257 "[MergeICmps][NFC] Make BCEAtom move-only."
Broke some bots.
llvm-svn: 361263
Nico Weber [Tue, 21 May 2019 14:22:38 +0000 (14:22 +0000)]
gn build: Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`
llvm-svn: 361262
Javed Absar [Tue, 21 May 2019 14:21:26 +0000 (14:21 +0000)]
[ARM][CMSE] Add commandline option and feature macro
Defines macro ARM_FEATURE_CMSE to 1 for v8-M targets and introduces
-mcmse option which for v8-M targets sets ARM_FEATURE_CMSE to 3.
A diagnostic is produced when the option is given on architectures
without support for Security Extensions.
Reviewed By: dmgreen, snidertm
Differential Revision: https://reviews.llvm.org/D59879
llvm-svn: 361261
Nico Weber [Tue, 21 May 2019 14:20:46 +0000 (14:20 +0000)]
gn build: Merge r361252
llvm-svn: 361260
Nico Weber [Tue, 21 May 2019 14:10:55 +0000 (14:10 +0000)]
gn build: Merge r361233
llvm-svn: 361259
Sam McCall [Tue, 21 May 2019 13:40:31 +0000 (13:40 +0000)]
[clangd] Turn no-parse-completion on by when preamble isn't ready. Add flag to force it.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62135
llvm-svn: 361258
Clement Courbet [Tue, 21 May 2019 13:34:12 +0000 (13:34 +0000)]
[MergeICmps][NFC] Make BCEAtom move-only.
And handle for self-move. This is required so that llvm::sort can work
with EXPENSIVE_CHECKS, as it will do a random shuffle of the input
which can result in self-moves.
llvm-svn: 361257
Paul Robinson [Tue, 21 May 2019 13:23:32 +0000 (13:23 +0000)]
Fix typo in r361251.
llvm-svn: 361256
Tatyana Krasnukha [Tue, 21 May 2019 13:22:46 +0000 (13:22 +0000)]
[lldb-mi] Include full path in the -data-disassemble response
Differential Revision: https://reviews.llvm.org/D59015
Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>
llvm-svn: 361255
Roman Lebedev [Tue, 21 May 2019 13:04:56 +0000 (13:04 +0000)]
[NFC][X86][AArch64] Shift amount masking: tests that show that 'neg' doesn't last
Meaning if we were to produce 'neg' in dagcombine, we will get an
endless cycle; some inverse transform would need to be guarded somehow.
Also, the 'and (sub 0, x), 31' variant is sticky,
doesn't get optimized in any way.
https://bugs.llvm.org/show_bug.cgi?id=41952
llvm-svn: 361254
Florian Hahn [Tue, 21 May 2019 13:04:53 +0000 (13:04 +0000)]
[ScheduleDAGInstrs] Compute topological ordering on demand.
In most cases, the topological ordering does not get changed in
ScheduleDAGInstrs. We can compute the ordering on demand, similar to
D60125.
This drastically cuts down the number of times we need to compute the
topological ordering, e.g. for SPEC2006, SPEC2k and MultiSource, we get
the following stats for -O3 -flto on X86 (showing the top reductions,
with small absolute values filtered). The smallest reduction is -50%.
Slightly positive impact on compile-time (-0.1 % geomean speedup for
test-suite + SPEC & co, with -O1 on X86)
Tests: 243
Metric: pre-RA-sched.NumTopoInits
Program base patch diff
test-suite...ngs-C/fixoutput/fixoutput.test 115.00 3.00 -97.4%
test-suite...ks/Prolangs-C/cdecl/cdecl.test 957.00 26.00 -97.3%
test-suite...math/automotive-basicmath.test 107.00 3.00 -97.2%
test-suite...rolangs-C++/deriv2/deriv2.test 144.00 6.00 -95.8%
test-suite...lowfish/security-blowfish.test 410.00 18.00 -95.6%
test-suite...frame_layout/frame_layout.test 441.00 23.00 -94.8%
test-suite...rolangs-C++/employ/employ.test 159.00 11.00 -93.1%
test-suite...s/Ptrdist/anagram/anagram.test 157.00 11.00 -93.0%
test-suite...s-C/unix-smail/unix-smail.test 829.00 59.00 -92.9%
test-suite...chmarks/Olden/power/power.test 154.00 11.00 -92.9%
test-suite...T95/147.vortex/147.vortex.test 19876.00 1434.00 -92.8%
test-suite...000/255.vortex/255.vortex.test 19881.00 1435.00 -92.8%
test-suite...ce/Applications/Burg/burg.test 2203.00 168.00 -92.4%
test-suite...urce/Applications/hbd/hbd.test 1067.00 85.00 -92.0%
test-suite...ternal/HMMER/hmmcalibrate.test 3145.00 251.00 -92.0%
test-suite.../Applications/spiff/spiff.test 1037.00 84.00 -91.9%
test-suite...SPEC/CINT95/130.li/130.li.test 5913.00 487.00 -91.8%
test-suite.../CINT95/134.perl/134.perl.test 12532.00 1041.00 -91.7%
test-suite...ce/Benchmarks/Olden/bh/bh.test 220.00 19.00 -91.4%
test-suite :: External/Nurbs/nurbs.test 2304.00 206.00 -91.1%
test-suite...arks/VersaBench/dbms/dbms.test 773.00 75.00 -90.3%
test-suite...ce/Applications/siod/siod.test 9043.00 878.00 -90.3%
test-suite...pplications/treecc/treecc.test 4510.00 438.00 -90.3%
test-suite...T2006/456.hmmer/456.hmmer.test 7093.00 697.00 -90.2%
test-suite...s-C/Pathfinder/PathFinder.test 882.00 87.00 -90.1%
test-suite.../CINT2000/176.gcc/176.gcc.test 64978.00 6721.00 -89.7%
test-suite...cations/hexxagon/hexxagon.test 657.00 69.00 -89.5%
test-suite...fice-ispell/office-ispell.test 2712.00 285.00 -89.5%
test-suite.../CINT2006/403.gcc/403.gcc.test 139613.00 14992.00 -89.3%
test-suite...lications/ClamAV/clamscan.test 25880.00 2785.00 -89.2%
Reviewers: MatzeB, atrick, efriedma, niravd
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D60839
llvm-svn: 361253
Sam McCall [Tue, 21 May 2019 13:04:24 +0000 (13:04 +0000)]
[clangd] Add tweak to convert normal to raw string literal, when it contains escapes.
Reviewers: ilya-biryukov
Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62151
llvm-svn: 361252
Paul Robinson [Tue, 21 May 2019 12:48:46 +0000 (12:48 +0000)]
[DebugInfo] Fix tests missed by r362148
llvm-svn: 361251
Paul Robinson [Tue, 21 May 2019 12:08:42 +0000 (12:08 +0000)]
De-Window-ize a test
llvm-svn: 361250
Rui Ueyama [Tue, 21 May 2019 12:01:16 +0000 (12:01 +0000)]
Fix test failure.
I forgot to submit a last-minute change to the last patch.
llvm-svn: 361249
Paul Robinson [Tue, 21 May 2019 11:59:03 +0000 (11:59 +0000)]
[DebugInfo] Handle '# line "file"' correctly for asm source.
This provides the correct file path for the original source, rather
than the preprocessed source.
Part of the fix for PR41839.
Differential Revision: https://reviews.llvm.org/D62074
llvm-svn: 361248
Bob Haarman [Tue, 21 May 2019 11:53:41 +0000 (11:53 +0000)]
Revert r360902 "Resubmit: [Salvage] Change salvage debug info ..."
This reverts commit rr360902. It caused an assertion failure in
lib/IR/DebugInfoMetadata.cpp: Assertion `(OffsetInBits + SizeInBits <=
FragmentSizeInBits) && "new fragment outside of original fragment"'
failed.
PR41931.
llvm-svn: 361246
Paul Robinson [Tue, 21 May 2019 11:52:27 +0000 (11:52 +0000)]
[DebugInfo] Handle -main-file-name correctly for asm source.
This option provides only the base filename, not a full relative path.
Part of the fix for PR41839.
Differential Revision: https://reviews.llvm.org/D62071
llvm-svn: 361245
Rui Ueyama [Tue, 21 May 2019 11:52:14 +0000 (11:52 +0000)]
[WebAssembly] Add --reproduce.
--reproduce is a convenient option for debugging. If you invoke lld
with `--reproduce=repro.tar`, it creates `repro.tar` with all input
files and the command line options given to the linker, so that it is
very easy to run lld with the exact same inputs.
ELF and Windows lld have this option.
This patch add that option to lld/wasm.
Differential Revision: https://reviews.llvm.org/D62170
llvm-svn: 361244
Simon Pilgrim [Tue, 21 May 2019 11:42:28 +0000 (11:42 +0000)]
[X86][SSE] Add shuffle tests for 'splat3' patterns.
Test codegen from shuffles for { dst[0] = dst[1] = dst[2] = *src++; dst += 3 } 'splatting' memcpy patterns generated by loop-vectorizer.
llvm-svn: 361243
Simon Pilgrim [Tue, 21 May 2019 11:37:54 +0000 (11:37 +0000)]
[CodeGenModule] BlockByrefHelpers - add missing uninitialized variables to constructor. NFCI.
llvm-svn: 361242
Roman Lebedev [Tue, 21 May 2019 11:14:01 +0000 (11:14 +0000)]
[NFC][X86][AArch64] Add some more tests for shift amount masking
The negation creation should be more eager:
https://bugs.llvm.org/show_bug.cgi?id=41952
llvm-svn: 361241
George Rimar [Tue, 21 May 2019 11:05:46 +0000 (11:05 +0000)]
[llvm-objdump] Make --disassemble-functions imply -d
Fixes https://bugs.llvm.org/show_bug.cgi?id=41903
Patch by Mike Pozulp!
Differential revision: https://reviews.llvm.org/D62054
llvm-svn: 361240
Clement Courbet [Tue, 21 May 2019 11:02:23 +0000 (11:02 +0000)]
[MergeICmps] Preserve the dominator tree.
Summary: In preparation for D60318 .
Reviewers: gchatelet, efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62068
llvm-svn: 361239
Simon Pilgrim [Tue, 21 May 2019 10:48:42 +0000 (10:48 +0000)]
[CGBuiltin] dumpRecord - remove unused field offset. NFCI.
llvm-svn: 361238
Fangrui Song [Tue, 21 May 2019 10:41:25 +0000 (10:41 +0000)]
[PPC64] Update LocalEntry from assigned symbols
On PowerPC64 ELFv2 ABI, functions may have 2 entry points: global and local.
The local entry point location of a function is stored in the st_other field of the symbol, as an offset relative to the global entry point.
In order to make symbol assignments (e.g. .equ/.set) work properly with this, PPCTargetELFStreamer already copies the local entry bits from the source symbol to the destination one, on emitAssignment(). The problem is that this copy is performed only at the assignment location, where the source symbol may not yet have processed the .localentry directive, that sets the local entry. This may cause the destination symbol to end up with wrong local entry information. Other symbol info is not affected by this because, in this case, the destination symbol value is actually a symbol reference.
This change keeps track of these assignments, and update all needed st_other fields when finish() is called.
Patch by Leandro Lupori!
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D56586
llvm-svn: 361237
Sam Clegg [Tue, 21 May 2019 10:07:30 +0000 (10:07 +0000)]
[WebAssembly] Add __start_/_stop_ symbols for data sections
Fixes https://bugs.llvm.org/show_bug.cgi?id=41565
Differential Revision: https://reviews.llvm.org/D61876
llvm-svn: 361236
Florian Hahn [Tue, 21 May 2019 10:05:26 +0000 (10:05 +0000)]
[AArch64] Skip mask checks for masks with an odd number of elements.
Some checks in isShuffleMaskLegal expect an even number of elements,
e.g. isTRN_v_undef_Mask or isUZP_v_undef_Mask, otherwise they access
invalid elements and crash. This patch adds checks to the impacted
functions.
Fixes PR41951
Reviewers: t.p.northover, dmgreen, samparker
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D60690
llvm-svn: 361235
Nikolai Kosjar [Tue, 21 May 2019 09:21:35 +0000 (09:21 +0000)]
[libclang] visit c++14 lambda capture init expressions
Patch by Milian Wolff.
Differential Revision: https://reviews.llvm.org/D60672
llvm-svn: 361234
Sam Clegg [Tue, 21 May 2019 09:13:09 +0000 (09:13 +0000)]
[WebAssembly] Refactor synthetic sections and relocation processing. NFC.
Major refactor to better match the structure of the ELF linker.
- Split out relocation processing into scanRelocations
- Split out synthetic sections into their own classes.
Differential Revision: https://reviews.llvm.org/D61811
llvm-svn: 361233
Pavel Labath [Tue, 21 May 2019 09:11:11 +0000 (09:11 +0000)]
DWARF: Port debug_addr over to DWARFContext
llvm-svn: 361232
Eugene Leviant [Tue, 21 May 2019 09:09:33 +0000 (09:09 +0000)]
[llvm-objcopy] Strip file symbols with --strip-unneeded
Differential revision: https://reviews.llvm.org/D61641
llvm-svn: 361231
Cullen Rhodes [Tue, 21 May 2019 09:06:51 +0000 (09:06 +0000)]
[AArch64][SVE2] Asm: add integer unary instructions (predicated)
Summary:
Patch adds support for the following instructions:
* URECPE, URSQRTE, SQABS, SQNEG
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D62129
llvm-svn: 361230
Cullen Rhodes [Tue, 21 May 2019 08:59:00 +0000 (08:59 +0000)]
[AArch64][SVE2] Asm: add integer pairwise arithmetic instructions
Summary:
Patch adds support for the following instructions:
ADDP, SMAXP, UMAXP, SMINP, UMINP
The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D62128
llvm-svn: 361229
Fangrui Song [Tue, 21 May 2019 08:21:44 +0000 (08:21 +0000)]
[ELF] Don't advance position in a memory region when assigning to the Dot
For memory5.test, ld.bfd appears to ignore `. += 0x2000;`, so the test was testing
a wrong behavior. After deleting the code added in rLLD336335, we match ld.bfd and thus fix PR41357.
PR37836 (memory4.test) seems to have been fixed by another change.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D62177
llvm-svn: 361228
Sam Parker [Tue, 21 May 2019 07:56:47 +0000 (07:56 +0000)]
[ARM][CGP] Skip nuw in PrepareConstants
PrepareConstants step converts add/sub with 'negative' immediates to
sub/add with a 'positive' imm to make promotion more simple. nuw
already states that the add shouldn't cause an unsigned wrap, so
it shouldn't need any tweaking. Plus, we also don't allow a sub with
a 'negative' immediate to be safe wrap, so this functionality has
been removed. The PrepareConstants step now just handles the add
instructions that we've determined would be safe if they wrap around
zero.
Differential Revision: https://reviews.llvm.org/D62057
llvm-svn: 361227
Nikolai Kosjar [Tue, 21 May 2019 07:26:59 +0000 (07:26 +0000)]
[Preamble] Reuse preamble even if an unsaved file does not exist
When a preamble is created an unsaved file not existing on disk is
already part of PrecompiledPreamble::FilesInPreamble. However, when
checking whether the preamble can be re-used, a failed stat of such an
unsaved file invalidated the preamble, which led to pointless and time
consuming preamble regenerations on subsequent reparses.
Do not require anymore that unsaved files should exist on disk.
This avoids costly preamble invalidations depending on timing issues for
the cases where the file on disk might be removed just to be regenerated
a bit later.
It also allows an IDE to provide in-memory files that might not exist on
disk, e.g. because the build system hasn't generated those yet.
Differential Revision: https://reviews.llvm.org/D41005
llvm-svn: 361226
Adam Balogh [Tue, 21 May 2019 07:25:06 +0000 (07:25 +0000)]
[clang-tidy] New option for misc-throw-by-value-catch-by-reference
Catching trivial objects by value is not dangerous but may be
inefficient if they are too large. This patch adds an option
`WarnOnLargeObject` to the checker to also warn if such an object
is caught by value. An object is considered as "large" if its
size is greater than `MaxSize` which is another option. Default
value is the machine word of the architecture (size of the type
`size_t`).
Differential Revision: https://reviews.llvm.org/D61851
llvm-svn: 361225
Pavel Labath [Tue, 21 May 2019 07:22:34 +0000 (07:22 +0000)]
DWARF: Introduce DWARFUnitHeader class
Summary:
This patch introduces the DWARFUnitHeader class. Its purpose (and its
structure, to the extent it was possible to make it) is the same as its
LLVM counterpart -- to extract the unit header information before we
actually construct the unit, so that we know which kind of units to
construct. This is needed because as of DWARF5, type units live in the
.debug_info section, which means it's not possible to statically
determine the type of units in a given section.
Reviewers: aprantl, clayborg, JDevlieghere
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D62073
llvm-svn: 361224
Petr Hosek [Tue, 21 May 2019 07:13:58 +0000 (07:13 +0000)]
[CMake] Specify component for all target types
This addresses an issue introduced in r360230 which broke existing
use cases of LLVM_DISTRIBUTION_COMPONENTS since ARCHIVE and LIBRARY
target types are no longer handled as components.
Differential Revision: https://reviews.llvm.org/D62176
llvm-svn: 361223
Dylan McKay [Tue, 21 May 2019 06:38:02 +0000 (06:38 +0000)]
Add TargetLoweringInfo hook for explicitly setting the ABI calling convention endianess
Summary:
The endianess used in the calling convention does not always match the
endianess of the target on all architectures, namely AVR.
When an argument is too large to be legalised by the architecture and is
split for the ABI, a new hook TargetLoweringInfo::shouldSplitFunctionArgumentsAsLittleEndian
is queried to find the endianess that function arguments must be laid
out in.
This approach was recommended by Eli Friedman.
Originally reported in https://github.com/avr-rust/rust/issues/129.
Patch by Carl Peto.
Reviewers: bogner, t.p.northover, RKSimon, niravd, efriedma
Reviewed By: efriedma
Subscribers: JDevlieghere, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62003
llvm-svn: 361222
QingShan Zhang [Tue, 21 May 2019 06:32:31 +0000 (06:32 +0000)]
[NFC][PowerPC] Add a test to verify if the scheduler schedule the addi before the load.
llvm-svn: 361221
Nikita Popov [Tue, 21 May 2019 06:24:36 +0000 (06:24 +0000)]
Move thumbv7k test from AArch64 to ARM
As pointed out by charukcs on rL361166, this test uses an ARM triple.
llvm-svn: 361220
Chen Zheng [Tue, 21 May 2019 05:06:09 +0000 (05:06 +0000)]
[PowerPC] test cases for selecting x-form instruction for unaligned offset - NFC
llvm-svn: 361219
Chen Zheng [Tue, 21 May 2019 03:54:42 +0000 (03:54 +0000)]
[PowerPC] use more meaningful name - NFC
llvm-svn: 361218
Alex Langford [Tue, 21 May 2019 03:41:05 +0000 (03:41 +0000)]
[CMake] Correct some dependencies
Symbol doesn't depend on CPlusPlusLanguage, but Expressiond does.
llvm-svn: 361216
Lang Hames [Tue, 21 May 2019 03:23:08 +0000 (03:23 +0000)]
[ORC] Assert that JITDylibs have unique names.
Patch by Praveen Velliengiri. Thanks Praveen!
Differential Revision: https://reviews.llvm.org/D62139
llvm-svn: 361215
Nico Weber [Tue, 21 May 2019 03:01:01 +0000 (03:01 +0000)]
Tweaks for setting CMAKE_LINKER to lld-link
- Just look for "lld-link", not "lld-link.exe".
llvm/cmake/platforms/WinMsvc.cmake for example sets CMAKE_LINKER to
lld-link without .exe
- Stop passing -gwarf to the compiler in sanitizer options when lld is
enabled -- there's no reason to use different debug information keyed
off the linker. (If this was for MinGW, we should check for that
instead.)
Differential Revision: https://reviews.llvm.org/D62111
llvm-svn: 361214
Fangrui Song [Tue, 21 May 2019 02:38:11 +0000 (02:38 +0000)]
[ELF] Error on relocations to local undefined symbols
For a reference to a local symbol, ld.bfd and gold error if the symbol
is defined in a discarded section but accept it if the symbol is
undefined. This inconsistent behavior seems unnecessary for us (it
probably makes sense for them as they differentiate local/global
symbols, the error would mean more code).
Catch such errors. Symbol index 0 may be used by marker relocations,
e.g. R_*_NONE R_ARM_V4BX. Don't error on them.
The difference from D61563 (which caused msan failure) is we don't call
Sym.computeBinding() on local symbols - VersionId is uninitialized.
llvm-svn: 361213
Nico Weber [Tue, 21 May 2019 02:06:59 +0000 (02:06 +0000)]
Revert r361206 "[COFF] Store alignment in log2 form, NFC"
Makes the linker crash when linking nasm.exe.
llvm-svn: 361212
Saleem Abdulrasool [Tue, 21 May 2019 01:25:48 +0000 (01:25 +0000)]
lldb-server: LLGS: support 32-bit on 64-bit hosts
Enable the ARM emulation support on AArch64 which can execute ARM32
code. Similarly, handle MIPS 32 on 64.
llvm-svn: 361210
Nico Weber [Tue, 21 May 2019 00:27:26 +0000 (00:27 +0000)]
Try to fix build with older gccs after r361152
Also merge the cmake change there to the gn build.
llvm-svn: 361209
Richard Smith [Mon, 20 May 2019 23:37:18 +0000 (23:37 +0000)]
Give 'fixit-cxx0x.cpp' a more modern name.
llvm-svn: 361208
Petr Hosek [Mon, 20 May 2019 23:34:24 +0000 (23:34 +0000)]
[builtins] Deduplicate __eqsf2 and __gtsf2 via macro
The only difference between __eqsf2 and __gtsf2 is whether they return
1 or -1 on NaN. Rather than duplicating all the code, use a macro to
define the function twice and use an argument to decide whether to
negate the return value.
Differential Revision: https://reviews.llvm.org/D61919
llvm-svn: 361207
Reid Kleckner [Mon, 20 May 2019 22:57:52 +0000 (22:57 +0000)]
[COFF] Store alignment in log2 form, NFC
Summary:
Valid section or chunk alignments are powers of 2 in the range [1,
8192]. These can be stored more canonically in log2 form to free up some
bits in Chunk. Combined with D61696, SectionChunk gets 8 bytes smaller.
Reviewers: ruiu, aganea
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61698
llvm-svn: 361206
Leonard Chan [Mon, 20 May 2019 22:42:19 +0000 (22:42 +0000)]
[Sema] Fix for build on some iOS programs.
Nullability attributes weren't being stripped for AttributedTypes that
were wrapped in a MacroQualifiedType. This fix adds a check for this
type and a test.
llvm-svn: 361205
Michael Kruse [Mon, 20 May 2019 22:31:09 +0000 (22:31 +0000)]
[CodeGen] Fix order of PHINode and MA Write generation.
At the end of a region statement, the PHINode must be generated
while the current IRBuilder's block is the region's exit node. For
obvious reasons: The PHINode references the region's exiting block.
A partial write would insert new control flow, i.e. insert new basic
blocks between the exiting blocks and the current block.
We fix this by generating the PHI nodes (region exit values) before
generating any MemoryAccess's stores.
This should fix the AOSP buildbot.
Reported-by: Eli Friedman <efriedma@quicinc.com>
llvm-svn: 361204
Nick Desaulniers [Mon, 20 May 2019 22:17:43 +0000 (22:17 +0000)]
[ORC] fix use-after-move. NFC
Summary:
scan-build flagged a potential use-after-move in debug builds. It's not
safe that a moved from value contains anything but garbage. Manually
DRY up these repeated expressions.
Reviewers: lhames
Reviewed By: lhames
Subscribers: hiraditya, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62112
llvm-svn: 361203