platform/upstream/llvm.git
6 years ago[ARM] Share predecessor bookkeeping in CombineBaseUpdate. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:30:47 +0000 (15:30 +0000)]
[ARM] Share predecessor bookkeeping in CombineBaseUpdate. NFCI.

llvm-svn: 342987

6 years ago[AArch64] Share search bookkeeping in combines. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:30:22 +0000 (15:30 +0000)]
[AArch64] Share search bookkeeping in combines. NFCI.

Share predecessor search bookkeeping in both perform PostLD1Combine
and performNEONPostLDSTCombine. This should be approximately a 4x and
2x performance improvement.

llvm-svn: 342986

6 years ago[LegalizeDAG] Prune Predecessor check in ExpandExtractFromVectorThroughStack. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:29:57 +0000 (15:29 +0000)]
[LegalizeDAG] Prune Predecessor check in ExpandExtractFromVectorThroughStack. NFCI.

llvm-svn: 342985

6 years ago[DAGCombine] Improve Predecessor check in SimplifySelectOps. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:29:30 +0000 (15:29 +0000)]
[DAGCombine] Improve Predecessor check in SimplifySelectOps. NFCI.

Reuse search space bookkeeping across multiple predecessor checks
qdone to avoid redundancy. This should cut search cost by ~4x.

llvm-svn: 342984

6 years ago[DAGCombine] Share predecessor bookkeeping in CombineToPostIndexedLoadStore. NFCI.
Nirav Dave [Tue, 25 Sep 2018 15:29:04 +0000 (15:29 +0000)]
[DAGCombine] Share predecessor bookkeeping in CombineToPostIndexedLoadStore. NFCI.

llvm-svn: 342983

6 years ago[llvm-exegesis] Serializes registers initial values.
Guillaume Chatelet [Tue, 25 Sep 2018 15:15:54 +0000 (15:15 +0000)]
[llvm-exegesis] Serializes registers initial values.

Summary: Adds the registers initial values to the YAML output of llvm-exegesis.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 342982

6 years ago[llvm-exegesis] Fix missing document separator in YAML output.
Guillaume Chatelet [Tue, 25 Sep 2018 14:48:24 +0000 (14:48 +0000)]
[llvm-exegesis] Fix missing document separator in YAML output.

Reviewers: courbet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 342981

6 years ago[DAGCombine] Don't fold dependent loads across SELECT_CC.
Nirav Dave [Tue, 25 Sep 2018 14:43:05 +0000 (14:43 +0000)]
[DAGCombine] Don't fold dependent loads across SELECT_CC.

DAGCombine will try to fold two loads that feed a SELECT or SELECT_CC
after the select, resulting in a select of an address and a single
load after.

If either of the loads depend on the other, this is not legal as it
could introduce cycles. However, it only checked this if the opcode
was a SELECT, and not for a SELECT_CC.

Unfortunately, the only reproducer I have for this is for our
downstream target. I've tried getting it to trigger on an upstream one
but haven't been successful.

Patch thanks to Bevin Hansson.

llvm-svn: 342980

6 years agoParallelize .gdb_index string table writes.
Rui Ueyama [Tue, 25 Sep 2018 14:34:56 +0000 (14:34 +0000)]
Parallelize .gdb_index string table writes.

When we are creating a large .gdb_index, this change makes a difference.

llvm-svn: 342978

6 years ago[clang-cl] Provide separate flags for all the /O variants
Hans Wennborg [Tue, 25 Sep 2018 14:10:26 +0000 (14:10 +0000)]
[clang-cl] Provide separate flags for all the /O variants

This provides better help text in "clang-cl /?".

Also it cleans things up a bit: previously "/Od" could be handled either
as a separate flag aliased to "-O0", or by the main optimization flag
processing in TranslateOptArg. With this patch, all the flags get
aliased back to /O so they're handled by TranslateOptArg.

Thanks to Nico for the idea!

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

llvm-svn: 342977

6 years ago[VFS] Add a proxy FS that delegates calls to underlying FS by default.
Eric Liu [Tue, 25 Sep 2018 14:02:01 +0000 (14:02 +0000)]
[VFS] Add a proxy FS that delegates calls to underlying FS by default.

Summary:
This is useful when derived file systems want to override some calls
and still proxy other calls.

Reviewers: ilya-biryukov, sammccall

Subscribers: cfe-commits

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

llvm-svn: 342976

6 years ago[llvm-exegesis] Add lit tests (v2).
Clement Courbet [Tue, 25 Sep 2018 13:59:35 +0000 (13:59 +0000)]
[llvm-exegesis] Add lit tests (v2).

Summary: This revisits rL342953 by adding detection of host support.

Reviewers: gchatelet, lebedev.ri, alexshap

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 342975

6 years ago[clangd] NFC: Simplify code, enforce LLVM Coding Standards
Kirill Bobyrev [Tue, 25 Sep 2018 13:58:48 +0000 (13:58 +0000)]
[clangd] NFC: Simplify code, enforce LLVM Coding Standards

For consistency, functional-style code pieces are replaced with their
simple counterparts to improve readability.

Also, file headers are fixed to comply with LLVM Coding Standards.

`static` member of anonymous namespace is not marked `static` anymore,
because it is redundant.

Reviewed By: sammccall

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

llvm-svn: 342974

6 years ago[AST] Squeeze some bits in LinkageComputer::QueryType
Bruno Ricci [Tue, 25 Sep 2018 13:43:25 +0000 (13:43 +0000)]
[AST] Squeeze some bits in LinkageComputer::QueryType

Replace the pair std::pair<const NamedDecl *, unsigned> where the
unsigned represents an LVComputationKind by a PointerIntPair.
This saves a pointer per entry in the map LinkageComputer::CachedLinkageInfo.

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

Reviewed by: rjmccall, george.burgess.iv, erichkeane

llvm-svn: 342973

6 years ago[OpenMP][libomptarget] Simplify warp master selection for data sharing
Gheorghe-Teodor Bercea [Tue, 25 Sep 2018 13:23:32 +0000 (13:23 +0000)]
[OpenMP][libomptarget] Simplify warp master selection for data sharing

Summary:
There is currently no supported situation where the warp master is not the first thread in the warp.

This also avoids the device execution from hanging on Volta GPUs when ballot_sync is called by a number of threads that is less that the size of a warp.

Reviewers: ABataev, caomhin, grokos

Reviewed By: grokos

Subscribers: guansong, openmp-commits

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

llvm-svn: 342972

6 years ago[llvm-exegesis] Fix broken test.
Guillaume Chatelet [Tue, 25 Sep 2018 13:18:10 +0000 (13:18 +0000)]
[llvm-exegesis] Fix broken test.

llvm-svn: 342971

6 years ago[clangd] Fix some buildbots after r342965
Kirill Bobyrev [Tue, 25 Sep 2018 13:14:11 +0000 (13:14 +0000)]
[clangd] Fix some buildbots after r342965

Some compilers fail to parse struct default member initializer.

llvm-svn: 342970

6 years agoRevert rL342916: [X86] Remove shift/rotate by CL memory (RMW) overrides
Simon Pilgrim [Tue, 25 Sep 2018 13:01:26 +0000 (13:01 +0000)]
Revert rL342916: [X86] Remove shift/rotate by CL memory (RMW) overrides

As suggested by Craig Topper - I'm going to look at cleaning up the RMW sequences instead.

The uops are slightly different to the register variant, so requires a +1uop tweak

llvm-svn: 342969

6 years ago[OpenCL] Allow zero assignment and comparisons between queue_t type variables
Sven van Haastregt [Tue, 25 Sep 2018 12:59:34 +0000 (12:59 +0000)]
[OpenCL] Allow zero assignment and comparisons between queue_t type variables

This change allows for zero assignment and comparison of queue_t
type variables, and extends null_queue.cl to test this.

Patch by Alistair Davies.

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

llvm-svn: 342968

6 years ago[llvm-exegesis][NFC] Rewrite of the YAML serialization.
Guillaume Chatelet [Tue, 25 Sep 2018 12:18:08 +0000 (12:18 +0000)]
[llvm-exegesis][NFC] Rewrite of the YAML serialization.

Summary: This is a NFC in preparation of exporting the initial registers as part of the YAML dump

Reviewers: courbet

Reviewed By: courbet

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 342967

6 years agoRevert r342637 "[ADT] Try again to use the same version of llvm::Optional on all...
Hans Wennborg [Tue, 25 Sep 2018 12:08:56 +0000 (12:08 +0000)]
Revert r342637 "[ADT] Try again to use the same version of llvm::Optional on all compilers"

and also revert follow-ups r342643 and r342723.

This caused Clang to be miscompiled by GCC 4.8.4 (Unbuntu 14.04's
default compiler) and break the Chromium build (see
https://crbug.com/888061).

llvm-svn: 342966

6 years ago[clangd] Implement VByte PostingList compression
Kirill Bobyrev [Tue, 25 Sep 2018 11:54:51 +0000 (11:54 +0000)]
[clangd] Implement VByte PostingList compression

This patch implements Variable-length Byte compression of `PostingList`s
to sacrifice some performance for lower memory consumption.

`PostingList` compression and decompression was extensively tested using
fuzzer for multiple hours and runnning significant number of realistic
`FuzzyFindRequests`. AddressSanitizer and UndefinedBehaviorSanitizer
were used to ensure the correct behaviour.

Performance evaluation was conducted with recent LLVM symbol index (292k
symbols) and the collection of user-recorded queries (7751
`FuzzyFindRequest` JSON dumps):

| Metrics | Before| After | Change (%)
| -----  | -----  | -----   | -----
| Memory consumption (posting lists only), MB  |  54.4 | 23.5 | -60%
| Time to process queries, sec | 7.70 | 9.4 | +25%

Reviewers: sammccall, ioeric

Reviewed By: sammccall

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

llvm-svn: 342965

6 years ago[clangd] Fix build bot after r342961
Eric Liu [Tue, 25 Sep 2018 11:47:14 +0000 (11:47 +0000)]
[clangd] Fix build bot after r342961

Use llvm::isAlpha instead of std::isalpha etc. This should fix bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20180

llvm-svn: 342964

6 years ago[Profile] Fix gcov tests
Calixte Denizet [Tue, 25 Sep 2018 11:12:15 +0000 (11:12 +0000)]
[Profile] Fix gcov tests

Summary: The gcda need to be delete before running the binary to avoid to have an increasing "# of Runs" when a test is failing

Reviewers: vitalybuka, eugenis, marco-c

Reviewed By: marco-c

Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru, marco-c

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

llvm-svn: 342963

6 years ago[COFF] Add support for creating range extension thunks for ARM
Martin Storsjo [Tue, 25 Sep 2018 10:59:29 +0000 (10:59 +0000)]
[COFF] Add support for creating range extension thunks for ARM

This is a feature that MS link.exe lacks; it currently errors out on
such relocations, just like lld did before.

This allows linking clang.exe for ARM - practically, any image over
16 MB will likely run into the issue.

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

llvm-svn: 342962

6 years ago[clangd] Check that scheme is valid when parsing URI.
Eric Liu [Tue, 25 Sep 2018 10:47:46 +0000 (10:47 +0000)]
[clangd] Check that scheme is valid when parsing URI.

Reviewers: sammccall

Reviewed By: sammccall

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

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

llvm-svn: 342961

6 years agoFix a typo in the help of clangd
Sylvestre Ledru [Tue, 25 Sep 2018 10:36:57 +0000 (10:36 +0000)]
Fix a typo in the help of clangd

llvm-svn: 342960

6 years ago[Swig] Merge typemaps with same bodies
Tatyana Krasnukha [Tue, 25 Sep 2018 10:30:32 +0000 (10:30 +0000)]
[Swig] Merge typemaps with same bodies

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

llvm-svn: 342959

6 years ago[LoopUnroll] Add check to Latch's terminator in UnrollRuntimeLoopRemainder
David Green [Tue, 25 Sep 2018 10:08:47 +0000 (10:08 +0000)]
[LoopUnroll] Add check to Latch's terminator in UnrollRuntimeLoopRemainder

In this patch, I'm adding an extra check to the Latch's terminator in llvm::UnrollRuntimeLoopRemainder,
similar to how it is already done in the llvm::UnrollLoop.

The compiler would crash if this function is called with a malformed loop.

Patch by Rodrigo Caetano Rocha!

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

llvm-svn: 342958

6 years ago[clangd] NFC: Remove test duplicate
Kirill Bobyrev [Tue, 25 Sep 2018 09:47:01 +0000 (09:47 +0000)]
[clangd] NFC: Remove test duplicate

`FuzzyMatchQ` test was a duplicate of `FuzzyMatch` pulled from MemIndex
tests.

llvm-svn: 342957

6 years ago[AMDGPU] restore r342722 which was reverted with r342743
Sameer Sahasrabuddhe [Tue, 25 Sep 2018 09:39:21 +0000 (09:39 +0000)]
[AMDGPU] restore r342722 which was reverted with r342743

[AMDGPU] lower-switch in preISel as a workaround for legacy DA

Summary:
The default target of the switch instruction may sometimes be an
"unreachable" block, when it is guaranteed that one of the cases is
always taken. The dominator tree concludes that such a switch
instruction does not have an immediate post dominator. This confuses
divergence analysis, which is unable to propagate sync dependence to
the targets of the switch instruction.

As a workaround, the AMDGPU target now invokes lower-switch as a
preISel pass. LowerSwitch is designed to handle the unreachable
default target correctly, allowing the divergence analysis to locate
the correct immediate dominator of the now-lowered switch.

llvm-svn: 342956

6 years agoRevert rL342953 "[llvm-exegesis] Add lit tests."
Clement Courbet [Tue, 25 Sep 2018 09:36:44 +0000 (09:36 +0000)]
Revert rL342953 "[llvm-exegesis] Add lit tests."

We also need to make sure that we're on the right subtarget.

llvm-svn: 342955

6 years ago[ELF] - Add -z global option to manual.
George Rimar [Tue, 25 Sep 2018 09:32:31 +0000 (09:32 +0000)]
[ELF] - Add -z global option to manual.

This was requested during review of D49374,
but for some unknown reason was not in the final commit.

llvm-svn: 342954

6 years ago[llvm-exegesis] Add lit tests.
Clement Courbet [Tue, 25 Sep 2018 09:27:43 +0000 (09:27 +0000)]
[llvm-exegesis] Add lit tests.

Summary:
Right now we only have unit tests. This will allow testing the whole
tool. Even though We can't really check actual values, this will avoid
regressions such as PR39055.

Reviewers: gchatelet, alexshap

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 342953

6 years ago[llvm-exegesis] Add MCParser to LLVM_LINK_COMPONENTS
Heejin Ahn [Tue, 25 Sep 2018 08:25:29 +0000 (08:25 +0000)]
[llvm-exegesis] Add MCParser to LLVM_LINK_COMPONENTS

We need this to make builds with `-DBUILD_SHARED_LIBS=ON` work.

llvm-svn: 342952

6 years agoDeduplicate replacements from diagnostics.
Eric Liu [Tue, 25 Sep 2018 08:24:07 +0000 (08:24 +0000)]
Deduplicate replacements from diagnostics.

Summary:
After r329813, clang-apply-replacements stopped deduplicating identical
replacements; however, tools like clang-tidy relies on the deduplication of
identical dignostics replacements from different TUs to apply fixes correctly.

This change partially roll back the behavior by deduplicating changes from
diagnostics. Ideally, we should deduplicate on diagnostics level, but we need to
figure out an effecient way.

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 342951

6 years agoAnnotate LookupResult::clear() as LLVM_ATTRIBUTE_REINITIALIZES to silence bugprone...
Fangrui Song [Tue, 25 Sep 2018 08:07:42 +0000 (08:07 +0000)]
Annotate LookupResult::clear() as LLVM_ATTRIBUTE_REINITIALIZES to silence bugprone-use-after-move after rC342925

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 342950

6 years agoAdd macro LLVM_ATTRIBUTE_REINITIALIZES
Fangrui Song [Tue, 25 Sep 2018 08:06:32 +0000 (08:06 +0000)]
Add macro LLVM_ATTRIBUTE_REINITIALIZES

Summary:
This marks legitimate use-after-move (e.g. `Found.clear()` in rC342925)
which would otherwise be caught by bugprone-use-after-move.

bugprone-use-after-move recognizes this attribute after rCTE339571.

Reviewers: aaron.ballman, rsmith, mboehme, hokein

Reviewed By: mboehme

Subscribers: kristina, llvm-commits

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

llvm-svn: 342949

6 years ago[llvm-exegesis] Fix doc in r342947.
Clement Courbet [Tue, 25 Sep 2018 07:48:38 +0000 (07:48 +0000)]
[llvm-exegesis] Fix doc in r342947.

llvm-exegesis.rst was using invalid indentation for bullet points.

llvm-svn: 342948

6 years ago[llvm-exegesis] Allow benchmarking arbitrary code snippets.
Clement Courbet [Tue, 25 Sep 2018 07:31:44 +0000 (07:31 +0000)]
[llvm-exegesis] Allow benchmarking arbitrary code snippets.

Summary:

This is a step towards fixing PR38048.

Note that right now the measurements are given per instruction. We'll
need to give measurements a per code snippet and update the analysis (PR38731).

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 342947

6 years ago[mips] Correct MUL pattern for mips64
Stefan Maksimovic [Tue, 25 Sep 2018 06:27:49 +0000 (06:27 +0000)]
[mips] Correct MUL pattern for mips64

Guard existing pattern with a predicate, introduce a new one for revision 6.

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

llvm-svn: 342946

6 years agoUse unique_ptr to hold AsmInfo,MRI,MII,STI
Fangrui Song [Tue, 25 Sep 2018 06:19:31 +0000 (06:19 +0000)]
Use unique_ptr to hold AsmInfo,MRI,MII,STI

Reviewers: pcc, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

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

llvm-svn: 342945

6 years agoUse TRI->regsOverlap() in MachineBasicBlock::computeRegisterLiveness
Mikael Holmen [Tue, 25 Sep 2018 06:10:04 +0000 (06:10 +0000)]
Use TRI->regsOverlap() in MachineBasicBlock::computeRegisterLiveness

Summary:
For the loop that used MCRegAliasIterator this should be NFC.

For the loop that previously used MCSubRegIterator we should
now detect more cases where the register is actually live out that
we previously missed.

Reviewers: MatzeB, arsenm

Reviewed By: MatzeB

Subscribers: wdng, llvm-commits

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

llvm-svn: 342944

6 years ago[DebugInfo] Do not generate address info for removed debug labels.
Hsiangkai Wang [Tue, 25 Sep 2018 06:09:50 +0000 (06:09 +0000)]
[DebugInfo] Do not generate address info for removed debug labels.

In some senario, LLVM will remove llvm.dbg.labels in IR. For example,
when the labels are in unreachable blocks, these labels will not
be generated in LLVM IR. In the case, these debug labels will have
address zero as their address. It is not legal address for debugger to
set breakpoints or query sources. So, the patch inhibits the address info
(DW_AT_low_pc) of removed labels.

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

llvm-svn: 342943

6 years ago[MachineCopyPropagation] Reimplement CopyTracker in terms of register units
Justin Bogner [Tue, 25 Sep 2018 05:16:44 +0000 (05:16 +0000)]
[MachineCopyPropagation] Reimplement CopyTracker in terms of register units

Change the copy tracker to keep a single map of register units instead
of 3 maps of registers. This gives a very significant compile time
performance improvement to the pass. I measured a 30-40% decrease in
time spent in MCP on x86 and AArch64 and much more significant
improvements on out of tree targets with more registers.

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

llvm-svn: 342942

6 years agoRevert "[ORC] Switch to asynchronous resolution in JITSymbolResolver."
Lang Hames [Tue, 25 Sep 2018 04:54:03 +0000 (04:54 +0000)]
Revert "[ORC] Switch to asynchronous resolution in JITSymbolResolver."

This reverts commit r342939.

MSVC's promise/future implementation does not like types that are not default
constructible. Reverting while I figure out a solution.

llvm-svn: 342941

6 years ago[MachineCopyPropagation] Rework how we manage RegMask clobbers
Justin Bogner [Tue, 25 Sep 2018 04:45:25 +0000 (04:45 +0000)]
[MachineCopyPropagation] Rework how we manage RegMask clobbers

Instead of updating the CopyTracker's maps each time we come across a
RegMask, defer checking for this kind of interference until we're
actually trying to propagate a copy. This avoids the need to
repeatedly iterate over maps in the cases where we don't end up doing
any work.

This is a slight compile time improvement for MachineCopyPropagation
as is, but it also enables a much bigger improvement that I'll follow
up with soon.

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

llvm-svn: 342940

6 years ago[ORC] Switch to asynchronous resolution in JITSymbolResolver.
Lang Hames [Tue, 25 Sep 2018 04:43:38 +0000 (04:43 +0000)]
[ORC] Switch to asynchronous resolution in JITSymbolResolver.

Asynchronous resolution (where the caller receives a callback once the requested
set of symbols are resolved) is a core part of the new concurrent ORC APIs. This
change extends the asynchronous resolution model down to RuntimeDyld, which is
necessary to prevent deadlocks when compiling/linking on a fixed number of
threads: If RuntimeDyld's linking process were a blocking operation, then any
complete K-graph in a program will require at least K threads to link in the
worst case, as each thread would block waiting for all the others to complete.
Using callbacks instead allows the work to be passed between dependent threads
until it is complete.

For backwards compatibility, all existing RuntimeDyld functions will continue
to operate in blocking mode as before. This change will enable the introduction
of a new async finalization process in a subsequent patch to enable asynchronous
JIT linking.

llvm-svn: 342939

6 years agoRevert r342936 "Remove redundant null pointer check in operator delete"
Louis Dionne [Tue, 25 Sep 2018 04:13:08 +0000 (04:13 +0000)]
Revert r342936 "Remove redundant null pointer check in operator delete"

A review for the change was opened in https://reviews.llvm.org/D52401
but the change was committed before being approved by any of the code
owners for libc++.

llvm-svn: 342938

6 years ago[WebAssembly] SIMD sqrt
Thomas Lively [Tue, 25 Sep 2018 03:39:28 +0000 (03:39 +0000)]
[WebAssembly] SIMD sqrt

Reviewers: aheejin, dschuff

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

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

llvm-svn: 342937

6 years agoRemove redundant null pointer check in operator delete
Fangrui Song [Tue, 25 Sep 2018 02:50:57 +0000 (02:50 +0000)]
Remove redundant null pointer check in operator delete

C89 4.10.3.2 The free function
C99 7.20.3.2 The free function
C11 7.22.3.3 The free function

    If ptr is a null pointer, no action shall occur.

_aligned_free on MSDN:

    If memblock is a NULL pointer, this function simply performs no actions.

Reviewers: EricWF, mclow.lists

Subscribers: christof, ldionne, cfe-commits, libcxx-commits

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

llvm-svn: 342936

6 years ago[AMDGPU] Remove useless check from test. NFC.
Stanislav Mekhanoshin [Tue, 25 Sep 2018 01:24:54 +0000 (01:24 +0000)]
[AMDGPU] Remove useless check from test. NFC.

The check for assignment of zero is practically useless
while the assignment moves around with different scheduling.

llvm-svn: 342935

6 years ago[X86] Don't create FILD ISD nodes when X87 is disabled.
Craig Topper [Tue, 25 Sep 2018 00:16:57 +0000 (00:16 +0000)]
[X86] Don't create FILD ISD nodes when X87 is disabled.

The included test case previously asserted because the type legalizer tried to soften the FILD ISD node.

Fixes PR38819.

llvm-svn: 342934

6 years ago[X86] Remove superfluous curly braces. NFC
Craig Topper [Tue, 25 Sep 2018 00:16:54 +0000 (00:16 +0000)]
[X86] Remove superfluous curly braces. NFC

llvm-svn: 342933

6 years ago[X86] Update comment. Use 'glued' instead of 'flagged' NFC
Craig Topper [Tue, 25 Sep 2018 00:16:52 +0000 (00:16 +0000)]
[X86] Update comment. Use 'glued' instead of 'flagged' NFC

llvm-svn: 342932

6 years ago[WebAssembly] Move .debug_line section address of dead function outside section range
Yury Delendik [Mon, 24 Sep 2018 23:50:55 +0000 (23:50 +0000)]
[WebAssembly] Move .debug_line section address of dead function outside section range

Summary:
Currently we are pointing all debug information that refer removed function code
to the beginning of the code section (offset = 0). A debugger may want to
resolve code offset to the debug information, which will collide with offsets
of the live functions.

Moving offsets of dead functions outside code section range.

Reviewers: sbc100

Reviewed By: sbc100

Subscribers: dblaikie, ruiu, alexcrichton, dschuff, aprantl, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits

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

llvm-svn: 342930

6 years agoDriver: render arguments for the embedded bitcode correctly
Saleem Abdulrasool [Mon, 24 Sep 2018 23:50:02 +0000 (23:50 +0000)]
Driver: render arguments for the embedded bitcode correctly

When embedding bitcode, only a subset of the arguments should be recorded into
the bitcode compilation commandline.  The frontend job is split into two jobs,
one which will generate the bitcode.  Ensure that the arguments for the
compilation to bitcode is properly stripped so that the embedded arguments are
the permitted subset.

llvm-svn: 342929

6 years ago[WebAssembly][NFC] Fix hardcoded stack indices in tests
Thomas Lively [Mon, 24 Sep 2018 23:42:07 +0000 (23:42 +0000)]
[WebAssembly][NFC] Fix hardcoded stack indices in tests

Reviewers: aheejin, dschuff

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

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

llvm-svn: 342928

6 years ago[www] Change 'Clang 7' items from yellow to green now Clang 7 is
Richard Smith [Mon, 24 Sep 2018 23:21:09 +0000 (23:21 +0000)]
[www] Change 'Clang 7' items from yellow to green now Clang 7 is
released.

llvm-svn: 342927

6 years ago[www] Update cxx_status to mark P0962R1 as done.
Richard Smith [Mon, 24 Sep 2018 23:19:11 +0000 (23:19 +0000)]
[www] Update cxx_status to mark P0962R1 as done.

llvm-svn: 342926

6 years agoP0962R1: only use the member form of 'begin' and 'end' in a range-based
Richard Smith [Mon, 24 Sep 2018 23:17:44 +0000 (23:17 +0000)]
P0962R1: only use the member form of 'begin' and 'end' in a range-based
for loop if both members exist.

This resolves a DR whereby an errant 'begin' or 'end' member in a base
class could result in a derived class not being usable as a range with
non-member 'begin' and 'end'.

llvm-svn: 342925

6 years ago[CUDA] Added basic support for compiling with CUDA-10.0
Artem Belevich [Mon, 24 Sep 2018 23:10:44 +0000 (23:10 +0000)]
[CUDA] Added basic support for compiling with CUDA-10.0

llvm-svn: 342924

6 years ago[hwasan] Record and display stack history in stack-based reports.
Evgeniy Stepanov [Mon, 24 Sep 2018 23:03:34 +0000 (23:03 +0000)]
[hwasan] Record and display stack history in stack-based reports.

Summary:
Display a list of recent stack frames (not a stack trace!) when
tag-mismatch is detected on a stack address.

The implementation uses alignment tricks to get both the address of
the history buffer, and the base address of the shadow with a single
8-byte load. See the comment in hwasan_thread_list.h for more
details.

Developed in collaboration with Kostya Serebryany.

Reviewers: kcc

Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits

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

llvm-svn: 342923

6 years agoRevert "[hwasan] Record and display stack history in stack-based reports."
Evgeniy Stepanov [Mon, 24 Sep 2018 22:50:32 +0000 (22:50 +0000)]
Revert "[hwasan] Record and display stack history in stack-based reports."

This reverts commit r342921: test failures on clang-cmake-arm* bots.

llvm-svn: 342922

6 years ago[hwasan] Record and display stack history in stack-based reports.
Evgeniy Stepanov [Mon, 24 Sep 2018 21:38:42 +0000 (21:38 +0000)]
[hwasan] Record and display stack history in stack-based reports.

Summary:
Display a list of recent stack frames (not a stack trace!) when
tag-mismatch is detected on a stack address.

The implementation uses alignment tricks to get both the address of
the history buffer, and the base address of the shadow with a single
8-byte load. See the comment in hwasan_thread_list.h for more
details.

Developed in collaboration with Kostya Serebryany.

Reviewers: kcc

Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits

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

llvm-svn: 342921

6 years ago[analyzer] Prevent crashes in FindLastStoreBRVisitor
George Karpenkov [Mon, 24 Sep 2018 21:20:30 +0000 (21:20 +0000)]
[analyzer] Prevent crashes in FindLastStoreBRVisitor

This patch is a band-aid. A proper solution would be too change
trackNullOrUndefValue to only try to dereference the pointer when it is
relevant to the problem.

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

llvm-svn: 342920

6 years agoRe-submitting changes in D51550 because it failed to patch.
Christy Lee [Mon, 24 Sep 2018 20:47:12 +0000 (20:47 +0000)]
Re-submitting changes in D51550 because it failed to patch.

Reviewers: javed.absar, trentxintong, courbet

Reviewed By: trentxintong

Subscribers: llvm-commits

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

llvm-svn: 342919

6 years ago[InstCombine] add bitcast+extelt helper function; NFC
Sanjay Patel [Mon, 24 Sep 2018 20:41:22 +0000 (20:41 +0000)]
[InstCombine] add bitcast+extelt helper function; NFC

We can handle patterns where the elements have different
sizes, so refactoring ahead of trying to add another blob
within these clauses.

llvm-svn: 342918

6 years ago[compiler-rt] [builtins] Add logb/logbf/logbl methods to compiler-rt to avoid libm...
Jordan Rupprecht [Mon, 24 Sep 2018 20:39:19 +0000 (20:39 +0000)]
[compiler-rt] [builtins] Add logb/logbf/logbl methods to compiler-rt to avoid libm dependencies when possible.

Summary:
The complex division builtins (div?c3) use logb methods from libm to scale numbers during division and avoid rounding issues. However, these come from libm, meaning anyone that uses --rtlib=compiler-rt also has to include -lm. Implement logb* methods for standard ieee 754 floats so we can avoid -lm on those platforms, falling back to the old behavior (using either logb() or `__builtin_logb()`) when not supported.

These new methods are defined internally as `__compiler_rt_logb` so as not to conflict with the libm definitions in any way.

This fixes just the libm methods mentioned in PR32279 and PR28652. libc is still required, although that seems to not be an issue.

Note: this is proposed as an alternative to just adding -lm: D49330.

Reviewers: efriedma, compnerd, scanon, echristo

Reviewed By: echristo

Subscribers: jsji, echristo, nemanjai, dberris, mgorny, kbarton, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 342917

6 years ago[X86] Remove shift/rotate by CL memory (RMW) overrides
Simon Pilgrim [Mon, 24 Sep 2018 20:11:50 +0000 (20:11 +0000)]
[X86] Remove shift/rotate by CL memory (RMW) overrides

The uops are slightly different to the register variant, so requires a +1uop tweak

llvm-svn: 342916

6 years ago[lldb-mi] Fix hanging of target-select-so-path.test
Alexander Polyakov [Mon, 24 Sep 2018 19:10:48 +0000 (19:10 +0000)]
[lldb-mi] Fix hanging of target-select-so-path.test

Summary:
The target-select-so-path test might hang on
some platforms. The reason of that behavior
was in incorrect usage of Filecheck and lldb-mi
processes. Instead of redirecting lldb-mi's output
to Filecheck, we should run lldb-mi session,
finish the session, collect its output and then pass
it to Filecheck.
Also, this patch adds a timer to the test to prevent
it from hanging in the future.

Reviewers: tatyana-krasnukha, aprantl, teemperor

Reviewed By: tatyana-krasnukha, teemperor

Subscribers: apolyakov, aprantl, teemperor, ki.stfu, abidh, lldb-commits

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

llvm-svn: 342915

6 years ago[X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.
Craig Topper [Mon, 24 Sep 2018 18:55:41 +0000 (18:55 +0000)]
[X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.

After r341022, we more strictly check the 64bit feature in X86Subtargets constructor when a 64-bit triple is used. If we don't infer this feature for autodetected CPUs we might incorrectly report an error if the CPU name wasn't autodetected to a CPU that supports 64-bit.

llvm-svn: 342914

6 years ago[profile] Revert commit https://reviews.llvm.org/rL342718
Calixte Denizet [Mon, 24 Sep 2018 18:24:29 +0000 (18:24 +0000)]
[profile] Revert commit https://reviews.llvm.org/rL342718

llvm-svn: 342913

6 years ago[CodeGen] Revert commit https://reviews.llvm.org/rL342717
Calixte Denizet [Mon, 24 Sep 2018 18:24:18 +0000 (18:24 +0000)]
[CodeGen] Revert commit https://reviews.llvm.org/rL342717

llvm-svn: 342912

6 years ago[Power9] [CLANG] Add __float128 exponent GET and SET builtins
Stefan Pintilie [Mon, 24 Sep 2018 18:14:50 +0000 (18:14 +0000)]
[Power9] [CLANG] Add __float128 exponent GET and SET builtins

Added

__builtin_vsx_scalar_extract_expq
__builtin_vsx_scalar_insert_exp_qp

Builtins should behave the same way as in GCC.

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

llvm-svn: 342911

6 years ago[Power9] [LLVM] Add __float128 exponent GET and SET builtins
Stefan Pintilie [Mon, 24 Sep 2018 18:14:13 +0000 (18:14 +0000)]
[Power9] [LLVM] Add __float128 exponent GET and SET builtins

Added

__builtin_vsx_scalar_extract_expq
__builtin_vsx_scalar_insert_exp_qp

Builtins should behave the same way as in GCC.

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

llvm-svn: 342910

6 years agoFix the type of 1<<31 integer constants.
Benjamin Kramer [Mon, 24 Sep 2018 17:51:15 +0000 (17:51 +0000)]
Fix the type of 1<<31 integer constants.

Shifting into the sign bit is technically undefined behavior. No known
compiler exploits it though.

llvm-svn: 342909

6 years ago[X86][AVX] Add truncation as shuffle test for PR31451
Simon Pilgrim [Mon, 24 Sep 2018 17:26:31 +0000 (17:26 +0000)]
[X86][AVX] Add truncation as shuffle test for PR31451

llvm-svn: 342908

6 years agoReland r342494 after fixing LIT checks.
Christy Lee [Mon, 24 Sep 2018 17:26:30 +0000 (17:26 +0000)]
Reland r342494 after fixing LIT checks.

llvm-svn: 342907

6 years ago[Analysis] add comment to generalize finding a scalar op from vector; NFC
Sanjay Patel [Mon, 24 Sep 2018 17:18:32 +0000 (17:18 +0000)]
[Analysis] add comment to generalize finding a scalar op from vector; NFC

llvm-svn: 342906

6 years ago[InstCombine] add/move tests for extractelement; NFC
Sanjay Patel [Mon, 24 Sep 2018 17:17:16 +0000 (17:17 +0000)]
[InstCombine] add/move tests for extractelement; NFC

llvm-svn: 342905

6 years ago[X86] Remove WriteDiv/WriteIDiv schedule overrides - use classes directly. NFCI.
Simon Pilgrim [Mon, 24 Sep 2018 16:58:26 +0000 (16:58 +0000)]
[X86] Remove WriteDiv/WriteIDiv schedule overrides - use classes directly. NFCI.

We're missing quite a bit of data for these instruction, removing the overrides makes this obvious - inconsistent reg/mem variants is a concern as well.

Also, we have Divider resources (HWDivider etc.) but they aren't actually used consistently.

llvm-svn: 342904

6 years ago[clangd] Fix uninit bool in r342888
Sam McCall [Mon, 24 Sep 2018 16:52:48 +0000 (16:52 +0000)]
[clangd] Fix uninit bool in r342888

llvm-svn: 342903

6 years ago[InstCombine] improve variable name and use 'match'; NFC
Sanjay Patel [Mon, 24 Sep 2018 16:39:03 +0000 (16:39 +0000)]
[InstCombine] improve variable name and use 'match'; NFC

'width' of a vector usually refers to the bit-width.

https://bugs.llvm.org/show_bug.cgi?id=39016
shows a case where we could extend this fold to handle
a case where the number of elements in the bitcasted
vector is not equal to the resulting value.

llvm-svn: 342902

6 years agoReverting r342895
Luke Cheeseman [Mon, 24 Sep 2018 16:36:33 +0000 (16:36 +0000)]
Reverting r342895

- The used builtins do not compile for pre arm v8.3a targets with gcc

llvm-svn: 342901

6 years ago[ARM] Adjust the cost model for Exynos
Evandro Menezes [Mon, 24 Sep 2018 16:35:14 +0000 (16:35 +0000)]
[ARM] Adjust the cost model for Exynos

Tune `MaxInterleaveFactor` and `LdStMultipleTiming`and remove
`PartialUpdateClearance` for the Exynos processors.

llvm-svn: 342900

6 years ago[ARM] Adjust the feature set for Exynos
Evandro Menezes [Mon, 24 Sep 2018 16:35:09 +0000 (16:35 +0000)]
[ARM] Adjust the feature set for Exynos

Enable crypto and literals fusion for the Exynos processors.

llvm-svn: 342899

6 years ago[Thumb1] Any imm8 should have cost of 1
Zhaoshi Zheng [Mon, 24 Sep 2018 16:15:23 +0000 (16:15 +0000)]
[Thumb1] Any imm8 should have cost of 1

A simple MOVS rd, imm8 can materialize [-128, 127] in signed i8 type or
[0, 255] in unsigned i8 type on Thumb1.

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

llvm-svn: 342898

6 years ago[python] [tests] Update test_code_completion
Michal Gorny [Mon, 24 Sep 2018 16:10:25 +0000 (16:10 +0000)]
[python] [tests] Update test_code_completion

Update expected completions to match output generated by clang-7.0.

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

llvm-svn: 342897

6 years ago[New PM][PassInstrumentation] IR printing support for New Pass Manager
Fedor Sergeev [Mon, 24 Sep 2018 16:08:15 +0000 (16:08 +0000)]
[New PM][PassInstrumentation] IR printing support for New Pass Manager

Implementing -print-before-all/-print-after-all/-filter-print-func support
through PassInstrumentation callbacks.

- PrintIR routines implement printing callbacks.

- StandardInstrumentations class provides a central place to manage all
  the "standard" in-tree pass instrumentations. Currently it registers
  PrintIR callbacks.

Reviewers: chandlerc, paquette, philip.pfaffe
Differential Revision: https://reviews.llvm.org/D50923

llvm-svn: 342896

6 years ago[AArch64] Unwinding support for return address signing
Luke Cheeseman [Mon, 24 Sep 2018 15:55:35 +0000 (15:55 +0000)]
[AArch64] Unwinding support for return address signing

- When return address signing is enabled, the LR may be signed on function entry
- When an exception is thrown the return address is inspected used to unwind the call stack
- Before this happens, the return address must be correctly authenticated to avoid causing an abort by dereferencing the signed pointer

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

llvm-svn: 342895

6 years ago[lld-link] Generalize handling of /debug and /debug:{none,full,fastlink,ghash,symtab}
Will Wilson [Mon, 24 Sep 2018 15:28:03 +0000 (15:28 +0000)]
[lld-link] Generalize handling of /debug and /debug:{none,full,fastlink,ghash,symtab}

Implement final argument precedence if multiple /debug arguments are passed on the command-line to match expected link.exe behavior.
Support /debug:none and emit warning for /debug:fastlink with automatic fallback to /debug:full.
Emit error if last /debug:option is unknown.
Emit warning if last /debugtype:option is unknown.

https://reviews.llvm.org/D50404

llvm-svn: 342894

6 years agoRevert "rL342883: [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant...
Kristina Brooks [Mon, 24 Sep 2018 15:26:08 +0000 (15:26 +0000)]
Revert "rL342883: [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant-cfstrings`."

Seems to be causing buildbot failures, need to look into it.

llvm-svn: 342893

6 years ago[X86] Split WriteIMul into 8/16/32/64 implementations (PR36931)
Simon Pilgrim [Mon, 24 Sep 2018 15:21:57 +0000 (15:21 +0000)]
[X86] Split WriteIMul into 8/16/32/64 implementations (PR36931)

Split WriteIMul by size and also by IMUL multiply-by-imm and multiply-by-reg cases.

This removes all the scheduler overrides for gpr multiplies and stops WriteMULH being ignored for BMI2 MULX instructions.

llvm-svn: 342892

6 years ago[Arm][AsmParser] Restrict register list size for VSTM/VLDM
Luke Cheeseman [Mon, 24 Sep 2018 15:13:48 +0000 (15:13 +0000)]
[Arm][AsmParser] Restrict register list size for VSTM/VLDM

- The assembler accepts VSTM/VLDM with register lists (specifically double registers lists) with more than 16 registers specified
- The Arm architecture reference manual says this instruction must not contain more than 16 registers when the registers are doubleword registers
- This addresses one of the concerns in https://bugs.llvm.org/show_bug.cgi?id=38389

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

llvm-svn: 342891

6 years ago[CFString][ELF] Fix a missed test causing buildbot failures from 342883.
Kristina Brooks [Mon, 24 Sep 2018 14:52:48 +0000 (14:52 +0000)]
[CFString][ELF] Fix a missed test causing buildbot failures from 342883.

Accidetanlly forgot to update it, big sorry.

llvm-svn: 342890

6 years ago[VFS] Use llvm::StringMap instead of std::map. NFC
Eric Liu [Mon, 24 Sep 2018 14:52:11 +0000 (14:52 +0000)]
[VFS] Use llvm::StringMap instead of std::map. NFC

llvm-svn: 342889

6 years ago[clangd] Do bounds checks while reading data, otherwise var-length records are too...
Sam McCall [Mon, 24 Sep 2018 14:51:15 +0000 (14:51 +0000)]
[clangd] Do bounds checks while reading data, otherwise var-length records are too painful. NFC

llvm-svn: 342888

6 years agoCorrect RISC-V link in release notes
Ed Maste [Mon, 24 Sep 2018 14:47:56 +0000 (14:47 +0000)]
Correct RISC-V link in release notes

llvm-svn: 342887

6 years ago[DAGCombiner] use UADDO to optimize saturated unsigned add
Sanjay Patel [Mon, 24 Sep 2018 14:47:15 +0000 (14:47 +0000)]
[DAGCombiner] use UADDO to optimize saturated unsigned add

This is a preliminary step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

If we have an 'add' instruction that sets flags, we can use that to eliminate an
explicit compare instruction or some other instruction (cmn) that sets flags for
use in the later select.

As shown in the unchanged tests that use 'icmp ugt %x, %a', we're effectively
reversing an IR icmp canonicalization that replaces a variable operand with a
constant:
https://rise4fun.com/Alive/V1Q

But we're not using 'uaddo' in those cases via DAG transforms. This happens in
CGP after D8889 without checking target lowering to see if the op is supported.
So AArch already shows 'uaddo' codegen for the i8/i16/i32/i64 test variants with
"using_cmp_sum" in the title. That's the pattern that CGP matches as an unsigned
saturated add and converts to uaddo without checking target capabilities.

This patch is gated by isOperationLegalOrCustom(ISD::UADDO, VT), so we see only
see AArch diffs for i32/i64 in the tests with "using_cmp_notval" in the title
(unlike x86 which sees improvements for all sizes because all sizes are 'custom').
But the AArch code (like x86) looks better when translated to 'uaddo' in all cases.
So someone that is involved with AArch may want to set i8/i16 to 'custom' for UADDO,
so this patch will fire on those tests.

Another possibility given the existing behavior: we could remove the legal-or-custom
check altogether because we're assuming that a UADDO sequence is canonical/optimal
before we ever reach here. But that seems like a bug to me. If the target doesn't
have an add-with-flags op, then it's not likely that we'll get optimal DAG combining
using a UADDO node. This is similar justification for why we don't canonicalize IR to
the overflow math intrinsic sibling (llvm.uadd.with.overflow) for UADDO in the first
place.

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

llvm-svn: 342886