platform/upstream/llvm.git
4 years ago[ORC] fix use-after-free detected by -Wreturn-stack-address
Matthias Gehre [Mon, 19 Aug 2019 21:59:44 +0000 (21:59 +0000)]
[ORC] fix use-after-free detected by -Wreturn-stack-address

Summary:
llvm/lib/ExecutionEngine/Orc/Layer.cpp:53:12: warning: returning address of local temporary object [-Wreturn-stack-address]

In
```
StringRef IRMaterializationUnit::getName() const {
[...]
     return TSM.withModuleDo(
        [](const Module &M) { return M.getModuleIdentifier(); });
```
`getModuleIdentifier()` returns a `const std::string &`, but the implicit return type
of the lambda is `std::string` by value, and thus the returned `StringRef` refers
to a temporary `std::string`.

Detect by annotating `llvm::StringRef` with `[[gsl::Pointer]]`.

Reviewers: lhames, sgraenitz

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 369306

4 years ago[CaptureTracker] Let subclasses provide dereferenceability information
Johannes Doerfert [Mon, 19 Aug 2019 21:56:38 +0000 (21:56 +0000)]
[CaptureTracker] Let subclasses provide dereferenceability information

Summary:
CaptureTracker subclasses might have better dereferenceability
information which allows null pointer checks to be no-capturing.
The first user will be D59922.

Reviewers: sanjoy, hfinkel, aykevl, sstefan1, uenoku, xbolva00

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 369305

4 years agoFix use-after-free
Matthias Gehre [Mon, 19 Aug 2019 21:39:16 +0000 (21:39 +0000)]
Fix use-after-free

Summary:
The warning
```
lldb/source/Core/FormatEntity.cpp:2350:25: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling]
```
is emitted after annotating `llvm::StringRef` with `[[gsl::Pointer]]`.

The reason is that in
```
 size_t FormatEntity::AutoComplete(CompletionRequest &request) {
  llvm::StringRef str = request.GetCursorArgumentPrefix().str();
```
the function `GetCursorArgumentPrefix()` returns a `StringRef`, and `StringRef::str()` returns
a temporary `std::string`.

Reviewers: jingham, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369304

4 years agoRecommit "[Attributor] Fix: Do not partially resolve returned calls."
Johannes Doerfert [Mon, 19 Aug 2019 21:35:31 +0000 (21:35 +0000)]
Recommit "[Attributor] Fix: Do not partially resolve returned calls."

This reverts commit b1752f670f3d6393306dd5d37546b6e23384d8a2.

Fixed the issue with a different commit, reapply this one as it was,
afaik, not broken.

llvm-svn: 369303

4 years agoRecommit "[llvm-objcopy][MachO] Implement a layout algorithm for executables"
Seiya Nuta [Mon, 19 Aug 2019 21:12:02 +0000 (21:12 +0000)]
Recommit "[llvm-objcopy][MachO] Implement a layout algorithm for executables"

Summary: The layout algorithm for relocatable objects and for executable are somewhat different. This patch implements the latter one based on the algorithm in LLD (MachOFileLayout).

Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap

Subscribers: jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

llvm-svn: 369301

4 years agoRefactor isPointerOffset (NFC).
Evgeniy Stepanov [Mon, 19 Aug 2019 21:08:04 +0000 (21:08 +0000)]
Refactor isPointerOffset (NFC).

Summary:
Simplify the API using Optional<> and address comments in
         https://reviews.llvm.org/D66165

Reviewers: vitalybuka

Subscribers: hiraditya, llvm-commits, ostannard, pcc

Tags: #llvm

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

llvm-svn: 369300

4 years agoFixed placement of llvm.global_dtors on Windows.
Vyacheslav Zakharin [Mon, 19 Aug 2019 21:07:03 +0000 (21:07 +0000)]
Fixed placement of llvm.global_dtors on Windows.

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

llvm-svn: 369299

4 years agoRecommit "[llvm-objcopy][MachO] Support load commands used in executables/shared...
Seiya Nuta [Mon, 19 Aug 2019 21:05:31 +0000 (21:05 +0000)]
Recommit "[llvm-objcopy][MachO] Support load commands used in executables/shared libraries"

Summary:
This patch implements copying some load commands that appear in executables/shared libraries such as the indirect symbol table.

I don't add tests intentionally because this patch is incomplete: we need a layout algorithm for executables/shared libraries. I'll submit it as a separate patch with tests.

Reviewers: alexshap, rupprecht, jhenderson, compnerd

Reviewed By: alexshap

Subscribers: abrachet, mgorny, mgrang, MaskRay, mtrent, jakehehrlich, llvm-commits

Tags: #llvm

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

llvm-svn: 369298

4 years agoMemTag: stack initializer merging.
Evgeniy Stepanov [Mon, 19 Aug 2019 20:47:09 +0000 (20:47 +0000)]
MemTag: stack initializer merging.

Summary:
MTE provides instructions to update memory tags and data at the same
time. This change makes use of those to generate more compact code for
stack variable tagging + initialization.

We collect memory store and memset instructions following an alloca or a
lifetime.start call, and replace them with the corresponding MTE
intrinsics. Since the intrinsics work on 16-byte aligned chunks, the
stored values are combined as necessary.

Reviewers: pcc, vitalybuka, ostannard

Subscribers: srhines, javed.absar, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 369297

4 years ago[lldb-vscode] add `launchCommands` to handle launch specific commands
Alex Langford [Mon, 19 Aug 2019 20:17:27 +0000 (20:17 +0000)]
[lldb-vscode] add `launchCommands` to handle launch specific commands

Summary:
This can help `lldb-vscode` handle launch commands associate with remote platform
attach request have field `attachCommands` to handle attach specific commands
add a corresponding one for launch request
if no launch command is provided, create a new target and launch; otherwise, execute the launch command

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

Patch by Wanyi Ye <kusmour@gmail.com>

llvm-svn: 369296

4 years ago[Support] Replace sys::Mutex with their standard equivalents.
Benjamin Kramer [Mon, 19 Aug 2019 19:49:57 +0000 (19:49 +0000)]
[Support] Replace sys::Mutex with their standard equivalents.

Only use a recursive mutex if it can be locked recursively.

llvm-svn: 369295

4 years agoRe-apply fixed "[Attributor] Fix: Make sure we set the changed flag"
Johannes Doerfert [Mon, 19 Aug 2019 19:14:10 +0000 (19:14 +0000)]
Re-apply fixed "[Attributor] Fix: Make sure we set the changed flag"

This reverts commit cedd0d9a6e4b433e1cd6585d1d4d152eb5e60b11.

Re-apply the original commit but make sure the variables are initialized
(even if they are not used) so UBSan is not complaining.

llvm-svn: 369294

4 years ago[lldb] Make TestIOHandlerCompletion more stable and document it
Raphael Isemann [Mon, 19 Aug 2019 19:13:26 +0000 (19:13 +0000)]
[lldb] Make TestIOHandlerCompletion more stable and document it

Instead of relying that three tabs show all completions, we should
show all remaining completions which will always stop the mode
where we show completions. Should fix this test on systems that
somehow have more completions that our normal LLDB (as they
would end up being stuck in the mode where we show completions).

llvm-svn: 369293

4 years ago[WebAssembly][MC] Allow empty assembly functions
Sam Clegg [Mon, 19 Aug 2019 19:04:54 +0000 (19:04 +0000)]
[WebAssembly][MC] Allow empty assembly functions

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

llvm-svn: 369292

4 years ago[MemorySSA] Rename uses when inserting memory uses.
Alina Sbirlea [Mon, 19 Aug 2019 18:57:40 +0000 (18:57 +0000)]
[MemorySSA] Rename uses when inserting memory uses.

Summary:
When inserting uses from outside the MemorySSA creation, we don't
normally need to rename uses, based on the assumption that there will be
no inserted Phis (if  Def existed that required a Phi, that Phi already
exists). However, when dealing with unreachable blocks, MemorySSA will
optimize away Phis whose incoming blocks are unreachable, and these Phis end
up being re-added when inserting a Use.
There are two potential solutions here:
1. Analyze the inserted Phis and clean them up if they are unneeded
(current method for cleaning up trivial phis does not cover this)
2. Leave the Phi in place and rename uses, the same way as whe inserting
defs.
This patch use approach 2.

Resolves first test in PR42940.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 369291

4 years agoBuild symbolizer runtime with C++14.
Peter Collingbourne [Mon, 19 Aug 2019 18:43:52 +0000 (18:43 +0000)]
Build symbolizer runtime with C++14.

Should hopefully fix sanitizer-x86_64-linux bot.

llvm-svn: 369290

4 years ago[TSan] Rename file to make it clear that it defines interceptors
Julian Lettner [Mon, 19 Aug 2019 18:41:20 +0000 (18:41 +0000)]
[TSan] Rename file to make it clear that it defines interceptors

Rename file `tsan_libdispatch.cpp -> tsan_libdispatch_interceptors.cpp`
to make it clear that it's main purpose is defining interceptors.

llvm-svn: 369289

4 years ago[X86] Move scheduling tests for CMPXCHG to the corresponding resources-x86_64.s files...
Andrea Di Biagio [Mon, 19 Aug 2019 18:20:30 +0000 (18:20 +0000)]
[X86] Move scheduling tests for CMPXCHG to the corresponding resources-x86_64.s files. NFC

In D66424 it has been requested to move all the new tests added by r369278 into
resources-x86_64.s. That is because only the 8b/16 ops should be tested by
resources-cmpxchg.s. This partially reverts r369278.

llvm-svn: 369288

4 years ago[X86] Teach lowerV4I32Shuffle to only use broadcasts if the mask has more than one...
Craig Topper [Mon, 19 Aug 2019 18:15:50 +0000 (18:15 +0000)]
[X86] Teach lowerV4I32Shuffle to only use broadcasts if the mask has more than one undef element. Prioritize shifts over broadcast in lowerV8I16Shuffle.

The motivating case are the changes in vector-reduce-add.ll where
we were doing extra work in the scalar domain instead of shuffling.
There may be some one use check that needs to be looked into there,
but this patch sidesteps the issue by avoiding broadcasts that
aren't really broadcasting.

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

llvm-svn: 369287

4 years agoFix poorly formatted HTML in the cxx_status.html file caused by adding
Erich Keane [Mon, 19 Aug 2019 18:14:22 +0000 (18:14 +0000)]
Fix poorly formatted HTML in the cxx_status.html file caused by adding
1668.

llvm-svn: 369286

4 years ago[Sanitizer] arc4random interception on Mac
David Carlier [Mon, 19 Aug 2019 18:12:15 +0000 (18:12 +0000)]
[Sanitizer] arc4random interception on Mac

Reviewers: yln,vitalybuka

Reviewed By: yln

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

llvm-svn: 369285

4 years agoFix test where diagnostics changed in P1668 implementation
Erich Keane [Mon, 19 Aug 2019 18:08:52 +0000 (18:08 +0000)]
Fix test where diagnostics changed in P1668 implementation

llvm-svn: 369284

4 years ago[CGP] Remove ModifiedDT from the makeBitReverse loop
Craig Topper [Mon, 19 Aug 2019 18:02:24 +0000 (18:02 +0000)]
[CGP] Remove ModifiedDT from the makeBitReverse loop

I don't think anything in this loop modifies the control flow and we don't restart any iteration after setting the flag.

This code was added in http://reviews.llvm.org/D16893 but looking at the test case added there the code that caused the dominator tree to change was merging blocks with their predecessor not the bitreverse optimization.

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

llvm-svn: 369283

4 years agoUpdate cxx_status.html with P1668 status.
Erich Keane [Mon, 19 Aug 2019 17:57:27 +0000 (17:57 +0000)]
Update cxx_status.html with P1668 status.

llvm-svn: 369282

4 years agoImplement P1668R1
Erich Keane [Mon, 19 Aug 2019 17:39:59 +0000 (17:39 +0000)]
Implement P1668R1

Allow inline assembly statements in unexecuted branches of constexpr
functions.

llvm-svn: 369281

4 years ago[libc++] Add XFAIL for is_base_of test on AppleClang 11
Louis Dionne [Mon, 19 Aug 2019 17:29:42 +0000 (17:29 +0000)]
[libc++] Add XFAIL for is_base_of test on AppleClang 11

llvm-svn: 369280

4 years ago[X86] Added extensive scheduling model tests for all the CMPXCHG variants. NFC
Andrea Di Biagio [Mon, 19 Aug 2019 17:07:26 +0000 (17:07 +0000)]
[X86] Added extensive scheduling model tests for all the CMPXCHG variants. NFC

Addresses a review comment in D66424

llvm-svn: 369279

4 years ago[Attributor] -attributor-verify has false positives. Temporarily remove
Stefan Stipanovic [Mon, 19 Aug 2019 16:39:32 +0000 (16:39 +0000)]
[Attributor] -attributor-verify has false positives. Temporarily remove
it, until resolved.

llvm-svn: 369277

4 years ago[lld][WebAssembly] Honor --no-export-dynamic even with -shared
Sam Clegg [Mon, 19 Aug 2019 16:34:51 +0000 (16:34 +0000)]
[lld][WebAssembly] Honor --no-export-dynamic even with -shared

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

llvm-svn: 369276

4 years ago[clangd] Added highlighting for tokens that are macro arguments.
Johan Vikstrom [Mon, 19 Aug 2019 16:27:49 +0000 (16:27 +0000)]
[clangd] Added highlighting for tokens that are macro arguments.

Summary:
Adds semantic highlighting for tokens that are a macro argument.
Example:
```
D_V(SomeVar);
```
The "SomeVar" inside the macro is highlighted as a variable now.

Tokens that are in a macro body expansion are ignored in this patch for three reasons.
* The spelling loc is inside the macro "definition" meaning it would highlight inside the macro definition (could probably easily be fixed by using getExpansionLoc instead of getSpellingLoc?)
* If wanting to highlight the macro definition this could create duplicate tokens. And if the tokens are of different types there would be conflicts (tokens in the same range but with different types). Say a macro defines some name and both a variable declaration and a function use this, there would be two tokens in the macro definition but one with Kind "Variable" and the other with Kind "Function".
* Thirdly, macro body expansions could come from a file that is not the main file (easily fixed, just check that the Loc is in the main file and not even a problem if we wanted to highlight the actual macro "invocation")

Reviewers: hokein, sammccall, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 369275

4 years ago[dotest] Add --dwarf-version to override the tested DWARF version.
Jonas Devlieghere [Mon, 19 Aug 2019 16:04:21 +0000 (16:04 +0000)]
[dotest] Add --dwarf-version to override the tested DWARF version.

On the matrix bot on GreenDragon [1] we want to run the test suite
against different DWARF versions. The idea here is not to replace
targeted tests for certain DWARF features, but rather to provide an easy
way to support this configuration.

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/

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

llvm-svn: 369272

4 years ago[ELF] Simplify processRelocAux and allow a corner-case error
Fangrui Song [Mon, 19 Aug 2019 15:52:29 +0000 (15:52 +0000)]
[ELF] Simplify processRelocAux and allow a corner-case error

After D66007/r369262, if the control flow reaches `if (sym.isUndefined())`, we know:

* The relocation is not a link-time constant => symbol is preemptable => Undefined or SharedSymbol
* Not an undef weak.
* -no-pie.
* The symbol type is neither STT_OBJECT nor STT_FUNC.

ld.lld --export-dynamic --unresolved-symbols=ignore-all %t.o can satisfy
these conditions. Delete the isUndefined() test so that we error
`symbol '...' has no type`, because we don't know the type to make the
decision to create copy relocation/canonical PLT.

llvm-svn: 369271

4 years ago[libc++] reverts commit a5f5aad568bb7a91ceee47641f3076ac339ef8c7.
Zoe Carver [Mon, 19 Aug 2019 15:47:16 +0000 (15:47 +0000)]
[libc++] reverts commit a5f5aad568bb7a91ceee47641f3076ac339ef8c7.

The commit being reverted caused segfaults when building
with libc++ and GCC (and possibly other configurations).

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

llvm-svn: 369270

4 years agoFilesystem/Windows: fix inconsistency in readNativeFileSlice API
Pavel Labath [Mon, 19 Aug 2019 15:40:49 +0000 (15:40 +0000)]
Filesystem/Windows: fix inconsistency in readNativeFileSlice API

Summary:
The windows version implementation of readNativeFileSlice, was trying to
match the POSIX behavior of not treating EOF as an error, but it was
only handling the case of reading from a pipe. Attempting to read past
the end of a regular file returns a slightly different error code, which
needs to be handled too. This patch adds ERROR_HANDLE_EOF to the list of
error codes to be treated as an end of file, and adds some unit tests
for the API.

This issue was found while attempting to land D66224, which caused a bunch of
lldb tests to start failing on windows.

Reviewers: rnk, aganea

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 369269

4 years ago[TargetLowering] x s% C == 0 fold: vector divisor with INT_MIN handling
Roman Lebedev [Mon, 19 Aug 2019 15:01:42 +0000 (15:01 +0000)]
[TargetLowering] x s% C == 0 fold: vector divisor with INT_MIN handling

Summary:
The general fold is only valid for positive divisors.
Which effectively means, it is invalid for `INT_MIN` divisors,
and we currently bailout if we see them.

But that is too strict, we can just fix-up the results.
For that, let's do a second computation 'in parallel':
```
Name: srem -> and
Pre: isPowerOf2(C)
%o = srem i8 %X, C
%r = icmp eq %o, 0
  =>
%n = and i8 %X, C-1
%r = icmp eq %n, 0
```
https://rise4fun.com/Alive/Sup

And then just blend results: if the divisor was `INT_MIN`,
pick the value we got via bit-test,
else pick the value from general fold.

There's interesting observation - `ISD::ROTR` is set to
`LegalizeAction::Expand` before AVX512, so we should not
treat `INT_MIN` divisor as even; and as it can be seen
while `@test_srem_odd_even_one` improves on all run-lines,
`@test_srem_odd_even_INT_MIN` only improves for AVX512.

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 369268

4 years ago[lldb][NFC] Stop using GetNumberOfMatches in CompletionRequest test
Raphael Isemann [Mon, 19 Aug 2019 14:52:48 +0000 (14:52 +0000)]
[lldb][NFC] Stop using GetNumberOfMatches in CompletionRequest test

This function is just a wrapper for GetNumberOfResults and will
be removed soon. This patch just changes all calls to GetNumberOfResults
where possible (which is currently just the unit test).

llvm-svn: 369267

4 years ago[nfc] Silent gcc warning
Serge Guelton [Mon, 19 Aug 2019 14:40:33 +0000 (14:40 +0000)]
[nfc] Silent gcc warning

llvm-svn: 369266

4 years ago[llvm-objdump] - Restore lost comment.
George Rimar [Mon, 19 Aug 2019 14:35:08 +0000 (14:35 +0000)]
[llvm-objdump] - Restore lost comment.

It was removed by mistake in r369263 (D66417).

llvm-svn: 369265

4 years agoAutomatically generate AVX512 test cases. NFC
Amaury Sechet [Mon, 19 Aug 2019 14:34:08 +0000 (14:34 +0000)]
Automatically generate AVX512 test cases. NFC

llvm-svn: 369264

4 years ago[Object/COFF.h] - Stop returning std::error_code in a few methods. NFCI.
George Rimar [Mon, 19 Aug 2019 14:32:23 +0000 (14:32 +0000)]
[Object/COFF.h] - Stop returning std::error_code in a few methods. NFCI.

There are 4 methods that return std::error_code now,
though they do not have to because they are always succeed.
I refactored them.

This allows to simplify the code in tools a bit.

llvm-svn: 369263

4 years ago[ELF] Move (copy relocation/canonical PLT) before error checking
Fangrui Song [Mon, 19 Aug 2019 14:30:12 +0000 (14:30 +0000)]
[ELF] Move (copy relocation/canonical PLT) before error checking

In processRelocAux(), we handle errors before copy relocation/canonical PLT.
This makes error checking a bit complex because we have to check for
conditions that will be allowed by copy relocation/canonical PLT.

Instead, move copy relocation/canonical PLT before error checking. This
simplifies the previous clumsy error checking code

`config->shared || (config->pie && expr == R_ABS && type != target->symbolicRel)`

to the simple `config->isPic`. Some diagnostics can be reported in
different ways. The code motion changes diagnostics for some contrived
test cases:

* copy-rel-pie-error.s -> copy-rel-pie2.s:
  It was rejected before but accepted now. ld.bfd also accepts the case.
* copy-errors.s: "cannot preempt symbol" changes to "symbol 'bar' has no type"
* got32{,x}-i386.s: the suggestion changes from "-fPIC or -Wl,-z,notext" to "-fPIE"
* x86-64-dyn-rel-error5.s: one diagnostic changes for -pie case

Reviewed By: peter.smith

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

llvm-svn: 369262

4 years ago[PeepholeOptimizer] Don't assume bitcast def always has input
Jinsong Ji [Mon, 19 Aug 2019 14:19:04 +0000 (14:19 +0000)]
[PeepholeOptimizer] Don't assume bitcast def always has input

Summary:
If we have a MI marked with bitcast bits, but without input operands,
PeepholeOptimizer might crash with assert.

eg:
If we apply the changes in PPCInstrVSX.td as in this patch:

[(set v4i32:$XT, (bitconvert (v16i8 immAllOnesV)))]>;

We will get assert in PeepholeOptimizer.

```
llvm-lit llvm-project/llvm/test/CodeGen/PowerPC/build-vector-tests.ll -v

llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:417: const
llvm::MachineOperand &llvm::MachineInstr::getOperand(unsigned int)
const: Assertion `i < getNumOperands() && "getOperand() out of range!"'
failed.
```

The fix is to abort if we found out of bound access.

Reviewers: qcolombet, MatzeB, hfinkel, arsenm

Reviewed By: qcolombet

Subscribers: wdng, arsenm, steven.zhang, wuzish, nemanjai, hiraditya, kbarton, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 369261

4 years ago[ELF][Hexagon] Improve error message for unknown relocations
Fangrui Song [Mon, 19 Aug 2019 14:07:14 +0000 (14:07 +0000)]
[ELF][Hexagon] Improve error message for unknown relocations

Like rLLD354040

Previously, for unknown relocation types, in -no-pie/-pie mode, we got something like:

    foo.o: unrecognized relocation ...

In -shared mode:

    error: can't create dynamic relocation ... against symbol: yyy in readonly segment

Delete the default case from Hexagon::getRelExpr and add the error there. We will get consistent error message like `error: unknown relocation (1024) against symbol foo`

Reviewed By: sidneym

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

llvm-svn: 369260

4 years agoDon't keep stale pointers to LoopInfos.
Aaron Ballman [Mon, 19 Aug 2019 13:37:41 +0000 (13:37 +0000)]
Don't keep stale pointers to LoopInfos.

CGLoopInfo was keeping pointers to parent loop LoopInfos, but when the loop info vector grew, it reallocated the storage and invalidated all of the parent pointers, causing use-after-free. Manage the lifetimes of the LoopInfos separately so that the pointers aren't stale.

Patch by Bevin Hansson.

llvm-svn: 369259

4 years ago[lld][Hexagon] Add GOTREL relocations.
Sid Manning [Mon, 19 Aug 2019 13:32:32 +0000 (13:32 +0000)]
[lld][Hexagon] Add GOTREL relocations.

Add GOTREL relocation support. (S + A - GOT)

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

llvm-svn: 369258

4 years ago[RISCV] Don't force absolute FK_Data_X fixups to relocs
Alex Bradbury [Mon, 19 Aug 2019 13:23:02 +0000 (13:23 +0000)]
[RISCV] Don't force absolute FK_Data_X fixups to relocs

The current behavior of shouldForceRelocation forces relocations for the
majority of fixups when relaxation is enabled. This makes sense for
fixups which incorporate symbols but is unnecessary for simple data
fixups where the fixup target is already resolved to an absolute value.

Differential Revision: https://reviews.llvm.org/D63404
Patch by Edward Jones.

llvm-svn: 369257

4 years ago[DebugInfo] Allow bundled calls in the MIR's call site info
David Stenberg [Mon, 19 Aug 2019 12:41:22 +0000 (12:41 +0000)]
[DebugInfo] Allow bundled calls in the MIR's call site info

Summary:
Extend the MIR parser and writer so that the call site information can
refer to calls that are bundled.

Reviewers: aprantl, asowda, NikolaPrica, djtodoro, ivanbaev, vsk

Reviewed By: aprantl

Subscribers: arsenm, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 369256

4 years ago[SLP] add test that requires shuffle of scalars; NFC
Sanjay Patel [Mon, 19 Aug 2019 12:41:09 +0000 (12:41 +0000)]
[SLP] add test that requires shuffle of scalars; NFC

llvm-svn: 369255

4 years ago[llvm-readobj] unwrapOrError: remove unnecessary llvm_unreachable after r369194
Fangrui Song [Mon, 19 Aug 2019 12:18:18 +0000 (12:18 +0000)]
[llvm-readobj] unwrapOrError: remove unnecessary llvm_unreachable after r369194

llvm-svn: 369254

4 years ago[OpenCL] Add generic type handling for builtin functions
Sven van Haastregt [Mon, 19 Aug 2019 11:56:03 +0000 (11:56 +0000)]
[OpenCL] Add generic type handling for builtin functions

Generic types are an abstraction of type sets.  It mimics the way
functions are defined in the OpenCL specification.  For example,
floatN can abstract all the vector sizes of the float type.

This allows to
 * stick more closely to the specification, which uses generic types;
 * factorize definitions of functions with numerous prototypes in the
   tablegen file; and
 * reduce the memory impact of functions with many overloads.

Patch by Pierre Gondois and Sven van Haastregt.

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

llvm-svn: 369253

4 years ago[lldb][NFC] Use CompletionRequest in Variable::AutoComplete
Raphael Isemann [Mon, 19 Aug 2019 11:49:43 +0000 (11:49 +0000)]
[lldb][NFC] Use CompletionRequest in Variable::AutoComplete

llvm-svn: 369252

4 years ago[OpenCL] Fix addr space deduction for pointers/references to arrays.
Anastasia Stulova [Mon, 19 Aug 2019 11:43:16 +0000 (11:43 +0000)]
[OpenCL] Fix addr space deduction for pointers/references to arrays.

Rewrite the logic for detecting if we are deducing addr space of
a pointee type to take into account special logic for arrays. For
pointers/references to arrays we can have any number of parentheses
expressions as well as nested pointers.

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

llvm-svn: 369251

4 years ago[SLP] reduce duplicated code; NFC
Sanjay Patel [Mon, 19 Aug 2019 11:39:56 +0000 (11:39 +0000)]
[SLP] reduce duplicated code; NFC

llvm-svn: 369250

4 years ago[lldb][NFC] Add a few more completion tests to increase test coverage
Raphael Isemann [Mon, 19 Aug 2019 10:46:38 +0000 (10:46 +0000)]
[lldb][NFC] Add a few more completion tests to increase test coverage

These tests are mostly trying to reach the different completion functions
in CommandCompletions.cpp (::ArchitectureNames, ::DiskFiles, ::Modules).

llvm-svn: 369249

4 years ago[MC] Simplify ELFObjectWriter::recordRelocation. NFC
Fangrui Song [Mon, 19 Aug 2019 10:05:59 +0000 (10:05 +0000)]
[MC] Simplify ELFObjectWriter::recordRelocation. NFC

llvm-svn: 369248

4 years ago[DebugInfo] Make postra sinking of DBG_VALUEs subregister-safe
Jeremy Morse [Mon, 19 Aug 2019 09:53:07 +0000 (09:53 +0000)]
[DebugInfo] Make postra sinking of DBG_VALUEs subregister-safe

Currently the machine instruction sinker identifies DBG_VALUE insts that
also need to sink by comparing register numbers. Unfortunately this isn't
safe, because (after register allocation) a DBG_VALUE may read a register
that aliases what's being sunk. To fix this, identify the DBG_VALUEs that
need to sink by recording & examining their register units. Register units
gives us the following guarantee:

  "Two registers overlap if and only if they have a common register unit"
  [MCRegisterInfo.h]

Thus we can always identify aliasing DBG_VALUEs if the set of register
units read by the DBG_VALUE, and the register units of the instruction
being sunk, intersect. (MachineSink already uses classes like
"LiveRegUnits" for determining sinking validity anyway).

The test added checks for super and subregister DBG_VALUE reads of a sunk
copy being sunk as well.

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

llvm-svn: 369247

4 years ago[ELF][ARM] Add a test that maxes out the thunk convergence limit
Peter Smith [Mon, 19 Aug 2019 09:46:52 +0000 (09:46 +0000)]
[ELF][ARM] Add a test that maxes out the thunk convergence limit

Add a test that takes the maximum amount of passes permitted to converge.
This will make sure that any symbol defined in a linker script gets the
correct value and that any other convergence limit involving symbol address
doesn't restrict Thunk convergence.

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

llvm-svn: 369246

4 years ago[ARM] Add support for MVE vaddv
Sam Tebbs [Mon, 19 Aug 2019 09:38:28 +0000 (09:38 +0000)]
[ARM] Add support for MVE vaddv

This patch adds vecreduce_add and the relevant instruction selection for
vaddv.

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

llvm-svn: 369245

4 years ago[ARM] MVE sext costs
David Green [Mon, 19 Aug 2019 09:13:22 +0000 (09:13 +0000)]
[ARM] MVE sext costs

This adds some sext costs for MVE, taken from the length of assembly sequences
that we currently generate.

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

llvm-svn: 369244

4 years ago[DebugInfo] Test for variable range un-coalescing
Jeremy Morse [Mon, 19 Aug 2019 09:02:18 +0000 (09:02 +0000)]
[DebugInfo] Test for variable range un-coalescing

LiveDebugVariables can coalesce ranges of variable locations across
multiple basic blocks. However when it recreates DBG_VALUE instructions,
it has to recreate one DBG_VALUE per block, otherwise it doesn't
represent the pre-regalloc layout and variable assignments can go missing.

This feature works -- however while mucking around with LiveDebugVariables,
I commented the relevant code it out and no tests failed. Thus, here's a
test that checks LiveDebugVariables preserves DBG_VALUEs across block
boundaries.

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

llvm-svn: 369243

4 years ago[lldb][NFC] Remove StringList::AutoComplete
Raphael Isemann [Mon, 19 Aug 2019 08:15:46 +0000 (08:15 +0000)]
[lldb][NFC] Remove StringList::AutoComplete

We don't need this very specific function in StringList that
we only call once in LLDB.

llvm-svn: 369242

4 years agoRevert [Attributor] Fix: Make sure we set the changed flag
David L. Jones [Mon, 19 Aug 2019 08:00:08 +0000 (08:00 +0000)]
Revert [Attributor] Fix: Make sure we set the changed flag

This reverts r369159 (git commit cbaf1fdea2de891bdbc49cdec89ae2077e6b9ed0)

r369160 caused a test to fail under UBSAN. See thread on llvm-commits.

llvm-svn: 369241

4 years ago[lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecute
Raphael Isemann [Mon, 19 Aug 2019 07:59:44 +0000 (07:59 +0000)]
[lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecute

llvm-svn: 369240

4 years ago[MC] Delete unnecessary diagnostic: "No relocation available to represent this relati...
Fangrui Song [Mon, 19 Aug 2019 07:59:35 +0000 (07:59 +0000)]
[MC] Delete unnecessary diagnostic: "No relocation available to represent this relative expression"

Replace

- error: No relocation available to represent this relative expression

with

+ error: symbol 'undef' can not be undefined in a subtraction expression

or

+ error: Cannot represent a difference across sections

Keep !IsPcRel as an assertion after the two diagnostic checks are done.

llvm-svn: 369239

4 years ago[clangd] Added special HighlightingKind for function parameters.
Johan Vikstrom [Mon, 19 Aug 2019 07:51:39 +0000 (07:51 +0000)]
[clangd] Added special HighlightingKind for function parameters.

Summary: This means that function parameters are no longer highlighted as variable.other.cpp but instead as variable.parameter.cpp which is the more "correct" TextMate scope for them.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 369238

4 years ago[lldb][NFC] Address review comments to StringList for-loop support
Raphael Isemann [Mon, 19 Aug 2019 07:22:19 +0000 (07:22 +0000)]
[lldb][NFC] Address review comments to StringList for-loop support

llvm-svn: 369237

4 years agoRevert [Attributor] Fix: Do not partially resolve returned calls.
David L. Jones [Mon, 19 Aug 2019 07:16:24 +0000 (07:16 +0000)]
Revert [Attributor] Fix: Do not partially resolve returned calls.

This reverts r369160 (git commit f72d9b1c97b41fff48ad1eecbba59a29c171bff4)

r369160 caused some tests to fail under UBSAN. See thread on llvm-commits.

llvm-svn: 369236

4 years ago[lldb] Remove unused inheritance in RegularExpression
Jan Kratochvil [Mon, 19 Aug 2019 07:06:56 +0000 (07:06 +0000)]
[lldb] Remove unused inheritance in RegularExpression

D66174 left inherited llvm::Regex which is now a member variable there.

Approved as a part of: https://reviews.llvm.org/D66392#1634575

llvm-svn: 369235

4 years agoRevert r369230 and r369231
Seiya Nuta [Mon, 19 Aug 2019 06:45:48 +0000 (06:45 +0000)]
Revert r369230 and r369231

Looks these commits break CI builds:

- http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-gn/builds/4159

This commit reverts r369230 and r369231 (git coommit: 4a198a7 and dee9546).

llvm-svn: 369234

4 years ago[MC] Don't emit .symver redirected symbols to the symbol table
Fangrui Song [Mon, 19 Aug 2019 06:17:30 +0000 (06:17 +0000)]
[MC] Don't emit .symver redirected symbols to the symbol table

GNU as keeps the original symbol in the symbol table for defined @ and
@@, but suppresses it in other cases (@@@ or undefined). The original
symbol is usually undesired:
In a shared object, the original symbol can be localized with a version
script, but it is hard to remove/localize in an archive:

1) a post-processing step removes the undesired original symbol
2) consumers (executable) of the archive are built with the
   version script

Moreover, it can cause linker issues like binutils PR/18703 if the
original symbol name and the base name of the versioned symbol is the
same (both ld.bfd and gold have some code to work around defined @ and
@@). In lld, if it sees f and f@v1:

  --version-script =(printf 'v1 {};') => f and f@v1
  --version-script =(printf 'v1 { f; };') => f@v1 and f@@v1

It can be argued that @@@ added on 2000-11-13 corrected the @ and @@ mistake.

This patch catches some more multiple version errors (defined @ and @@),
and consistently suppress the original symbol. This addresses all the
problems listed above.

If the user wants other aliases to the versioned symbol, they can copy
the original symbol to other symbol names with .set directive, e.g.

    .symver f, f@v1  # emit f@v1 but not f into .symtab
    .set f_impl, f   # emit f_impl into .symtab

llvm-svn: 369233

4 years ago[X86] Teach lower1BitShuffle to match right shifts with upper zero elements on types...
Craig Topper [Mon, 19 Aug 2019 05:45:39 +0000 (05:45 +0000)]
[X86] Teach lower1BitShuffle to match right shifts with upper zero elements on types that don't natively support KSHIFT.

We can support these by widening to a supported type,
then shifting all the way to the left and then
back to the right to ensure that we shift in zeroes.

llvm-svn: 369232

4 years ago[llvm-objcopy][MachO] Implement a layout algorithm for executables
Seiya Nuta [Mon, 19 Aug 2019 05:41:33 +0000 (05:41 +0000)]
[llvm-objcopy][MachO] Implement a layout algorithm for executables

Summary: The layout algorithm for relocatable objects and for executable are somewhat different. This patch implements the latter one based on the algorithm in LLD (MachOFileLayout).

Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap

Subscribers: jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

llvm-svn: 369231

4 years ago[llvm-objcopy][MachO] Support load commands used in executables/shared libraries
Seiya Nuta [Mon, 19 Aug 2019 05:37:38 +0000 (05:37 +0000)]
[llvm-objcopy][MachO] Support load commands used in executables/shared libraries

Summary:
This patch implements copying some load commands that appear in executables/shared libraries such as the indirect symbol table.

I don't add tests intentionally because this patch is incomplete: we need a layout algorithm for executables/shared libraries. I'll submit it as a separate patch with tests.

Reviewers: alexshap, rupprecht, jhenderson, compnerd

Reviewed By: alexshap

Subscribers: abrachet, mgorny, mgrang, MaskRay, mtrent, jakehehrlich, llvm-commits

Tags: #llvm

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

llvm-svn: 369230

4 years ago[clangd] Update features table in the docs with links to LSP extension proposals
Nathan Ridge [Mon, 19 Aug 2019 05:11:15 +0000 (05:11 +0000)]
[clangd] Update features table in the docs with links to LSP extension proposals

Also update the semantic coloring entry to reflect it being supported in
clangd now.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 369229

4 years ago[X86] Fix the lower1BitShuffle code added in r369215 to correctly pass the widened...
Craig Topper [Mon, 19 Aug 2019 04:08:44 +0000 (04:08 +0000)]
[X86] Fix the lower1BitShuffle code added in r369215 to correctly pass the widened vector to the KSHIFT node.

Not sure how to test this as we have tests that exercise this code,
but nothing failed for the types not matching. Since all the k-registers
use equivalent register classes everything just ends up working.

llvm-svn: 369228

4 years ago[X86] Teach lower1BitShuffle to match KSHIFTR that doesn't use Zeroable and only...
Craig Topper [Mon, 19 Aug 2019 04:08:40 +0000 (04:08 +0000)]
[X86] Teach lower1BitShuffle to match KSHIFTR that doesn't use Zeroable and only relies on undef.

This allows us to widen the type when the KSHIFTR instruction
doesn't exist for the type. If we need to shift in zeroes into
the upper elements we would need more work to guarantee zeroes
when widening.

llvm-svn: 369227

4 years ago[X86] Teach lower1BitShuffle to recognize padding a subvector with zeros with V2...
Craig Topper [Mon, 19 Aug 2019 00:39:22 +0000 (00:39 +0000)]
[X86] Teach lower1BitShuffle to recognize padding a subvector with zeros with V2 as the source and V1 as the zero vector.

Shuffle canonicalization can swap the sources so the zero vector
might be V1 and the subvector that's being padded can be V2.

llvm-svn: 369226

4 years ago[X86] Add test case for missed opportunity to recognize a vXi1 shuffle as an insert...
Craig Topper [Mon, 19 Aug 2019 00:39:18 +0000 (00:39 +0000)]
[X86] Add test case for missed opportunity to recognize a vXi1 shuffle as an insert into a zero vector.

We are currently missing this because shuffle canonicalization
puts the zero vector as V1 and the subvector as V2. Our current
code doesn't recognize this case.

llvm-svn: 369225

4 years ago[X86] Add a special case to LowerCONCAT_VECTORSvXi1 to handle concatenating zero...
Craig Topper [Sun, 18 Aug 2019 23:30:11 +0000 (23:30 +0000)]
[X86] Add a special case to LowerCONCAT_VECTORSvXi1 to handle concatenating zero vectors followed by one non-zero vector followed by undef vectors.

For such a case we should only need a KSHIFTL, but we were
previously generating a KSHIFTL followed by a KSHIFTR because
we mistakenly believed we need to zero the undef elements.

llvm-svn: 369224

4 years ago[X86] Add test cases for suboptimal insertion of a vXi1 vector into a larger vector...
Craig Topper [Sun, 18 Aug 2019 23:30:07 +0000 (23:30 +0000)]
[X86] Add test cases for suboptimal insertion of a vXi1 vector into a larger vector with zeros in the lower elements and undef upper elements.

Currently we generate kshifts to clear both the upper and lower
elements, but we only need one kshift.

llvm-svn: 369223

4 years ago[X86] Replace uses of getZeroVector for vXi1 vectors with DAG.getConstant.
Craig Topper [Sun, 18 Aug 2019 23:30:03 +0000 (23:30 +0000)]
[X86] Replace uses of getZeroVector for vXi1 vectors with DAG.getConstant.

vXi1 vectors don't need special handling.

llvm-svn: 369222

4 years ago[cmake] Move blocks out of redundant else( MSVC ); NFC
Hubert Tong [Sun, 18 Aug 2019 22:02:24 +0000 (22:02 +0000)]
[cmake] Move blocks out of redundant else( MSVC ); NFC

Address post-commit comment on D66256 regarding the `else( MSVC )` block
containing only blocks guarded with `LLVM_COMPILER_IS_GCC_COMPATIBLE`,
which would imply `NOT MSVC`.

llvm-svn: 369221

4 years ago[CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.
Jonas Devlieghere [Sun, 18 Aug 2019 21:54:26 +0000 (21:54 +0000)]
[CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.

After LLVM moved to C++14, the RWMutex implementation was removed in
favor of std::shared_timed_mutex, which is only available on macOS
10.12 and later. As a workaround for older deployment targets, I added
   the original RWMutexImpl again, guarded by the deployment target.

When doing a standalone build of LLDB using the Xcode generator, the
CMake cache specifies a minimum deployment target. However, LLVM and
Clang might have been built with a different minimum deployment target.

This is exactly what happened for the Xcode build. LLVM was built with a
minimum deployment target newer than 10.12, using
std::shared_timed_mutex. LLDB on the other hand was built with a minimum
deployment target of 10.11, using the old RWMutexImpl, resulting in
undefined symbols at link-time.

This patch changes the minimum deployment target for the Xcode build to
10.12 to work around this problem. A better solution would involve
synchronizing the minimum deployment or even not setting one at all.

llvm-svn: 369220

4 years ago[ORC] Make sure we linker-mangle symbol names in the SpeculationLayer.
Lang Hames [Sun, 18 Aug 2019 21:29:57 +0000 (21:29 +0000)]
[ORC] Make sure we linker-mangle symbol names in the SpeculationLayer.

If mangling is not performed then speculative lookups will fail.

llvm-svn: 369219

4 years ago[ORC] Remove some dead code.
Lang Hames [Sun, 18 Aug 2019 21:22:14 +0000 (21:22 +0000)]
[ORC] Remove some dead code.

llvm-svn: 369218

4 years ago[Diagnostics] Diagnose misused xor as pow
David Bolvansky [Sun, 18 Aug 2019 19:14:14 +0000 (19:14 +0000)]
[Diagnostics] Diagnose misused xor as pow

Summary:
Motivation:
https://twitter.com/jfbastien/status/1139298419988549632
https://twitter.com/mikemx7f/status/1139335901790625793
https://codesearch.isocpp.org/cgi-bin/cgi_ppsearch?q=10+%5E&search=Search

Reviewers: jfb, rsmith, regehr, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: lebedev.ri, Quuxplusone, erik.pilkington, riccibruno, dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 369217

4 years ago[Docs] Test commit
DeForest Richards [Sun, 18 Aug 2019 19:07:10 +0000 (19:07 +0000)]
[Docs] Test commit

Fixes typo - Removes extra space between last word of sentence and period.

llvm-svn: 369216

4 years ago[X86] Improve lower1BitShuffle handling for KSHIFTL on narrow vectors.
Craig Topper [Sun, 18 Aug 2019 18:52:46 +0000 (18:52 +0000)]
[X86] Improve lower1BitShuffle handling for KSHIFTL on narrow vectors.

We can insert the value into a larger legal type and shift that
by the desired amount.

llvm-svn: 369215

4 years ago[clang-format] Fix a bug that joins template closer and =
Owen Pan [Sun, 18 Aug 2019 18:51:39 +0000 (18:51 +0000)]
[clang-format] Fix a bug that joins template closer and =

Also fixes the documentation for SpaceBeforeAssignmentOperators.

See discussions at https://reviews.llvm.org/D66332

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

llvm-svn: 369214

4 years agoFix signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Sun, 18 Aug 2019 17:26:30 +0000 (17:26 +0000)]
Fix signed/unsigned comparison warning. NFCI.

llvm-svn: 369213

4 years ago[X86] isTargetShuffleEquivalent - add BUILD_VECTOR matching
Simon Pilgrim [Sun, 18 Aug 2019 17:15:26 +0000 (17:15 +0000)]
[X86] isTargetShuffleEquivalent - add BUILD_VECTOR matching

Add similar functionality to isShuffleEquivalent - if the mask elements don't match, try matching the BUILD_VECTOR scalars instead.

As target shuffles need to handle SM_Sentinel values, this can get a bit tricky, so commit just adds actual mask element index handling - full SM_SentinelZero support will be added when the need arises.

Also, enables support in matchVectorShuffleWithPACK

llvm-svn: 369212

4 years ago[X86] isTargetShuffleEquivalent - early out on illegal shuffle masks. NFCI.
Simon Pilgrim [Sun, 18 Aug 2019 16:37:58 +0000 (16:37 +0000)]
[X86] isTargetShuffleEquivalent - early out on illegal shuffle masks. NFCI.

Simplifies shuffle mask comparisons by just bailing out if the shuffle mask has any out of range values - will make an upcoming patch much simpler.

llvm-svn: 369211

4 years ago[X86][SSE] Improve PACKSS shuffle tests to better match codegen from D61129
Simon Pilgrim [Sun, 18 Aug 2019 15:39:04 +0000 (15:39 +0000)]
[X86][SSE] Improve PACKSS shuffle tests to better match codegen from D61129

D61129 creates 'concat + trunc' style patterns (at the 128-bit subvector level)

llvm-svn: 369209

4 years ago[MC] MCFixup - Fix cppcheck + MSVC analyzer uninitialized member variable warnings...
Simon Pilgrim [Sun, 18 Aug 2019 13:29:12 +0000 (13:29 +0000)]
[MC] MCFixup - Fix cppcheck + MSVC analyzer uninitialized member variable warnings. NFCI.

llvm-svn: 369208

4 years ago[InstCombine] Cherry-pick NFC cleanups of foldShiftIntoShiftInAnotherHandOfAndInICmp...
Roman Lebedev [Sun, 18 Aug 2019 12:26:33 +0000 (12:26 +0000)]
[InstCombine] Cherry-pick NFC cleanups of foldShiftIntoShiftInAnotherHandOfAndInICmp() from D66383

llvm-svn: 369207

4 years ago[Diagnostics] Improve -Wsizeof-pointer-div
David Bolvansky [Sun, 18 Aug 2019 10:10:09 +0000 (10:10 +0000)]
[Diagnostics] Improve -Wsizeof-pointer-div

Emit diag note with a location of pointer declaration.
Revisited/added tests.

llvm-svn: 369206

4 years ago[TargetLowering] Teach computeRegisterProperties to only widen v3i16/v3f16 vectors...
Craig Topper [Sun, 18 Aug 2019 06:28:06 +0000 (06:28 +0000)]
[TargetLowering] Teach computeRegisterProperties to only widen v3i16/v3f16 vectors to the next power of 2 type if that's legal.

These were recently made simple types. This restores their
behavior back to something like their EVT legalization.

We might be able to fix the code in type legalization where the
assert was failing, but I didn't investigate too much as I had
already looked at the computeRegisterProperties code during the
review for v3i16/v3f16.

Most of the test changes restore the X86 codegen back to what
it looked like before the recent change. The test case in
vec_setcc.ll and is a reduced version of the reproducer from
the fuzzer.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16490

llvm-svn: 369205

4 years ago[SelectionDAG] Add a node creation debug message to getMachineNode.
Craig Topper [Sun, 18 Aug 2019 06:28:00 +0000 (06:28 +0000)]
[SelectionDAG] Add a node creation debug message to getMachineNode.

llvm-svn: 369204

4 years agoAMDGPU: Fix iterator error when lowering SI_END_CF
Matt Arsenault [Sun, 18 Aug 2019 00:20:44 +0000 (00:20 +0000)]
AMDGPU: Fix iterator error when lowering SI_END_CF

If the instruction is the last in the block, there is no next
instruction but the iteration still needs to look at the new block.

llvm-svn: 369203

4 years agoAMDGPU: Disambiguate v3f16 format in load/store tables
Matt Arsenault [Sun, 18 Aug 2019 00:20:43 +0000 (00:20 +0000)]
AMDGPU: Disambiguate v3f16 format in load/store tables

Currently the searchable tables report the number of dwords. These
round to the same number for 3 and 4 component d16
instructions. Change this to report the number of elements so this
isn't ambiguous.

llvm-svn: 369202