Commit Graph

319082 Commits

Author SHA1 Message Date
Jonas Devlieghere 28defa70ea Remove stale comment and disabled code (NFC)
llvm-svn: 363438
2019-06-14 18:12:55 +00:00
Nico Weber 6e4957eb77 gn build: Add NVPTX target
The NVPTX target is a bit unusual in that it's the only target without a
disassembler, and one of three targets without an asm parser (and the
first one of those three in the gn build). NVPTX doesn't have those
because it's not a binary format.

The CMake build checks for the existence of
{AsmParser,Disassembler}/CMakeLists.txt when setting
LLVM_ENUM_ASM_PARSERS / LLVM_ENUM_DISASSEBLERS
(http://llvm-cs.pcc.me.uk/CMakeLists.txt#744). The GN build doesn't want
to hit the disk for things like this, so instead I'm adding explicit
`targets_with_asm_parsers` and `targets_with_disassemblers` lists. Since
both are needed rarely, they are defined in their own gni files.

Differential Revision: https://reviews.llvm.org/D63210

llvm-svn: 363437
2019-06-14 18:07:00 +00:00
Nico Weber 3819e68b9c gn build: Simplify Target build files
Now that the cycle between MCTargetDesc and TargetInfo is gone
(see revisions 360709 360718 360722 360724 360726 360731 360733 360735 360736),
remove the dependency from TargetInfo on MCTargetDesc:tablegen. In most
targets, this makes MCTargetDesc:tablegen have just a single use, so
inline it there.

For AArch64, ARM, and RISCV there's still a similar cycle between
MCTargetDesc and Utils, so the MCTargetDesc:tablegen indirection is
still needed there.

Differential Revision: https://reviews.llvm.org/D63200

llvm-svn: 363436
2019-06-14 17:58:34 +00:00
Gheorghe-Teodor Bercea 5254f0a9ab [OpenMP] Avoid emitting maps for target link variables when unified memory is used
Summary: This patch avoids the emission of maps for target link variables when unified memory is present.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: guansong, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60883

llvm-svn: 363435
2019-06-14 17:58:26 +00:00
Amara Emerson f79d3bc724 [GlobalISel] Add a G_BRJT opcode.
This is a branch opcode that takes a jump table pointer, jump table index and an
index into the table to do an indirect branch.

We pass both the table pointer and JTI to allow targets like ARM64 to more
easily use the existing jump table compression optimization without having to
walk up the block to find a paired G_JUMP_TABLE.

Differential Revision: https://reviews.llvm.org/D63159

llvm-svn: 363434
2019-06-14 17:55:48 +00:00
Martin Storsjo ff4e0a9f3e [MinGW] Support the --subsystem=val option in joined form
Differential Revision: https://reviews.llvm.org/D63250

llvm-svn: 363433
2019-06-14 17:50:39 +00:00
Martin Storsjo 6f047ae58b [MinGW] Support the --{major,minor}-{os,subsystem}-version options
This fixes PR42218.

Differential Revision: https://reviews.llvm.org/D63249

llvm-svn: 363432
2019-06-14 17:50:35 +00:00
Martin Storsjo b20fefc89b [COFF] Allow setting subsystem versions while inferring the subsystem type implicitly
Differential Revision: https://reviews.llvm.org/D63248

llvm-svn: 363431
2019-06-14 17:50:29 +00:00
Richard Smith 14059d2a13 Remove unused SK_LValueToRValue initialization step.
In addition to being unused and duplicating code, this was also wrong
(it didn't properly mark the operand as being potentially not odr-used).

This reinstates r363340, reverted in r363352.

llvm-svn: 363430
2019-06-14 17:46:39 +00:00
Richard Smith 27252a1f95 PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
nullptr_t does not access memory.

We now reuse CK_NullToPointer to represent a conversion from a glvalue
of type nullptr_t to a prvalue of nullptr_t where necessary.

This reinstates r363337, reverted in r363352.

llvm-svn: 363429
2019-06-14 17:46:38 +00:00
Richard Smith 24cdcadcc5 C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue conversion applied to a member access or similar not-quite-trivial lvalue expression.
Summary:
When a variable is named in a context where we can't directly emit a
reference to it (because we don't know for sure that it's going to be
defined, or it's from an enclosing function and not captured, or the
reference might not "work" for some reason), we emit a copy of the
variable as a global and use that for the known-to-be-read-only access.

This reinstates r363295, reverted in r363352, with a fix for PR42276:
we now produce a proper name for a non-odr-use reference to a static
constexpr data member. The name <mangled-name>.const is used in that
case; such names are reserved to the implementation for cases such as
this and should demangle nicely.

Reviewers: rjmccall

Subscribers: jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63157

llvm-svn: 363428
2019-06-14 17:46:37 +00:00
Florian Hahn dcdd12b68c Revert Fix a bug w/inbounds invalidation in LFTR
Reverting because it breaks a green dragon build:
    http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/18208

This reverts r363289 (git commit eb88badff9)

llvm-svn: 363427
2019-06-14 17:23:09 +00:00
Florian Hahn a19809045c Revert [LFTR] Stylistic cleanup as suggested in last review comment of D62939 [NFC]
Reverting because it depends on r363289, which breaks a green dragon build:
    http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/18208

This reverts r363292 (git commit 42a3fc133d)

llvm-svn: 363426
2019-06-14 17:22:56 +00:00
Florian Hahn e1b4b1b46e Revert [LFTR] Rename variable to minimize confusion [NFC]
Reverting because it depends on r363289, which breaks a green dragon
build:
    http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/18208

This reverts r363293 (git commit c37be29634)

llvm-svn: 363425
2019-06-14 17:22:49 +00:00
Aditya Nandakumar 5c7fcbdc4b [GISel]: Fix pattern matcher for m_OneUse
https://reviews.llvm.org/D63302

llvm-svn: 363424
2019-06-14 17:19:37 +00:00
Jinsong Ji c9e3dbb0a5 [PowerPC][NFC] Format comments in P9InstrResrouce.td
llvm-svn: 363423
2019-06-14 17:04:24 +00:00
Shawn Landden f2e60fc4e8 [SimpligyCFG] NFC intended, remove GCD that was only used for powers of two
and replace with an equilivent countTrailingZeros.

GCD is much more expensive than this, with repeated division.

This depends on D60823

Differential Revision: https://reviews.llvm.org/D61151

llvm-svn: 363422
2019-06-14 16:56:49 +00:00
Nico Weber bea1286155 Wrap a test to 80 columns
llvm-svn: 363421
2019-06-14 16:47:07 +00:00
Saleem Abdulrasool 2874d285b9 build: don't attempt to run config.guess on Windows
When cross-compiling LLVM to android from Windows (for LLVMSupport), we would
attempt to execute `config.guess` to determine the host triple since
`CMAKE_SYSTEM_NAME` is not Windows and `CMAKE_C_COMPILER` will be set to GNU or
Clang.  This will fail as `config.guess` is a shell script which cannot be
executed on Windows.  Simply log a warning instead.  The user can specify the
value for this instead in those cases.

llvm-svn: 363420
2019-06-14 16:47:04 +00:00
Nico Weber 96a15796fb Remove two unused parameters
llvm-svn: 363419
2019-06-14 16:46:02 +00:00
Valery Pykhtin ffeb01c113 [AMDGPU] Don't constrain callees with inlinehint from inlining on MaxBB check
Summary: Function bodies marked inline in an opencl source are eliminated but MaxBB check may prevent inlining them leaving undefined references.

Reviewers: rampitec, arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, Anastasia, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63337

llvm-svn: 363418
2019-06-14 16:37:33 +00:00
Kevin P. Neal fece7c6c83 [FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of ISelLowering to mirror non-strict nodes on x86.
I recently discovered a bug on the x86 platform: The fp80 type was not handled well by x86 for constrained floating point nodes, as their regular counterparts are replaced by extending loads and truncating stores during the preprocess phase. Normally, platforms don't have this issue, as they don't typically attempt to perform such legalizations during instruction selection preprocessing. Before this change, strict_fp nodes survived until they were mutated to normal nodes, which happened shortly after preprocessing on other platforms. This modification lowers these nodes at the same phase while properly utilizing the chain.5

Submitted by:	Drew Wock <drew.wock@sas.com>
Reviewed by:	Craig Topper, Kevin P. Neal
Approved by:	Craig Topper
Differential Revision:	https://reviews.llvm.org/D63271

llvm-svn: 363417
2019-06-14 16:28:55 +00:00
Stanislav Mekhanoshin cdf339266b [AMDGPU] gfx1010 BoolReg definition. NFC.
Earlier commit has added AMDGPUOperand::isBoolReg(). Turns out
gcc issues warning about unused function since D63204 is not
yet submitted.

Added NFC part of D63204 to have a use of that function and
mute the warning.

llvm-svn: 363416
2019-06-14 16:25:46 +00:00
Francis Visoiu Mistrih 7a21113ce8 Reland: [Remarks] Refactor optimization remarks setup
* Add a common function to setup opt-remarks
* Rename common options to the same names
* Add error types to distinguish between file errors and regex errors

llvm-svn: 363415
2019-06-14 16:20:51 +00:00
Yaxun Liu cabce71845 [AMDGPU] Enable the implicit arguments for HIP (CLANG)
Enable 48-bytes of implicit arguments for HIP as well. Earlier it was enabled for OpenCL. This code is specific to AMDGPU target.

Differential Revision: https://reviews.llvm.org/D62244

llvm-svn: 363414
2019-06-14 15:54:47 +00:00
Adrian Prantl 573ffd88a0 Python 3: decode string as utf-8 to avoid type mismatch.
rdar://problem/51464644

Differential Revision: https://reviews.llvm.org/D63311

llvm-svn: 363413
2019-06-14 15:39:14 +00:00
Adrian Prantl 38be2c65b6 Make crashlog.py less noisy
For end-users there is no point in printing dSYM load errors for
system frameworks, since they will all fail and there's nothing they
can do about it. This patch hides them by default and shows them when
--verbose is present.

Differential Revision: https://reviews.llvm.org/D63310

llvm-svn: 363412
2019-06-14 15:39:11 +00:00
Sanjay Patel 75312aa805 [x86] move vector shift tests for PR37428; NFC
As suggested in the post-commit thread for rL363392 - it's
wasteful to have so many runs for larger tests. AVX1/AVX2
is what shows the diff and probably what matters most going
forward.

llvm-svn: 363411
2019-06-14 15:23:09 +00:00
Matt Arsenault c2864c0de0 GlobalISel: Avoid producing Illegal copies in RegBankSelect
Avoid producing illegal register bank copies for reg_sequence and
phi. The default implementation assumes it is possible to pick any
operand's bank and use that for the result, introducing a copy for
operands with a different bank. This does not check for illegal
copies. It is not legal to introduce a VGPR->SGPR copy, so any VGPR
operand requires the result to be a VGPR.

The changes in getInstrMappingImpl aren't strictly necessary, since
AMDGPU now just bypasses this for reg_sequence/phi. This could be
replaced with an assert in case other targets run into this. It is
currently responsible for producing the error for unsatisfiable
copies, but this will be better served with a verifier check.

For phis, for now assume any undetermined operands must be
VGPRs. Eventually, this needs to be able to defer mapping these
operations. This also does not yet have a way to check for whether the
block is in a divergent region.

llvm-svn: 363410
2019-06-14 15:22:25 +00:00
Sanjay Patel 7ea378b940 [CodeGenPrepare] propagate debuginfo when copying a shuffle
llvm-svn: 363409
2019-06-14 15:05:35 +00:00
Johannes Doerfert 282d34ee78 [Attributor] Disable the Attributor by default and fix a comment
llvm-svn: 363408
2019-06-14 14:53:41 +00:00
Johannes Doerfert d85dd0f0c9 [Attributor] Introduce bit-encodings for abstract states
Summary:
The IntegerState, and its sepecialization BooleanState, can be used to
simplify the implementation of abstract attributes. The two abstract
state implementations provide storage and helpers to deal with bit-wise
encoded state.

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60012

llvm-svn: 363407
2019-06-14 14:53:36 +00:00
Matt Arsenault 492d71cc99 AMDGPU: Fold readlane intrinsics of constants
I'm not 100% sure about this, since I'm worried about IR transforms
that might end up introducing divergence downstream once replaced with
a constant, but I haven't come up with an example yet.

llvm-svn: 363406
2019-06-14 14:51:26 +00:00
Louis Dionne 0feebef501 [libcxx] Add XFAIL for facet test when back-deploying to older macOS
llvm-svn: 363405
2019-06-14 14:40:38 +00:00
Pavel Labath 2dd0053d3a EditlineTest: Improve error message
This test seems to occasionally fail because editline returns a
different number of lines. Rewrite the message in such a way that we
also see the actual lines when that happens (and not just their count).

Also, clean up the dependencies of the test while I'm in there.

llvm-svn: 363404
2019-06-14 14:33:04 +00:00
Mikhail Maltsev d1cc2e1543 [ARM] Add MVE horizontal accumulation instructions
This is the family of vector instructions that combine all the lanes
in their input vector(s), and output a value in one or two GPRs.

Differential Revision: https://reviews.llvm.org/D62670

llvm-svn: 363403
2019-06-14 14:31:13 +00:00
George Rimar 76d575312d [LLD][ELF] - Fix test case after r363401
llvm-svn: 363402
2019-06-14 14:26:34 +00:00
George Rimar 0aecabae14 Revert "Revert r363377: [yaml2obj] - Allow setting custom section types for implicit sections."
LLD test case will be fixed in a following commit.

Original commit message:

[yaml2obj] - Allow setting custom section types for implicit sections.

We were hardcoding the final section type for sections that
are usually implicit. The patch fixes that.

This also fixes a few issues in existent test cases and removes
one precompiled object.

Differential revision: https://reviews.llvm.org/D63267

llvm-svn: 363401
2019-06-14 14:25:34 +00:00
Pavel Labath 00e3968b8a DWARF: port debug_ranges/rnglists over to DWARFContext
llvm-svn: 363400
2019-06-14 14:12:25 +00:00
Fangrui Song e05ca38101 [ELF] Don't emit dynamic relocations with weak undef in writable sections
In processRelocAux(), our handling of 1) link-time constant and 2) weak
undef is the same, so put them together to simplify the logic.

This moves the weak undef code around. The result is that: in a writable
section (or -z notext), we will no longer emit dynamic relocations for
weak undefined symbols.

The new behavior seems to match GNU linkers, and improves consistency
with the case of a readonly section.

The condition `!Config->Shared` was there probably because it is common
for a -shared link not to specify full dependencies. Keep it now but we
may revisit the decision in the future.

gABI says:

> The behavior of weak symbols in areas not specified by this document is
> implementation defined. Weak symbols are intended primarily for use in
> system software. Applications using weak symbols are unreliable since
> changes in the runtime environment might cause the execution to fail.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D63003

llvm-svn: 363399
2019-06-14 14:09:15 +00:00
George Rimar a59bc6e589 Revert r363395.
It will not work because of r363394.

llvm-svn: 363398
2019-06-14 14:06:03 +00:00
Nico Weber a35b935d39 lld/coff: slightly simplify ImportFile::parse()
llvm-svn: 363397
2019-06-14 14:03:08 +00:00
Rui Ueyama 43f4b037d5 Add --undefined-glob which is an --undefined with wildcard pattern match
This patch adds new command line option `--undefined-glob` to lld.
That option is a variant of `--undefined` but accepts wildcard
patterns so that all symbols that match with a given pattern are
handled as if they were given by `-u`.

`-u foo` is to force resolve symbol foo if foo is not a defined symbol
and there's a static archive that contains a definition of symbol foo.

Now, you can specify a wildcard pattern as an argument for `--undefined-glob`.
So, if you want to include all JNI symbols (which start with "Java_"), you
can do that by passing `--undefined-glob "Java_*"` to the linker, for example.

In this patch, I use the same glob pattern matcher as the version script
processor is using, so it does not only support `*` but also `?` and `[...]`.

Differential Revision: https://reviews.llvm.org/D63244

llvm-svn: 363396
2019-06-14 14:00:59 +00:00
George Rimar a0b0d626ab [ELF] - Attemp to fix BB.
Seems section has a wrong type.

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/28

llvm-svn: 363395
2019-06-14 13:59:27 +00:00
Rui Ueyama 9f4e21c69a Revert r363377: [yaml2obj] - Allow setting custom section types for implicit sections.
This reverts commit r363377 because lld's ELF/invalid/undefined-local-symbol-in-dso.test
test started failing after this commit.

llvm-svn: 363394
2019-06-14 13:57:25 +00:00
Eugene Leviant c74910b842 Fix failing test on ARM buildbot
r363261 caused test failure on 32-bit ARM buildbot,
because of unsigned integer overflow. This patch
fixes it changing offset type from size_t to uint64_t.

llvm-svn: 363393
2019-06-14 13:45:21 +00:00
Sanjay Patel e5a78cd90f [x86] add test for original example in PR37428; NFC
The reduced case may avoid complications seen in this larger function.

llvm-svn: 363392
2019-06-14 13:44:01 +00:00
Matt Arsenault 731a81598e RegBankSelect: Remove checks for invalid mappings
Avoid a check for valid and a set of redundant asserts. The place
InstructionMapping is constructed asserts all of the default fields
are passed anyway for an invalid mapping, so don't overcomplicate
this.

llvm-svn: 363391
2019-06-14 13:42:40 +00:00
Matt Arsenault 5d0bebcdf2 AMDGPU: Use AMDGPU toolchain for other OSes
This would need more work to actually support them, but this is less
wrong than the default.

llvm-svn: 363390
2019-06-14 13:39:57 +00:00
Matt Arsenault 5a86dbcf30 AMDGPU: Fix input chain when gluing copies to m0
I don't think this was causing any observable issues, but was making
reading the DAG dump confusing.

llvm-svn: 363389
2019-06-14 13:33:36 +00:00