Nico Weber [Wed, 22 May 2019 19:03:45 +0000 (19:03 +0000)]
gn build: Fix check-clangd target after r359825
llvm-svn: 361419
Yitzhak Mandelbaum [Wed, 22 May 2019 18:56:18 +0000 (18:56 +0000)]
[clang-tidy] Add support for writing a check as a Transformer rewrite rule.
This revision introduces an adaptor from Transformer's rewrite rules
(`clang::tooling::RewriteRule`) to `ClangTidyCheck`. For example, given a
RewriteRule `MyCheckAsRewriteRule`, it lets one define a tidy check as follows:
```
class MyTidyCheck : public TransformerClangTidyCheck {
public:
MyTidyCheck(StringRef Name, ClangTidyContext *Context)
: TransformerClangTidyCheck(MyCheckAsRewriteRule, Name, Context) {}
};
```
Reviewers: aaron.ballman
Subscribers: mgorny, xazax.hun, cfe-commits, ilya-biryukov
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61386
llvm-svn: 361418
Alexey Lapshin [Wed, 22 May 2019 18:48:58 +0000 (18:48 +0000)]
[DebugInfo][AArch64] Recognise target specific instruction as mov instr
This fix is for the problem from https://bugs.llvm.org/show_bug.cgi?id=38714.
Specifically, Simple Register Coalescing creates following conversion :
undef %0.sub_32:gpr64 = ORRWrs $wzr, %3:gpr32common, 0, debug-location !24;
It copies 32-bit value from gpr32 into gpr64. But Live DEBUG_VALUE analysis
is not able to create debug location record for that instruction. So the problem
is in that debug info for argc variable is incorrect. The fix is
to write custom isCopyInstrImpl() which would recognize the ORRWrs instr.
llvm-svn: 361417
Hiroshi Yamauchi [Wed, 22 May 2019 18:37:34 +0000 (18:37 +0000)]
[PGO][CHR] Speed up following long use-def chains.
Summary: Avoid visiting an instruction more than once by using a map.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62262
llvm-svn: 361416
Cameron McInally [Wed, 22 May 2019 18:27:43 +0000 (18:27 +0000)]
[NFC][InstCombine] Add unary fneg tests to maxnum.ll/minnum.ll
llvm-svn: 361415
Louis Dionne [Wed, 22 May 2019 18:10:32 +0000 (18:10 +0000)]
[libcxx][test] Fix order checking in some more unordered_multimap tests
Some tests assume that iteration through an unordered multimap elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch is a continuation of D54838 and introduces checks verifying that
any iteration will return elements exactly from a set of valid values
and without repetition, but in no particular order.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D56498
llvm-svn: 361414
Yitzhak Mandelbaum [Wed, 22 May 2019 18:03:00 +0000 (18:03 +0000)]
[LibTooling] Update Stencil to use RangeSelector
Add support for creating a `StencilPart` from any `RangeSelector`, which
broadens the scope of `Stencil`.
Correspondingly, deprecate Stencil's specialized combinators `node` and `sNode`
in favor of using the new `selection` combinator directly (with the appropriate
range selector).
Reviewers: sbenza
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62160
llvm-svn: 361413
Jonas Devlieghere [Wed, 22 May 2019 17:46:59 +0000 (17:46 +0000)]
[EditLine] Rewrite GetHistoryFilePath
Rewrite the GetHistoryFilePath implementation without relying on
FileSpec in the spirit of our discussion in D61994.
It changes LLDBs behavior in two ways:
1. We now only use the -widehistory suffix when LLDB is built with wchar
support, instead of as the fallback from when the ~/.lldb directory
isn't writable.
2. When the ~/.lldb directory isn't writable, we don't write any history
files at all. Previously we would write them to the user's home
directory (with the incorrect wide suffix), polluting ~ with a
different file for every IO handler.
Differential revision: https://reviews.llvm.org/D62216
llvm-svn: 361412
Dmitri Gribenko [Wed, 22 May 2019 17:45:24 +0000 (17:45 +0000)]
Fixed a -Wunused-variable warning when assertions are disabled
llvm-svn: 361411
Xing Xue [Wed, 22 May 2019 17:41:27 +0000 (17:41 +0000)]
Disable EHFrameSupport in JITLink/RuntimeDyld on AIX
Summary:
EH Frames aren't supported on AIX with the system compiler, but the definition of HAVE_EHTABLE_SUPPORT misses this which causes linking problems on AIX. This patch updates the definition of HAVE_EHTABLE_SUPPORT in both JITLink and RuntimeDyld.
Author: daltenty
Reviewers: sfertile, xingxue, hubert.reinterpretcase
Reviewed By: xingxue
Subscribers: hiraditya, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62203
llvm-svn: 361410
Roman Lebedev [Wed, 22 May 2019 16:58:26 +0000 (16:58 +0000)]
[NFC][X86][AArch64] Add tests for missing (x - y) + -1 -> not(y) + x fold
https://rise4fun.com/Alive/OaY
llvm-svn: 361409
Andrey Churbanov [Wed, 22 May 2019 16:48:05 +0000 (16:48 +0000)]
Fixed third issue reported in https://bugs.llvm.org/show_bug.cgi?id=41584.
Removed wrong debug assertion.
Differential Revision: https://reviews.llvm.org/D62251
llvm-svn: 361408
Petr Hosek [Wed, 22 May 2019 16:36:35 +0000 (16:36 +0000)]
[libFuzzer] Ignore synthetic exceptions on Fuchsia
Fuchsia has several exceptions which are merely informational and should
not be treated as crashes. This patch puts logic that read from the
exception port and handled the exception in a loop, and ignores
non-exceptions and informational exceptions.
Patch By: aarongreen
Differential Revision: https://reviews.llvm.org/D62226
llvm-svn: 361407
Matt Arsenault [Wed, 22 May 2019 16:28:48 +0000 (16:28 +0000)]
AMDGPU: Move disassembler support check to constructor
Don't check for unsupported targets for every instruction.
llvm-svn: 361406
Matt Arsenault [Wed, 22 May 2019 16:28:41 +0000 (16:28 +0000)]
MC: Allow getMaxInstLength to depend on the subtarget
Keep it optional in cases this is ever needed in some global
context. Currently it's only used for getting an upper bound inline
asm code size.
For AMDGPU, gfx10 increases the maximum instruction size to
20-bytes. This avoids penalizing older subtargets when estimating code
size, and making some annoying branch relaxation test adjustments.
llvm-svn: 361405
Kees Cook [Wed, 22 May 2019 16:16:15 +0000 (16:16 +0000)]
[TargetLowering] Extend bool args to inline-asm according to getBooleanType
Summary:
This extends Krzysztof Parzyszek's X86-specific solution
(https://reviews.llvm.org/D60208) to the generic code pointed out by
James Y Knight.
Reviewers: kparzysz, craig.topper, nickdesaulniers
Subscribers: efriedma, sdardis, nemanjai, javed.absar, eraman, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, llvm-commits, srhines, void, nickdesaulniers, jyknight
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60224
llvm-svn: 361404
Kees Cook [Wed, 22 May 2019 16:02:13 +0000 (16:02 +0000)]
[TargetLowering] Add blank line (test commit)
llvm-svn: 361403
Nico Weber [Wed, 22 May 2019 15:53:23 +0000 (15:53 +0000)]
llvm-undname: Fix an assert-on-invalid, found by oss-fuzz
If a template parameter refers to a pointer to member, but the mangling
of that was a string literal instead of a real symbol, llvm-undname used
to crash instead of rejecting the input.
llvm-svn: 361402
Sanjay Patel [Wed, 22 May 2019 15:50:46 +0000 (15:50 +0000)]
[IR] allow fast-math-flags on select of FP values
This is a minimal start to correcting a problem most directly discussed in PR38086:
https://bugs.llvm.org/show_bug.cgi?id=38086
We have been hacking around a limitation for FP select patterns by using the
fast-math-flags on the condition of the select rather than the select itself.
This patch just allows FMF to appear with the 'select' opcode. No changes are
needed to "FPMathOperator" because it already includes select-of-FP because
that definition is based on the (return) value type.
Once we have this ability, we can start correcting and adding IR transforms
to use the FMF on a 'select' instruction. The instcombine and vectorizer test
diffs only show that the IRBuilder change is behaving as expected by applying
an FMF guard value to 'select'.
For reference:
rL241901 - allowed FMF with fcmp
rL255555 - allowed FMF with FP calls
Differential Revision: https://reviews.llvm.org/D61917
llvm-svn: 361401
Amy Huang [Wed, 22 May 2019 15:48:59 +0000 (15:48 +0000)]
Combine two if cases because the second one is never reached.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62214
llvm-svn: 361400
David Zarzycki [Wed, 22 May 2019 15:48:12 +0000 (15:48 +0000)]
Unbreak non-PIC builds after r361340/D62174
llvm-svn: 361399
Roman Lebedev [Wed, 22 May 2019 15:42:33 +0000 (15:42 +0000)]
[NFC][ARM] addsubcarry-promotion.ll: whoops - replace '.' with '-' in check-prefix
Does not affect update_llc_test_checks, or the actual output,
but is not accepted by the actual FileCheck.
Sorry, i should have noticed this before committing,
not the very next second after..
llvm-svn: 361398
Roman Lebedev [Wed, 22 May 2019 15:34:51 +0000 (15:34 +0000)]
[NFC][ARM] Autogenerate addsubcarry-promotion.ll test
Being affected by upcoming patch
llvm-svn: 361397
Roman Lebedev [Wed, 22 May 2019 15:34:43 +0000 (15:34 +0000)]
[NFC][X86] Autogenerate negative-offset.ll test
Being affected by upcoming patch
llvm-svn: 361396
Fangrui Song [Wed, 22 May 2019 15:12:51 +0000 (15:12 +0000)]
[llvm-objdump] Dump inline relocations if the relocated section is specified with --section
This fixes PR41886: llvm-objdump -d -r -j .text doesn't show inline relocations of .text
While here, switch to stable_sort() because we don't want to change the order of relocations applied to the same location. gABI says consecutive relocation records are composed together and their order matters. In practise it is difficult to see relocations applied to the same location not consecutive, we just have to keep the relative order of relocations with the same offset.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D62253
llvm-svn: 361395
Simon Atanasyan [Wed, 22 May 2019 15:03:52 +0000 (15:03 +0000)]
[mips] Use GNU-style output to make tests smaller. NFC
llvm-svn: 361394
Simon Atanasyan [Wed, 22 May 2019 15:03:42 +0000 (15:03 +0000)]
[mips] Replace multiple `-check-prefix` by single `-check-prefixes`. NFC
llvm-svn: 361393
Yitzhak Mandelbaum [Wed, 22 May 2019 14:48:19 +0000 (14:48 +0000)]
[LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.
Transformer provides an enum to indicate the range of source text to be edited.
That support is now redundant with the new (and more general) RangeSelector
library, so we remove the custom enum support in favor of supporting any
RangeSelector.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62149
llvm-svn: 361392
Ilya Biryukov [Wed, 22 May 2019 14:44:45 +0000 (14:44 +0000)]
Reland r361148 with a fix to the buildbot failure.
Reverted in r361377.
Also reland the '.gn' files (reverted in r361389).
llvm-svn: 361391
Roman Lebedev [Wed, 22 May 2019 14:42:41 +0000 (14:42 +0000)]
[NFC][X86][AArch64] Rewrite sink-addsub-of-const.ll tests to have full permutation coverage
Somehow missed some patterns initially..
While there, add comments.
llvm-svn: 361390
Nico Weber [Wed, 22 May 2019 14:31:22 +0000 (14:31 +0000)]
gn build: Merge r361377
llvm-svn: 361389
Kadir Cetinkaya [Wed, 22 May 2019 14:19:40 +0000 (14:19 +0000)]
[clangd] improve help message for limit-results
Summary: Make it clear that the default is 100.
Patch by Brennan Vincent(@umanwizard)!
Reviewers: #clang-tools-extra, kadircet
Reviewed By: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61865
llvm-svn: 361388
Simon Pilgrim [Wed, 22 May 2019 14:18:17 +0000 (14:18 +0000)]
LoopVectorizationCostModel::selectInterleaveCount - assert we have a non-zero loop cost. NFCI.
The input LoopCost value can be zero, but if so it should be recalculated with the current VF. After that it should always be non-zero.
llvm-svn: 361387
Dmitry Preobrazhensky [Wed, 22 May 2019 13:59:01 +0000 (13:59 +0000)]
[AMDGPU][MC] Corrected parsing of op_sel* and neg_* modifiers
See bug 41361: https://bugs.llvm.org/show_bug.cgi?id=41361
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D61012
llvm-svn: 361386
Clement Courbet [Wed, 22 May 2019 13:50:16 +0000 (13:50 +0000)]
[llvm-exegesis] Move native target initialization code to a separate file.
Summary: This helps building internal tools on top of the library.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits, bdb, ondrasej
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62239
llvm-svn: 361385
James Henderson [Wed, 22 May 2019 13:23:26 +0000 (13:23 +0000)]
[llvm-objcopy] Tidy up error messages
This patch brings various error messages into line with each other, by
removing trailing full stops, and making the first letter lower-case.
This addresses https://bugs.llvm.org/show_bug.cgi?id=40859.
Reviewed by: jhenderson, rupprecht, jakehehrlich
Differential Revision: https://reviews.llvm.org/D62072
Patch by Alex Brachet
llvm-svn: 361384
Konrad Kleine [Wed, 22 May 2019 13:23:15 +0000 (13:23 +0000)]
Added a dot at the end of comment
Summary: to test SVN commit access with a simple change.
Reviewers: jankratochvil
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62243
llvm-svn: 361383
Sven van Haastregt [Wed, 22 May 2019 13:12:20 +0000 (13:12 +0000)]
[OpenCL] Support pipe keyword in C++ mode
Support the OpenCL C pipe feature in C++ for OpenCL mode, to preserve
backwards compatibility with OpenCL C.
Various changes had to be made in Parse and Sema to enable
pipe-specific diagnostics, so enable a SemaOpenCL test for C++.
Differential Revision: https://reviews.llvm.org/D62181
llvm-svn: 361382
Roman Lebedev [Wed, 22 May 2019 13:04:34 +0000 (13:04 +0000)]
UpdateTestChecks: sparc march handling
Summary:
Another target that prefers to use `-march` in tests
```
llvm/test/CodeGen/SPARC$ grep -ri mtriple | wc -l
25
llvm/test/CodeGen/SPARC$ grep -ri march | wc -l
165
```
This test is being affected by a further patch,
so regenerate it to better visualize the changes
Reviewers: RKSimon, dcederman, gberry
Reviewed By: RKSimon
Subscribers: jyknight, fedor.sergeev, jrtc27, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62242
llvm-svn: 361381
Roman Lebedev [Wed, 22 May 2019 13:04:24 +0000 (13:04 +0000)]
[NFC][SystemZ] Autogenerate alloca-03.ll test to make test changes more visible
The check lines are being affected by an upcoming patch,
regenerate the checklines to visualize the changes better.
llvm-svn: 361380
Simon Pilgrim [Wed, 22 May 2019 13:02:19 +0000 (13:02 +0000)]
[CGOpenMPRuntime] emitX86DeclareSimdFunction - assert simdlen/cdtsize is not zero. NFCI.
Fixes scan-build division by zero warning.
llvm-svn: 361379
Aaron Ballman [Wed, 22 May 2019 13:01:28 +0000 (13:01 +0000)]
Clang-formatting the header in advance of other planned changes; NFC.
llvm-svn: 361378
Russell Gallop [Wed, 22 May 2019 12:50:52 +0000 (12:50 +0000)]
Revert r361148 "[Syntax] Introduce TokenBuffer, start clangToolingSyntax library"
Also reverted r361264 "[Syntax] Rename TokensTest to SyntaxTests. NFC"
which built on it. This is because there were hitting an assert on bots
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast
llvm-svn: 361377
Ilya Biryukov [Wed, 22 May 2019 12:50:01 +0000 (12:50 +0000)]
[Frontend] Return an error on bad inputs to PrecompiledPreabmle
Summary:
Instead of failing with assertions. Fixes a crash found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12865
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62137
llvm-svn: 361376
Simon Pilgrim [Wed, 22 May 2019 12:25:46 +0000 (12:25 +0000)]
[Hexagon] assert getRegisterBitWidth returns non-zero value. NFCI.
Fixes scan-build warning.
llvm-svn: 361375
Russell Gallop [Wed, 22 May 2019 12:07:52 +0000 (12:07 +0000)]
Mark tests from r361278 as unsupported on Windows.
llvm-svn: 361374
Pavel Labath [Wed, 22 May 2019 11:44:36 +0000 (11:44 +0000)]
DWARF: Add debug_ranges/rnglists tests
.debug_ranges parsing is not well tested [citation needed] because this
section tends to be only used in optimized code, and we don't build
optimized executables in our tests, as they produce unpredictable
results.
This patch aims to add some very simple tests for parsing static range
data, which can serve as a first line of defense in case things break.
I also include one XFAILed test, which demonstrates that we don't
correctly handle mixed DWARF v5 and v4 ranges in a single file.
llvm-svn: 361373
John Brawn [Wed, 22 May 2019 11:42:54 +0000 (11:42 +0000)]
[ARM][AArch64] Fix incorrect handling of alignment in va_arg code generation
Overaligned and underaligned types (i.e. types where the alignment has been
increased or decreased using the aligned and packed attributes) weren't being
correctly handled in all cases, as the unadjusted alignment should be used.
This patch also adjusts getTypeUnadjustedAlign to correctly handle typedefs of
non-aggregate types, which it appears it never had to handle before.
Differential Revision: https://reviews.llvm.org/D62152
llvm-svn: 361372
Simon Pilgrim [Wed, 22 May 2019 11:20:52 +0000 (11:20 +0000)]
[VirtualFileSystem] Fix uninitialized variable warning. NFCI.
llvm-svn: 361371
Sjoerd Meijer [Wed, 22 May 2019 10:40:26 +0000 (10:40 +0000)]
[TargetMachine] error message unsupported code model
When the tiny code model is requested for a target machine that does not
support this, we get an error message (which is nice) but also this diagnostic
and request to submit a bug report:
fatal error: error in backend: Target does not support the tiny CodeModel
[Inferior 2 (process 31509) exited with code 0106]
clang-9: error: clang frontend command failed with exit code 70 (use -v to see invocation)
(gdb) clang version 9.0.0 (http://llvm.org/git/clang.git
29994b0c63a40f9c97c664170244a7bba5ecc15e) (http://llvm.org/git/llvm.git
95606fdf91c2d63a931e865f4b78b2e9828ddc74)
Target: arm-arm-none-eabi
Thread model: posix
clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/tiny-dfe1a2.c
clang-9: note: diagnostic msg: /tmp/tiny-dfe1a2.sh
clang-9: note: diagnostic msg:
But this is not a bug, this is a feature. :-) Not only is this not a bug, this
is also pretty confusing. This patch causes just to print the fatal error and
not the diagnostic:
fatal error: error in backend: Target does not support the tiny CodeModel
Differential Revision: https://reviews.llvm.org/D62236
llvm-svn: 361370
Russell Gallop [Wed, 22 May 2019 10:06:49 +0000 (10:06 +0000)]
[Driver][Windows] Add dependent lib argument for -fprofile-generate and -fcs-profile-generate
Follows on from r360674 which added it for -fprofile-instr-generate.
Differential Revision: https://reviews.llvm.org/D62200
llvm-svn: 361368
Martin Storsjo [Wed, 22 May 2019 09:49:54 +0000 (09:49 +0000)]
[llvm-dlltool] Respect NONAME keyword
This adds proper handling of the NONAME-keyword, which makes llvm-dlltool
generate an import using the ordinal instead of the name.
Patch by by Jannik Vogel, test added by Stefan Schmidt.
Differential Revision: https://reviews.llvm.org/D62175
llvm-svn: 361367
Clement Courbet [Wed, 22 May 2019 09:45:40 +0000 (09:45 +0000)]
Re-land r361257 "[MergeICmps][NFC] Make BCEAtom move-only.""
llvm-svn: 361366
Fangrui Song [Wed, 22 May 2019 09:26:46 +0000 (09:26 +0000)]
[PPC64] Fix PPC64TargetInfo ABI on clang side after D61950
llvm-svn: 361365
Rui Ueyama [Wed, 22 May 2019 09:19:30 +0000 (09:19 +0000)]
Copy symbol length when we replace a symbol.
Symbol's NameSize is computed lazily. Currently, when we replace a symbol,
a cached length value can be discarded. This patch propagates that value.
Differential Revision: https://reviews.llvm.org/D62234
llvm-svn: 361364
Fangrui Song [Wed, 22 May 2019 09:17:21 +0000 (09:17 +0000)]
[PPC64] Fix PPC64TargetInfo after D61950
llvm-svn: 361363
Gabor Marton [Wed, 22 May 2019 09:10:19 +0000 (09:10 +0000)]
Add AST logging
Summary:
Log the AST of the TU associated with LLDB's `expr` command, once a declaration
is completed
Reviewers: shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D62061
llvm-svn: 361362
Pavel Labath [Wed, 22 May 2019 09:09:44 +0000 (09:09 +0000)]
DWARFDebugInfoEntry: remove unused variable
llvm-svn: 361361
Pavel Labath [Wed, 22 May 2019 09:09:39 +0000 (09:09 +0000)]
DWARF: Introduce DWARFTypeUnit class
Summary:
This patch introduces the DWARFTypeUnit class, and teaches lldb to parse
type units out of both the debug_types section (DWARF v4), and from the
regular debug_info section (DWARF v5).
The most important piece of functionality - resolving DW_AT_signatures
to connect type forward declarations to their definitions - is not
implemented here, but even without that, a lot of functionality becomes
available. I've added tests for the commands that start to work after
this patch.
The changes in this patch were greatly inspired by D61505, which in turn took
over changes from D32167.
Reviewers: JDevlieghere, clayborg, aprantl
Subscribers: mgorny, jankratochvil, lldb-commits
Differential Revision: https://reviews.llvm.org/D62008
llvm-svn: 361360
Fangrui Song [Wed, 22 May 2019 09:06:42 +0000 (09:06 +0000)]
[ELF] Improve error message for relocations to symbols defined in discarded sections
Rather than report "undefined symbol: ", give more informative message
about the object file that defines the discarded section.
In particular, PR41133, if the section is a discarded COMDAT, print the
section group signature and the object file with the prevailing
definition. This is useful to track down some ODR issues.
We need to
* add `uint32_t DiscardedSecIdx` to Undefined for this feature.
* make ComdatGroups public and change its type to DenseMap<CachedHashStringRef, const InputFile *>
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D59649
llvm-svn: 361359
Fangrui Song [Wed, 22 May 2019 08:38:23 +0000 (08:38 +0000)]
Delete unnecessary copy ctors
llvm-svn: 361358
Pavel Labath [Wed, 22 May 2019 08:34:56 +0000 (08:34 +0000)]
[Sanitizer] Add interceptor for wcsdup
Summary: The wide-string equivalent of strdup. Implementation trivial.
Reviewers: vitalybuka, eugenis
Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D62189
llvm-svn: 361357
Anton Afanasyev [Wed, 22 May 2019 07:41:34 +0000 (07:41 +0000)]
[MIR] Add simple PRE pass to MachineCSE
This is the second part of the commit fixing PR38917 (hoisting
partitially redundant machine instruction). Most of PRE (partitial
redundancy elimination) and CSE work is done on LLVM IR, but some of
redundancy arises during DAG legalization. Machine CSE is not enough
to deal with it. This simple PRE implementation works a little bit
intricately: it passes before CSE, looking for partitial redundancy
and transforming it to fully redundancy, anticipating that the next
CSE step will eliminate this created redundancy. If CSE doesn't
eliminate this, than created instruction will remain dead and eliminated
later by Remove Dead Machine Instructions pass.
The third part of the commit is supposed to refactor MachineCSE,
to make it more clear and to merge MachinePRE with MachineCSE,
so one need no rely on further Remove Dead pass to clear instrs
not eliminated by CSE.
First step: https://reviews.llvm.org/D54839
Fixes llvm.org/PR38917
llvm-svn: 361356
Fangrui Song [Wed, 22 May 2019 07:29:59 +0000 (07:29 +0000)]
[PPC64] Parse -elfv1 -elfv2 when specified on target triple
Summary:
For big-endian powerpc64, the default ABI is ELFv1. OpenPower ABI ELFv2 is supported when -mabi=elfv2 is specified. FreeBSD support for PowerPC64 ELFv2 ABI with LLVM is in progress[1]. This patch adds an alternative way to specify ELFv2 ABI on target triple [2].
The following results are expected:
ELFv1 when using:
-target powerpc64-unknown-freebsd12.0
-target powerpc64-unknown-freebsd12.0 -mabi=elfv1
-target powerpc64-unknown-freebsd12.0-elfv1
ELFv2 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv2
-target powerpc64-unknown-freebsd12.0-elfv2
[1] https://wiki.freebsd.org/powerpc/llvm-elfv2
[2] https://clang.llvm.org/docs/CrossCompilation.html
Patch by Alfredo Dal'Ava Júnior!
Differential Revision: https://reviews.llvm.org/D61950
llvm-svn: 361355
Sjoerd Meijer [Wed, 22 May 2019 07:10:27 +0000 (07:10 +0000)]
[AArch64] Subtarget crypto extension defaults
The Armv8.2-A crypto extensions all defaulted to true, but should default to
false, like all the other extensions.
Differential Revision: https://reviews.llvm.org/D62180
llvm-svn: 361354
Dmitri Gribenko [Wed, 22 May 2019 06:57:23 +0000 (06:57 +0000)]
Fixed a -Wunused-variable warning when assertions are disabled
llvm-svn: 361353
Nikita Popov [Wed, 22 May 2019 06:47:06 +0000 (06:47 +0000)]
[X86] Don't compare i128 through vector if construction not cheap (PR41971)
Fix for https://bugs.llvm.org/show_bug.cgi?id=41971. Make the
combineVectorSizedSetCCEquality() transform more conservative by
checking that the bitcast to the vector type will be cheap/free
for both operands. I'm considering it cheap if it's a constant,
a load or already a vector. I've dropped the explicit check for
f128 because it should fall out naturally (in the cases where
it'd be detrimental).
Differential Revision: https://reviews.llvm.org/D62220
llvm-svn: 361352
Serge Guelton [Wed, 22 May 2019 06:30:46 +0000 (06:30 +0000)]
Properly categorize llvm-objdump options
Filters out noise, and distinguish Mach-O related options from others.
Differential Revision: https://reviews.llvm.org/D62195
llvm-svn: 361351
Rui Ueyama [Wed, 22 May 2019 04:56:25 +0000 (04:56 +0000)]
Simplify the logic to instantiate Symbols. Should be NFC.
llvm-svn: 361350
Seiya Nuta [Wed, 22 May 2019 04:48:26 +0000 (04:48 +0000)]
[NFC] Remove a blank line (test commit)
llvm-svn: 361349
Eric Fiselier [Wed, 22 May 2019 03:45:49 +0000 (03:45 +0000)]
Speculative fix for std stream destruction order on Windows.
The MSVC CRT uses TLS storage to implement per-thread locales.
This storage gets freed during program termination, and if we attempt
to do any io operations (like flushing the std streams) after this occurs
the program may abort.
This patch is a speculative fix for that issue.
The fix tries forcing the initialization of the locale TLS before
initializing the std streams. This should mean that the TLS is freed
after we destroy the streams.
llvm-svn: 361348
Chen Zheng [Wed, 22 May 2019 03:17:39 +0000 (03:17 +0000)]
[PowerPC] use meaningful name for displacement form aligned with x-form - NFC
llvm-svn: 361347
Chen Zheng [Wed, 22 May 2019 02:57:31 +0000 (02:57 +0000)]
[PowerPC] [ISEL] select x-form instruction for unaligned offset
Differential Revision: https://reviews.llvm.org/D62173
llvm-svn: 361346
Fangrui Song [Wed, 22 May 2019 02:15:25 +0000 (02:15 +0000)]
[docs] Fix troff macro (.F1 -> .Fl) in ld.lld.1
llvm-svn: 361345
Don Hinton [Wed, 22 May 2019 01:01:11 +0000 (01:01 +0000)]
[clang-tidy] remove default header-filter for run-clang-tidy
Summary:
run-clang-tidy.py was enforcing '-header-filter' parameter with an
unfortunate default value when none was given. Thus, leading to
overwritten clang-tidy configuration (e.g. from .clang-tidy).
This change removes the default value for '-header-filter' resulting in
the default behaviour of clang-tidy itself.
Fixes PR#41426
Reviewed By: hintonda
Patch by Torbjörn Klatt!
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D61747
llvm-svn: 361344
Don Hinton [Wed, 22 May 2019 00:56:42 +0000 (00:56 +0000)]
[Docs] Increase Doxygen cache size
Summary:
When building Doxygen docs for llvm and clang, it helpfully prints a warning at
the end noting that the `LOOKUP_CACHE_SIZE` value was too small to keep all
symbols in memory.
By increasing to the size it recommends, Doxygen builds have greatly improved
performance. On my machine, time to run `doxygen-llvm` changes from 34 minutes
to 22 minutes, which is a decent amount of time saved by changing a single
number.
Reviewed By: hintonda
Patch by J. Ryan Stinnett!
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62138
llvm-svn: 361343
Pengfei Wang [Wed, 22 May 2019 00:50:21 +0000 (00:50 +0000)]
[X86] [CET] Deal with return-twice function such as vfork, setjmp when
CET-IBT enabled
Return-twice functions will indirectly jump after the caller's position.
So when CET-IBT is enable, we should make sure these is endbr*
instructions follow these Return-twice function caller. Like GCC does.
Patch by Xiang Zhang (xiangzhangllvm)
Differential Revision: https://reviews.llvm.org/D61881
llvm-svn: 361342
Sanjay Patel [Wed, 22 May 2019 00:48:47 +0000 (00:48 +0000)]
[Docs] fix formatting for bullet list; NFC
llvm-svn: 361341
Petr Hosek [Wed, 22 May 2019 00:47:37 +0000 (00:47 +0000)]
[Analysis] Link library dependencies to Analysis plugins
These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.
Differential Revision: https://reviews.llvm.org/D62174
llvm-svn: 361340
Matt Morehouse [Wed, 22 May 2019 00:41:54 +0000 (00:41 +0000)]
[libFuzzer] Sleep after process exits in merge-sigusr.test.
Ensure that log file has been fully updated before trying to read it.
llvm-svn: 361339
Sanjay Patel [Wed, 22 May 2019 00:32:25 +0000 (00:32 +0000)]
[InstCombine] fold shuffles of insert_subvectors
This should be a valid exception to the general rule of not creating new shuffle masks in IR...
because we already do it. :)
Also, DAG combining/legalization will undo this by widening the shuffle back out if needed.
Explanation for how we already do this: SLP or vector source can create chains of insert/extract
as shown in 1 of the examples from PR16739:
https://godbolt.org/z/NlK7rA
https://bugs.llvm.org/show_bug.cgi?id=16739
And we expect instcombine or DAGCombine to clean that up by creating relatively simple shuffles.
Differential Revision: https://reviews.llvm.org/D62024
llvm-svn: 361338
Alex Langford [Wed, 22 May 2019 00:06:44 +0000 (00:06 +0000)]
[Symbol] Remove dead code
llvm-svn: 361337
Matt Morehouse [Tue, 21 May 2019 23:54:39 +0000 (23:54 +0000)]
[libFuzzer] Kill by session ID in merge-sigusr.test.
Ensures that parent and all child processes are killed at once.
llvm-svn: 361336
Joel E. Denny [Tue, 21 May 2019 23:51:38 +0000 (23:51 +0000)]
[PragmaHandler] Expose `#pragma` location
Currently, a pragma AST node's recorded location starts at the
namespace token (such as `omp` in the case of OpenMP) after the
`#pragma` token, and the `#pragma` location isn't available. However,
the `#pragma` location can be useful when, for example, rewriting a
directive using Clang's Rewrite facility.
This patch makes `#pragma` locations available in any `PragmaHandler`
but it doesn't yet make use of them.
This patch also uses the new `struct PragmaIntroducer` to simplify
`Preprocessor::HandlePragmaDirective`. It doesn't do the same for
`PPCallbacks::PragmaDirective` because that changes the API documented
in `clang-tools-extra/docs/pp-trace.rst`, and I'm not sure about
backward compatibility guarantees there.
Reviewed By: ABataev, lebedev.ri, aaron.ballman
Differential Revision: https://reviews.llvm.org/D61643
llvm-svn: 361335
Chris Bieneman [Tue, 21 May 2019 23:50:15 +0000 (23:50 +0000)]
Fix target property to make BUILD_SHARED_LIBS work
Public and Private link libraries get merged in the LINK_LIBRARIES property instead of being kept separate.
With any luck this will get `BUILD_SHARED_LIBS` working again on Linux.
llvm-svn: 361334
Matt Arsenault [Tue, 21 May 2019 23:23:16 +0000 (23:23 +0000)]
AMDGPU: Assume calls read exec
llvm-svn: 361333
Matt Arsenault [Tue, 21 May 2019 23:23:12 +0000 (23:23 +0000)]
AMDGPU: Add some tests for inlineasm behavior
llvm-svn: 361332
Matt Arsenault [Tue, 21 May 2019 23:23:10 +0000 (23:23 +0000)]
AMDGPU: Assume call pseudos are convergent
There should probably be nonconvergent versions, but my guess is it
doesn't matter in practice.
llvm-svn: 361331
Matt Arsenault [Tue, 21 May 2019 23:23:05 +0000 (23:23 +0000)]
AMDGPU: Fix not marking new gfx10 SGPRs as CSRs
llvm-svn: 361330
Richard Smith [Tue, 21 May 2019 23:15:20 +0000 (23:15 +0000)]
[c++20] P1330R0: permit simple-assignments that change the active member
of a union within constant expression evaluation.
llvm-svn: 361329
Richard Smith [Tue, 21 May 2019 23:15:18 +0000 (23:15 +0000)]
Refactor: split Uninitialized state on APValue into an "Absent" state
representing no such object, and an "Indeterminate" state representing
an uninitialized object. The latter is not yet used, but soon will be.
llvm-svn: 361328
Dan Gohman [Tue, 21 May 2019 23:06:34 +0000 (23:06 +0000)]
[WebAssembly] Add the signature for the new llround builtin function
r360889 added new llround builtin functions. This patch adds their
signatures for the WebAssembly backend.
It also adds wasm32 support to utils/update_llc_test_checks.py, since
that's the script other targets are using for their testcases for this
feature.
Differential Revision: https://reviews.llvm.org/D62207
llvm-svn: 361327
Matt Morehouse [Tue, 21 May 2019 22:48:40 +0000 (22:48 +0000)]
[libFuzzer] Ignore exit status of wait in merge-sigusr.test.
If process $PID has already exited, wait will give a non-zero exit
status.
llvm-svn: 361326
Aaron Ballman [Tue, 21 May 2019 22:43:48 +0000 (22:43 +0000)]
Rename identifiers to spell out analyze; NFC.
llvm-svn: 361325
Lang Hames [Tue, 21 May 2019 22:07:53 +0000 (22:07 +0000)]
[ORC] Guarantee unique JITDylib names in lli, add usage notes to createJITDylib.
JITDylibs should have unique names. This patch adds code to lli to respect this
invariant (by refering to the exist JITDylib if a -jd <name> option is specified
more than once). It also adds usage notes to the doxygen comment for
createJITDylib method in ExecutionSession and LLJIT.
http://llvm.org/PR41937
llvm-svn: 361322
Jonas Devlieghere [Tue, 21 May 2019 21:56:37 +0000 (21:56 +0000)]
[FileSystem] Fix regression in FileSystem::Resolve
When I moved the resolve code from FileSpec to the FileSystem class, I
introduced a regression. If you compare the two implementations, you'll
notice that if the path doesn't exist, we should only reverse the
effects of makeAbsolute, not the effects of tilde expansion.
As a result, the logic to create the ~/.lldb directory broke, because we
would resolve the path before creating it. Because the directory didn't
exist yet, we'd call create_directories on the unresolved path, which
failed.
Differential revision: https://reviews.llvm.org/D62219
llvm-svn: 361321
Roman Lebedev [Tue, 21 May 2019 21:49:14 +0000 (21:49 +0000)]
[NFC][AMDGPU] Autogenerate llvm.amdgcn.s.barrier.ll test
llvm-svn: 361320
Roman Lebedev [Tue, 21 May 2019 21:49:10 +0000 (21:49 +0000)]
[NFC][X86] Autogenerate ragreedy-hoist-spill.ll test
llvm-svn: 361319
Roman Lebedev [Tue, 21 May 2019 21:49:05 +0000 (21:49 +0000)]
[NFC][Thumb2] Autogenerate thumb2-ldr_pre.ll test
llvm-svn: 361318
Sanjay Patel [Tue, 21 May 2019 21:45:24 +0000 (21:45 +0000)]
[InstCombine] add more tests for shuffle folding; NFC
As discussed in D62024, we want to limit any potential IR
transforms of shuffles to cases where we know the SDAG
conversion would result in equivalent patterns for these
IR variants.
llvm-svn: 361317