Commit Graph

324906 Commits

Author SHA1 Message Date
Haojian Wu 65c58a902d [clangd] Ignore implicit conversion-operator nodes in find refs.
Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 369514
2019-08-21 10:54:19 +00:00
Raphael Isemann 68756a8c37 [lldb][NFC] Add tests for register command
llvm-svn: 369513
2019-08-21 10:40:05 +00:00
Petar Avramovic 7f581df649 [MIPS GlobalISel] NarrowScalar G_ZEXTLOAD and G_SEXTLOAD
NarrowScalar G_ZEXTLOAD and G_SEXTLOAD to s32 for MIPS32.

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

llvm-svn: 369512
2019-08-21 09:43:20 +00:00
Petar Avramovic e406aa791c [MIPS GlobalISel] NarrowScalar G_ZEXT and G_SEXT
NarrowScalar G_ZEXT and G_SEXT to s32 for MIPS32.

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

llvm-svn: 369511
2019-08-21 09:35:02 +00:00
Petar Avramovic 61bf2675b9 [MIPS GlobalISel] Consider type1 when legalizing shifts after r351882
r351882 allows different type for shift amount then result and value
being shifted. Fix MIPS Legalizer rules to take r351882 into account.

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

llvm-svn: 369510
2019-08-21 09:31:29 +00:00
Petar Avramovic 5b4c5c2c54 [MIPS GlobalISel] NarrowScalar G_TRUNC
Add NarrowScalar for G_TRUNC when NarrowTy is half the size of source.
NarrowScalar G_TRUNC to s32 for MIPS32.

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

llvm-svn: 369509
2019-08-21 09:26:39 +00:00
Jeremy Morse 67443c3c6e [DebugInfo] Avoid dropping location info across block boundaries
LiveDebugValues propagates variable locations between blocks by creating
new DBG_VALUE insts in the successors, then interpreting them when it
passes back through the block at a later time. However, this flushes out
any extra information about the location that LiveDebugValues holds: for
example, connections between variable locations such as discussed in
D65368. And as reported in PR42772 this causes us to lose track of the
fact that a spill-location is actually a spill, not a register location.

This patch fixes that by deferring the creation of propagated DBG_VALUEs
until after propagation has completed: instead location propagation occurs
only by sharing location ID numbers between blocks. 

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

llvm-svn: 369508
2019-08-21 09:22:31 +00:00
Fangrui Song 2d337fdc95 Reland D65242 "[ELF] More dynamic relocation packing""
This fixed a bug in r369488. When config->isRela is false, i->r_addend
is not initialized (see encodeDynamicReloc). So we should check
config->isRela before accessing r_addend:

- if (j - i < 3 || i->r_addend)
+ if (j - i < 3 || (config->isRela && i->r_addend != 0))

Original description:

Currently, with Android dynamic relocation packing, only relative
relocations are grouped together. This patch implements similar
packing for non-relative relocations.

The implementation groups non-relative relocations with the same
r_info and r_addend, if using RELA. By requiring a minimum group
size of 3, this achieves smaller relocation sections. Building Android
for an ARM32 device, I see the total size of /system/lib decrease by
392 KB.

Grouping by r_info also allows the runtime dynamic linker to implement
an 1-entry cache to reduce the number of symbol lookup required. With
such 1-entry cache implemented on Android, I'm seeing 10% to 20%
reduction in total time spent in runtime linker for several executables
that I tested.

As a simple correctness check, I've also built x86_64 Android and booted
successfully.

Differential Revision: https://reviews.llvm.org/D65242
Patch by Vic Yang

llvm-svn: 369507
2019-08-21 09:21:37 +00:00
Raphael Isemann 4fc1eb55d1 [lldb][NFC] Add tests for invalid command invocations
llvm-svn: 369506
2019-08-21 09:15:44 +00:00
Luke Cheeseman 71d38b3c62 [AArch64] Update MTE system register encodings
The encodings for the system registers TFSRE0_EL1, TFSR_EL1 TFSR_EL2, TFSR_EL3
and TFSR_EL12 have been changed so that they consistently have CRn=5 and CRm=6
as per https://developer.arm.com/docs/ddi0487/latest.

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

llvm-svn: 369505
2019-08-21 09:09:56 +00:00
Dmitri Gribenko 6b9d7c9da5 Removed some dead code in BugReporter and related files
Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 369504
2019-08-21 08:48:24 +00:00
Pavel Labath 9cb317968a Fix an unused variable warning in ClangASTContext.cpp
llvm-svn: 369503
2019-08-21 08:22:19 +00:00
Pavel Labath dc5403d2dc Properly EXCLUDE_FROM_ALL the testing support library
The EXCLUDE_FROM_ALL variable is used by add_llvm_library, but lldb does
not use that function (it uses llvm_add_library :P). Instead, set the directory
property with the same name directly.

This should fix standalone builds against an llvm install tree.

llvm-svn: 369502
2019-08-21 08:21:51 +00:00
Serge Guelton d1262a6e91 Be explicit about Windows coff name trailing character policy
It's okay to *not* copy the trailing zero of a windows section/symbol name.
This is compatible with strncpy behavior but gcc doesn't know that and
throws an invalid warning. Encode this behavior in a proper function.

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

llvm-svn: 369501
2019-08-21 07:54:42 +00:00
Raphael Isemann 8a42af7b17 [NFC] Mark CallTargetComparator() as const to fix libc++ warnings
We currently get this warning when compiling with libc++:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:454:26: warning: the specified comparator type does not provide a const call operator [-Wuser-defined-warnings]
    static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), "");
                         ^
llvm-project/llvm/include/llvm/ProfileData/SampleProf.h:193:29: note: in instantiation of template class 'std::__1::set<std::__1::pair<llvm::StringRef, unsigned long long>, llvm::sampleprof::SampleRecord::CallTargetComparator, std::__1::allocator<std::__1::pair<llvm::StringRef, unsigned long long> > >' requested here
  const SortedCallTargetSet getSortedCallTargets() const {
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:967:5: note: from 'diagnose_if' attribute on '__diagnose_non_const_comparator<std::__1::pair<llvm::StringRef, unsigned long long>, llvm::sampleprof::SampleRecord::CallTargetComparator>':
    _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
    ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:1320:21: note: expanded from macro '_LIBCPP_DIAGNOSE_WARNING'
     __attribute__((diagnose_if(__VA_ARGS__, "warning")))
                    ^           ~~~~~~~~~~~
1 warning generated.

llvm-svn: 369500
2019-08-21 07:39:17 +00:00
Fangrui Song b2895a8cdc Revert D65242 "[ELF] More dynamic relocation packing"
This reverts r369488 and r369489. The change broke build bots:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/14511
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/34407

llvm-svn: 369497
2019-08-21 06:50:08 +00:00
David Zarzycki b08884554f [PPC Docs] Remove duplicate info about __builtin_setrnd()
This looks like a combination of a copy-and-paste (and paste and paste)
error and a commit without reviewing the diff first error.

llvm-svn: 369496
2019-08-21 06:48:11 +00:00
Vitaly Buka 93a3cbc746 Revert r369472 and r369441
check-sanitizer does not work on Linux

llvm-svn: 369495
2019-08-21 05:06:21 +00:00
Alex Langford 7719495e2c [Symbol] Remove unused clang headers from Type
llvm-svn: 369494
2019-08-21 04:56:23 +00:00
Jonas Devlieghere d35b42f20a [NFC] Return llvm::StringRef from StringExtractor::GetStringRef.
This patch removes the two variant of StringExtractor::GetStringRef that
return (non-)const references to std::string. The non-const one was
being abused to reinitialize the StringExtractor and its uses are
replaced by calls to the copy asignment operator. The const variant was
refactored to return an actual llvm::StringRef.

llvm-svn: 369493
2019-08-21 04:55:56 +00:00
Jonas Devlieghere 7483005c59 [NFC] Remove unused function GetHexWithFixedSize
The implementation of this function was obviously incorrect, as the
result variable was never used. This led me to check if it was actually
used anywhere, which came back negative.

llvm-svn: 369492
2019-08-21 04:55:53 +00:00
Jonas Devlieghere dc333e6398 [NFC] Simplify code
This simplifies the code and updates the comments.

llvm-svn: 369491
2019-08-21 04:55:50 +00:00
Vitaly Buka 5d84a67ce0 Fix 'fall through' annotation
llvm-svn: 369490
2019-08-21 04:05:34 +00:00
Fangrui Song d840a9cbed [ELF][test] Add CHECK lines omitted in r369488
Add append .o to some object file names

llvm-svn: 369489
2019-08-21 03:15:57 +00:00
Fangrui Song 35f9a84a15 [ELF] More dynamic relocation packing
Currently, with Android dynamic relocation packing, only relative
relocations are grouped together. This patch implements similar
packing for non-relative relocations.

The implementation groups non-relative relocations with the same
r_info and r_addend, if using RELA. By requiring a minimum group
size of 3, this achieves smaller relocation sections. Building Android
for an ARM32 device, I see the total size of /system/lib decrease by
392 KB.

Grouping by r_info also allows the runtime dynamic linker to implement
an 1-entry cache to reduce the number of symbol lookup required. With
such 1-entry cache implemented on Android, I'm seeing 10% to 20%
reduction in total time spent in runtime linker for several executables
that I tested.

As a simple correctness check, I've also built x86_64 Android and booted
successfully.

Differential Revision: https://reviews.llvm.org/D66491
Patch by Vic Yang!

llvm-svn: 369488
2019-08-21 03:02:08 +00:00
Nico Weber f938755a33 libcxx: Rename .hpp files in libcxx/benchmarks to .h
LLVM uses .h as its extension for header files.

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

llvm-svn: 369487
2019-08-21 01:59:12 +00:00
Chris Bieneman 8d18384809 Autogenerate the shebang lines for tools/opt-viewer
Summary:
Since these files depend on the built python modules, they need to use
the right python binary to run them. So use configure_file
to set the right shebang line.

Patch By: cbiesinger (Christian Biesinger)

Reviewers: chandlerc, beanz, anemet

Reviewed By: anemet

Subscribers: compnerd, JDevlieghere, mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 369486
2019-08-21 01:48:28 +00:00
Jonas Devlieghere 4b3c0fd5da [NFC] Remove lldb_utility namespace.
While generating the Doxygen I noticed this lone namespace that has one
class and one function in it. This moves them into lldb_private.

llvm-svn: 369485
2019-08-21 00:50:46 +00:00
Jason Molenda 1ecc507e2a Update a few tests that may change the platform to save & restore
the platform in the setUp/tearDown methods.  I want to migrate the
re-instatement of the correct plaform to the setUp base method but
haven't had time to look at that yet, so I want to land this handful
of fixes until I get to it.

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

llvm-svn: 369484
2019-08-21 00:27:30 +00:00
Eric Fiselier 5b59295011 Fix missing __muloti4 function with UBSAN
llvm-svn: 369483
2019-08-21 00:16:33 +00:00
Eric Fiselier a6edef3563 Attempt to fix MSAN failures in benchmarks
llvm-svn: 369482
2019-08-21 00:14:48 +00:00
Nico Weber cc89063bff libcxx: Rename .hpp files in libcxx/test/support to .h
LLVM uses .h as its extension for header files.

Files renamed using:

    for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done

References to the files updated using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
        a=$(basename $f);
        echo $a;
        rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/";
    done

HPP include guards updated manually using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
      echo ${f%.hpp}.h ;
    done | xargs mvim

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

llvm-svn: 369481
2019-08-21 00:14:12 +00:00
Amara Emerson 56606a4db3 [AArch64][GlobalISel] Add support for narrowScalar of G_ZEXT
We do this by merging the source with the high bits set to 0.

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

llvm-svn: 369480
2019-08-21 00:12:37 +00:00
Jonas Devlieghere d979a29935 [Doxygen] Document private class members.
Given that the C++ documentation is meant for LLDB developers it makes
sense to include private class members in the output.

llvm-svn: 369479
2019-08-21 00:10:19 +00:00
Nico Weber 61eedd10c5 Remove llvm/utils/git/find-rev
It assumes git-svn, hasn't been touched in ages, and it's replaced
by llvm-git in llvm/utils/git-svn.

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

llvm-svn: 369478
2019-08-20 23:59:07 +00:00
Jonas Devlieghere 625ab43318 [dotest] Don't set the DWARF version override in CFLAGS_EXTRA.
We cannot override the DWARF version in the CFLAGS_EXTRA because they
are used by tests that explicitly build without debug info. Instead, we
pass them through the regular CFLAGS.

llvm-svn: 369477
2019-08-20 23:56:32 +00:00
Nico Weber 6fa300aa1e gn build: Merge r369467
llvm-svn: 369476
2019-08-20 23:49:12 +00:00
Amaury Sechet 4ccf5ba941 [X86] Automatically generate shift tests. NFC
llvm-svn: 369475
2019-08-20 23:47:19 +00:00
Reid Kleckner ed757305b8 Add triple to new test to try to pacify bots
llvm-svn: 369474
2019-08-20 23:32:51 +00:00
Andrew Trick 861b371e13 Add TinyPtrVector support for general pointer-like things.
In particular, make TinyPtrVector<PtrIntPair<T *, 1>> work. Remove all
unnecessary assumptions that the element type has a formal "null"
representation. The important property to maintain is that
default-constructed element type has the same internal representation
as the default-constructed PointerUnion (all zero bits).

Remove the incorrect recursive behavior from
PointerUnion::isNull. This was never generally correct because it only
recursed over the first type parameter. With variadic templates it's
completely unnecessary.

llvm-svn: 369473
2019-08-20 23:29:28 +00:00
Sebastian Pop 5a7bba09ac [AArch64][asan] fix typo in AsanStats::Print
This created an infinite loop that timed out several build bots while
executing the test in compiler-rt/test/asan/TestCases/atexit_stats.cpp

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

llvm-svn: 369472
2019-08-20 23:28:05 +00:00
Sean Fertile 9467734a1c Fix assert in XCOFFObjectWriter related to program code csects.
Removed code that added program code csects to a collection as part
of addressing review comments, but I failed to update an assert affected
by the change before commiting.

llvm-svn: 369471
2019-08-20 23:24:47 +00:00
Stefan Stipanovic 26121ae4d0 [Attributor] Liveness for internal functions.
For an internal function, if all its call sites are dead, the body of the function is considered dead.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 369470
2019-08-20 23:16:57 +00:00
Amaury Sechet 33c283adfd [X86] Autogenerate vec_* tests. NFC
llvm-svn: 369469
2019-08-20 23:11:29 +00:00
Alexandre Ganea 21e9603030 [Sanitizer] Remove unused functions
Differential Revision: https://reviews.llvm.org/D66503

llvm-svn: 369468
2019-08-20 22:56:40 +00:00
Daniel Sanders a16bd4f9f2 [RISCV GlobalISel] Adding initial GlobalISel infrastructure
Summary:
Add an initial GlobalISel skeleton for RISCV. It can only run ir translator for `ret void`.

Patch by Andrew Wei

Reviewers: asb, sabuasal, apazos, lenary, simoncook, lewis-revill, edward-jones, rogfer01, xiangzhai, rovka, Petar.Avramovic, mgorny, dsanders

Reviewed By: dsanders

Subscribers: pzheng, s.egerton, dsanders, hiraditya, rbar, johnrusso, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

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

llvm-svn: 369467
2019-08-20 22:53:24 +00:00
Alina Sbirlea 2863721f05 [MemorySSA] Make Phi cleanups consistent.
Summary:
Make Phi cleanups consistent: remove self as a trivial Phi and
recurse to potentially remove other trivial phis.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 369466
2019-08-20 22:47:58 +00:00
Jessica Paquette e6c299b983 [AArch64][GlobalISel] Select logical_imm32 and logical_imm64 patterns
Add a GlobalISel equivalent for the logical_imm32_XFORM and logical_imm64_XFORM
SDNodeXForms in AArch64InstrFormats.td.

- Add select-logical-imm.mir, which contains tests for each imported pattern.

- Update select-pr32733.mir and select-scalar-shift-imm.mir, since they now
select instructions of this form.

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

llvm-svn: 369465
2019-08-20 22:31:25 +00:00
Alina Sbirlea 1c528e8f1b [MemorySSA] Fix existing phis when inserting defs.
Summary:
When inserting a new Def, and inserting Phis in the IDF when needed,
also mark the already existing Phis in the IDF as non-optimized, since
these may need fixing as well.
In the test attached, there is a Phi in the IDF that happens to be
trivial, and is wrongfully removed by the call to getLastDef that
follows. This is a valid situation and the existing IDF Phis need to
marked as "may need fixing" as well.
Resolves PR43044.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 369464
2019-08-20 22:29:06 +00:00
Marshall Clow 4f41779cca Add a missing _VSTD:: before a call to merge. Fixes PR43034. Checked the rest of 'algorithm' looking for unqualified calls. Didn't find any.
llvm-svn: 369463
2019-08-20 22:23:35 +00:00