Commit Graph

312877 Commits

Author SHA1 Message Date
Pavel Labath f2ffb47ff2 Minidump: Use minidump types defined in llvm
This is the next step in moving the minidump parsing into llvm. I remove
the minidump structures already defined in the llvm Object library and
convert our parser to use those. NFC.

llvm-svn: 356992
2019-03-26 13:23:01 +00:00
Luis Marques 614fd9d830 [RISCV] Improve codegen for icmp {ne,eq} with a constant
Adds two patterns to improve the codegen of GPR value comparisons with small
constants. Instead of first loading the constant into another register and then
doing an XOR of those registers, these patterns directly use the constant as an
XORI immediate.

llvm-svn: 356990
2019-03-26 12:55:00 +00:00
Simon Pilgrim e24441aab0 [TargetLowering] Add SimplifyDemandedBits support for ISD::INSERT_VECTOR_ELT
This helps us relax the extension of a lot of scalar elements before they are inserted into a vector.

Its exposes an issue in DAGCombiner::convertBuildVecZextToZext as some/all the zero-extensions may be relaxed to ANY_EXTEND, so we need to handle that case to avoid a couple of AVX2 VPMOVZX test regressions.

Once this is in it should be easier to fix a number of remaining failures to fold loads into VBROADCAST nodes.

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

llvm-svn: 356989
2019-03-26 12:32:01 +00:00
Yi Kong 74b874ac4c Fix nondeterminism introduced in r353954
DenseMap iteration order is not guaranteed, use MapVector instead.

Fix provided by srhines.

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

llvm-svn: 356988
2019-03-26 12:18:08 +00:00
Anastasia Stulova 545652b964 [OpenCL] Allow variadic macros as Clang feature.
llvm-svn: 356987
2019-03-26 11:22:37 +00:00
Javed Absar c85cb2fb5d [TableGen] Let list elements have a trailing comma
Let lists have an trailing comma to allow cleaner diffs e.g:
  def : Features<[FeatureA,
                  FeatureB,
                 ]>;
Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D59247

llvm-svn: 356986
2019-03-26 11:16:01 +00:00
Javed Absar 33888ff66b [TableGen] Give meaningful msg for def use in multiclass
When one mistakenly specifies 'def' instead of using 'defm',
the error message is quite misleading: 'Couldn't find class..'
Instead, it should recommend using defm if the multiclass of
same name exists.

Reviewed By: hfinkel

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

llvm-svn: 356985
2019-03-26 10:49:09 +00:00
Oliver Stannard 5c90238479 [ARM][Asm] Accept upper case coprocessor number and registers
Differential revision: https://reviews.llvm.org/D59760

llvm-svn: 356984
2019-03-26 10:24:03 +00:00
Sylvestre Ledru 90dbbdbc95 update the release notes after the change of 'clang -dumpversion'
llvm-svn: 356983
2019-03-26 09:48:23 +00:00
Martin Storsjo 146db4405c [llvm-dlltool] Set a proper machine type for weak symbol object files
This makes GNU binutils not reject the libraries outright.

GNU ld handles weak externals slightly differently though, so it
can't use them for aliases in import libraries, but this makes GNU
ld able to use the rest of the import libraries.

LLD accepted object files with machine type 0 aka
IMAGE_FILE_MACHINE_UNKNOWN.

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

llvm-svn: 356982
2019-03-26 09:02:44 +00:00
Roger Ferrer Ibanez e41a74e8d2 [RISCV] Pass -target-abi to -cc1as
The RISC-V assembler needs the target ABI because it defines a flag of the ELF
file, as described in [1].

Make clang (the driver) to pass the target ABI to -cc1as in exactly the same
way it does for -cc1.

Currently -cc1as knows about -target-abi but is not handling it. Handle it and
pass it to the MC layer via MCTargetOptions.

[1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#file-header

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

llvm-svn: 356981
2019-03-26 08:01:18 +00:00
Fangrui Song 78e21bac99 [ADT] Update SmallVectorTest.EmplaceBack tests after rL356312
rL356312 changed the return type of emplace_back from void to reference.
Update the tests to check the behavior.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 356980
2019-03-26 05:33:52 +00:00
Craig Topper 4dcabf8ddf [X86] In matchBitExtract, place all of the new nodes before Node's position in the DAG for the topological sort.
We were using OrigNBits, but that put all the nodes before the node we used to start the control computation. This caused some node earlier than the sequence we inserted to be selected before the sequence we created. We want our new sequence to be selected first since it depends on OrigNBits.

I don't have a test case. Found by reviewing the code.

llvm-svn: 356979
2019-03-26 05:31:32 +00:00
Craig Topper 10576fea82 [X86] In matchBitExtract, if we need to truncate the BEXTR make sure we put the BEXTR at Node's position in the DAG for the topological sort.
We were using OrigNBits, but that doesn't guarantee that it will be selected before the nodes that make up X.

llvm-svn: 356978
2019-03-26 05:12:23 +00:00
Craig Topper 795ebe3bff [X86] Remove unneeded FIXME. NFC
We do fold loads right below this.

llvm-svn: 356977
2019-03-26 05:12:21 +00:00
Thomas Lively 82de51a3ae Reland "[WebAssembly] Add linker options to control feature checking"
Do not pipe binary data between processes in lit tests this time,
since it turns out that can break on Windows.

This reverts commit 84c8652fc3.

llvm-svn: 356975
2019-03-26 04:11:05 +00:00
Jan Korous 2d000e395e [clangd][xpc][cmake] Respect explicit value of CLANGD_BUILD_XPC
We shouldn't prevent user from disabling XPC framework build on Darwin.
However, by keeping it on by default our CI systems also test
it by default on macOS.

Based on user request:
http://lists.llvm.org/pipermail/cfe-dev/2019-March/061778.html

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

llvm-svn: 356974
2019-03-26 03:48:25 +00:00
Craig Topper fd880d30b1 X86Parser: Fix potential reference to deleted object
Within the MatchFPUWaitAlias function, Operands[0] is potentially overwritten leading to &Op referencing a deleted object. To fix this, assign the reference after the function.

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

llvm-svn: 356973
2019-03-26 03:12:43 +00:00
Craig Topper 3dce29b8e9 X86AsmParser: Do not process a non-existent token
This error can only happen if an unfinished operation is at Eof.

Patch by Brandon Jones

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

llvm-svn: 356972
2019-03-26 03:12:41 +00:00
Jonas Devlieghere 282890d711 [Python] Define empty SWIG wrapper for unit testin"
The python plugin uses wrappers generated by swig. For the symbols to be
available, we'd need to link against liblldb, which is not an option
because the symbols could conflict with the static library we are
testing. Instead we define the symbols ourselves in the unit test.

llvm-svn: 356971
2019-03-26 01:11:15 +00:00
Petr Hosek 1b1523c6ff [CMake][Fuchsia] Merge static libunwind and libc++abi into libc++ on Darwin
We want to distribute only a single archive so -lc++ does the right
thing and users don't have to explicitly link -lc++abi and -lunwind.

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

llvm-svn: 356970
2019-03-26 00:43:29 +00:00
Artem Dergachev bef9f8aac3 [CFG] [analyzer] pr41142: C++17: Skip transparent InitListExprs in ExprEngine.
r356634 didn't fix all the problems caused by r356222 - even though simple
constructors involving transparent init-list expressions are now evaluated
precisely, many more complicated constructors aren't, for other reasons.

The attached test case is an example of a constructor that will never be
evaluated precisely - simply because there isn't a constructor there (instead,
the program invokes run-time undefined behavior by returning without a return
statement that should have constructed the return value).

Fix another part of the problem for such situations: evaluate transparent
init-list expressions transparently, so that to avoid creating ill-formed
"transparent" nonloc::CompoundVals.

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

llvm-svn: 356969
2019-03-26 00:36:53 +00:00
Fangrui Song 210949a221 [ELF] Change GOT*_FROM_END (relative to end(.got)) to GOTPLT* (start(.got.plt))
Summary:
This should address remaining issues discussed in PR36555.

Currently R_GOT*_FROM_END are exclusively used by x86 and x86_64 to
express relocations types relative to the GOT base. We have
_GLOBAL_OFFSET_TABLE_ (GOT base) = start(.got.plt) but end(.got) !=
start(.got.plt)

This can have problems when _GLOBAL_OFFSET_TABLE_ is used as a symbol, e.g.
glibc dl_machine_dynamic assumes _GLOBAL_OFFSET_TABLE_ is start(.got.plt),
which is not true.

  extern const ElfW(Addr) _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
  return _GLOBAL_OFFSET_TABLE_[0]; // R_X86_64_GOTPC32

In this patch, we

* Change all GOT*_FROM_END to GOTPLT* to fix the problem.
* Add HasGotPltOffRel to denote whether .got.plt should be kept even if
  the section is empty.
* Simplify GotSection::empty and GotPltSection::empty by setting
  HasGotOffRel and HasGotPltOffRel according to GlobalOffsetTable early.

The change of R_386_GOTPC makes X86::writePltHeader simpler as we don't
have to compute the offset start(.got.plt) - Ebx (it is constant 0).

We still diverge from ld.bfd (at least in most cases) and gold in that
.got.plt and .got are not adjacent, but the advantage doing that is
unclear.

Reviewers: ruiu, sivachandra, espindola

Subscribers: emaste, mehdi_amini, arichardson, dexonsmith, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356968
2019-03-25 23:46:19 +00:00
Jonas Devlieghere 1d1f1ba3d2 [Python] Move SWIG wrapper dependency into the plugin
This should fix the Windows bot (fingers crossed).

llvm-svn: 356967
2019-03-25 23:36:12 +00:00
Rui Ueyama e6c24299d2 Use a class instead of lambda-based callbacks to organize garbage collector.
lld's mark-sweep garbage collector was written in the visitor pattern.
There are functions that traverses a given graph, and the functions calls
callback functions to dispatch according to node type.

The code was originaly pretty simple, and lambdas worked pretty
well. However, as we add more features to the garbage collector, that became
more like a callback hell. We now have a callback function that wraps
another callback function, for example. It is not easy to follow the flow of
the control.

This patch rewrites it as a regular class. What was once a lambda is now a
regular class member function. I think this change fixes the readability
issue.

No functionality change intended.

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

llvm-svn: 356966
2019-03-25 23:28:47 +00:00
Michael Kruse ea40d5b05b Moving ManagedMemoryRewritePass when hybrid option is selected
Compiling with -polly-target=hybrid was causing Polly to occur two times
in the pipeline. The reason was how the ManagedMemoryRewritePass was
registered in the pass manager. ManagedMemoryRewritePass being a
ModulePass was forcing all previous passes to get recomputed. This
commit avoids Polly to appear two times in the pipeline registering the
ManagedMemoryRewritePass later in the pass manager.

Patch by Lorenzo Chelini <l.chelini@icloud.com>

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

llvm-svn: 356965
2019-03-25 23:26:59 +00:00
Reid Kleckner 1181c9f45d [MS] Add frontend support for __declspec(allocator)
The intention is to add metadata to direct call sites of functions
marked with __declspec(allocator), which will ultimately result in some
S_HEAPALLOCSITE debug info records when emitting codeview.

This is a piece of PR38491

llvm-svn: 356964
2019-03-25 23:20:18 +00:00
Eli Friedman 1e5d569c8c [ARM] Add missing memory operands to a bunch of instructions.
This should hopefully lead to minor improvements in code generation, and
more accurate spill/reload comments in assembly.

Also fix isLoadFromStackSlotPostFE/isStoreToStackSlotPostFE so they
don't lead to misleading assembly comments for merged memory operands;
this is technically orthogonal, but in practice the relevant memory
operand lists don't show up without this change.

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

llvm-svn: 356963
2019-03-25 22:42:30 +00:00
Jonathan Peyton 3bc703d538 [OpenMP] Add LLVM license header to file
This file was missing the LLVM license header

llvm-svn: 356962
2019-03-25 22:36:31 +00:00
Jonathan Peyton 7ca09056c7 [OpenMP] Add Intel 19.0 to list of compilers in kmp_version.cpp
llvm-svn: 356961
2019-03-25 22:31:00 +00:00
Michal Gorny c5d7bc86b8 [lldb] [Process/NetBSD] Use nullptr to fix template arg deduction
llvm-svn: 356960
2019-03-25 22:29:29 +00:00
Sanjay Patel 9bcb0766eb [x86] add tests for vector cmps; NFC
llvm-svn: 356959
2019-03-25 22:08:45 +00:00
Matt Arsenault 8bbc159786 Revert "AMDGPU: Scavenge register instead of findUnusedReg"
This reverts r356149.

This is crashing on rocBLAS.

llvm-svn: 356958
2019-03-25 21:41:40 +00:00
Bruno Ricci 95550e412f [Sema] Don't check for array bounds when the types in the base expression are dependent
Bail-out of CheckArrayAccess when the types of the base expression before
and after eventual casts are dependent. We will get another chance to check
for array bounds during instantiation. Fixes PR41087.

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

Reviewed By: efriedma

llvm-svn: 356957
2019-03-25 21:37:10 +00:00
Matt Arsenault 77bf2e3704 AMDGPU: Remove unnecessary check for isFullCopy
Subregister indexes are not used for physical register operands, so
isFullCopy is implied by the physical register check.

llvm-svn: 356956
2019-03-25 21:28:53 +00:00
Matt Arsenault b008b37b61 AMDGPU: Make collapse-endcf test more useful
Without a VALU instruction in the return block, these were mostly
testing the path to delete exec mask code before s_endpgm rather than
the end cf handling.

llvm-svn: 356955
2019-03-25 21:28:51 +00:00
Eli Friedman 92d0d13366 [AArch64] Prefer "mov" over "orr" to materialize constants.
This is generally more readable due to the way the assembler aliases
work.

(This causes a lot of test changes, but it's not really as scary as it
looks at first glance; it's just mechanically changing a bunch of checks
for orr to check for mov instead.)

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

llvm-svn: 356954
2019-03-25 21:25:28 +00:00
Sam Clegg 4dcf3acce6 [WebAssembly] Don't use default GetLinkerPath
We can't (don't want to) honor the same set of "-fuse-ld" flags with
WebAssembly since the ELF linkers (ld.lld, ld.gnu, etc) don't work with
wasm object files.

Instead we implement our own linker finding logic, similar or other
non-ELF platforms like MSVC.

We've had a few issues with CLANG_DEFAULT_LINKER overriding the
WebAssembly linker which doesn't make sense since there is no generic
linker that can handle WebAssembly today.

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

llvm-svn: 356953
2019-03-25 21:14:26 +00:00
Matt Arsenault bc978872de AMDGPU: Set hasSideEffects 0 on _term instructions
These were defaulting to true, but they are just wrappers around bit
operations. This avoids regressions in the exec mask optimization
passes in a future commit.

llvm-svn: 356952
2019-03-25 21:10:12 +00:00
Ali Tamur fdce82a814 Revert "[llvm] Prevent duplicate files in debug line header in dwarf 5."
This reverts commit 312ab05887.

My commit broke the build; I will revert and find out what happened.

llvm-svn: 356951
2019-03-25 21:09:07 +00:00
Jonas Devlieghere e3959de268 [PythonTestSuite] Fix usage of InitializePrivate in PythonTestSuite
llvm-svn: 356950
2019-03-25 21:07:53 +00:00
Ali Tamur 800fe977d0 Revert "[lld] Prevent duplicate files in debug line header in dwarf 5."
This reverts commit 5aa7478a55.

Some things are broken; I will fix and try to commit again.

llvm-svn: 356949
2019-03-25 21:06:02 +00:00
Robert Widmann 9d94a68404 [LLVM-C] Add binding to look up intrinsic by name
Summary: Add a binding to Function::lookupIntrinsicID so clients don't have to go searching the ID table themselves.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 356948
2019-03-25 20:58:58 +00:00
Konstantin Zhuravlyov ec28a1dcef AMDGPU: Add support for cross address space synchronization scopes (clang)
Differential Revision: https://reviews.llvm.org/D59494

llvm-svn: 356947
2019-03-25 20:54:00 +00:00
Konstantin Zhuravlyov 51809cbc98 AMDGPU: Add support for cross address space synchronization scopes
Differential Revision: https://reviews.llvm.org/D59517

llvm-svn: 356946
2019-03-25 20:50:21 +00:00
Louis Dionne 65bd5d8aa3 [pstl][NFC] Remove some warnings
llvm-svn: 356945
2019-03-25 20:44:07 +00:00
Jonas Devlieghere b29d82ebaf [ScriptInterpreterPython] Make SWIG callback private (NFC)
With the initialization taking place inside the Python script
interpreter, these function no longer need to be public. The exception
is the g_swig_init_callback which is used from the RAII object.

llvm-svn: 356944
2019-03-25 20:39:08 +00:00
Ali Tamur 5aa7478a55 [lld] Prevent duplicate files in debug line header in dwarf 5.
Summary:
Changes to a couple of tests that will start failing after https://reviews.llvm.org/D59515 is submitted.

Reviewers: echristo, ruiu, espindola

Reviewed By: echristo, ruiu

Subscribers: emaste, arichardson, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 356943
2019-03-25 20:18:27 +00:00
Jonas Devlieghere b01b10877d [ScriptInterpreterPython] Move SWIG initialization into the Python plugin (NFC)
Abstract initialization of the Python SWIG support in the Python plugin.

llvm-svn: 356942
2019-03-25 20:14:31 +00:00
Ali Tamur 312ab05887 [llvm] Prevent duplicate files in debug line header in dwarf 5.
Summary:

Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Reviewers: dblaikie, probinson, aprantl, espindola

Reviewed By: probinson

Subscribers: emaste, jvesely, nhaehnle, aprantl, javed.absar, arichardson, hiraditya, MaskRay, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

llvm-svn: 356941
2019-03-25 20:08:00 +00:00