Fangrui Song [Tue, 16 Apr 2019 03:51:53 +0000 (03:51 +0000)]
[MachO] Add -macho to llvm-objdump commands
llvm-svn: 358473
Fangrui Song [Tue, 16 Apr 2019 02:37:29 +0000 (02:37 +0000)]
[llvm-objdump] Simplify PrintHelpMessage() logic
This relands rL358418. It missed one test that should also use -macho
Note, all the other -private-header -exports-trie tests are used
together with -macho.
llvm-svn: 358472
Quentin Colombet [Tue, 16 Apr 2019 02:12:05 +0000 (02:12 +0000)]
[CodeExtractor] Add a few debug lines to understand why a region is not extracted
The CodeExtractor is not smart enough to compute which basic block is
the entry of a region. Instead it relies on the order of the list
of basic blocks that is handed to it and assumes that the entry
is the first block in the list.
Without the additional debug information, it is hard to understand
why a valid region does not get extracted, because we would miss
that the order of in the list just doesn't match what the CodeExtractor
wants.
NFC
llvm-svn: 358471
Richard Smith [Tue, 16 Apr 2019 01:44:53 +0000 (01:44 +0000)]
Tweak test to pass when using a non-integrated assembler.
llvm-svn: 358470
Julian Lettner [Tue, 16 Apr 2019 01:34:38 +0000 (01:34 +0000)]
[TSan][libdispatch] Port gcd-sync-block-copy.mm to C++
Summary:
Apparently, it makes a difference on where a block lives depending on if
it's passed "inline" versus assigned and then passed via a variable.
Both tests in this commit now give a signal, if `Block_copy` is used in
`dispatch_sync`.
Since these tests use different mechanisms (Objective-C retain versus
C++ copy constructor) as proxies to observe if the block was copied, we
should keep both of them.
Commit, that first avoided the unnecessary copy:
faef7d034a9ec6cb757137adce8e8670ec6c2d7b
Subscribers: kubamracek, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D60639
llvm-svn: 358469
Eric Christopher [Tue, 16 Apr 2019 01:06:03 +0000 (01:06 +0000)]
Remove some more unused headers from MachineFunction.h and friends.
Most of these headers are still included via transitive includes and
so won't likely show any problems or improvements in incremental
rebuild time.
Differential Revision: https://reviews.llvm.org/D60741
llvm-svn: 358468
Richard Smith [Tue, 16 Apr 2019 00:47:45 +0000 (00:47 +0000)]
PR41192: fix cases where "missing ';' after class" error would
incorrectly fire.
llvm-svn: 358467
Shoaib Meenai [Tue, 16 Apr 2019 00:18:50 +0000 (00:18 +0000)]
Reapply [Support] Fix recursive response file expansion guard
The test in the dependent revision has been fixed for Windows.
Original commit message:
Response file expansion limits the amount of expansion to prevent
potential infinite recursion. However, the current logic assumes that
any argument beginning with @ is a response file, which is not true for
e.g. `-Xlinker -rpath -Xlinker @executable_path/../lib` on Darwin.
Having too many of these non-response file arguments beginning with @
prevents actual response files from being expanded. Instead, limit based
on the number of successful response file expansions, which should still
prevent infinite recursion but also avoid false positives.
Differential Revision: https://reviews.llvm.org/D60631
> llvm-svn: 358452
llvm-svn: 358466
Shoaib Meenai [Tue, 16 Apr 2019 00:18:47 +0000 (00:18 +0000)]
Reapply [Support] Add a test for recursive response file expansion
Use the appropriate tokenizer to fix the test on Windows.
Original commit message:
I'm going to be modifying the logic to avoid infinitely recursing on
self-referential response files, so add a unit test to verify the
expected behavior.
Differential Revision: https://reviews.llvm.org/D60630
> llvm-svn: 358451
llvm-svn: 358465
David Blaikie [Tue, 16 Apr 2019 00:16:29 +0000 (00:16 +0000)]
DebugInfo: Default to standalone debug when tuning for LLDB
LLDB can't currently handle Clang's default (limit/no-standalone) DWARF,
so platforms that default to LLDB (Darwin) or anyone else manually
requesting LLDB tuning, should also get standalone DWARF.
That doesn't mean a user can't explicitly enable (because they have
other reasons to prefer standalone DWARF (such as that they're only
building half their application with debug info enabled, and half
without - or because they're tuning for GDB, but want to be able to use
it under LLDB too (this is the default on FreeBSD))) or disable (testing
LLDB fixes/improvements that handle no-standalone mode, building C code,
perhaps, which wouldn't have the LLDB<>no-standalone conflict, etc) the
feature regardless of the tuning.
llvm-svn: 358464
Richard Smith [Mon, 15 Apr 2019 23:55:58 +0000 (23:55 +0000)]
Simplify diagnosis of misplaced attributes in module-declarations.
No functional change intended.
llvm-svn: 358463
Shafik Yaghmour [Mon, 15 Apr 2019 23:05:45 +0000 (23:05 +0000)]
[ASTImporter] Regression test to ensure that we handling importing of anonymous enums correctly
Summary:
https://reviews.llvm.org/D51633 added error handling in the ASTImporter.cpp which uncovered an underlying bug in which we used the wrong name when handling naming conflicts. This could cause a segmentation fault when attempting to cast an int to an enum during expression parsing.
This test should pass once https://reviews.llvm.org/D59665 is committed.
Differential Revision: https://reviews.llvm.org/D59667
llvm-svn: 358462
Shoaib Meenai [Mon, 15 Apr 2019 22:51:54 +0000 (22:51 +0000)]
Revert [Support] Add a test for recursive response file expansion
This reverts r358451 (git commit
c8497467edc5766ae81ffbde58159f8c6af50803)
The test breaks a Windows buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17016/steps/test-check-all/logs/stdio
llvm-svn: 358461
Shoaib Meenai [Mon, 15 Apr 2019 22:51:53 +0000 (22:51 +0000)]
Revert [Support] Fix recursive response file expansion guard
This reverts r358452 (git commit
c8df4fb9c3865eac52a99602c26bbc070098c3d4)
A dependent commit breaks the Windows buildbots.
llvm-svn: 358460
Alex Lorenz [Mon, 15 Apr 2019 22:36:12 +0000 (22:36 +0000)]
Revert r358405: "[llvm-objdump] Align instructions to a tab stop in disassembly output"
The test fails on darwin due to a sed error:
sed: 1: "y/\t/ /": transform strings are not the same length
llvm-svn: 358459
Amara Emerson [Mon, 15 Apr 2019 22:34:08 +0000 (22:34 +0000)]
[AArch64][GlobalISel] Don't do extending loads combine for non-pow-2 types.
Since non-pow-2 types are going to get split up into multiple loads anyway,
don't do the [SZ]EXTLOAD combine for those and save us trouble later in
legalization.
llvm-svn: 358458
Quentin Colombet [Mon, 15 Apr 2019 22:23:46 +0000 (22:23 +0000)]
[LSR] Rewrite misses some fixup locations if it splits critical edge
If LSR split critical edge during rewriting phi operands and
phi node has other pending fixup operands, we need to
update those pending fixups. Otherwise formulae will not be
implemented completely and some instructions will not be eliminated.
llvm.org/PR41445
Differential Revision: https://reviews.llvm.org/D60645
Patch by: Denis Bakhvalov <denis.bakhvalov@intel.com>
llvm-svn: 358457
Sean Silva [Mon, 15 Apr 2019 22:07:56 +0000 (22:07 +0000)]
Only use argv[0] as the main executable name if it exists.
Under some environments, argv[0] doesn't hold a valid file name, but
sys::fs::getMainExecutable will find the main executable properly.
This patch tweaks the logic to fall back to sys::fs::getMainExecutable
in more situations.
Differential Revision: https://reviews.llvm.org/D60730
llvm-svn: 358455
Sanjay Patel [Mon, 15 Apr 2019 21:51:51 +0000 (21:51 +0000)]
[EarlyCSE] add more tests for double-negated select condition; NFC
llvm-svn: 358454
Douglas Yung [Mon, 15 Apr 2019 21:43:28 +0000 (21:43 +0000)]
Fix test on Windows that uses a different path separator character.
llvm-svn: 358453
Shoaib Meenai [Mon, 15 Apr 2019 21:31:28 +0000 (21:31 +0000)]
[Support] Fix recursive response file expansion guard
Response file expansion limits the amount of expansion to prevent
potential infinite recursion. However, the current logic assumes that
any argument beginning with @ is a response file, which is not true for
e.g. `-Xlinker -rpath -Xlinker @executable_path/../lib` on Darwin.
Having too many of these non-response file arguments beginning with @
prevents actual response files from being expanded. Instead, limit based
on the number of successful response file expansions, which should still
prevent infinite recursion but also avoid false positives.
Differential Revision: https://reviews.llvm.org/D60631
llvm-svn: 358452
Shoaib Meenai [Mon, 15 Apr 2019 21:31:25 +0000 (21:31 +0000)]
[Support] Add a test for recursive response file expansion
I'm going to be modifying the logic to avoid infinitely recursing on
self-referential response files, so add a unit test to verify the
expected behavior.
Differential Revision: https://reviews.llvm.org/D60630
llvm-svn: 358451
Craig Topper [Mon, 15 Apr 2019 21:06:32 +0000 (21:06 +0000)]
[X86] Limit the 'x' inline assembly constraint to zmm0-15 when used for a 512 type.
The 'v' constraint is used to select zmm0-31. This makes 512 bit consistent with 128/256-bit.a
llvm-svn: 358450
Craig Topper [Mon, 15 Apr 2019 21:06:23 +0000 (21:06 +0000)]
[X86] Fix a stack folding test to have a full xmm2-31 clobber list instead of stopping at xmm15. Add an additional dependency to keep instruction below inline asm block.
llvm-svn: 358449
Anton Afanasyev [Mon, 15 Apr 2019 21:02:47 +0000 (21:02 +0000)]
Time profiler: small fixes and optimizations
Summary: Fixes from Roman's review here: https://reviews.llvm.org/D58675#1465336
Reviewers: lebedev.ri
Subscribers: hiraditya, mgrang, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D60663
llvm-svn: 358448
Matt Arsenault [Mon, 15 Apr 2019 20:51:12 +0000 (20:51 +0000)]
AMDGPU: Fix unreachable when counting register usage of SGPR96
llvm-svn: 358447
Matt Arsenault [Mon, 15 Apr 2019 20:42:18 +0000 (20:42 +0000)]
AMDGPU: Fix printed format of SReg_96
These are artificial, so I think this should only come up with inline
asm comments.
llvm-svn: 358446
Alexey Bataev [Mon, 15 Apr 2019 20:38:10 +0000 (20:38 +0000)]
[OPENMP][NVPTX]Run parallel regions with num_threads clauses in SPMD
mode.
After the previous patch with the more correct handling of the number of
threads in parallel regions, the parallel regions with num_threads
clauses can be executed in SPMD mode.
llvm-svn: 358445
Sanjay Patel [Mon, 15 Apr 2019 20:25:31 +0000 (20:25 +0000)]
[EarlyCSE] add test for select condition double-negation; NFC
llvm-svn: 358444
Alex Lorenz [Mon, 15 Apr 2019 20:16:19 +0000 (20:16 +0000)]
Revert r358418: "[llvm-objdump] Simplify PrintHelpMessage() logic"
This reverts commit r358418 as it broke `test/Object/objdump-export-list`
on Darwin.
llvm-svn: 358443
Alexey Bataev [Mon, 15 Apr 2019 20:15:20 +0000 (20:15 +0000)]
[OPENMP][NVPTX]Fix dynamic scheduling in L2+ SPMD parallel regions.
Summary:
If the kernel is executed in SPMD mode and the L2+ parallel for region
with the dynamic scheduling is executed, dynamic scheduling functions
are called. They expect full runtime support, but SPMD kernels may be
executed without the full runtime. It leads to the runtime crash of the
compiled program. Patch fixes this problem + fixes handling of the
parallelism level in SPMD mode, which is required as part of this patch.
Reviewers: gtbercea, kkwli0, grokos
Subscribers: guansong, jdoerfert, openmp-commits, caomhin
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D60578
llvm-svn: 358442
Reuben Thomas [Mon, 15 Apr 2019 20:13:20 +0000 (20:13 +0000)]
[clang-format] Fix -Wconversion-null warning in GCC
GCC -Wconversion-null warning appeared after
9a63380260860b657b72f07c4f0e61e382ab934a.
There was a similar problem already in the past:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20131230/096230.html
Patch committed on behalf of @dendibakh
Differential Revision: https://reviews.llvm.org/D60726
llvm-svn: 358441
Bob Haarman [Mon, 15 Apr 2019 19:48:32 +0000 (19:48 +0000)]
[LLD][COFF] use offset in archive to disambiguate archive members
Summary:
Archives can contain multiple members with the same name. This would
cause ThinLTO links to fail ("Expected at most one ThinLTO module per
bitcode file"). This change implements the same strategy we use in
the ELF linker: make the offset in the archive part of the module
name so that names are unique.
Reviewers: pcc, mehdi_amini, ruiu
Reviewed By: ruiu
Subscribers: eraman, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60549
llvm-svn: 358440
Philip Reames [Mon, 15 Apr 2019 19:45:27 +0000 (19:45 +0000)]
[Tests] Add a few more tests for LoopPredication w/invariant loads
Making sure to cover an important legality cornercase.
llvm-svn: 358439
Jonathan Peyton [Mon, 15 Apr 2019 19:19:57 +0000 (19:19 +0000)]
[OpenMP] Exchange code in asm file for inline assembly
This change replaces some of the assembly functions in z_Linux_asm.S
for inline asm in kmp.h. This allows better interaction with compiler
tools and sanitizers.
Differential Revision: https://reviews.llvm.org/D60423
llvm-svn: 358438
Louis Dionne [Mon, 15 Apr 2019 19:08:52 +0000 (19:08 +0000)]
Revert "[clang] Aligned allocation is actually supported in macosx 10.13"
This reverts r358409, which I think broke the bots in compiler-rt.
Since I'm having trouble reproducing the failure, I'm reverting this
until I can investigate locally.
llvm-svn: 358437
Craig Topper [Mon, 15 Apr 2019 18:39:45 +0000 (18:39 +0000)]
[X86] Block i32/i64 for 'k' and 'Yk' in getRegForInlineAsmConstraint without avx512bw.
32 and 64 bit k-registers require avx512bw. If we don't block this properly, it leads to a crash.
llvm-svn: 358436
Craig Topper [Mon, 15 Apr 2019 18:39:36 +0000 (18:39 +0000)]
[X86] Improve avx512-kconstraints-att_inline_asm.c to not be easily defeated by deadcode elimination. Improve CHECK lines to check IR types used. NFC
I plan to use this as the basis for backend IR test cases. We currently crash hard for using 32 or 64 bit mask registers without avx512bw.
llvm-svn: 358435
Philip Reames [Mon, 15 Apr 2019 18:15:08 +0000 (18:15 +0000)]
[LoopPred] Stop passing around builders [NFC]
This is a preparatory patch for D60093. This patch itself is NFC, but while preparing this I noticed and committed a small hoisting change in rL358419.
The basic structure of the new scheme is that we pass around the guard ("the using instruction"), and select an optimal insert point by examining operands at each construction point. This seems conceptually a bit cleaner to start with as it isolates the knowledge about insertion safety at the actual insertion point.
Note that the non-hoisting path is not actually used at the moment. That's not exercised until D60093 is rebased on this one.
Differential Revision: https://reviews.llvm.org/D60718
llvm-svn: 358434
Louis Dionne [Mon, 15 Apr 2019 18:00:01 +0000 (18:00 +0000)]
[libc++] Fix debug_less test in C++03
We were using C++11 features but the test needs to work in C++03 too.
llvm-svn: 358433
Sanjay Patel [Mon, 15 Apr 2019 17:38:47 +0000 (17:38 +0000)]
[x86] update test checks; NFC
llvm-svn: 358432
Wolfgang Pieb [Mon, 15 Apr 2019 17:36:29 +0000 (17:36 +0000)]
[DEBUGINFO] Prevent Instcombine from dropping debuginfo when removing zexts
Zexts can be treated like no-op casts when it comes to assessing whether their
removal affects debug info.
Reviewer: aprantl
Differential Revision: https://reviews.llvm.org/D60641
llvm-svn: 358431
Pete Couperus [Mon, 15 Apr 2019 17:36:19 +0000 (17:36 +0000)]
Add explicit dependency to MCDwarf.h in ARC backend.
llvm-svn: 358430
Hiroshi Yamauchi [Mon, 15 Apr 2019 17:29:21 +0000 (17:29 +0000)]
Fix header guard typo and build error.
llvm-svn: 358429
Don Hinton [Mon, 15 Apr 2019 17:18:10 +0000 (17:18 +0000)]
[CommandLineParser] Add DefaultOption flag
Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.
Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.
(relanding after revert, r358414)
Added DefaultOptions.clear() to reset().
Reviewers: alexfh, klimek
Reviewed By: klimek
Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D59746
llvm-svn: 358428
Craig Topper [Mon, 15 Apr 2019 17:17:35 +0000 (17:17 +0000)]
[X86] Restore the pavg intrinsics.
The pattern we replaced these with may be too hard to match as demonstrated by
PR41496 and PR41316.
This patch restores the intrinsics and then we can start focusing
on the optimizing the intrinsics.
I've mostly reverted the original patch that removed them. Though I modified
the avx512 intrinsics to not have masking built in.
Differential Revision: https://reviews.llvm.org/D60674
llvm-svn: 358427
Sean Fertile [Mon, 15 Apr 2019 17:08:43 +0000 (17:08 +0000)]
Add slbfee instruction.
llvm-svn: 358425
Thomas Anderson [Mon, 15 Apr 2019 17:02:15 +0000 (17:02 +0000)]
[libc++] Fix build failure with _LIBCPP_DEBUG=0 when iterators return values instead of references
There are many STL algorithms (such as lexicographical_compare) that compare
values pointed to by iterators like so:
__comp(*it1, *it2);
When building with `_LIBCPP_DEBUG=0`, comparators are wrapped in `__debug_less`
which does some additional validation. But `__debug_less::operator()` takes
non-const references, so if the type of `*it1` is int, not int&, then the build
will fail.
This change adds a `const&` overload for `operator()` to fix the build.
Differential Revision: https://reviews.llvm.org/D60592
llvm-svn: 358423
Hiroshi Yamauchi [Mon, 15 Apr 2019 16:49:00 +0000 (16:49 +0000)]
[PGO] Profile guided code size optimization.
Summary:
Enable some of the existing size optimizations for cold code under PGO.
A ~5% code size saving in big internal app under PGO.
The way it gets BFI/PSI is discussed in the RFC thread
http://lists.llvm.org/pipermail/llvm-dev/2019-March/130894.html
Note it doesn't currently touch loop passes.
Reviewers: davidxl, eraman
Reviewed By: eraman
Subscribers: mgorny, javed.absar, smeenai, mehdi_amini, eraman, zzheng, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59514
llvm-svn: 358422
Nico Weber [Mon, 15 Apr 2019 16:42:44 +0000 (16:42 +0000)]
llvm-undname: Fix nullptr deref on invalid conversion operator names in template args
A ConversionOperatorIdentifierNode has a TargetType which is read when
printing it, but if the ConversionOperatorIdentifierNode appears in a
template argument there's nothing that can provide the TargetType.
Normally the COIN is a symbol (leaf) name and takes its TargetType from the
symbol's type, but in a template argument context the COIN can only be
either a non-leaf name piece or a type, and must hence be invalid.
Similar to the COIN check in demangleDeclarator().
Found by oss-fuzz.
llvm-svn: 358421
Sanjay Patel [Mon, 15 Apr 2019 16:01:05 +0000 (16:01 +0000)]
[EarlyCSE] add tests for selects with commuted operands (PR41101); NFC
llvm-svn: 358420
Philip Reames [Mon, 15 Apr 2019 15:53:25 +0000 (15:53 +0000)]
[LoopPred] Hoist and of predicated checks where legal
If we have multiple range checks which can be predicated, hoist the and of the results outside the loop. This minorly cleans up the resulting IR, but the main motivation is as a building block for D60093.
llvm-svn: 358419
Fangrui Song [Mon, 15 Apr 2019 15:52:32 +0000 (15:52 +0000)]
[llvm-objdump] Simplify PrintHelpMessage() logic
llvm-svn: 358418
Fangrui Song [Mon, 15 Apr 2019 15:31:42 +0000 (15:31 +0000)]
[llvm-objdump] Wrap things in namespace llvm
llvm-svn: 358417
Fangrui Song [Mon, 15 Apr 2019 15:08:01 +0000 (15:08 +0000)]
[llvm-objdump] Delete unused forward declarations
llvm-svn: 358416
Fangrui Song [Mon, 15 Apr 2019 15:00:10 +0000 (15:00 +0000)]
[llvm-objdump] Reorganize cl::opt variables and move Mach-O specifics to MachODump.cpp
llvm-svn: 358415
Ilya Biryukov [Mon, 15 Apr 2019 14:43:50 +0000 (14:43 +0000)]
Revert r358337: "[CommandLineParser] Add DefaultOption flag"
The change causes test failures under asan. Reverting to unbreak our
integrate.
llvm-svn: 358414
Kadir Cetinkaya [Mon, 15 Apr 2019 14:38:46 +0000 (14:38 +0000)]
[clangd] Fallback to OrigD when SLoc is invalid
Summary:
Some implicit/built-in decls lack the source location
information. Fallback to OrigD that we've seen in the source code
instead of the canonical one in those cases.
Reviewers: sammccall
Subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60689
llvm-svn: 358413
Louis Dionne [Mon, 15 Apr 2019 14:29:33 +0000 (14:29 +0000)]
[NFC] Add missing revision number in libc++ ABI changelog
llvm-svn: 358411
Louis Dionne [Mon, 15 Apr 2019 14:14:45 +0000 (14:14 +0000)]
[clang] Aligned allocation is actually supported in macosx 10.13
Summary:
In r350649, I changed aligned allocation from being available starting
in macosx10.13 to macosx10.14. However, aligned allocation is indeed
available starting with macosx10.13, my investigation had been based
on the wrong libc++abi dylib.
This means that Clang before the fix will be more stringent when it
comes to aligned allocation -- it will not allow it when back-deploying
to macosx 10.13, when it would actually be safe to do so.
Note that a companion change will be coming to fix the libc++ tests.
Reviewers: ahatanak
Subscribers: jkorous, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60626
llvm-svn: 358409
Louis Dionne [Mon, 15 Apr 2019 14:04:52 +0000 (14:04 +0000)]
[libc++] Make sure that the symbol differ takes into account symbol types
Summary:
Otherwise, it doesn't take into account things like whether the symbol
is defined or undefined, and whether symbols are indirect references
(re-exports) or not.
Reviewers: EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D60416
llvm-svn: 358408
Sanjay Patel [Mon, 15 Apr 2019 14:02:37 +0000 (14:02 +0000)]
[EarlyCSE] regenerate test checks; NFC
llvm-svn: 358407
Fangrui Song [Mon, 15 Apr 2019 13:32:41 +0000 (13:32 +0000)]
[llvm-objdump] Align instructions to a tab stop in disassembly output
Summary:
In GNU objdump, -w/--wide aligns instructions in the disassembly output.
This patch does the same to llvm-objdump. However, we always use the
wide format (-w/--wide is ignored), because the narrow format
(instructions are misaligned) is probably not very useful.
In llvm-readobj, we made a similar decision: always use the wide format,
accept but ignore -W/--wide.
To save some columns, we change the tab before hex bytes (controlled by
--[no-]show-raw-insn) to a space.
Reviewers: rupprecht, jhenderson, grimar
Reviewed By: jhenderson
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60376
llvm-svn: 358405
Sanjay Patel [Mon, 15 Apr 2019 13:23:38 +0000 (13:23 +0000)]
[InstCombine] canonicalize fdiv after fmul if reassociation is allowed
(X / Y) * Z --> (X * Z) / Y
This can allow other optimizations/reassociations as shown in the test diffs.
llvm-svn: 358404
Hans Wennborg [Mon, 15 Apr 2019 13:02:03 +0000 (13:02 +0000)]
clang-format vs plugin: Visual Studio 2019 support
llvm-svn: 358402
Eric Liu [Mon, 15 Apr 2019 12:32:28 +0000 (12:32 +0000)]
[clangd] Wait for compile command in ASTWorker instead of ClangdServer
Summary:
This makes addDocument non-blocking and would also allow code completion
(in fallback mode) to run when worker waits for the compile command.
Reviewers: sammccall, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: javed.absar, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60607
llvm-svn: 358400
Tim Northover [Mon, 15 Apr 2019 12:04:10 +0000 (12:04 +0000)]
DAG: propagate ConsecutiveRegs flags to returns too.
Arguments already have a flag to inform backends when they have been split up.
The AArch64 arm64_32 ABI makes use of these on return types too, so that code
emitted for armv7k can be ABI-compliant.
There should be no CodeGen changes yet, just making more information available.
llvm-svn: 358399
Tim Northover [Mon, 15 Apr 2019 12:03:54 +0000 (12:03 +0000)]
DAG: propagate whether an arg is a pointer for CallingConv decisions.
The arm64_32 ABI specifies that pointers (despite being 32-bits) should be
zero-extended to 64-bits when passed in registers for efficiency reasons. This
means that the SelectionDAG needs to be able to tell the backend that an
argument was originally a pointer, which is implmented here.
Additionally, some memory intrinsics need to be declared as taking an i8*
instead of an iPTR.
There should be no CodeGen change yet, but it will be triggered when AArch64
backend support for ILP32 is added.
llvm-svn: 358398
Nico Weber [Mon, 15 Apr 2019 11:25:23 +0000 (11:25 +0000)]
gn build: Merge r358390
llvm-svn: 358397
Eugene Leviant [Mon, 15 Apr 2019 11:21:47 +0000 (11:21 +0000)]
[llvm-readelf] Correctly dump symbols whose section id is SHN_XINDEX
Differential revision: https://reviews.llvm.org/D60614
llvm-svn: 358396
Stephen Tozer [Mon, 15 Apr 2019 11:17:48 +0000 (11:17 +0000)]
[llvm-readobj] Reapply: Improve error message for --string-dump
This is a resubmission of a previous patch that caused test failures,
with the fixes for the relevant tests included.
Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630
This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.
llvm-svn: 358395
Martin Storsjo [Mon, 15 Apr 2019 10:57:44 +0000 (10:57 +0000)]
[COFF] Link crtend.o as the last object file
When faced with command line options such as "crtbegin.o appmain.o
-lsomelib crtend.o", GNU ld pulls in all necessary object files from
somelib before proceeding to crtend.o.
LLD operates differently, only loading object files from any
referenced static libraries after processing all input object files.
This uses a similar hack as in the ELF linker. Here, it moves crtend.o
to the end of the vector of object files. This makes sure that
terminator chunks for sections such as .eh_frame gets ordered last,
fixing DWARF exception handling for libgcc and gcc's crtend.o.
Differential Revision: https://reviews.llvm.org/D60628
llvm-svn: 358394
Martin Storsjo [Mon, 15 Apr 2019 10:57:09 +0000 (10:57 +0000)]
[MinGW] Remove some supefluous calls to MakeArgString. NFC.
llvm-svn: 358393
Tim Renouf [Mon, 15 Apr 2019 10:36:24 +0000 (10:36 +0000)]
[AMDGPU] Fixed incorrect test in vcnd/vcmp optimization
This fixes a test I introduced in change D59191 (that added src0 and
src1 modifiers to the v_cndmask instruction for disassembly purposes).
Spotted by David Binderman in bug 41488.
Differential Revision: https://reviews.llvm.org/D60652
Change-Id: I6ac95e66cd84e812ed3359ad57bcd0e13198ba0c
llvm-svn: 358392
Jeremy Morse [Mon, 15 Apr 2019 10:23:22 +0000 (10:23 +0000)]
[Docs] Switch a code block from LLVM to text
While I can't replicate this locally, it looks like the buildbots don't
recognize the IR block in r358385 l764 as IR. Downgrade it to being just
text while I look into it.
http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30132
llvm-svn: 358391
Thomas Preud'homme [Mon, 15 Apr 2019 10:10:11 +0000 (10:10 +0000)]
FileCheck [1/12]: Move variable table in new object
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds a new class to hold
pattern matching global state.
The table holding the values of FileCheck variable constitutes some sort
of global state for the matching phase, yet is passed as parameters of
all functions using it. This commit create a new FileCheckPatternContext
class pointed at from FileCheckPattern. While it increases the line
count, it separates local data from global state. Later commits build
on that to add numeric expression global state to that class.
Copyright:
- Linaro (changes up to diff 183612 of revision D55940)
- GraphCore (changes in later versions of revision D55940 and
in new revision created off D55940)
Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60381
llvm-svn: 358390
Simon Tatham [Mon, 15 Apr 2019 10:06:26 +0000 (10:06 +0000)]
[TableGen] Include schedule model name in diagnostic.
If you have more than one schedule model in your TableGen target
definitions, then the diagnostic "No schedule information for
instruction 'foo'" is rather unhelpful, because it doesn't tell you
_which_ schedule model is missing the necessary information (or, as it
might be, missing the UnsupportedFeatures definition that would stop
it thinking it needed it).
Extended the message to include the name of the schedule model that
it's complaining about.
Reviewers: nhaehnle, hfinkel, javedabsar, efriedma, javed.absar
Reviewed By: javed.absar
Subscribers: javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60559
llvm-svn: 358389
Jeremy Morse [Mon, 15 Apr 2019 10:04:52 +0000 (10:04 +0000)]
[Docs] Correct some indentation muppetry that trips buildbots
llvm-svn: 358388
Fangrui Song [Mon, 15 Apr 2019 10:02:36 +0000 (10:02 +0000)]
[DWARF] Fix DWARFVerifier::DieRangeInfo::contains
It didn't handle empty LHS correctly. If two ranges of LHS were
contiguous and jointly contained one range of RHS, it could also be incorrect.
DWARFAddressRange::contains can be removed and its tests can be merged into DWARFVerifier::DieRangeInfo::contains
llvm-svn: 358387
Jeremy Morse [Mon, 15 Apr 2019 09:42:38 +0000 (09:42 +0000)]
[DebugInfo][Docs] Document variable location metadata transformations
This patch adds documentation explaining how variable location information is
compiled from the IR representation down to the end of the codegen pipeline,
but avoiding discussion of file formats and encoding.
This should make it clearer how the dbg.value / dbg.declare etc intrinsics
are transformed and arranged into DBG_VALUE instructions, and their meaning.
Differential Revision: https://reviews.llvm.org/D59790
llvm-svn: 358385
Yevgeny Rouban [Mon, 15 Apr 2019 09:30:31 +0000 (09:30 +0000)]
Codegen: Fixed perf branch_weights in couple of tests. NFC.
This is need to pass future checks of perf branch_weights metadata.
llvm-svn: 358384
Kadir Cetinkaya [Mon, 15 Apr 2019 09:18:57 +0000 (09:18 +0000)]
[clangd] Bump clangd-index version for TemplateArgument changes
llvm-svn: 358383
Fangrui Song [Mon, 15 Apr 2019 09:01:10 +0000 (09:01 +0000)]
Revert "[DWARF] Delete redundant check in DWARFAddressRange::intersects"
This reverts rL358377. It isn't redundant, though the semantic seems weird.
llvm-svn: 358381
Alexander Potapenko [Mon, 15 Apr 2019 08:59:56 +0000 (08:59 +0000)]
[Transforms][ASan] Move findAllocaForValue() to Utils/Local.cpp. NFC
Summary:
Factor out findAllocaForValue() from ASan so that we can use it in
MSan to handle lifetime intrinsics.
Reviewers: eugenis, pcc
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60615
llvm-svn: 358380
Serguei Katkov [Mon, 15 Apr 2019 08:57:53 +0000 (08:57 +0000)]
[NewPM] Add Option handling for SimplifyCFG
This patch enables passing options to SimplifyCFGPass via the passes pipeline.
Reviewers: chandlerc, fedor.sergeev, leonardchan, philip.pfaffe
Reviewed By: fedor.sergeev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60675
llvm-svn: 358379
Eric Liu [Mon, 15 Apr 2019 08:46:34 +0000 (08:46 +0000)]
[Lookup] Invisible decls should not be ambiguous when renaming.
Summary:
For example, a renamed type in a header file can conflict with declaration in
a random file that includes the header, but we should not consider the decl ambiguous if
it's not visible at the rename location. This improves consistency of generated replacements
when header file is included in different TUs.
Reviewers: hokein
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60257
llvm-svn: 358378
Fangrui Song [Mon, 15 Apr 2019 08:36:21 +0000 (08:36 +0000)]
[DWARF] Delete redundant check in DWARFAddressRange::intersects
llvm-svn: 358377
Fangrui Song [Mon, 15 Apr 2019 08:30:10 +0000 (08:30 +0000)]
[DWARF] Fix DWARFVerifier::DieRangeInfo::intersects
It was incorrect if RHS had more than 1 ranges and one of the ranges interacted with *this
llvm-svn: 358376
Paul Hoad [Mon, 15 Apr 2019 07:47:15 +0000 (07:47 +0000)]
[clang-format] [PR41170] Break after return type ignored with certain comments positions
Summary:
Addresses https://bugs.llvm.org/show_bug.cgi?id=41170
The AlwaysBreakAfterReturn type setting can go wrong if the line ends with a comment
```
void foo() /* comment */
```
or
```
void foo() // comment
```
It will incorrectly see such functions as Declarations and not Definitions
The following code addresses this by looking for function which end with `; <comment>` rather than just `;` or `<comment>`
Reviewers: klimek, djasper, reuk, russellmcc, owenpan, sammccall
Reviewed By: owenpan
Subscribers: lebedev.ri, cfe-commits, sammccall
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60363
llvm-svn: 358375
Fangrui Song [Mon, 15 Apr 2019 07:40:30 +0000 (07:40 +0000)]
[DWARF] Make DWARFDebugLine::ParsingState::RowNumber a local variable
llvm-svn: 358374
Kadir Cetinkaya [Mon, 15 Apr 2019 07:21:17 +0000 (07:21 +0000)]
[clangd] Reorder source files in CMakeLists
llvm-svn: 358373
Bjorn Pettersson [Mon, 15 Apr 2019 07:19:11 +0000 (07:19 +0000)]
[SelectionDAG] Use KnownBits::computeForAddSub/computeForAddCarry
Summary:
Use KnownBits::computeForAddSub/computeForAddCarry
in SelectionDAG::computeKnownBits when doing value
tracking for addition/subtraction.
This should improve the precision of the known bits,
as we only used to make a simple estimate of known
zeroes. The KnownBits support functions are also
able to deduce bits that are known to be one in the
result.
Reviewers: spatel, RKSimon, nikic, lebedev.ri
Reviewed By: nikic
Subscribers: nikic, javed.absar, lebedev.ri, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60460
llvm-svn: 358372
Craig Topper [Mon, 15 Apr 2019 05:22:47 +0000 (05:22 +0000)]
[X86] Regenerate checks for domain-reassignment.mir
Apparently there are some stray IMPLICIT_DEF operations that weren't in the
checks. Not sure if they've always been there or something changed at some
point.
llvm-svn: 358371
Jim Lin [Mon, 15 Apr 2019 05:16:46 +0000 (05:16 +0000)]
[Sparc] Fix typo. NFC.
llvm-svn: 358370
Amara Emerson [Mon, 15 Apr 2019 05:04:20 +0000 (05:04 +0000)]
[GlobalISel] Enable CSE in the IRTranslator & legalizer for -O0 with constants only.
Other opcodes shouldn't be CSE'd until we can be sure debug info quality won't
be degraded.
This change also improves the IRTranslator so that in most places, but not all,
it creates constants using the MIRBuilder directly instead of first creating a
new destination vreg and then creating a constant. By doing this, the
buildConstant() method can just return the vreg of an existing G_CONSTANT
instead of having to create a COPY from it.
I measured a 0.2% improvement in compile time and a 0.9% improvement in code
size at -O0 ARM64.
Compile time:
Program base cse diff
test-suite...ark/tramp3d-v4/tramp3d-v4.test 9.04 9.12 0.8%
test-suite...Mark/mafft/pairlocalalign.test 2.68 2.66 -0.7%
test-suite...-typeset/consumer-typeset.test 5.53 5.51 -0.4%
test-suite :: CTMark/lencod/lencod.test 5.30 5.28 -0.3%
test-suite :: CTMark/Bullet/bullet.test 25.82 25.76 -0.2%
test-suite...:: CTMark/ClamAV/clamscan.test 6.92 6.90 -0.2%
test-suite...TMark/7zip/7zip-benchmark.test 34.24 34.17 -0.2%
test-suite :: CTMark/SPASS/SPASS.test 6.25 6.24 -0.1%
test-suite...:: CTMark/sqlite3/sqlite3.test 1.66 1.66 -0.1%
test-suite :: CTMark/kimwitu++/kc.test 13.61 13.60 -0.0%
Geomean difference -0.2%
Code size:
Program base cse diff
test-suite...-typeset/consumer-typeset.test 1315632 1266480 -3.7%
test-suite...:: CTMark/ClamAV/clamscan.test 1313892 1297508 -1.2%
test-suite :: CTMark/lencod/lencod.test 1439504 1423112 -1.1%
test-suite...TMark/7zip/7zip-benchmark.test 2936980 2904172 -1.1%
test-suite :: CTMark/Bullet/bullet.test 3478276 3445460 -0.9%
test-suite...ark/tramp3d-v4/tramp3d-v4.test 8082868 8033492 -0.6%
test-suite :: CTMark/kimwitu++/kc.test 3870380 3853972 -0.4%
test-suite :: CTMark/SPASS/SPASS.test 1434904 1434896 -0.0%
test-suite...Mark/mafft/pairlocalalign.test 764528 764528 0.0%
test-suite...:: CTMark/sqlite3/sqlite3.test 782092 782092 0.0%
Geomean difference -0.9%
Differential Revision: https://reviews.llvm.org/D60580
llvm-svn: 358369
Amara Emerson [Mon, 15 Apr 2019 04:53:46 +0000 (04:53 +0000)]
[GlobalISel] Introduce a CSEConfigBase class to allow targets to define their own CSE configs.
Because CodeGen can't depend on GlobalISel, we need a way to encapsulate the CSE
configs that can be passed between TargetPassConfig and the targets' custom
pass configs. This CSEConfigBase allows targets to create custom CSE configs
which is then used by the GISel passes for the CSEMIRBuilder.
This support will be used in a follow up commit to allow constant-only CSE for
-O0 compiles in D60580.
llvm-svn: 358368
Nico Weber [Sun, 14 Apr 2019 23:32:37 +0000 (23:32 +0000)]
llvm-undname: Fix oss-fuzz-foudn crash-on-invalid with incomplete special table nodes
llvm-svn: 358367
Nico Weber [Sun, 14 Apr 2019 23:23:14 +0000 (23:23 +0000)]
gn build: Merge r358297
llvm-svn: 358366
Nico Weber [Sun, 14 Apr 2019 23:21:58 +0000 (23:21 +0000)]
gn build: Merge r358243
llvm-svn: 358365
Nico Weber [Sun, 14 Apr 2019 23:19:32 +0000 (23:19 +0000)]
gn build: Merge r358272
llvm-svn: 358364