Commit Graph

328230 Commits

Author SHA1 Message Date
Jay Foad e536800022 [AMDGPU] Add VerifyScheduling support.
Summary:
This is cut and pasted from the corresponding GenericScheduler
functions.

Reviewers: arsenm, atrick, tstellar, vpykhtin

Subscribers: MatzeB, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 373346
2019-10-01 15:45:47 +00:00
David Bolvansky 362055d1fa [Diagnostics] Move warning into the subgroup (-Wenum-compare-conditional)
llvm-svn: 373345
2019-10-01 15:44:38 +00:00
Adrian Prantl bf9d84c014 Remove size_t return parameter from FindTypes
In r368345 I accidentally introduced a regression that would
over-report the number of matches found by FindTypes if the
DeclContext Filter was hit.

This patch simply removes the size_t return parameter altogether —
it's not that useful.

rdar://problem/55500457

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

llvm-svn: 373344
2019-10-01 15:40:41 +00:00
Simon Pilgrim 3c912c4abe [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)
This patch converts the DAGCombine isNegatibleForFree/GetNegatedExpression into overridable TLI hooks.

The intention is to let us extend existing FNEG combines to work more generally with negatible float ops, allowing it work with target specific combines and opcodes (e.g. X86's FMA variants).

Unlike the SimplifyDemandedBits, we can't just handle target nodes through a Target callback, we need to do this as an override to allow targets to handle generic opcodes as well. This does mean that the target implementations has to duplicate some checks (recursion depth etc.).

Partial reversion of rL372756 - I've identified the infinite loop issue inside the X86 override but haven't fixed it yet so I've only (re)committed the common TargetLowering refactoring part of the patch.

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

llvm-svn: 373343
2019-10-01 15:32:04 +00:00
Adrian Prantl 796cd312ac Update SymbolFilePDB for FindTypes API change.
This is untested, I don't have access to a Windows machine.

llvm-svn: 373342
2019-10-01 15:29:33 +00:00
Jakub Kuderski 56b52a207f [Dominators][CodeGen] Add MachinePostDominatorTree verification
Summary:
This patch implements Machine PostDominator Tree verification and ensures that the verification doesn't fail the in-tree tests.

MPDT verification can be enabled using `verify-machine-dom-info` -- the same flag used by Machine Dominator Tree verification.

Flipping the flag revealed that MachineSink falsely claimed to preserve CFG and MDT/MPDT. This patch fixes that.

Reviewers: arsenm, hliao, rampitec, vpykhtin, grosser

Reviewed By: hliao

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373341
2019-10-01 15:23:27 +00:00
Kadir Cetinkaya fd019ed54e [clang] Make handling of unnamed template params similar to function params
Summary:
Clang uses the location identifier should be inserted for declarator
decls when a decl is unnamed. But for type template and template template
paramaters it uses the location of "typename/class" keyword, which makes it hard
for tooling to insert/change parameter names.

This change tries to unify these two cases by making template parameter
parsing and sourcerange operations similar to function params/declarator decls.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 373340
2019-10-01 14:08:51 +00:00
Raphael Isemann b67c3b6cf0 [lldb][NFC] Mark ClangASTContext constructor as explicit
Given that we can implicitly construct a ClangASTContext from any string, we should
really mark this as explicit.

llvm-svn: 373339
2019-10-01 13:45:06 +00:00
Simon Pilgrim 9eb2bd6b8d Revert rL349624 : Let TableGen write output only if it changed, instead of doing so in cmake, attempt 2
Differential Revision: https://reviews.llvm.org/D55842
-----------------
As discussed on PR43385 this is causing Visual Studio msbuilds to perpetually rebuild all tablegen generated files

llvm-svn: 373338
2019-10-01 13:39:43 +00:00
Raphael Isemann e4e305e5ee [lldb][NFC] Remove unused ClangASTContext::GetHasExternalStorage
This code isn't used nor tested.

llvm-svn: 373337
2019-10-01 13:25:25 +00:00
Djordje Todorovic 372048e908 Revert "Reland "[utils] Implement the llvm-locstats tool""
This reverts commit rL373317 due to test failure on the
clang-s390x-linux build bot.

llvm-svn: 373336
2019-10-01 13:21:15 +00:00
David Bolvansky 4037582d6b Revert [InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)
Seems to be slower than memcpy + strlen.

llvm-svn: 373335
2019-10-01 13:19:04 +00:00
Raphael Isemann 1ce75045eb [lldb][NFC] Remove unused ClangASTContext functions for checking/removing the ExternalASTSource
llvm-svn: 373334
2019-10-01 13:05:57 +00:00
David Bolvansky 8fc6a1bf56 [InstCombine] sprintf(dest, "%s", str) -> memccpy(dest, str, 0, MAX)
llvm-svn: 373333
2019-10-01 13:03:10 +00:00
Michal Gorny f488cbdcd8 [llvm-exegesis/lib] Fix missing linkage to MCParser
Otherwise, shared-lib build fails with:

lib64/libLLVMExegesis.a(SnippetFile.cpp.o): In function `llvm::exegesis::readSnippets(llvm::exegesis::LLVMState const&, llvm::StringRef)':
SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x31f): undefined reference to `llvm::createMCAsmParser(llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&, llvm::MCAsmInfo const&, unsigned int)'
SnippetFile.cpp:(.text._ZN4llvm8exegesis12readSnippetsERKNS0_9LLVMStateENS_9StringRefE+0x41c): undefined reference to `llvm::MCAsmParser::setTargetParser(llvm::MCTargetAsmParser&)'
collect2: error: ld returned 1 exit status

llvm-svn: 373332
2019-10-01 13:02:48 +00:00
Sam Parker ef7990a88a [NFC][ARM][MVE] More tests
Add some tail predication tests with fast math.

llvm-svn: 373331
2019-10-01 13:02:14 +00:00
Raphael Isemann c73bfc98f8 [lldb][NFC] Disallow changing the ASTContext of an ClangASTContext after construction.
We have no use case in LLDB where we actually do want to change the ASTContext after
it the ClangASTContext has been constructed. All callers of setASTContext are just setting
the ASTContext directly after construction, so we might as well make this a Constructor
instead of supporting this tricky use case.

llvm-svn: 373330
2019-10-01 12:55:37 +00:00
Raphael Isemann d01b4a7862 [lldb][NFC] Modernize ClangASTContext constructor
Now using default initializers and StringRef.

Also formats the member list that we excluded from clang-format
at some point and still hangs around with the old LLDB code style.

llvm-svn: 373329
2019-10-01 12:28:14 +00:00
Louis Dionne 371ea70bb7 [libc++] Harden usage of static_assert against C++03
In C++03, we emulate static_assert with a macro, and we must parenthesize
multiple arguments.

llvm-svn: 373328
2019-10-01 12:12:21 +00:00
Raphael Isemann ed5a8971ec [clang] Ignore builtin namespaces in test/Import/cxx-anon-namespace
Some platforms (e.g. AArch64) put __va_list in the 'std' namespace which might
end up being the first namespace we match in this test. Instead let
the first namespace match via file name/line so that we skip the
builtin namespaces.

llvm-svn: 373327
2019-10-01 11:53:20 +00:00
Simon Pilgrim 30f76caa46 DIExpression::createFragmentExpression - silence static analyzer DIExpression* null dereference warning with an assertion. NFCI.
llvm-svn: 373326
2019-10-01 11:25:38 +00:00
Simon Pilgrim 7ce312307a VirtualFileSystem - replace dyn_cast<>+assert with cast<> calls. NFCI.
Silences a number of clang static analyzer null dereference warnings.

llvm-svn: 373325
2019-10-01 11:25:29 +00:00
Simon Pilgrim bc9a1b37b9 ObjectFile makeTriple - silence static analyzer dyn_cast<COFFObjectFile> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<COFFObjectFile> directly and if not assert will fire for us.

llvm-svn: 373324
2019-10-01 11:25:17 +00:00
Haojian Wu 9f2bf666bc [clangd] Implement getBeginning for overloaded operators.
Summary:
This will fix some bugs where navigation doesn't work on cases like
`std::cout <^< "hello"`.

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 373323
2019-10-01 11:03:56 +00:00
Simon Pilgrim 339b1b5bb0 InstrProf - avoid static analyzer dyn_cast<ConstantInt> null dereference warning.
The static analyzer is warning about a potential null dereference, as we're already earlying-out for a null Constant pointer I've just folded this into a dyn_cast_or_null<ConstantInt>.

No test case, this is by inspection only.

llvm-svn: 373322
2019-10-01 10:38:30 +00:00
Simon Pilgrim d71315f2ae ConstantFold - ConstantFoldSelectInstruction - assume constant vector elements are constant. NFCI.
Goes a bit further than rL372743 which added the early out - elements should be Constant so use cast<Constant> instead (and rely on the assert if anything fails).

llvm-svn: 373321
2019-10-01 10:22:01 +00:00
Haojian Wu d6d5eddcdb [clangd] Use the index-based API to do the header-source switch.
Summary:
If the file heuristic fails, we try to use the index&AST to do the
header/source inference.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 373320
2019-10-01 10:21:15 +00:00
George Rimar c764c36fbd [obj2yaml] - Fix BB after r373315.
The success return value for data extractor's cursor
should also be checked.

llvm-svn: 373319
2019-10-01 10:02:47 +00:00
Ilya Biryukov 1d32da8249 [clangd] Handle template arguments in findExplicitReferences
Reviewers: kadircet

Reviewed By: kadircet

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

Tags: #clang

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

llvm-svn: 373318
2019-10-01 10:02:23 +00:00
Djordje Todorovic 6d7f7e6792 Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 373317
2019-10-01 09:59:15 +00:00
George Rimar 0210a1a530 [yaml2obj] - Allow specifying custom Link values for SHT_HASH section.
This allows setting any sh_link values for SHT_HASH sections.

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

llvm-svn: 373316
2019-10-01 09:54:40 +00:00
George Rimar e5163ebf8d [yaml2obj/obj2yaml] - Add support for SHT_HASH sections.
SHT_HASH specification is:
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash

In short the format is the following: it has 2 uint32 fields
in its header: nbucket and nchain followed by (nbucket + nchain)
uint32 values.

This patch allows dumping and parsing such sections.

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

llvm-svn: 373315
2019-10-01 09:45:59 +00:00
Diana Picus c2c377ea58 Fixup r373278: Move test to X86 directory
...since it's using an x86 triple.

llvm-svn: 373314
2019-10-01 09:27:20 +00:00
Clement Courbet 8109901bf6 [llvm-exegesis][NFC] Refactor X86 tests fixtures into a base class.
Reviewers: gchatelet, a.sidorin

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 373313
2019-10-01 09:20:36 +00:00
Raphael Isemann cf62871488 [clang][lldb][NFC] Encapsulate ExternalASTMerger::ImporterSource
NFC preparation work for upcoming ExternalASTMerger patches.

llvm-svn: 373312
2019-10-01 09:02:05 +00:00
Dmitri Gribenko f58d01930f Revert "[OCaml] Handle nullptr in Llvm.global_initializer"
This reverts commit r373299. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18485

llvm-svn: 373311
2019-10-01 08:29:07 +00:00
Dmitri Gribenko 827a7fab78 Revert "GlobalISel: Handle llvm.read_register"
This reverts commit r373294. It broke Clang's
CodeGen/arm64-microsoft-status-reg.cpp:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18483

llvm-svn: 373310
2019-10-01 08:24:01 +00:00
Sam Parker 95aee9da4c [NFC][HardwareLoops] Update some iterators
llvm-svn: 373309
2019-10-01 07:53:28 +00:00
Sylvestre Ledru 7009204bd2 Decrease the verbosity of the -ftime-trace option
And move the relevant information in the doc.

Summary:
Currently, building a large software like Firefox shows
'Use chrome://tracing or Speedscope App (https://www.speedscope.app) for flamegraph visualization'
for each file.

Reviewers: anton-afanasyev

Reviewed By: anton-afanasyev

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373308
2019-10-01 07:52:42 +00:00
Ilya Biryukov a160a0ba53 [clangd] Handle OverloadExpr in targetDecl
Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

llvm-svn: 373305
2019-10-01 07:27:55 +00:00
Dmitri Gribenko d1337ec22d [clang-tidy] Fix module registry name and description for Darwin clang-tidy module.
Summary: When creating the module, must have copy-pasted from the misc module, and forgotten to update the name/description of the module in the registry.

Reviewers: stephanemoore, benhamilton, gribozavr

Reviewed By: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra, #llvm

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

llvm-svn: 373304
2019-10-01 07:17:26 +00:00
Craig Topper 220cf53540 [X86] Consider isCodeGenOnly in the EVEX2VEX pass to make VMAXPD/PS map to the non-commutable VEX instruction. Use EVEX2VEX override to fix the scalar instructions.
Previously the match was ambiguous and VMAXPS/PD and VMAXCPS/PD
were mapped to the same VEX instruction. But we should keep
the commutableness when change the opcode.

llvm-svn: 373303
2019-10-01 07:10:09 +00:00
Heejin Ahn e2bcab6100 [WebAssembly] Make sure EH pads are preferred in sorting
Summary:
In CFGSort, we try to make EH pads have higher priorities as soon as
they are ready to be sorted, to prevent creation of unwind destination
mismatches in CFGStackify. We did that by making priority queues'
comparison function  prefer EH pads, but it was possible for an EH pad
to be popped from `Preferred` queue and then not sorted immediately and
enter `Ready` queue instead in a certain condition. This patch makes
sure that special condition does not consider EH pads as its candidates.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 373302
2019-10-01 06:53:28 +00:00
Heejin Ahn 61d5c76a18 [WebAssembly] Unstackify regs after fixing unwinding mismatches
Summary:
Fixing unwind mismatches for exception handling can result in splicing
existing BBs and moving some of instructions to new BBs. In this case
some of stackified def registers in the original BB can be used in the
split BB. For example, we have this BB and suppose %r0 is a stackified
register.
```
bb.1:
  %r0 = call @foo
  ... use %r0 ...
```

After fixing unwind mismatches in CFGStackify, `bb.1` can be split and
some instructions can be moved to a newly created BB:
```
bb.1:
  %r0 = call @foo

bb.split (new):
  ... use %r0 ...
```

In this case we should make %r0 un-stackified, because its use is now in
another BB.

When spliting a BB, this CL unstackifies all def registers that have
uses in the new split BB.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 373301
2019-10-01 06:21:53 +00:00
Aleksandr Urakov 5b5274eaf8 [Windows] Added support of watchpoints to `NativeProcessWindows`
Summary: This patch adds support of watchpoints to the new `NativeProcessWindows` plugin. The same tests as in D67168 pass with these changes when the old plugin is turned off, so they will cover this functionality when the old plugin is gone.

Reviewers: asmith, amccarth, stella.stamenova, labath

Reviewed By: labath

Subscribers: labath, jfb, JDevlieghere, lldb-commits, leonid.mashinskiy

Tags: #lldb

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

llvm-svn: 373300
2019-10-01 05:52:16 +00:00
Aditya Kumar 07286cb384 [OCaml] Handle nullptr in Llvm.global_initializer
LLVMGetInitializer returns nullptr in case there is no
initializer. There is not much that can be done with nullptr in OCaml,
not even test if it is null. Also, there does not seem to be a C or
OCaml API to test if there is an initializer. So this diff changes
Llvm.global_initializer to return an option.

Differential Revision: https://reviews.llvm.org/D65195
Reviewed by: whitequark
Authored by: kren1

llvm-svn: 373299
2019-10-01 03:45:09 +00:00
Matt Arsenault fdea5e02ce AMDGPU/GlobalISel: Select s1 src G_SITOFP/G_UITOFP
llvm-svn: 373298
2019-10-01 02:23:20 +00:00
Yuanfang Chen b169ee2eca Remove a undefined constructor introduced by r373244.
llvm-svn: 373297
2019-10-01 02:08:14 +00:00
Matt Arsenault 59b91aa93e AMDGPU/GlobalISel: Add support for init.exec intrinsics
TThe existing wave32 behavior seems broken and incomplete, but this
reproduces it.

llvm-svn: 373296
2019-10-01 02:07:25 +00:00
Matt Arsenault 5823a28270 AMDGPU/GlobalISel: Allow scc/vcc alternative mappings for s1 constants
llvm-svn: 373295
2019-10-01 02:07:19 +00:00