Commit Graph

314504 Commits

Author SHA1 Message Date
Shoaib Meenai 8eeb56d133 Revert [Support] Add a test for recursive response file expansion
This reverts r358451 (git commit c8497467ed)

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
2019-04-15 22:51:54 +00:00
Shoaib Meenai d60ac111e6 Revert [Support] Fix recursive response file expansion guard
This reverts r358452 (git commit c8df4fb9c3)

A dependent commit breaks the Windows buildbots.

llvm-svn: 358460
2019-04-15 22:51:53 +00:00
Alex Lorenz d9d0c3e138 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
2019-04-15 22:36:12 +00:00
Amara Emerson 02a90ea73d [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
2019-04-15 22:34:08 +00:00
Quentin Colombet fda0426888 [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
2019-04-15 22:23:46 +00:00
Sean Silva de68a37518 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
2019-04-15 22:07:56 +00:00
Sanjay Patel 800a0c3e4b [EarlyCSE] add more tests for double-negated select condition; NFC
llvm-svn: 358454
2019-04-15 21:51:51 +00:00
Douglas Yung 45129145b9 Fix test on Windows that uses a different path separator character.
llvm-svn: 358453
2019-04-15 21:43:28 +00:00
Shoaib Meenai c8df4fb9c3 [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
2019-04-15 21:31:28 +00:00
Shoaib Meenai c8497467ed [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
2019-04-15 21:31:25 +00:00
Craig Topper 0495f29e42 [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
2019-04-15 21:06:32 +00:00
Craig Topper 77439bb128 [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
2019-04-15 21:06:23 +00:00
Anton Afanasyev 2653672859 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
2019-04-15 21:02:47 +00:00
Matt Arsenault 101abd219b AMDGPU: Fix unreachable when counting register usage of SGPR96
llvm-svn: 358447
2019-04-15 20:51:12 +00:00
Matt Arsenault fbdd2a1887 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
2019-04-15 20:42:18 +00:00
Alexey Bataev e0eb13135f [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
2019-04-15 20:38:10 +00:00
Sanjay Patel 5ae05d810c [EarlyCSE] add test for select condition double-negation; NFC
llvm-svn: 358444
2019-04-15 20:25:31 +00:00
Alex Lorenz 16256123d0 Revert r358418: "[llvm-objdump] Simplify PrintHelpMessage() logic"
This reverts commit r358418 as it broke `test/Object/objdump-export-list`
on Darwin.

llvm-svn: 358443
2019-04-15 20:16:19 +00:00
Alexey Bataev 13532ea623 [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
2019-04-15 20:15:20 +00:00
Reuben Thomas 407dd4d169 [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
2019-04-15 20:13:20 +00:00
Bob Haarman 8b1ec798b5 [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
2019-04-15 19:48:32 +00:00
Philip Reames af808ee2ee [Tests] Add a few more tests for LoopPredication w/invariant loads
Making sure to cover an important legality cornercase.

llvm-svn: 358439
2019-04-15 19:45:27 +00:00
Jonathan Peyton 4f21f5f5ce [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
2019-04-15 19:19:57 +00:00
Louis Dionne 0fa94ee318 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
2019-04-15 19:08:52 +00:00
Craig Topper 3d9b47c770 [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
2019-04-15 18:39:45 +00:00
Craig Topper a54a11e22a [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
2019-04-15 18:39:36 +00:00
Philip Reames e46d77d1d9 [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
2019-04-15 18:15:08 +00:00
Louis Dionne e1e1bd7f9c [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
2019-04-15 18:00:01 +00:00
Sanjay Patel 8ae68f2648 [x86] update test checks; NFC
llvm-svn: 358432
2019-04-15 17:38:47 +00:00
Wolfgang Pieb 4fe42214e2 [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
2019-04-15 17:36:29 +00:00
Pete Couperus 3929c432e6 Add explicit dependency to MCDwarf.h in ARC backend.
llvm-svn: 358430
2019-04-15 17:36:19 +00:00
Hiroshi Yamauchi 5221532a4e Fix header guard typo and build error.
llvm-svn: 358429
2019-04-15 17:29:21 +00:00
Don Hinton b85f74a283 [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
2019-04-15 17:18:10 +00:00
Craig Topper 8e364c680f [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
2019-04-15 17:17:35 +00:00
Sean Fertile 8d856488a8 Add slbfee instruction.
llvm-svn: 358425
2019-04-15 17:08:43 +00:00
Thomas Anderson 3c3ccc0049 [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
2019-04-15 17:02:15 +00:00
Hiroshi Yamauchi 09e539fcae [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
2019-04-15 16:49:00 +00:00
Nico Weber 64041d7b90 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
2019-04-15 16:42:44 +00:00
Sanjay Patel 0e0bb0e24a [EarlyCSE] add tests for selects with commuted operands (PR41101); NFC
llvm-svn: 358420
2019-04-15 16:01:05 +00:00
Philip Reames fbe64a2cfb [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
2019-04-15 15:53:25 +00:00
Fangrui Song 204339a234 [llvm-objdump] Simplify PrintHelpMessage() logic
llvm-svn: 358418
2019-04-15 15:52:32 +00:00
Fangrui Song 523758ef5b [llvm-objdump] Wrap things in namespace llvm
llvm-svn: 358417
2019-04-15 15:31:42 +00:00
Fangrui Song 8c1353dd14 [llvm-objdump] Delete unused forward declarations
llvm-svn: 358416
2019-04-15 15:08:01 +00:00
Fangrui Song 9d812f4499 [llvm-objdump] Reorganize cl::opt variables and move Mach-O specifics to MachODump.cpp
llvm-svn: 358415
2019-04-15 15:00:10 +00:00
Ilya Biryukov 70921d4a86 Revert r358337: "[CommandLineParser] Add DefaultOption flag"
The change causes test failures under asan. Reverting to unbreak our
integrate.

llvm-svn: 358414
2019-04-15 14:43:50 +00:00
Kadir Cetinkaya bb6cd8254c [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
2019-04-15 14:38:46 +00:00
Louis Dionne 5e165fba3a [NFC] Add missing revision number in libc++ ABI changelog
llvm-svn: 358411
2019-04-15 14:29:33 +00:00
Louis Dionne f2073321c9 [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
2019-04-15 14:14:45 +00:00
Louis Dionne f3e4f24ed7 [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
2019-04-15 14:04:52 +00:00
Sanjay Patel c71433335a [EarlyCSE] regenerate test checks; NFC
llvm-svn: 358407
2019-04-15 14:02:37 +00:00