Commit Graph

352460 Commits

Author SHA1 Message Date
Yaxun (Sam) Liu b46b1a916d recommit c77a4078e0 2020-04-24 16:53:18 -04:00
David Blaikie a8e5dcb072 Fix bug in SmallBitVector::find_next_unset
Summary: find_next_unset was returning size() instead of -1 in small-mode, when no unset bits are found.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D77985
2020-04-24 13:50:30 -07:00
Alexandre Ganea 65fe71be48 Revert "[MC] Fix quadratic behavior in addPendingLabel()"
This reverts commit e98f73a629.
2020-04-24 16:43:10 -04:00
Craig Topper 03aa967c0d [CostModel][X86][ARM] Teach getCastInstrCost to include the splitting factor when handling operations that type legalize to the same number of subvectors or scalar components
Previously, we just always returned 1. But that ignores that we have to do the operation for each subvector or scalar component.

Differential Revision: https://reviews.llvm.org/D78824
2020-04-24 13:36:26 -07:00
Ron Lieberman ee9c53d271 [libomptarget] Initialize reference parameter IsNew within Device::getOrAllocTgtPtr
The two locals IsNew and Pointer_IsNew were uninitialized at declaration, and then passed by
reference to Device.getOrAllocTgtPtr which in turn did not assign on all
paths within the function. This resulted in occasional runtime failures in one application.
Device::getOrAllocTgtPtr will now initialize IsNew to false on entry to function.

Differential Revision: https://reviews.llvm.org/D78744
2020-04-24 15:33:37 -05:00
Pengxuan Zheng 79702dd349 [RISCV] Add instruction definition for dret
Summary:
The instruction dret is used to return from debug mode and is defined in the
RISC-V debug mode spec.

https://github.com/riscv/riscv-opcodes/blob/master/opcodes-system

Reviewers: apazos, asb, lenary, luismarques

Reviewed By: apazos

Subscribers: jfb, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, sameer.abuasal, evandro, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78583
2020-04-24 13:27:43 -07:00
Tyker 97ecd91e20 [NFC] Refactor SimplifyCFG to make propagating information easier.
Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77742
2020-04-24 22:22:20 +02:00
Adrian Prantl 79feafa514 Add an internal bit to the XcodeSDK class.
For developing the OS itself there exists an "internal" variant of
each SDK. This patch adds support for these SDK directories to the
XcodeSDK class.

Differential Revision: https://reviews.llvm.org/D78675
2020-04-24 12:55:53 -07:00
Matt Arsenault 35e6a9c839 AMDGPU: Break read2/write2 search range on a memory fence
This is to fix performance regressions introduced by
86c944d790.

The old search would collect all potentially mergeable instructions in
the entire block. In this case, the same address is written in
multiple places in the block on the other side of a fence. When sorted
by offset, the two unmergeable, identical addresses would be next to
each other and the merge would give up.

Break the search space when we encounter an instruction we won't be
able to merge across. This will keep the identical addresses in
different merge attempts.

This may also improve compile time by reducing the merge list size.
2020-04-24 15:53:30 -04:00
Jonas Devlieghere 0d671dbca9 [lldb/Driver] Remove level of indentation (NFC)
Use an early return for when we couldn't create a pipe to source the
commands.
2020-04-24 12:50:53 -07:00
Louis Dionne a9104f89b1 [libc++] Properly import lit.formats from the new format 2020-04-24 15:47:48 -04:00
Fangrui Song bea5a958d3 [gold] Simplify with StringRef::consume_front. NFC
Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D78819
2020-04-24 12:39:35 -07:00
River Riddle 0816de167a [mlir][DialectConversion] Add support for properly tracking replaceUsesOfBlockArgument
The current implementation of this method performs the replacement directly, and thus doesn't support proper back tracking.

Differential Revision: https://reviews.llvm.org/D78790
2020-04-24 12:37:32 -07:00
Louis Dionne 4de60d955a [libc++] NFC: Refactor the new format substitutions into its own method
This way, we can reuse the substitution logic in the new DSL.
2020-04-24 15:35:57 -04:00
Lei Zhang 60f1d26366 Revert "[mlir][drr] NFC: avoid SmallVector when collecting substitution values"
This reverts commit 2f8b164ca2, which
causes a breakage on Clang 5.
2020-04-24 15:33:03 -04:00
Louis Dionne 4fd92cc475 [libc++] Get rid of pipe in command to check whether verify is supported 2020-04-24 15:30:25 -04:00
Alexandre Ganea 0e13a0331f [llvm-cov] Prevent llvm-cov from using too many threads
As reported here: https://reviews.llvm.org/D75153#1987272

Before, each instance of llvm-cov was creating one thread per hardware core, which wasn't needed probably because the number of inputs were small. This was probably causing a thread rlimit issue on large core count systems.

After this patch, the previous behavior is restored (to what was before rG8404aeb5):

If --num-threads is not specified, we create one thread per input, up to num.cores.
When specified, --num-threads indicates any number of threads, with no upper limit.

Differential Revision: https://reviews.llvm.org/D78408
2020-04-24 15:28:25 -04:00
River Riddle 0e2bd49370 [mlir][DictionaryAttr] Add a new getWithSorted and use it when possible
The elements of a DictionaryAttr are sorted by name. In many situations, e.g NamedAttributeList, we can guarantee that the elements are sorted on construction and remove the need to perform extra checks. In places with lots of calls to attribute methods, this leads to a good performance improvement.

Differential Revision: https://reviews.llvm.org/D78781
2020-04-24 12:23:32 -07:00
Petr Hosek 063128f979 [Fuchsia] Build compiler-rt builtins for 32-bit x86
While we don't support 32-bit architectures in Fuchsia, these are needed
in the early boot phase on x86, so we build just these to satisfy that
use case.

Differential Revision: https://reviews.llvm.org/D78687
2020-04-24 12:18:30 -07:00
Michael Liao 495bb8feb9 Fix `-Wparentheses` warnings. NFC. 2020-04-24 15:04:01 -04:00
Yaxun (Sam) Liu 7eae00477f Revert "[CUDA][HIP] Fix host/device based overload resolution"
This reverts commit c77a4078e0.
2020-04-24 14:57:10 -04:00
Yaxun (Sam) Liu c77a4078e0 [CUDA][HIP] Fix host/device based overload resolution
Currently clang fails to compile the following CUDA program in device compilation:

__host__ int foo(int x) {
     return 1;
}

template<class T>
__device__ __host__ int foo(T x) {
    return 2;
}

__device__ __host__ int bar() {
    return foo(1);
}

__global__ void test(int *a) {
    *a = bar();
}

This is due to foo is resolved to the __host__ foo instead of __device__ __host__ foo.
This seems to be a bug since __device__ __host__ foo is a viable callee for foo whereas
clang is unable to choose it.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D77954
2020-04-24 14:55:18 -04:00
Adrian Prantl 304ba5d4c6 Delete cargo-cult code that doesn't affect the testsuite. 2020-04-24 11:54:52 -07:00
Louis Dionne 7f48246175 [libc++] Quietly scp tarballs over with the remote executor
Otherwise, the progress-meter is printed.
2020-04-24 14:47:56 -04:00
Tyker 42431da895 [AssumeBundles] Use assume bundles in isKnownNonZero
Summary: Use nonnull and dereferenceable from an assume bundle in isKnownNonZero

Reviewers: jdoerfert, nikic, lebedev.ri, reames, fhahn, sstefan1

Reviewed By: jdoerfert

Subscribers: fhahn, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76149
2020-04-24 20:41:51 +02:00
Vedant Kumar c0fa447e02 AArch64: Remove reversedInstructionsWithoutDebug helper
When using reversedInstructionsWithoutDebug to construct a range from a
pair of MachineInstrBundleIterators, the range unexpectedly leaves out an
element. This results in mis-optimization as @mstorsjo points out in
https://reviews.llvm.org/D78157.

The problem is that when we convert a MachineInstrBundleIterator to a
reverse iterator, the result gets incremented:

  MachineInstrBundleIterator(++I.getReverse())

The comment there explains that the "resulting iterator will dereference
... to the previous node, which is somewhat unexpected; but converting
the two endpoints in a range will give the same range in reverse". This
makes it hard to understand what reversedInstructionsWithoutDebug will
do: I've removed the helper to prevent similar mistakes in the future.
2020-04-24 11:28:17 -07:00
Adrian Prantl ef423a3ba5 Add Objective-C property accessors loaded from Clang module DWARF to lookup
This patch fixes a bug when synthesizing an ObjC property from
-gmodules debug info. Because the method declaration that is injected
via the non-modular property implementation is not added to the
ObjCInterfaceDecl's lookup pointer, a second copy of the accessor
would be generated when processing the ObjCPropertyDecl. This can be
avoided by finding the existing method decl in
ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName() and
adding it to the LookupPtr.

Differential Revision: https://reviews.llvm.org/D78333
2020-04-24 11:10:50 -07:00
Mircea Trofin fdbf493a70 [llvm][NFC][CallSite] Remove {Immutable}CallSite and CallSiteBase
Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78794
2020-04-24 11:03:35 -07:00
Craig Topper 0ed5b0d517 [X86] Don't use types when getting the intrinsic declaration for x86_avx512_mask_vcvtph2ps_512.
This intrinsic isn't overloaded so we should query with types.
Doing so causes the backend to miss the intrinsic and not codegen it.
This eventually leads to a linker error.
2020-04-24 11:01:22 -07:00
Sanjay Patel 238f00f6d3 [InstCombine] regenerate test checks; NFC
Values named 'tmp' can cause problems for the auto-generated check script.
2020-04-24 13:51:13 -04:00
Stella Laurenzo 7720d6578c Add constructor to ShapedTypeComponents for unranked with element type.
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78774
2020-04-24 10:43:08 -07:00
Simon Pilgrim acc3cbbc9a [cmake] Add headers in TextAPI/Elf and TextAPI/MachO subdirectories 2020-04-24 18:42:44 +01:00
Simon Pilgrim 628b0243c8 AllocationOrder.h - split MCRegisterInfo.h include. NFC.
We only require to include MCRegister.h and SmallVector.h.
2020-04-24 18:42:43 +01:00
Christopher Tetreault 947be4a024 [SVE] Do not store a bool for Scalable in VectorType
Summary:
- Whether or not a vector is scalable is a function of its type. Since
all instances of ScalableVectorType will have true for this value and
all instances of FixedVectorType will have false for this value, there
is no need to store it as a class member.

Reviewers: efriedma, fpetrogalli, kmclaughlin

Reviewed By: fpetrogalli

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78601
2020-04-24 10:36:26 -07:00
Craig Topper 4cf73a3fc6 [CostModel][X86] Account for splitting cost when vector zext/sext type legalize to the same size vector. 2020-04-24 09:59:23 -07:00
Florian Hahn e1235831c4 [DSE,MSSA] Improve debug output (NFC).
This patch slightly improves the formatting of the debug output, adds a
few missing outputs and makes some existing outputs more consistent with
the rest.
2020-04-24 17:50:08 +01:00
Alexandre Ganea e98f73a629 [MC] Fix quadratic behavior in addPendingLabel()
Differential Revision: https://reviews.llvm.org/D78775
2020-04-24 12:48:54 -04:00
Samuel Thibault 6395980370 [Driver] Move GCC multilib/multiarch paths support from Linux.cpp to Gnu.cpp
The current code for GNU/Linux is actually completely generic, and can be moved to ToolChains/Gnu.cpp,
so that it can benefit GNU/Hurd and GNU/kFreeBSD.

Reviewed By: MaskRay, phosek

Differential Revision: https://reviews.llvm.org/D73845
2020-04-24 09:33:19 -07:00
Mircea Trofin c3770c5d6d [llvm][NFC] Factor out inlining pipeline as a module pipeline.
Summary:
This simplifies testing in scenarios where we want to set up module-wide
analyses for inlining. The patch enables treating inlining and its
function cleanups, as a module pass. The alternative would be for tests
to describe the pipeline, which is tedious and adds maintenance
overhead.

Reviewers: davidxl, dblaikie, jdoerfert, sstefan1

Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78512
2020-04-24 09:24:12 -07:00
Florian Hahn 44ce588670 [DSE,MSSA] Skip checking write clobber for DomAccess (NFC).
There is no need to check if the starting access for is a write clobber
and all of its uses have already been checked.
2020-04-24 17:16:22 +01:00
Sanjay Patel e4175ff525 [InstCombine] intersect FMF when reassociating FP min/max intrinsics
As discussed in PR45478:
https://bugs.llvm.org/show_bug.cgi?id=45478
...propagating FMF from the outer (second) call is not correct,
so intersect them instead.
I suspect we could do better (see TODO comment), but mismatched
FMF is probably too rare to care about.

Differential Revision: https://reviews.llvm.org/D78631
2020-04-24 12:14:03 -04:00
Jonas Devlieghere 1fcd234ac5 [lldb/Core] Don't crash in GetSoftwareBreakpointTrapOpcode for unknown triples
This patch ensures we don't crash in GetSoftwareBreakpointTrapOpcode for
not-yet-supported architectures but rather continue with degraded
behavior.

I found the issue in the context of an invalid ArchSpec, which should be
handled further up the chain. In this patch I've also added an assert to
cover that, so we can still catch those issues.

Differential revision: https://reviews.llvm.org/D78588
2020-04-24 09:10:41 -07:00
Pablo Barrio d4e7b000b2 [AArch64] Allow PAC mnemonics in the HINT space with PAC disabled
Summary:
It is important to emit HINT instructions instead of PAC ones when
PAC is disabled. This allows compatibility with other assemblers
(e.g. GAS). This was implemented in commit da33762de8.

Still, developers of assembly code will want to write code that is
compatible with both pre- and post-PAC CPUs. They could use HINT
mnemonics, but the new mnemonics are a lot more readable (e.g.
paciaz instead of hint #24), and they will result in the same
encodings. So, while LLVM should not *emit* the new mnemonics when
PAC is disabled, this patch will at least make LLVM *accept*
assembly code that uses them.

Reviewers: danielkiss, chill, olista01, LukeCheeseman, simon_tatham

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78372
2020-04-24 16:56:51 +01:00
Nico Weber 6121122a3b [gn build] update two comments 2020-04-24 11:52:49 -04:00
Fangrui Song 25e22613df [XRay] Change ARM/AArch64/powerpc64le to use version 2 sled (PC-relative address)
Follow-up of D78082 (x86-64).

This change avoids dynamic relocations in `xray_instr_map` for ARM/AArch64/powerpc64le.

MIPS64 cannot use 64-bit PC-relative addresses because R_MIPS_PC64 is not defined.
Because MIPS32 shares the same code, for simplicity, we don't use PC-relative addresses for MIPS32 as well.

Tested on AArch64 Linux and ppc64le Linux.

Reviewed By: ianlevesque

Differential Revision: https://reviews.llvm.org/D78590
2020-04-24 08:35:43 -07:00
Simon Pilgrim 3ae9957871 ValueEnumerator.h - remove unnecessary includes. NFC.
The forward declarations are already present in the header.
2020-04-24 16:21:38 +01:00
Simon Pilgrim 82c9eed2cf MipsTargetStreamer.h - remove unnecessary MipsABIFlagsSection forward declaration. NFC.
We need to include MipsABIFlagsSection.h already
2020-04-24 16:21:37 +01:00
Simon Pilgrim 091f7f0103 AMDGPUArgumentUsageInfo.h - cleanup includes and forward declarations. NFC.
Reduce Function.h include to (already existing) forward declaration.
Remove unused GCNSubtarget/TargetMachine forward declarations.
2020-04-24 16:21:37 +01:00
LLVM GN Syncbot 531bfa3e02 [gn build] Port 7aaff8fd2d 2020-04-24 15:06:14 +00:00
Nico Weber 446082b99f [gn build] minimally merge 67b2dbd5a3 even more 2020-04-24 11:05:58 -04:00