platform/upstream/llvm.git
5 years ago[AArch64] Implement aarch64_vector_pcs codegen support.
Sander de Smalen [Wed, 12 Sep 2018 12:10:22 +0000 (12:10 +0000)]
[AArch64] Implement aarch64_vector_pcs codegen support.

This patch adds codegen support for the saving/restoring
V8-V23 for functions specified with the aarch64_vector_pcs
calling convention attribute, as added in patch D51477.

Reviewers: t.p.northover, gberry, thegameg, rengolin, javed.absar, MatzeB

Reviewed By: thegameg

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

llvm-svn: 342049

5 years ago[DWARF] Refactoring range list dumping to fold DWARF v4 functionality into v5 handling
Wolfgang Pieb [Wed, 12 Sep 2018 12:01:19 +0000 (12:01 +0000)]
[DWARF] Refactoring range list dumping to fold DWARF v4 functionality into v5 handling

Eliminating some duplication of rangelist dumping code at the expense of
some version-dependent code in dump and extract routines.

Reviewer: dblaikie, JDevlieghere, vleschuk

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

llvm-svn: 342048

5 years agoRemove another unused mislayered include.
Benjamin Kramer [Wed, 12 Sep 2018 11:31:18 +0000 (11:31 +0000)]
Remove another unused mislayered include.

llvm-svn: 342047

5 years agoRemove unused include that's also a layering violation.
Benjamin Kramer [Wed, 12 Sep 2018 11:27:10 +0000 (11:27 +0000)]
Remove unused include that's also a layering violation.

llvm-svn: 342046

5 years ago[ADT] Made numerous methods of ImmutableList const
Kristof Umann [Wed, 12 Sep 2018 11:20:15 +0000 (11:20 +0000)]
[ADT] Made numerous methods of ImmutableList const

Also added ImmutableList<T>::iterator::operator->.

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

llvm-svn: 342045

5 years agoRemove manual byte counting from internal Stream methods.
Raphael Isemann [Wed, 12 Sep 2018 10:20:41 +0000 (10:20 +0000)]
Remove manual byte counting from internal Stream methods.

Summary:
This patch removes the manual byte counting in all internal Stream methods.
This is now done by the automatic byte counting provided by calling `GetWrittenBytes()`
before and after writing the data (which is automatically done for us by the `ByteDelta`
utility class).

Reviewers: #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere, labath, lldb-commits

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

llvm-svn: 342044

5 years ago[CGP] Ensure splitgep gives deterministic output
David Green [Wed, 12 Sep 2018 10:19:10 +0000 (10:19 +0000)]
[CGP] Ensure splitgep gives deterministic output

The output of splitLargeGEPOffsets does not appear to be deterministic because
of the way that we iterate over a DenseMap. I've changed it to a MapVector for
consistent output.

The test here isn't particularly great, only showing a consmetic difference in
output. The original reproducer is much larger but show a diffierence in
instruction ordering, leading to different codegen.

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

llvm-svn: 342043

5 years agoAdd a basic test for 'memory region'
Raphael Isemann [Wed, 12 Sep 2018 10:04:25 +0000 (10:04 +0000)]
Add a basic test for 'memory region'

Summary:
The 'memory region' command is at the moment not tested at all by our test suite.
This patch just adds a basic test that at least provides some basic testing.

Reviewers: #lldb, davide

Reviewed By: #lldb, davide

Subscribers: vsk, davide, lldb-commits

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

llvm-svn: 342042

5 years ago[clang-tidy] Abseil: Add more directories that are slated for future absl expansion.
Benjamin Kramer [Wed, 12 Sep 2018 10:04:16 +0000 (10:04 +0000)]
[clang-tidy] Abseil: Add more directories that are slated for future absl expansion.

llvm-svn: 342041

5 years ago[ARM] Follow-up to rL342033
Sam Parker [Wed, 12 Sep 2018 09:58:56 +0000 (09:58 +0000)]
[ARM] Follow-up to rL342033

Fixed typo which can cause segfault.

llvm-svn: 342040

5 years ago[SimplifyCFG] Put an alignment on generated switch tables
David Green [Wed, 12 Sep 2018 09:54:17 +0000 (09:54 +0000)]
[SimplifyCFG] Put an alignment on generated switch tables

Previously the alignment on the newly created switch table data was not set,
meaning that DataLayout::getPreferredAlignment was free to overalign it to 16
bytes. This causes unnecessary code bloat.

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

llvm-svn: 342039

5 years ago[AArch64] NFC: Refactoring to prepare for vector PCS.
Sander de Smalen [Wed, 12 Sep 2018 09:44:46 +0000 (09:44 +0000)]
[AArch64] NFC: Refactoring to prepare for vector PCS.

This patch refactors several parts of AArch64FrameLowering
so that it can be easily extended to support saving/restoring
of FPR128 (Q) registers.

Reviewers: t.p.northover, gberry, thegameg, rengolin, javed.absar

Reviewed By: thegameg

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

llvm-svn: 342038

5 years ago[clangd] Add missing clangBasic target_link_libraries
Heejin Ahn [Wed, 12 Sep 2018 09:40:13 +0000 (09:40 +0000)]
[clangd] Add missing clangBasic target_link_libraries

Without this, builds with `-DSHARED_LIB=ON` fail.

llvm-svn: 342037

5 years agoFix buildbots after r342027
Kirill Bobyrev [Wed, 12 Sep 2018 09:27:55 +0000 (09:27 +0000)]
Fix buildbots after r342027

llvm-svn: 342036

5 years ago[llvm-exegesis][NFC]Remove dead function parameter
Clement Courbet [Wed, 12 Sep 2018 09:26:32 +0000 (09:26 +0000)]
[llvm-exegesis][NFC]Remove dead function parameter

llvm-svn: 342035

5 years ago[CodeGen][ARM] Coerce FP16 vectors to integer vectors when needed
Mikhail Maltsev [Wed, 12 Sep 2018 09:19:19 +0000 (09:19 +0000)]
[CodeGen][ARM] Coerce FP16 vectors to integer vectors when needed

Summary:
On targets that do not support FP16 natively LLVM currently legalizes
vectors of FP16 values by scalarizing them and promoting to FP32. This
causes problems for the following code:

  void foo(int, ...);

  typedef __attribute__((neon_vector_type(4))) __fp16 float16x4_t;
  void bar(float16x4_t x) {
    foo(42, x);
  }

According to the AAPCS (appendix A.2) float16x4_t is a containerized
vector fundamental type, so 'foo' expects that the 4 16-bit FP values
are packed into 2 32-bit registers, but instead bar promotes them to
4 single precision values.

Since we already handle scalar FP16 values in the frontend by
bitcasting them to/from integers, this patch adds similar handling for
vector types and homogeneous FP16 vector aggregates.

One existing test required some adjustments because we now generate
more bitcasts (so the patch changes the test to target a machine with
native FP16 support).

Reviewers: eli.friedman, olista01, SjoerdMeijer, javed.absar, efriedma

Reviewed By: javed.absar, efriedma

Subscribers: efriedma, kristof.beyls, cfe-commits, chrib

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

llvm-svn: 342034

5 years ago[ARM] Exchange MAC operands in ARMParallelDSP
Sam Parker [Wed, 12 Sep 2018 09:17:44 +0000 (09:17 +0000)]
[ARM] Exchange MAC operands in ARMParallelDSP

SMLAD and SMLALD instructions also come in the form of SMLADX and
SMLALDX which perform an exchange on their second operand. To support
this, more of the loads in the MAC candidates are compared for
sequential access and a boolean value has been added to BinOpChain.

AddMACCandiate has been refactored into a small pattern matching
state machine to reduce the amount of duplicated code, but also to
enable the matching to be more flexible. CreateParallelMACPairs now
iterates through all the candidates to find parallel ones.

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

llvm-svn: 342033

5 years ago[ARM] Allow bitcasts in ARMCodeGenPrepare
Sam Parker [Wed, 12 Sep 2018 09:11:48 +0000 (09:11 +0000)]
[ARM] Allow bitcasts in ARMCodeGenPrepare

Allow bitcasts in the use-def chains, treating them as sources.

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

llvm-svn: 342032

5 years agoFix Check test to avoid output string mismatch
Christian Bruel [Wed, 12 Sep 2018 08:59:17 +0000 (08:59 +0000)]
Fix Check test to avoid output string mismatch

Differential Revision: http://reviews.llvm.org/D51354

llvm-svn: 342031

5 years ago[AArch64] Add parsing of aarch64_vector_pcs attribute.
Sander de Smalen [Wed, 12 Sep 2018 08:54:06 +0000 (08:54 +0000)]
[AArch64] Add parsing of aarch64_vector_pcs attribute.

This patch adds parsing support for the 'aarch64_vector_pcs'
calling convention attribute to calls and function declarations.

More information describing the vector ABI and procedure call standard
can be found here:

  https://developer.arm.com/products/software-development-tools/\
                            hpc/arm-compiler-for-hpc/vector-function-abi

Reviewers: t.p.northover, rnk, rengolin, javed.absar, thegameg, SjoerdMeijer

Reviewed By: SjoerdMeijer

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

llvm-svn: 342030

5 years agoReduce alignment on struct XSAVE, fixing a gcc warning
Pavel Labath [Wed, 12 Sep 2018 08:50:08 +0000 (08:50 +0000)]
Reduce alignment on struct XSAVE, fixing a gcc warning

The warning is about heap-allocating a struct with bigger alignment
requirements than the standard heap allocator provides.

AFAICT, all uses of the XSAVE struct are already heap-allocated, so this
high alignment does not actually have any effect and removing it should
be NFC.

I have also done some digging in the commit history. This alignment
requirement was since the XSAVE struct was introduced in r180572 when
adding AVX register support for linux. It does not mention the alignment
specifically, so I am guessing this was just put there because the
corresponging XSAVE cpu instruction requires its buffer to be 64-byte
aligned. However, LLDB will not be normally reading this struct via the
XSAVE instruction directly. Instead we will ask the kernel to copy the
buffer saved when suspeding the inferior. This should not require such
strict alignment (in fact, linux kernel will happily do this for any
alignment).

llvm-svn: 342029

5 years ago[Tooling] Wait for all threads to finish before resetting CWD.
Eric Liu [Wed, 12 Sep 2018 08:29:47 +0000 (08:29 +0000)]
[Tooling] Wait for all threads to finish before resetting CWD.

llvm-svn: 342028

5 years ago[LV] Move InterleaveGroup and InterleavedAccessInfo to VectorUtils.h (NFC)
Florian Hahn [Wed, 12 Sep 2018 08:01:57 +0000 (08:01 +0000)]
[LV] Move InterleaveGroup and InterleavedAccessInfo to VectorUtils.h (NFC)

Move the 2 classes out of LoopVectorize.cpp to make it easier to re-use
them for VPlan outside LoopVectorize.cpp

Reviewers: Ayal, mssimpso, rengolin, dcaballe, mkuper, hsaito, hfinkel, xbolva00

Reviewed By: rengolin, xbolva00

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

llvm-svn: 342027

5 years ago[clangd] Add index benchmarks
Kirill Bobyrev [Wed, 12 Sep 2018 07:49:44 +0000 (07:49 +0000)]
[clangd] Add index benchmarks

This patch introduces index benchmarks on top of the proposed LLVM
benchmark pull.

Reviewed By: sammccall, lebedev.ri

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

llvm-svn: 342026

5 years ago[clangd] Implement a Proof-of-Concept tool for symbol index exploration
Kirill Bobyrev [Wed, 12 Sep 2018 07:32:54 +0000 (07:32 +0000)]
[clangd] Implement a Proof-of-Concept tool for symbol index exploration

Reviewed By: sammccall, ilya-biryukov

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

llvm-svn: 342025

5 years agoRemove unused include from IVDescriptors.cpp.
Ilya Biryukov [Wed, 12 Sep 2018 07:22:46 +0000 (07:22 +0000)]
Remove unused include from IVDescriptors.cpp.

This fixes a layering violation:

Analysis/IVDescrtors.cpp can't include Transforms/Utils/BasicBlockUtils.h,
since TransformUtils depends on Analysis.

llvm-svn: 342024

5 years agoRevert "AMDGPU: Move isa version and EF_AMDGPU_MACH_* determination into TargetParser."
Ilya Biryukov [Wed, 12 Sep 2018 07:05:30 +0000 (07:05 +0000)]
Revert "AMDGPU: Move isa version and EF_AMDGPU_MACH_* determination into TargetParser."

This reverts commit r341982.

The change introduced a layering violation. Reverting to unbreak
our integrate.

llvm-svn: 342023

5 years ago[SelectionDAG] Remove some code from PromoteIntOp_MGATHER that handles UpdateNodeOper...
Craig Topper [Wed, 12 Sep 2018 05:25:41 +0000 (05:25 +0000)]
[SelectionDAG] Remove some code from PromoteIntOp_MGATHER that handles UpdateNodeOperands returning an existing node instead of updating.

I suspect this became unecessary when the CSE of mgather was fixed in r338080. It may still be possible to hit this if we widen the element type of a gather outside of type legalization and the promote the mask of a separate gather node so they become the same. But that seems pretty unlikely.

llvm-svn: 342022

5 years ago[Driver] Search LibraryPaths when handling -print-file-name
Petr Hosek [Wed, 12 Sep 2018 03:26:10 +0000 (03:26 +0000)]
[Driver] Search LibraryPaths when handling -print-file-name

This is necessary to handle the multiarch runtime directories.

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

llvm-svn: 342021

5 years agoRevert r342019, "Track definition merging on the canonical declaration
Richard Smith [Wed, 12 Sep 2018 02:28:14 +0000 (02:28 +0000)]
Revert r342019, "Track definition merging on the canonical declaration
even when [...]"

Further testing has revealed that this causes build breaks during
explicit module compilations.

llvm-svn: 342020

5 years agoTrack definition merging on the canonical declaration even when local
Richard Smith [Wed, 12 Sep 2018 02:13:48 +0000 (02:13 +0000)]
Track definition merging on the canonical declaration even when local
submodule visibility is disabled.

Attempting to pick a specific declaration to make visible when the
module containing the merged declaration becomes visible is error-prone,
as we don't yet know which declaration we'll choose to be the definition
when we are informed of the merging.

llvm-svn: 342019

5 years agoConsistently create a new declaration when merging a pre-existing but
Richard Smith [Wed, 12 Sep 2018 02:13:47 +0000 (02:13 +0000)]
Consistently create a new declaration when merging a pre-existing but
hidden definition with a would-be-parsed redefinition.

This permits a bunch of cleanups. In particular, we no longer need to
take merged definitions into account when checking declaration
visibility, only when checking definition visibility, which makes
certain visibility checks take linear instead of quadratic time.

We could also now remove the UPD_DECL_EXPORTED update record and track
on each declaration whether it was demoted from a definition (as we
already do for variables), but I'm not doing that in this patch to keep
the changes here simpler.

llvm-svn: 342018

5 years agoFix tracking of merged definitions when the merge target is also merged
Richard Smith [Wed, 12 Sep 2018 02:13:46 +0000 (02:13 +0000)]
Fix tracking of merged definitions when the merge target is also merged
into something else.

llvm-svn: 342017

5 years agoBreak LoopUtils into an Analysis file.
Vikram TV [Wed, 12 Sep 2018 01:59:43 +0000 (01:59 +0000)]
Break LoopUtils into an Analysis file.

Summary:
The InductionDescriptor and RecurrenceDescriptor classes basically analyze the IR to identify the respective IVs. So, it is better to have them in the "Analysis" directory instead of the "Transforms" directory.

The rationale for this is to make the Induction and Recurrence descriptor classes available for analysis passes. Currently including them in an analysis pass produces link error (http://lists.llvm.org/pipermail/llvm-dev/2018-July/124456.html).

Induction and Recurrence descriptors are moved from Transforms/Utils/LoopUtils.h|cpp to Analysis/IVDescriptors.h|cpp.

Reviewers: dmgreen, llvm-commits, hfinkel

Reviewed By: dmgreen

Subscribers: mgorny

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

llvm-svn: 342016

5 years ago[X86] Teach X86SelectionDAGInfo::EmitTargetCodeForMemcpy about GNUX32
Craig Topper [Wed, 12 Sep 2018 01:57:22 +0000 (01:57 +0000)]
[X86] Teach X86SelectionDAGInfo::EmitTargetCodeForMemcpy about GNUX32

Summary:
In GNUX23, is64BitMode returns true, but pointers are 32-bits. So we shouldn't copy pointer values into RSI/RDI since the widths don't match.

Fixes PR38865 despite what the title says. I think the llvm_unreachable in the copyPhysReg code tricked the optimizer and made the fatal error trigger.

Reviewers: rnk, efriedma, MatzeB, echristo

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 342015

5 years ago[hwasan] On every use-after-free print a developer note: the index of this heap objec...
Kostya Serebryany [Wed, 12 Sep 2018 00:58:15 +0000 (00:58 +0000)]
[hwasan] On every use-after-free print a developer note: the index of this heap object in the thread's deallocation ring buffer. Mostly useful to hwasan developers, will hopefully let us know the good size of the deallocation ring buffer

llvm-svn: 342014

5 years ago[ORC] Remove some unused typedefs.
Lang Hames [Wed, 12 Sep 2018 00:35:03 +0000 (00:35 +0000)]
[ORC] Remove some unused typedefs.

llvm-svn: 342013

5 years ago[NFC] Fix build breakage due to missing dep caused by D51950
Shuai Wang [Wed, 12 Sep 2018 00:32:13 +0000 (00:32 +0000)]
[NFC] Fix build breakage due to missing dep caused by D51950

llvm-svn: 342012

5 years ago[hwasan] tests for a buffer overflow with a large allocation
Kostya Serebryany [Wed, 12 Sep 2018 00:27:34 +0000 (00:27 +0000)]
[hwasan] tests for a buffer overflow with a large allocation

llvm-svn: 342011

5 years ago[ScopDetection] Use addUnknown for calls in the AliasSetTracker.
Eli Friedman [Tue, 11 Sep 2018 23:48:14 +0000 (23:48 +0000)]
[ScopDetection] Use addUnknown for calls in the AliasSetTracker.

The general-purpose add() now sometimes adds unexpected loop-variant
pointers to the AliasSetTracker, so certain loops would be rejected with
-polly-allow-modref-calls.  Use addUnknown() instead, which has the old
behavior.

I'm not completely convinced the resulting behavior is actually
correct: ScopDetection::isValidAccess seems to mostly ignore
"unknown" instructions in the AliasSetTracker.  But it's not any worse
than what was happening before.

Committing without pre-commit review to unbreak the buildbots; the
following tests were failing:

test/ScopInfo/mod_ref_access_pointee_arguments.ll
test/ScopInfo/mod_ref_read_pointee_arguments.ll
test/ScopInfo/multidim_2d_with_modref_call_2.ll

llvm-svn: 342010

5 years ago[MachineOutliner] Add codegen size remarks to the MachineOutliner
Jessica Paquette [Tue, 11 Sep 2018 23:05:34 +0000 (23:05 +0000)]
[MachineOutliner] Add codegen size remarks to the MachineOutliner

Since the outliner is a module pass, it doesn't get codegen size remarks like
the other codegen passes do. This adds size remarks *to* the outliner.

This is kind of a workaround, so it's peppered with FIXMEs; size remarks
really ought to not ever be handled by the pass itself. However, since the
outliner is the only "MachineModulePass", this works for now. Since the
entire purpose of the MachineOutliner is to produce code size savings, it
really ought to be included in codgen size remarks.

If we ever go ahead and make a MachineModulePass (say, something similar to
MachineFunctionPass), then all of this ought to be moved there.

llvm-svn: 342009

5 years ago[MIPS] Fix signed overflow in DADDIU emulation
Vedant Kumar [Tue, 11 Sep 2018 23:04:05 +0000 (23:04 +0000)]
[MIPS] Fix signed overflow in DADDIU emulation

This fixes a signed integer overflow diagnostic reported by ubsan.

rdar://44353380

llvm-svn: 342008

5 years ago[ELF] Revert "Also demote lazy symbols."
Chih-Hung Hsieh [Tue, 11 Sep 2018 23:00:36 +0000 (23:00 +0000)]
[ELF] Revert "Also demote lazy symbols."

This reverts commit https://reviews.llvm.org/rL330869
for a regression to link Android dex2oatds.

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

llvm-svn: 342007

5 years ago[clangtidy] Remove old copy of ExprMutationAnalyzer
Shuai Wang [Tue, 11 Sep 2018 22:59:46 +0000 (22:59 +0000)]
[clangtidy] Remove old copy of ExprMutationAnalyzer

Summary:
This is 2/2 of moving ExprMutationAnalyzer from clangtidy to clang/Analysis.
ExprMutationAnalyzer is moved to clang/Analysis in D51948.
This diff migrates existing usages within clangtidy to point to the new
location and remove the old copy of ExprMutationAnalyzer.

Reviewers: george.karpenkov, JonasToth

Reviewed By: george.karpenkov

Subscribers: mgorny, a.sidorin, Szelethus, cfe-commits

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

llvm-svn: 342006

5 years ago[NFC] Fix build breakage caused by D51948
Shuai Wang [Tue, 11 Sep 2018 22:41:14 +0000 (22:41 +0000)]
[NFC] Fix build breakage caused by D51948

llvm-svn: 342005

5 years ago[InstCombine] add folds for unsigned-overflow compares
Sanjay Patel [Tue, 11 Sep 2018 22:40:20 +0000 (22:40 +0000)]
[InstCombine] add folds for unsigned-overflow compares

Name: op_ugt_sum
  %a = add i8 %x, %y
  %r = icmp ugt i8 %x, %a
  =>
  %notx = xor i8 %x, -1
  %r = icmp ugt i8 %y, %notx

Name: sum_ult_op
  %a = add i8 %x, %y
  %r = icmp ult i8 %a, %x
  =>
  %notx = xor i8 %x, -1
  %r = icmp ugt i8 %y, %notx

https://rise4fun.com/Alive/ZRxI

AFAICT, this doesn't interfere with any add-saturation patterns
because those have >1 use for the 'add'. But this should be
better for IR analysis and codegen in the basic cases.

This is another fold inspired by PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

llvm-svn: 342004

5 years ago[PDB] Write FPO Data to the PDB.
Zachary Turner [Tue, 11 Sep 2018 22:35:01 +0000 (22:35 +0000)]
[PDB] Write FPO Data to the PDB.

llvm-svn: 342003

5 years ago[cmake] Speed up check-llvm 5x by delay loading shell32 and ole32
Reid Kleckner [Tue, 11 Sep 2018 22:25:13 +0000 (22:25 +0000)]
[cmake] Speed up check-llvm 5x by delay loading shell32 and ole32

Summary:
Previously, check-llvm on my Windows 10 workstation took about 300s to
run, and it would lock up my mouse. Now, it takes just under 60s.
Previously running the tests only used about 15% of the available CPU
time, now it uses up to 60%.

Shell32.dll and ole32.dll have direct dependencies on user32.dll and
gdi32.dll. These DLLs are mostly used to for Windows GUI functionality,
which most LLVM tools don't need. It seems that these DLLs acquire and
release some system resources on startup and exit, and that requires
acquiring the same highly contended lock discussed in this post:
https://randomascii.wordpress.com/2017/07/09/24-core-cpu-and-i-cant-move-my-mouse/

Most LLVM tools still have a transitive dependency on
SHGetKnownFolderPathW, which is used to look up the user home directory
and local AppData directory. We also use SHFileOperationW to recursively
delete a directory, but only LLDB and clang-doc use this today. At some
point, we might consider removing these last shell32.dll deps, but for
now, I would like to take this free performance.

Many thanks to Bruce Dawson for suggesting this fix. He looked at an ETW
trace of an LLVM test run, noticed these DLLs, and suggested avoiding
them.

Reviewers: zturner, pcc, thakis

Subscribers: mgorny, llvm-commits, hiraditya

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

llvm-svn: 342002

5 years agoRevert "[GVNHoist] Re-enable GVNHoist by default"
Alexandros Lamprineas [Tue, 11 Sep 2018 22:10:57 +0000 (22:10 +0000)]
Revert "[GVNHoist] Re-enable GVNHoist by default"

This reverts rL341954.

The builder `sanitizer-x86_64-linux-bootstrap-ubsan` has been
failing with timeouts at stage2 clang/ubsan:

[3065/3073] Linking CXX executable bin/lld
command timed out: 1200 seconds without output running python
../sanitizer_buildbot/sanitizers/buildbot_selector.py,
attempting to kill

llvm-svn: 342001

5 years agoApply local fixes intended to be part of r341999.'
Reid Kleckner [Tue, 11 Sep 2018 22:02:31 +0000 (22:02 +0000)]
Apply local fixes intended to be part of r341999.'

llvm-svn: 342000

5 years ago[codeview] Decode and dump FP regs from S_FRAMEPROC records
Reid Kleckner [Tue, 11 Sep 2018 22:00:50 +0000 (22:00 +0000)]
[codeview] Decode and dump FP regs from S_FRAMEPROC records

Summary:
There are two registers encoded in the S_FRAMEPROC flags: one for locals
and one for parameters. The encoding is described by the
ExpandEncodedBasePointerReg function in cvinfo.h. Two bits are used to
indicate one of four possible values:

  0: no register - Used when there are no variables.
  1: SP / standard - Variables are stored relative to the standard SP
     for the ISA.
  2: FP - Variables are addressed relative to the ISA frame
     pointer, i.e. EBP on x86. If realignment is required, parameters
     use this. If a dynamic alloca is used, locals will be EBP relative.
  3: Alternative - Variables are stored relative to some alternative
     third callee-saved register. This is required to address highly
     aligned locals when there are dynamic stack adjustments. In this
     case, both the incoming SP saved in the standard FP and the current
     SP are at some dynamic offset from the locals. LLVM uses ESI in
     this case, MSVC uses EBX.

Most of the changes in this patch are to pass around the CPU so that we
can decode these into real, named architectural registers.

Subscribers: hiraditya

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

llvm-svn: 341999

5 years ago[object] Improve the performance of getSymbols used by ArchiveWriter
Alexander Shaposhnikov [Tue, 11 Sep 2018 22:00:47 +0000 (22:00 +0000)]
[object] Improve the performance of getSymbols used by ArchiveWriter

In this diff we adjust the code of getSymbols to avoid creating LLVMContext when it's not necessary.
Without this patch when the function getSymbols was called on a MachO object with a __bitcode section
it was parsing the embedded bitcode and then ignoring the result.

Test plan: make check-all

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

llvm-svn: 341998

5 years ago[InstCombine] add folds for icmp with xor mask constant
Sanjay Patel [Tue, 11 Sep 2018 22:00:15 +0000 (22:00 +0000)]
[InstCombine] add folds for icmp with xor mask constant

These are the folds in Alive;
Name: xor_ult
Pre: isPowerOf2(-C1)
%xor = xor i8 %x, C1
%r = icmp ult i8 %xor, C1
=>
%r = icmp ugt i8 %x, ~C1

Name: xor_ugt
Pre: isPowerOf2(C1+1)
%xor = xor i8 %x, C1
%r = icmp ugt i8 %xor, C1
=>
%r = icmp ugt i8 %x, C1

https://rise4fun.com/Alive/Vty

The ugt case in its simplest form was already handled by DemandedBits,
but that's not ideal as shown in the multi-use test.

I'm not sure if these are all of the symmetrical folds, but I adjusted
the existing code for one of the folds to try to show the similarities.

There's no obvious connection, but this is another preliminary step
for PR14613...
https://bugs.llvm.org/show_bug.cgi?id=14613

llvm-svn: 341997

5 years agoadd IR flags to MI
Michael Berg [Tue, 11 Sep 2018 21:35:32 +0000 (21:35 +0000)]
add IR flags to MI

Summary: Initial support for nsw, nuw and exact flags in MI

Reviewers: spatel, hfinkel, wristow

Reviewed By: spatel

Subscribers: nlopes

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

llvm-svn: 341996

5 years agoRevert "[SanitizerCoverage] Create comdat for global arrays."
Matt Morehouse [Tue, 11 Sep 2018 21:15:41 +0000 (21:15 +0000)]
Revert "[SanitizerCoverage] Create comdat for global arrays."

This reverts r341987 since it will cause trouble when there's a module
ID collision.

llvm-svn: 341995

5 years ago[analyzer] Add ExprMutationAnalyzer
Shuai Wang [Tue, 11 Sep 2018 21:13:20 +0000 (21:13 +0000)]
[analyzer] Add ExprMutationAnalyzer

Summary:
This is 1/2 of moving ExprMutationAnalyzer from clangtidy to
clang/Analysis.
This diff along simply copies the ExprMutationAnalyzer over with trivial
modifications (e.g. include path, namespace)
2/2 will migrate existing usage of ExprMutationAnalyzer and remove the
original copy inside clangtidy.

Reviewers: george.karpenkov

Subscribers: mgorny, xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits, JonasToth

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

llvm-svn: 341994

5 years ago[InstCombine] add tests for icmp with xor; NFC
Sanjay Patel [Tue, 11 Sep 2018 21:13:20 +0000 (21:13 +0000)]
[InstCombine] add tests for icmp with xor; NFC

llvm-svn: 341993

5 years ago[Support] Quote arguments containing \n on Windows
Reid Kleckner [Tue, 11 Sep 2018 21:02:03 +0000 (21:02 +0000)]
[Support] Quote arguments containing \n on Windows

Fixes at_file.c test failure caused by r341988. We may want to change
how we treat \n in our tokenizer, but this is probably a good fix
regardless, since we can invoke all kinds of programs with different
interpretations of the command line quoting rules.

llvm-svn: 341992

5 years agoRefactoring std::function formatter to move core functionality into CPPLanguageRuntime
Shafik Yaghmour [Tue, 11 Sep 2018 20:58:28 +0000 (20:58 +0000)]
Refactoring std::function formatter to move core functionality into CPPLanguageRuntime

Patch by Shafik Yaghmour.

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

llvm-svn: 341991

5 years agoUpdate the synopsis for <version>. NFC
Marshall Clow [Tue, 11 Sep 2018 20:51:54 +0000 (20:51 +0000)]
Update the synopsis for <version>. NFC

llvm-svn: 341990

5 years agoIntroduce the VTable interleaving scheme to the CFI design documentation
Peter Collingbourne [Tue, 11 Sep 2018 20:43:52 +0000 (20:43 +0000)]
Introduce the VTable interleaving scheme to the CFI design documentation

Dimitar et. al. in [1] proposed a novel VTable layout scheme that enables efficient implementation of virtual call CFI.

This patch adds an introduction of this scheme to the CFI design documentation.

[1] Protecting C++ Dynamic Dispatch Through VTable Interleaving. Dimitar Bounov, Rami Gökhan Kıcı, Sorin Lerner. https://cseweb.ucsd.edu/~lerner/papers/ivtbl-ndss16.pdf

Patch by Zhaomo Yang!

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

llvm-svn: 341989

5 years ago[Support] Avoid calling CommandLineToArgvW from shell32.dll
Reid Kleckner [Tue, 11 Sep 2018 20:22:39 +0000 (20:22 +0000)]
[Support] Avoid calling CommandLineToArgvW from shell32.dll

Summary:
Shell32.dll depends on gdi32.dll and user32.dll, which are mostly DLLs
for Windows GUI functionality. LLVM's utilities don't typically need GUI
functionality, and loading these DLLs seems to be slowing down startup.
Also, we already have an implementation of Windows command line
tokenization in cl::TokenizeWindowsCommandLine, so we can just use it.

The goal is to get the original argv in UTF-8, so that it can pass
through most LLVM string APIs. A Windows process starts life with a
UTF-16 string for its command line, and it can be retreived with
GetCommandLineW from kernel32.dll.

Previously, we would:
1. Get the wide command line
2. Call CommandLineToArgvW to handle quoting rules and separate it into
   arguments.
3. For each wide argument, expand wildcards (* and ?) using
   FindFirstFileW.
4. Convert each argument to UTF-8

Now we:
1. Get the wide command line, convert the whole thing to UTF-8
2. Tokenize the UTF-8 command line with cl::TokenizeWindowsCommandLine
3. For each argument, expand wildcards if present
   - This requires converting back to UTF-16 to call FindFirstFileW
   - Results of FindFirstFileW must be converted back to UTF-8

Reviewers: zturner

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 341988

5 years ago[SanitizerCoverage] Create comdat for global arrays.
Matt Morehouse [Tue, 11 Sep 2018 20:10:40 +0000 (20:10 +0000)]
[SanitizerCoverage] Create comdat for global arrays.

Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

llvm-svn: 341987

5 years ago[clang-tidy] Handle sugared reference types in ExprMutationAnalyzer
Shuai Wang [Tue, 11 Sep 2018 20:05:37 +0000 (20:05 +0000)]
[clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

Summary:
This handles cases like this:
```
typedef int& IntRef;
void mutate(IntRef);
void f() {
  int x;
  mutate(x);
}
```
where the param type is a sugared type (`TypedefType`) instead of a
reference type directly.

Note that another category of similar but different cases are already
handled properly before:
```
typedef int Int;
void mutate(Int&);
void f() {
  int x;
  mutate(x);
}
```

Reviewers: aaron.ballman, alexfh, george.karpenkov

Subscribers: xazax.hun, a.sidorin, Szelethus, cfe-commits

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

llvm-svn: 341986

5 years ago[gcov] Update a clang test for r341977
Vedant Kumar [Tue, 11 Sep 2018 19:42:58 +0000 (19:42 +0000)]
[gcov] Update a clang test for r341977

Update test/CodeGen/code-coverage.c so that it doesn't refer to a gcov
function which is no longer emitted after r341977.

Fixes bot failure:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/23831

llvm-svn: 341985

5 years agoUpdate MemorySSA in LoopUnswitch.
Alina Sbirlea [Tue, 11 Sep 2018 19:19:21 +0000 (19:19 +0000)]
Update MemorySSA in LoopUnswitch.

Summary:
Update MemorySSA in old LoopUnswitch pass.
Actual dependency and update is disabled by default.

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

llvm-svn: 341984

5 years ago[libFuzzer] [Windows] Include windows.h and psapi.h with lowercase
Martin Storsjo [Tue, 11 Sep 2018 19:11:54 +0000 (19:11 +0000)]
[libFuzzer] [Windows] Include windows.h and psapi.h with lowercase

This fixes building on a case sensitive filesystem with mingw-w64
headers, where all headers are lowercase, and matches how these
headers are included elsewhere in compiler-rt.

Also include these headers with angle brackets, as they are system
headers.

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

llvm-svn: 341983

5 years agoAMDGPU: Move isa version and EF_AMDGPU_MACH_* determination
Konstantin Zhuravlyov [Tue, 11 Sep 2018 18:56:51 +0000 (18:56 +0000)]
AMDGPU: Move isa version and EF_AMDGPU_MACH_* determination
into TargetParser.

Also switch away from target features to CPU string when
determining isa version. This fixes an issue when we
output wrong isa version in the object code when features
of a particular CPU are altered (i.e. gfx902 w/o xnack
used to result in gfx900).

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

llvm-svn: 341982

5 years ago[InstCombine] enhance vector demanded elements to look at a vector select condition...
Sanjay Patel [Tue, 11 Sep 2018 18:49:00 +0000 (18:49 +0000)]
[InstCombine] enhance vector demanded elements to look at a vector select condition operand

I noticed that we were not back-propagating undef lanes to shuffle masks when we have a
shuffle that reduces the vector width. This is part of investigating/solving PR38691:
https://bugs.llvm.org/show_bug.cgi?id=38691

The DAG equivalent was proposed with:
D51696

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

llvm-svn: 341981

5 years ago[llvm-mca] Delay calculation of Cycles per Resources, separate the cycles and resourc...
Matt Davis [Tue, 11 Sep 2018 18:47:48 +0000 (18:47 +0000)]
[llvm-mca] Delay calculation of Cycles per Resources, separate the cycles and resource quantities.

Summary:
This patch removes the storing of accumulated floating point data
within the llvm-mca library.

This patch splits-up the two quantities: cycles and number of resource units.
By splitting-up these two quantities, we delay the calculation of "cycles per resource unit"
until that value is read, reducing the chance of accumulating floating point error.

I considered using the APFloat, but after measuring performance, for a large (many iteration)
sample, I decided to go with this faster solution.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: llvm-commits, javed.absar, tschuett, gbedwell

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

llvm-svn: 341980

5 years ago[InstCombine] add tests for add-with-overflow compares; NFC
Sanjay Patel [Tue, 11 Sep 2018 18:45:28 +0000 (18:45 +0000)]
[InstCombine] add tests for add-with-overflow compares; NFC

llvm-svn: 341979

5 years ago[analyzer] [NFC] Change the tests by making the version check more resilient
George Karpenkov [Tue, 11 Sep 2018 18:45:15 +0000 (18:45 +0000)]
[analyzer] [NFC] Change the tests by making the version check more resilient

llvm-svn: 341978

5 years ago[gcov] Fix branch counters with switch statements (fix PR38821)
Vedant Kumar [Tue, 11 Sep 2018 18:38:34 +0000 (18:38 +0000)]
[gcov] Fix branch counters with switch statements (fix PR38821)

Right now, the counters are added in regards of the number of successors
for a given BasicBlock: it's good when we've only 1 or 2 successors (at
least with BranchInstr). But in the case of a switch statement, the
BasicBlock after switch has several predecessors and we need know from
which BB we're coming from.

So the idea is to revert what we're doing: add a PHINode in each block
which will select the counter according to the incoming BB.  They're
several pros for doing that:

- we fix the "switch" bug
- we remove the function call to "__llvm_gcov_indirect_counter_increment"
  and the lookup table stuff
- we replace by PHINodes, so the optimizer will probably makes a better
  job.

Patch by calixte!

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

llvm-svn: 341977

5 years agoFix PR# 38900 - don't call swap inside of random_shuffle when we'd be swapping an...
Marshall Clow [Tue, 11 Sep 2018 18:33:45 +0000 (18:33 +0000)]
Fix PR# 38900 - don't call swap inside of random_shuffle when we'd be swapping an element with itself

llvm-svn: 341975

5 years agoAdd some context to fatal verifier errors
Xin Tong [Tue, 11 Sep 2018 18:06:03 +0000 (18:06 +0000)]
Add some context to fatal verifier errors

Summary: Add function name when verification fails as an initial breadcrumb for debugging.

Patch by David Callahan.

Reviewers: mehdi_amini, modocache

Reviewed By: modocache

Subscribers: llvm-commits, modocache

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

llvm-svn: 341974

5 years ago[X86] Prefer unpckhpd over movhlps in isel for fake unary cases
Craig Topper [Tue, 11 Sep 2018 17:57:27 +0000 (17:57 +0000)]
[X86] Prefer unpckhpd over movhlps in isel for fake unary cases

In r337348, I changed lowering to prefer X86ISD::UNPCKL/UNPCKH opcodes over MOVLHPS/MOVHLPS for v2f64 {0,0} and {1,1} shuffles when we have SSE2. This enabled the removal of a bunch of weirdly bitcasted isel patterns in r337349. To avoid changing the tests I placed a gross hack in isel to still emit movhlps instructions for fake unary unpckh nodes. A similar hack was not needed for unpckl and movlhps because we do execution domain switching for those. But unpckh and movhlps have swapped operand order.

This patch removes the hack.

This is a code size increase since unpckhpd requires a 0x66 prefix and movhlps does not. But if that's a big concern we should be using movhlps for all unpckhpd opcodes and let commuteInstruction turnit into unpckhpd when its an advantage.

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

llvm-svn: 341973

5 years ago[X86] Teach X86FastISel::X86SelectRet to use EAX for the sret pointer in GNUX32
Craig Topper [Tue, 11 Sep 2018 17:57:23 +0000 (17:57 +0000)]
[X86] Teach X86FastISel::X86SelectRet to use EAX for the sret pointer in GNUX32

GNUX32 uses 32-bit pointers despite is64BitMode being true. So we should use EAX to return the value.

Fixes ones of the failures from PR38865.

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

llvm-svn: 341972

5 years ago[InstCombine] Fix incorrect usage of getPrimitiveSizeInBits when we should be using...
Craig Topper [Tue, 11 Sep 2018 17:57:20 +0000 (17:57 +0000)]
[InstCombine] Fix incorrect usage of getPrimitiveSizeInBits when we should be using the element size for vectors

For vectors, getPrimitiveSizeInBits returns the full vector width. This code should using the element size for vectors. This could be fixed by calling getScalarSizeInBits, but its even easier to just get it from the APInt we're checking.

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

llvm-svn: 341971

5 years ago[CallSiteSplitting] Add debug location to created PHI nodes.
Florian Hahn [Tue, 11 Sep 2018 17:55:58 +0000 (17:55 +0000)]
[CallSiteSplitting] Add debug location to created PHI nodes.

There are 2 cases when we create PHI nodes:
 * For the result of the call that was duplicated in the split blocks.
   Those PHI nodes should have the debug location of the call.

 * For values produced before the call. Those instructions need to be
   duplicated in the split blocks and the PHI nodes should have the
   debug locations of those instructions.

Fixes PR37962.

Reviewers: junbuml, gbedwell, vsk

Reviewed By: junbuml

Tags: #debug-info

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

llvm-svn: 341970

5 years ago[GlobalISel] Lower dbg.declare into indirect DBG_VALUE
Josh Stone [Tue, 11 Sep 2018 17:52:01 +0000 (17:52 +0000)]
[GlobalISel] Lower dbg.declare into indirect DBG_VALUE

Summary:
D31439 changed the semantics of dbg.declare to take the address of a
variable as the first argument, making it indirect.  It specifically
updated FastISel for this change here:

https://reviews.llvm.org/D31439#change-WVArzi177jPl

GlobalISel needs to follow suit, or else it will be missing a level of
indirection in the generated debuginfo.  This problem was seen in a Rust
debuginfo test on aarch64, since GlobalISel is used at -O0 for aarch64.

https://github.com/rust-lang/rust/issues/49807
https://bugzilla.redhat.com/show_bug.cgi?id=1611597
https://bugzilla.redhat.com/show_bug.cgi?id=1625768

Reviewers: dblaikie, aprantl, t.p.northover, javed.absar, rnk

Reviewed By: rnk

Subscribers: #debug-info, rovka, kristof.beyls, JDevlieghere, llvm-commits, tstellar

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

llvm-svn: 341969

5 years ago[LoopInfo][FIX] Remove leftover dump in unit test
Johannes Doerfert [Tue, 11 Sep 2018 17:49:43 +0000 (17:49 +0000)]
[LoopInfo][FIX] Remove leftover dump in unit test

llvm-svn: 341968

5 years ago[clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer
Shuai Wang [Tue, 11 Sep 2018 17:33:12 +0000 (17:33 +0000)]
[clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

Summary:
For smart pointers like std::unique_ptr which uniquely owns the
underlying object, treat the mutation of the pointee as mutation of the
smart pointer itself.

This gives better behavior for cases like this:
```
void f(std::vector<std::unique_ptr<Foo>> v) { // undesirable analyze result of `v` as not mutated.
  for (auto& p : v) {
      p->mutate(); // only const member function `operator->` is invoked on `p`
  }
}
```

Reviewers: hokein, george.karpenkov

Subscribers: xazax.hun, a.sidorin, Szelethus, cfe-commits

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

llvm-svn: 341967

5 years agoTest commit: remove trailing whitespace
Josh Stone [Tue, 11 Sep 2018 17:28:43 +0000 (17:28 +0000)]
Test commit: remove trailing whitespace

llvm-svn: 341966

5 years agoRevert "[SanitizerCoverage] Create comdat for global arrays."
Matt Morehouse [Tue, 11 Sep 2018 17:20:14 +0000 (17:20 +0000)]
Revert "[SanitizerCoverage] Create comdat for global arrays."

This reverts r341951 due to bot breakage.

llvm-svn: 341965

5 years ago[OPENMP]Increment iterator when the loop is continued.
Alexey Bataev [Tue, 11 Sep 2018 17:16:26 +0000 (17:16 +0000)]
[OPENMP]Increment iterator when the loop is continued.

Summary:
Missed operation of the incrementing iterator when required just to
continue execution.

Reviewers: kkwli0, gtbercea, grokos

Subscribers: guansong, openmp-commits

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

llvm-svn: 341964

5 years ago[clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstop
Mike Rice [Tue, 11 Sep 2018 17:10:44 +0000 (17:10 +0000)]
[clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstop

With clang-cl, when the user specifies /Yc or /Yu without a filename
the compiler uses a #pragma hdrstop in the main source file to
determine the end of the PCH. If a header is specified with /Yc or
/Yu #pragma hdrstop has no effect.

The optional #pragma hdrstop filename argument is not yet supported.

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

llvm-svn: 341963

5 years ago[InstCombine] Use dyn_cast instead of match(m_Constant). NFC
Craig Topper [Tue, 11 Sep 2018 16:51:26 +0000 (16:51 +0000)]
[InstCombine] Use dyn_cast instead of match(m_Constant). NFC

llvm-svn: 341962

5 years ago[InstCombine] Support (mul (sext x), cst) --> (sext (mul x, cst')) and (mul (zext...
Craig Topper [Tue, 11 Sep 2018 16:51:24 +0000 (16:51 +0000)]
[InstCombine] Support (mul (sext x), cst) --> (sext (mul x, cst')) and (mul (zext x), cst) --> (zext (mul x, cst')) for vectors constants.

Similar to D51236, but for mul instead of add.

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

llvm-svn: 341961

5 years ago[NFC] Fix typo in comment
Jessica Paquette [Tue, 11 Sep 2018 16:38:46 +0000 (16:38 +0000)]
[NFC] Fix typo in comment

Fore -> For

llvm-svn: 341960

5 years ago[MachineOutliner][NFC] Factor out instruction mapping into its own function
Jessica Paquette [Tue, 11 Sep 2018 16:33:46 +0000 (16:33 +0000)]
[MachineOutliner][NFC] Factor out instruction mapping into its own function

Just some tidy-up. Pull the mapper stuff into `populateMapper`. This makes it
a bit easier to read what's going on in `runOnModule`.

llvm-svn: 341959

5 years ago[ASTMatchers] add three matchers for dependent expressions
Jonas Toth [Tue, 11 Sep 2018 16:09:19 +0000 (16:09 +0000)]
[ASTMatchers] add three matchers for dependent expressions

Summary:
The new matchers can be used to check if an expression is type-, value- or instantiation-dependent
in a templated context.
These matchers are used in a clang-tidy check and generally useful as the
problem of unresolved templates occurs more often in clang-tidy and they
provide an easy way to check for this issue.

Reviewers: aaron.ballman, alexfh, klimek

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 341958

5 years agoRemove undefined behavior around the use of StateType
Shafik Yaghmour [Tue, 11 Sep 2018 16:08:05 +0000 (16:08 +0000)]
Remove undefined behavior around the use of StateType

rdar://problem/43530233

Patch by Shafik Yaghmour.

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

llvm-svn: 341957

5 years ago[X86] Correct the one use check from r341915.
Craig Topper [Tue, 11 Sep 2018 16:05:03 +0000 (16:05 +0000)]
[X86] Correct the one use check from r341915.

The one use check should be on the bitcast, not the input to the bitcast.

llvm-svn: 341956

5 years agoReland "Implement a (simple) Markdown generator"
Julie Hockett [Tue, 11 Sep 2018 15:56:55 +0000 (15:56 +0000)]
Reland "Implement a (simple) Markdown generator"

Relanding with fixes to tests for the failing bots.

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

llvm-svn: 341955

5 years ago[GVNHoist] Re-enable GVNHoist by default
Alexandros Lamprineas [Tue, 11 Sep 2018 15:55:45 +0000 (15:55 +0000)]
[GVNHoist] Re-enable GVNHoist by default

Rebase rL340922 since https://bugs.llvm.org/show_bug.cgi?id=38807
has been fixed by rL341947.

llvm-svn: 341954

5 years ago[DagCombine][NFC] Some more tests fo for X % C == 0 (UREM case) transform
Roman Lebedev [Tue, 11 Sep 2018 15:34:26 +0000 (15:34 +0000)]
[DagCombine][NFC] Some more tests fo for X % C == 0 (UREM case) transform

For https://reviews.llvm.org/D50222

Patch by: hermord (Dmytro Shynkevych)!

llvm-svn: 341953

5 years ago[MIPS] Fix illegal type assert in single-float mode
Simon Atanasyan [Tue, 11 Sep 2018 15:32:47 +0000 (15:32 +0000)]
[MIPS] Fix illegal type assert in single-float mode

An fp_to_sint node would be incorrectly lowered to a TruncIntFP node in
single-float mode. This would trigger an "Unexpected illegal type!"
assert.

Patch by Dan Ravensloft.

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

llvm-svn: 341952

5 years ago[SanitizerCoverage] Create comdat for global arrays.
Matt Morehouse [Tue, 11 Sep 2018 15:23:14 +0000 (15:23 +0000)]
[SanitizerCoverage] Create comdat for global arrays.

Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

llvm-svn: 341951

5 years ago[clangd] Add unittests for D51917
Kadir Cetinkaya [Tue, 11 Sep 2018 15:12:10 +0000 (15:12 +0000)]
[clangd] Add unittests for D51917

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

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

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

llvm-svn: 341950

5 years ago[CodeCompletion] Enable signature help when initializing class/struct/union members.
Kadir Cetinkaya [Tue, 11 Sep 2018 15:02:18 +0000 (15:02 +0000)]
[CodeCompletion] Enable signature help when initializing class/struct/union members.

Summary:
Factors out member decleration gathering and uses it in parsing to call signature
help. Doesn't support signature help for base class constructors, the code was too
coupled with diagnostic handling, but still can be factored out but just needs
more afford.

Reviewers: sammccall, ilya-biryukov, ioeric

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 341949