platform/upstream/llvm.git
6 years ago[lit] Move the shtest-xunit-output check lines into shtest-format
Justin Bogner [Mon, 23 Jul 2018 18:08:36 +0000 (18:08 +0000)]
[lit] Move the shtest-xunit-output check lines into shtest-format

These two tests are operating on the same test suite, which causes
them to be racy about writing temporary files and can cause spurious
failures. Merge them into one test to avoid the issue.

llvm-svn: 337718

6 years ago[DebugInfo] Error out when enabling -fdebug-types-section on non-ELF target.
Jonas Devlieghere [Mon, 23 Jul 2018 17:50:15 +0000 (17:50 +0000)]
[DebugInfo] Error out when enabling -fdebug-types-section on non-ELF target.

Currently, support for debug_types is only present for ELF and trying to
pass -fdebug-types-section for other targets results in a crash in the
backend. Until this is fixed, we should emit a diagnostic in the front
end when the option is passed for non-linux targets.

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

llvm-svn: 337717

6 years ago[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well
Jonas Toth [Mon, 23 Jul 2018 17:46:17 +0000 (17:46 +0000)]
[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

Summary:
The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where
pointer arithmetic is used, but does not check values where the pointer types
is deduced via `auto`. This patch adjusts this behaviour and solved
PR36489.
I accidentally commited a wrong patch, this Differential is meant to have a
correct revision description and code attached to it.
Because the patch was accepted by aaron.ballman already, i will just commit
it.
See https://reviews.llvm.org/D48717 for the old differntial (contains wrong
code from the mixup)

Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits

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

llvm-svn: 337716

6 years ago[MS] Update _MSVC_LANG values for C++17 and C++2a
Reid Kleckner [Mon, 23 Jul 2018 17:44:00 +0000 (17:44 +0000)]
[MS] Update _MSVC_LANG values for C++17 and C++2a

Fixes PR38262

llvm-svn: 337715

6 years ago[ARM] Use unique_ptr to fix memory leak introduced in r337701
Fangrui Song [Mon, 23 Jul 2018 17:43:21 +0000 (17:43 +0000)]
[ARM] Use unique_ptr to fix memory leak introduced in r337701

llvm-svn: 337714

6 years agoOpChain has subclasses, so add a virtual destructor.
Jordan Rupprecht [Mon, 23 Jul 2018 17:38:05 +0000 (17:38 +0000)]
OpChain has subclasses, so add a virtual destructor.

Summary:
OpChain has subclasses, so add a virtual destructor.

This fixes an issue when deleting subclasses of OpChain (see MatchSMLAD() specifically) in r337701.

Reviewers: javed.absar

Subscribers: llvm-commits, SjoerdMeijer, samparker

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

llvm-svn: 337713

6 years agoRevert "[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well"
Jonas Toth [Mon, 23 Jul 2018 17:34:25 +0000 (17:34 +0000)]
Revert "[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well"

I applied the wrong patch.

llvm-svn: 337712

6 years ago[ARM] Follow-up to r337709.
Matt Morehouse [Mon, 23 Jul 2018 17:22:53 +0000 (17:22 +0000)]
[ARM] Follow-up to r337709.

Fix double-free.

llvm-svn: 337711

6 years ago[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well
Jonas Toth [Mon, 23 Jul 2018 17:13:06 +0000 (17:13 +0000)]
[clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

Summary:
The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where
pointer arithmetic is used, but does not check values where the pointer types
is deduced via ``auto``. This patch adjusts this behaviour and solved
PR36489.

Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov

Reviewed By: alexfh, aaron.ballman

Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits

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

llvm-svn: 337710

6 years ago[ARM] Add doFinalization() to ARMCodeGenPrepare pass.
Matt Morehouse [Mon, 23 Jul 2018 17:00:45 +0000 (17:00 +0000)]
[ARM] Add doFinalization() to ARMCodeGenPrepare pass.

Attempt to fix the leak introduced in r337687 and make sanitizer
buildbots green again.

llvm-svn: 337709

6 years ago[Legalize] Elide MERGE_VALUES created by scalarizeVectorLoad.
Nirav Dave [Mon, 23 Jul 2018 16:43:42 +0000 (16:43 +0000)]
[Legalize] Elide MERGE_VALUES created by scalarizeVectorLoad.

scalarizeVectorLoad creates MERGE_VALUES nodes which are immediately
decomposed in expandLoad. Elide the node in these cases.

llvm-svn: 337708

6 years ago[clang-tidy] remove private decltypeType in TrailingReturnType
Jonas Toth [Mon, 23 Jul 2018 16:30:13 +0000 (16:30 +0000)]
[clang-tidy] remove private decltypeType in TrailingReturnType

Summary:
This patch removes a private matcher in fuchsia/TrailingReturnType check because
the matcher is now in ASTMatchers

Reviewers: aaron.ballman, alexfh, hokein

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 337707

6 years ago[Sema] Don't emit -Wmemset-transposed-args for memset(p,0,0)
Erik Pilkington [Mon, 23 Jul 2018 16:24:14 +0000 (16:24 +0000)]
[Sema] Don't emit -Wmemset-transposed-args for memset(p,0,0)

Thanks to Arthur O'Dwyer for the suggestion!

llvm-svn: 337706

6 years ago[mips] Add more checks to the tls.ll test case. NFC
Simon Atanasyan [Mon, 23 Jul 2018 16:05:44 +0000 (16:05 +0000)]
[mips] Add more checks to the tls.ll test case. NFC

llvm-svn: 337705

6 years ago[NEON] Define half-precision vmaxnm intrinsics only when available
Ivan A. Kosarev [Mon, 23 Jul 2018 16:01:35 +0000 (16:01 +0000)]
[NEON] Define half-precision vmaxnm intrinsics only when available

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

llvm-svn: 337704

6 years ago[ASTMatchers] add matcher for decltypeType and its underlyingType
Jonas Toth [Mon, 23 Jul 2018 15:59:27 +0000 (15:59 +0000)]
[ASTMatchers] add matcher for decltypeType and its underlyingType

Summary:
This patch introduces a new matcher for `DecltypeType` and its underlying type
in order to fix a bug in clang-tidy, see https://reviews.llvm.org/D48717 for more.

Reviewers: aaron.ballman, alexfh, NoQ, dcoughlin

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 337703

6 years ago[isl] Simplify iterator implementation by building on top of list accessors
Philip Pfaffe [Mon, 23 Jul 2018 15:28:50 +0000 (15:28 +0000)]
[isl] Simplify iterator implementation by building on top of list accessors

Summary:
With the new accessors, it's straightforward to use the templated
iterator instead of subclassing it for all the list types.

Depends on D49019

Reviewers: grosser, Meinersbur, bollu

Reviewed By: grosser

Subscribers: mehdi_amini, steven_wu, dexonsmith, pollydev, llvm-commits

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

llvm-svn: 337702

6 years ago[ARM][NFC] ParallelDSP reorganisation
Sam Parker [Mon, 23 Jul 2018 15:25:59 +0000 (15:25 +0000)]
[ARM][NFC] ParallelDSP reorganisation

In preparing to allow ARMParallelDSP pass to parallelise more than
smlads, I've restructed some elements:

- The ParallelMAC struct has been renamed to BinOpChain.
- The BinOpChain struct holds two value lists: LHS and RHS, as well
  as inheriting from the OpChain base class.
- The OpChain struct holds all the values of the represented chain
  and has had the memory locations functionality inserted into it.
- ParallelMACList becomes OpChainList and it now holds pointers
  instead of objects.

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

llvm-svn: 337701

6 years ago[SystemZ] Fix dumpSU() method in SystemZHazardRecognizer.
Jonas Paulsson [Mon, 23 Jul 2018 15:08:35 +0000 (15:08 +0000)]
[SystemZ]  Fix dumpSU() method in SystemZHazardRecognizer.

Two minor issues: The new MCD SchedWrite name does not contain "Unit" like
all the others, so a check is needed. Also, print "LSU" instead of "LS".

Review: Ulrich Weigand
llvm-svn: 337700

6 years ago[NEON] Define half-precision vrnd intrinsics only when available
Ivan A. Kosarev [Mon, 23 Jul 2018 14:53:44 +0000 (14:53 +0000)]
[NEON] Define half-precision vrnd intrinsics only when available

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

llvm-svn: 337699

6 years ago[FPEnv] Legalize double width StrictFP vector operations
Cameron McInally [Mon, 23 Jul 2018 14:40:17 +0000 (14:40 +0000)]
[FPEnv] Legalize double width StrictFP vector operations

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

llvm-svn: 337698

6 years ago[clangd] Fix category in clangd-vscode's package.json
Simon Marchi [Mon, 23 Jul 2018 14:32:12 +0000 (14:32 +0000)]
[clangd] Fix category in clangd-vscode's package.json

Summary:
When opening package.json, vscode shows:

  Use 'Programming  Languages' instead

Replacing "Languages" with this fixes it.

Reviewers: ilya-biryukov

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

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

llvm-svn: 337697

6 years ago[libFuzzer] Handle unstable edges by using minimum hit counts
Max Moroz [Mon, 23 Jul 2018 14:20:52 +0000 (14:20 +0000)]
[libFuzzer] Handle unstable edges by using minimum hit counts

Summary:
Created unstable_handle flag that takes 1 or 2, depending on the handling type.
Modified RunOne to accommodate the following heuristic:
    Use the first CollectFeatures to count how many features there are.
    If no new features, CollectFeatures like before.
    If there is new feature, we run CB 2 more times,
        Check which edges are unstable per input and we store the least amount of hit counts for each edge.
        Apply these hit counts back to inline8bitcounters so that CollectFeatures can work as intended.
Modified UnstableCounters to 8int_t and created a bitset UnstableSet to tell which edges are unstable.

Patch by Kyungtak Woo (@kevinwkt).

Reviewers: Dor1s, metzman, morehouse

Reviewed By: Dor1s, morehouse

Subscribers: delcypher, #sanitizers, llvm-commits, kcc

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

llvm-svn: 337696

6 years ago[Docs] Fix LLVM_YAML_IS_DOCUMENT_LIST_VECTOR
Jonas Devlieghere [Mon, 23 Jul 2018 14:17:43 +0000 (14:17 +0000)]
[Docs] Fix LLVM_YAML_IS_DOCUMENT_LIST_VECTOR

The docs incorrectly said to repeat std::vector inside
LLVM_YAML_IS_DOCUMENT_LIST_VECTOR.

llvm-svn: 337695

6 years agoAdd support for parsing Breakpad minidump files that can have extra padding in the...
Greg Clayton [Mon, 23 Jul 2018 14:16:08 +0000 (14:16 +0000)]
Add support for parsing Breakpad minidump files that can have extra padding in the module, thread and memory lists.

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

llvm-svn: 337694

6 years ago[LLD] Add llvm-objcopy to test dependencies. NFC.
Andrew Ng [Mon, 23 Jul 2018 14:12:57 +0000 (14:12 +0000)]
[LLD] Add llvm-objcopy to test dependencies. NFC.

Dependency on llvm-objcopy was introduced by r337429.

Also sorted the list of dependencies.

llvm-svn: 337693

6 years agoFix windows build after r337689
Alexander Polyakov [Mon, 23 Jul 2018 14:10:30 +0000 (14:10 +0000)]
Fix windows build after r337689

Added missing header.

llvm-svn: 337692

6 years ago[OPNEMP, NVPTX] Fixed sychronization construct + code cleanup.
Alexey Bataev [Mon, 23 Jul 2018 13:52:12 +0000 (13:52 +0000)]
[OPNEMP, NVPTX] Fixed sychronization construct + code cleanup.

Summary:
1. Fixed internal problem in `__kmpc_barrier` function: SPMD mode
synchronization function should be called only in L1 parallel level.
2. Removed some extra code for synchronization inside of the code, used
`__kmpc_barrier` instead.
3. Some code cleanup.

Reviewers: gtbercea, grokos

Subscribers: openmp-commits

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

llvm-svn: 337691

6 years ago[NEON] Fix support for vrndi_f32(), vrndiq_f32() and vrndns_f32() intrinsics
Ivan A. Kosarev [Mon, 23 Jul 2018 13:26:37 +0000 (13:26 +0000)]
[NEON] Fix support for vrndi_f32(), vrndiq_f32() and vrndns_f32() intrinsics

This patch adds support for vrndi_f32() and vrndiq_f32()
intrinsics in AArch32 mode and for vrndns_f32() intrinsic in
AArch64 mode.

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

llvm-svn: 337690

6 years ago[lldb-mi] Re-implement data-info-line command.
Alexander Polyakov [Mon, 23 Jul 2018 13:02:41 +0000 (13:02 +0000)]
[lldb-mi] Re-implement data-info-line command.

Summary: Now data-info-line command uses SB API instead of HandleCommand.

Reviewers: aprantl, clayborg, jingham

Reviewed By: aprantl

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 337689

6 years ago[AST] Use llvm::TrailingObjects in CXXTryStmt
Benjamin Kramer [Mon, 23 Jul 2018 12:45:24 +0000 (12:45 +0000)]
[AST] Use llvm::TrailingObjects in CXXTryStmt

1. Use llvm::TrailingObjects in CXXTryStmt instead of manually doing the reinterpret_casts + pointer arithmetic. This is more consistent with other classes using this idiom and this make it clearer that this class has trailing objects.
2. Make the class CXXTryStmt final since it has trailing objects.
3. Move the friend declarations together.

No functional changes.

Patch by Bruno Ricci!

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

llvm-svn: 337688

6 years ago[ARM] ARMCodeGenPrepare backend pass
Sam Parker [Mon, 23 Jul 2018 12:27:47 +0000 (12:27 +0000)]
[ARM] ARMCodeGenPrepare backend pass

Arm specific codegen prepare is implemented to perform type promotion
on icmp operands, which can enable the removal of uxtb and uxth
(unsigned extend) instructions. This is possible because performing
type promotion before ISel alleviates this duty from the DAG builder
which has to perform legalisation, but has a limited view on data
ranges.

The pass visits any instruction operand of an icmp and creates a
worklist to traverse the use-def tree to determine whether the values
can simply be promoted. Our concern is values in the registers
overflowing the narrow (i8, i16) data range, so instructions marked
with nuw can be promoted easily. For add and sub instructions, we are
able to use the parallel dsp instructions to operate on scalar data
types and avoid overflowing bits. Underflowing adds and subs are also
permitted when the result is only used by an unsigned icmp.

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

llvm-svn: 337687

6 years ago[GVN] Don't use the eliminated load as an available value in phi construction
John Brawn [Mon, 23 Jul 2018 12:14:45 +0000 (12:14 +0000)]
[GVN] Don't use the eliminated load as an available value in phi construction

In ConstructSSAForLoadSet if an available value is actually the load that we're
doing SSA construction to eliminate, then we can omit it as SSAUpdate will add
in the value for the phi that will be replacing it anyway. This can result in
simpler IR which can allow further optimisation.

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

llvm-svn: 337686

6 years agoCleanup unnecessary conversions in filesystem.
Eric Fiselier [Mon, 23 Jul 2018 11:55:13 +0000 (11:55 +0000)]
Cleanup unnecessary conversions in filesystem.

llvm-svn: 337685

6 years agoCleanup name qualification in the filesystem internals.
Eric Fiselier [Mon, 23 Jul 2018 11:46:47 +0000 (11:46 +0000)]
Cleanup name qualification in the filesystem internals.

In most cases there is no reason why the filesystem internals
use the qualifier std:: or _VSTD::. This patch removes the unneeded
qualifiers, making the sources files more consistent

llvm-svn: 337684

6 years ago[ELF] Fix handling of FDE negative relative PC addr
Andrew Ng [Mon, 23 Jul 2018 11:29:46 +0000 (11:29 +0000)]
[ELF] Fix handling of FDE negative relative PC addr

Signed values for the FDE PC addr were not correctly handled in
readFdeAddr(). If the value is negative and the type of the value is
smaller than 64 bits, the FDE PC addr overflow error would be
incorrectly triggered.

Fixed readFdeAddr() to properly handle signed values by sign extending
where appropriate.

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

llvm-svn: 337683

6 years ago[Tooling] Use UniqueStringSaver. NFC
Sam McCall [Mon, 23 Jul 2018 11:25:25 +0000 (11:25 +0000)]
[Tooling] Use UniqueStringSaver. NFC

llvm-svn: 337682

6 years ago[clangd] Penalize non-instance members when accessed via class instances.
Eric Liu [Mon, 23 Jul 2018 10:56:37 +0000 (10:56 +0000)]
[clangd] Penalize non-instance members when accessed via class instances.

Summary:
The following are metrics for explicit member access completions. There is no
noticeable impact on other completion types.

Before:
EXPLICIT_MEMBER_ACCESS
  Total measurements: 24382
  All measurements: MRR: 62.27 Top10: 80.21% Top-100: 94.48%
  Full identifiers: MRR: 98.81 Top10: 99.89% Top-100: 99.95%
  0-5 filter len:
MRR:  13.25 46.31 62.47 67.77 70.40 81.91
Top-10:  29% 74% 84% 91% 91% 97%
Top-100:  67% 99% 99% 99% 99% 100%

After:
EXPLICIT_MEMBER_ACCESS
  Total measurements: 24382
  All measurements: MRR: 63.18 Top10: 80.58% Top-100: 95.07%
  Full identifiers: MRR: 98.79 Top10: 99.89% Top-100: 99.95%
  0-5 filter len:
MRR:  13.84 48.39 63.55 68.83 71.28 82.64
Top-10:  30% 75% 84% 91% 91% 97%
Top-100:  70% 99% 99% 99% 99% 100%

* Top-N: wanted result is found in the first N completion results.
* MRR: Mean reciprocal rank.

Remark: the change seems to have minor positive impact. Although the improvement
is relatively small, down-ranking non-instance members in instance member access
should reduce noise in the completion results.

Reviewers: sammccall

Reviewed By: sammccall

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

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

llvm-svn: 337681

6 years ago[MemorySSAUpdater] Update Phi operands after trivial Phi elimination
Alexandros Lamprineas [Mon, 23 Jul 2018 10:56:30 +0000 (10:56 +0000)]
[MemorySSAUpdater] Update Phi operands after trivial Phi elimination

Bug fix for PR37445. The underlying problem and its fix are similar to PR37808.
The bug lies in MemorySSAUpdater::getPreviousDefRecursive(), where PhiOps is
computed before the call to tryRemoveTrivialPhi() and it ends up being out of
date, pointing to stale data. We have now turned each of the PhiOps into a
TrackingVH<MemoryAccess>.

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

llvm-svn: 337680

6 years agoFix for last commit: adding new test file forgotten.
Adam Balogh [Mon, 23 Jul 2018 10:53:02 +0000 (10:53 +0000)]
Fix for last commit: adding new test file forgotten.

llvm-svn: 337679

6 years ago[Analyzer] Quick Fix for exponential execution time when simpilifying complex additiv...
Adam Balogh [Mon, 23 Jul 2018 10:50:20 +0000 (10:50 +0000)]
[Analyzer] Quick Fix for exponential execution time when simpilifying complex additive expressions

Patch https://reviews.llvm.org/rC329780 not only rearranges comparisons but
also binary expressions. This latter behavior is not protected by the analyzer
option. Hower, since no complexity threshold is enforced to the symbols this
may result in exponential execution time if the expressions are too complex:
https://bugs.llvm.org/show_bug.cgi?id=38208. For a quick fix we extended the
analyzer option to also cover the additive cases.

This is only a temporary fix, the final solution should be enforcing the
complexity threshold to the symbols.

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

llvm-svn: 337678

6 years ago[Support] Add a UniqueStringSaver: like StringSaver, but deduplicating.
Sam McCall [Mon, 23 Jul 2018 10:44:40 +0000 (10:44 +0000)]
[Support] Add a UniqueStringSaver: like StringSaver, but deduplicating.

Summary: Clarify contract of StringSaver (it null-terminates, callers rely on it).

Reviewers: hokein

Subscribers: llvm-commits

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

llvm-svn: 337677

6 years ago[NFC][MCA] ZnVer1: Update RegisterFile to identify false dependencies on partially...
Roman Lebedev [Mon, 23 Jul 2018 10:10:13 +0000 (10:10 +0000)]
[NFC][MCA] ZnVer1: Update RegisterFile to identify false dependencies on partially written registers.

Summary:
Pretty mechanical follow-up for D49196.

As microarchitecture.pdf notes, "20 AMD Ryzen pipeline",
"20.8 Register renaming and out-of-order schedulers":
  The integer register file has 168 physical registers of 64 bits each.
  The floating point register file has 160 registers of 128 bits each.
"20.14 Partial register access":
  The processor always keeps the different parts of an integer register together.
  ...
  An instruction that writes to part of a register will therefore have a false dependence
  on any previous write to the same register or any part of it.

Reviewers: andreadb, courbet, RKSimon, craig.topper, GGanesh

Reviewed By: GGanesh

Subscribers: gbedwell, llvm-commits

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

llvm-svn: 337676

6 years ago[NFC][MCA] ZnVer1: add partial-reg-update tests
Roman Lebedev [Mon, 23 Jul 2018 10:10:04 +0000 (10:10 +0000)]
[NFC][MCA] ZnVer1: add partial-reg-update tests

Reviewers: andreadb, courbet, RKSimon, craig.topper, GGanesh

Reviewed By: GGanesh

Subscribers: gbedwell, llvm-commits

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

llvm-svn: 337675

6 years ago[GVNHoist] safeToHoistLdSt allows illegal hoisting
Alexandros Lamprineas [Mon, 23 Jul 2018 09:42:35 +0000 (09:42 +0000)]
[GVNHoist] safeToHoistLdSt allows illegal hoisting

Bug fix for PR36787. When reasoning if it's safe to hoist a load we
want to make sure that the defining memory access dominates the new
insertion point of the hoisted instruction. safeToHoistLdSt calls
firstInBB(InsertionPoint,DefiningAccess) which returns false if
InsertionPoint == DefiningAccess, and therefore it falsely thinks
it's safe to hoist.

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

llvm-svn: 337674

6 years ago[x86/SLH] Fix a bug where we would harden tail calls twice -- once as
Chandler Carruth [Mon, 23 Jul 2018 07:56:15 +0000 (07:56 +0000)]
[x86/SLH] Fix a bug where we would harden tail calls twice -- once as
a call, and then again as a return.

Also added a comment to try and explain better why we would be doing
what we're doing when hardening the (non-call) returns.

llvm-svn: 337673

6 years ago[x86/SLH] Add a test covering indirect forms of control flow. NFC.
Chandler Carruth [Mon, 23 Jul 2018 07:51:51 +0000 (07:51 +0000)]
[x86/SLH] Add a test covering indirect forms of control flow. NFC.

This specifically covers different ways of making indirect calls and
jumps. There are some bugs in SLH that I will be fixing in subsequent
patches where the diff in the generated instructions makes the bug fix
much more clear, so just checking in a baseline of this test to start.

I'm also going to be adding direct mitigation for variant 1.2 which this
file very specifically tests in the various forms it can arise on x86.
Again, the diff to the generated instructions should make the change for
that much more clear, so having the test as a baseline seems useful.

llvm-svn: 337672

6 years agoRevert "Fold dangling-field warning into general initialization lifetime checks."
Ilya Biryukov [Mon, 23 Jul 2018 06:32:36 +0000 (06:32 +0000)]
Revert "Fold dangling-field warning into general initialization lifetime checks."

This reverts commit r337627.
After the change, clang started producing invalid warning on the following code:
    struct foo {
      foo(char *x) : x_(&x[10]) {}
    private:
      char *x_;
    };

1.cpp:2:21: warning: initializing pointer member 'x_' with the stack address of parameter 'x' [-Wdangling-field]

llvm-svn: 337671

6 years agoRevert "[CMake] Support statically linking dependencies only to shared or static...
Petr Hosek [Mon, 23 Jul 2018 05:07:44 +0000 (05:07 +0000)]
Revert "[CMake] Support statically linking dependencies only to shared or static library"

This reverts commit r337668: broke the cxxabi build when using Make.

llvm-svn: 337670

6 years agoUse possibly cached directory entry values when performing recursive directory iteration.
Eric Fiselier [Mon, 23 Jul 2018 04:55:57 +0000 (04:55 +0000)]
Use possibly cached directory entry values when performing recursive directory iteration.

llvm-svn: 337669

6 years ago[CMake] Support statically linking dependencies only to shared or static library
Petr Hosek [Mon, 23 Jul 2018 04:19:55 +0000 (04:19 +0000)]
[CMake] Support statically linking dependencies only to shared or static library

Currently it's possible to select whether to statically link unwinder
or the C++ ABI library, but this option applies to both the shared
and static library. However, in some scenarios it may be desirable to
only statically link unwinder and C++ ABI library into static C++
library since for shared C++ library we can rely on dynamic linking
and linker scripts. This change enables selectively enabling or
disabling statically linking only to shared or static library.

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

llvm-svn: 337668

6 years ago[x86/SLH] Rename and comment the main hardening function. NFC.
Chandler Carruth [Mon, 23 Jul 2018 04:01:34 +0000 (04:01 +0000)]
[x86/SLH] Rename and comment the main hardening function. NFC.

This provides an overview of the algorithm used to harden specific
loads. It also brings this our terminology further in line with
hardening rather than checking.

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

llvm-svn: 337667

6 years agoFix use of C++14 syntax in C++11 filesystem tests.
Eric Fiselier [Mon, 23 Jul 2018 03:41:46 +0000 (03:41 +0000)]
Fix use of C++14 syntax in C++11 filesystem tests.

llvm-svn: 337666

6 years agoWork around various GCC 4.9 build errors
Eric Fiselier [Mon, 23 Jul 2018 03:06:57 +0000 (03:06 +0000)]
Work around various GCC 4.9 build errors

llvm-svn: 337665

6 years agoImplement filesystem_error::what() and improve reporting.
Eric Fiselier [Mon, 23 Jul 2018 02:00:52 +0000 (02:00 +0000)]
Implement filesystem_error::what() and improve reporting.

This patch implements the `what()` for filesystem errors. The message
includes the 'what_arg', any paths that were specified, and the
error code message.

Additionally this patch refactors how errors are created, making it easier
to report them correctly.

llvm-svn: 337664

6 years agoFix the test
Brad Smith [Sun, 22 Jul 2018 22:04:28 +0000 (22:04 +0000)]
Fix the test

llvm-svn: 337663

6 years agoAdd GCC 9 to XFAILs list for test
Eric Fiselier [Sun, 22 Jul 2018 21:58:46 +0000 (21:58 +0000)]
Add GCC 9 to XFAILs list for test

llvm-svn: 337662

6 years agoWorkaround bug in GCC trunk.
Eric Fiselier [Sun, 22 Jul 2018 21:56:40 +0000 (21:56 +0000)]
Workaround bug in GCC trunk.

For some reason GCC ToT is failing to deduce the auto type for
a static data member from its initializer in some cases.

Though I'm sure the bug will be short lived, there is a trivial workaround for it.
So we might as well get the bot passing again.

llvm-svn: 337661

6 years agoOpenBSD/arm has switched to float ABI SoftFP.
Brad Smith [Sun, 22 Jul 2018 21:39:54 +0000 (21:39 +0000)]
OpenBSD/arm has switched to float ABI SoftFP.

llvm-svn: 337660

6 years agoHarden copy_file even more.
Eric Fiselier [Sun, 22 Jul 2018 21:15:15 +0000 (21:15 +0000)]
Harden copy_file even more.

This patch removes the O_CREAT open flag when we first
attempt to open the destination file but we expect it to
already exist.

This theoretically avoids the possibility that it was removed
between when we first stat'ed it, and when we attempt to open it.

llvm-svn: 337659

6 years agofix test failures with older clang versions
Eric Fiselier [Sun, 22 Jul 2018 20:50:16 +0000 (20:50 +0000)]
fix test failures with older clang versions

llvm-svn: 337658

6 years agoTest commit, fix a minor typo.
Jiading Gai [Sun, 22 Jul 2018 20:04:42 +0000 (20:04 +0000)]
Test commit, fix a minor typo.

llvm-svn: 337657

6 years ago[X86] Remove the max vector width restriction from combineLoopMAddPattern and rely...
Craig Topper [Sun, 22 Jul 2018 19:44:35 +0000 (19:44 +0000)]
[X86] Remove the max vector width restriction from combineLoopMAddPattern and rely splitOpsAndApply to handle splitting.

This seems to be a net improvement. There's still an issue under avx512f where we have a 512-bit vpaddd, but not vpmaddwd so we end up doing two 256-bit vpmaddwds and inserting the results before a 512-bit vpaddd. It might be better to do two 512-bits paddds with zeros in the upper half. Same number of instructions, but breaks a dependency.

llvm-svn: 337656

6 years ago[clangd] Unbreak fuzzer build.
Benjamin Kramer [Sun, 22 Jul 2018 15:55:57 +0000 (15:55 +0000)]
[clangd] Unbreak fuzzer build.

llvm-svn: 337655

6 years ago[ORE] Move loop invariant ORE checks outside the PM loop.
Xin Tong [Sun, 22 Jul 2018 05:27:41 +0000 (05:27 +0000)]
[ORE] Move loop invariant ORE checks outside the PM loop.

Summary:
This takes 22ms out of ~20s compiling sqlite3.c because we call it
for every unit of compilation and every pass.

Reviewers: paquette, anemet

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 337654

6 years agoPR38257: don't perform ADL when instantiating a unary & operator that turns out
Richard Smith [Sun, 22 Jul 2018 05:21:47 +0000 (05:21 +0000)]
PR38257: don't perform ADL when instantiating a unary & operator that turns out
to be forming a pointer-to-member.

llvm-svn: 337653

6 years ago[SelectionDAGBuilder] Use APInt::isZero instead of comparing APInt::getZExtValue...
Craig Topper [Sun, 22 Jul 2018 05:16:50 +0000 (05:16 +0000)]
[SelectionDAGBuilder] Use APInt::isZero instead of comparing APInt::getZExtValue to 0 in a place where we can't be sure contents of the APInt fit in a uint64_t.

This is used on an extract vector element index which is most cases is going to be an i32 or i64 and the element will be a valid element number. But it is possible to construct IR with a larger type and large out of range value.

llvm-svn: 337652

6 years ago[SelectionDAGBuilder] Restrict vector reduction check to types with a power of 2...
Craig Topper [Sun, 22 Jul 2018 05:16:49 +0000 (05:16 +0000)]
[SelectionDAGBuilder] Restrict vector reduction check to types with a power of 2 number of elements.

The check for the shuffles usages probably isn't correct for non power of 2 vectors.

llvm-svn: 337651

6 years ago[X86] Add more MADD recurrence test cases with larger and narrower vector widths.
Craig Topper [Sun, 22 Jul 2018 05:16:47 +0000 (05:16 +0000)]
[X86] Add more MADD recurrence test cases with larger and narrower vector widths.

llvm-svn: 337650

6 years agoImplement a better copy_file.
Eric Fiselier [Sun, 22 Jul 2018 02:00:53 +0000 (02:00 +0000)]
Implement a better copy_file.

This patch improves both the performance, and the safety of the
copy_file implementation.

The performance improvements are achieved by using sendfile on
Linux and copyfile on OS X when available.

The TOCTOU hardening is achieved by opening the source and
destination files and then using fstat to check their attributes to
see if we can copy them.

Unfortunately for the destination file, there is no way to open
it without accidentally creating it, so we first have to use
stat to determine if it exists, and if we should copy to it.
Then, once we're sure we should try to copy, we open the dest
file and ensure it names the same entity we previously stat'ed.

llvm-svn: 337649

6 years ago[llvm-mca][docs] Add documentation for the statistic outputs from mca. NFC
Matt Davis [Sat, 21 Jul 2018 18:32:47 +0000 (18:32 +0000)]
[llvm-mca][docs] Add documentation for the statistic outputs from mca. NFC

Summary: The original text was lifted from the MCA README.  I re-ran the dot-product example and updated the output seen in the docs.  I also added a few paragraphs discussing the instruction issued and retired histograms, as well as discussing the register file stats.

Reviewers: andreadb, RKSimon, courbet, gbedwell, filcab

Reviewed By: andreadb

Subscribers: tschuett

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

llvm-svn: 337648

6 years ago[mips] Factor out register class selection for global base register. NFC
Simon Atanasyan [Sat, 21 Jul 2018 16:16:08 +0000 (16:16 +0000)]
[mips] Factor out register class selection for global base register. NFC

Factor out register class selection for global base register into a
separate function to escape long chain of ternary operators.

llvm-svn: 337647

6 years ago[mips] Move out the WrapperPat declaration from the NotInMicroMips predicate
Simon Atanasyan [Sat, 21 Jul 2018 16:16:03 +0000 (16:16 +0000)]
[mips] Move out the WrapperPat declaration from the NotInMicroMips predicate

This is a follow-up to the rL335185. Those commit adds some WrapperPat
patterns for microMIPS target. But declaration of the WrapperPat class
is under the NotInMicroMips predicate and microMIPS patterns cannot be
selected because predicate (Subtarget->inMicroMipsMode()) &&
(!Subtarget->inMicroMipsMode()) is always false.

This change move out the WrapperPat class declaration from the
NotInMicroMips predicate and enables microMIPS WrapperPat patterns.

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

llvm-svn: 337646

6 years ago[llvm-undname] Flush output before demangling.
Zachary Turner [Sat, 21 Jul 2018 15:39:05 +0000 (15:39 +0000)]
[llvm-undname] Flush output before demangling.

If an error occurs and we write it to stderr, it could appear
before we wrote the mangled name which we're undecorating.
By flushing stdout first, we ensure that the messages are always
sequenced in the correct order.

llvm-svn: 337645

6 years agoFix the MSVC Visualizers for SmallVector classes.
Zachary Turner [Sat, 21 Jul 2018 15:38:47 +0000 (15:38 +0000)]
Fix the MSVC Visualizers for SmallVector classes.

Recent changes to the internal structure of SmallVector<> broke
all of the MSVC visualizers.  This fixes them.

llvm-svn: 337644

6 years agoEarly exit with cheaper checks
Aditya Kumar [Sat, 21 Jul 2018 14:13:44 +0000 (14:13 +0000)]
Early exit with cheaper checks

Reviewers: sebpop,davide,fhahn,trentxintong
Differential Revision: https://reviews.llvm.org/D49617

llvm-svn: 337643

6 years ago[InstrSimplify] fold sdiv if two operands are negated and non-overflow
Chen Zheng [Sat, 21 Jul 2018 12:27:54 +0000 (12:27 +0000)]
[InstrSimplify] fold sdiv if two operands are negated and non-overflow

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

llvm-svn: 337642

6 years ago[DebugInfo] Add a new DI flag to record if a C++ record is a trivial type
Aaron Smith [Sat, 21 Jul 2018 05:42:13 +0000 (05:42 +0000)]
[DebugInfo] Add a new DI flag to record if a C++ record is a trivial type

Summary:
This flag is used when emitting debug info and is needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs.

It is not easy to determine if a C++ record is trivial or not based on the current DICompositeType flags and other accessible debug information from Codeview. For example, without this flag the metadata for a non-trivial C++ record with user-defined ctor and a trivial one with a defaulted ctor are the same.

    struct S { S(); }
    struct S { S() = default; }

This change introduces a new DI flag and corresponding clang::CXXRecordDecl::isTrivial method to set the flag in the frontend.

Reviewers: rnk, zturner, llvm-commits, dblaikie, aleksandr.urakov, deadalnix

Reviewed By: rnk

Subscribers: asmith, probinson, aprantl, JDevlieghere

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

llvm-svn: 337641

6 years agoELF: Read address significance tables with --icf=all.
Peter Collingbourne [Sat, 21 Jul 2018 02:14:59 +0000 (02:14 +0000)]
ELF: Read address significance tables with --icf=all.

Under --icf=all we now only apply KeepUnique to non-executable
address-significant sections. This has the effect of making --icf=all
mean unsafe ICF for executable sections and safe ICF for non-executable
sections.

With this change the meaning of the KeepUnique bit changes to
"does the current ICF mode (together with the --keep-unique and
--ignore-data-address-equality flags) require this section to be
kept unique".

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

llvm-svn: 337640

6 years ago[HIP] Support -fcuda-flush-denormals-to-zero for amdgcn
Yaxun Liu [Sat, 21 Jul 2018 02:02:22 +0000 (02:02 +0000)]
[HIP] Support -fcuda-flush-denormals-to-zero for amdgcn

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

llvm-svn: 337639

6 years agoELF: Make sections with KeepUnique bit eligible for ICF.
Peter Collingbourne [Sat, 21 Jul 2018 00:17:11 +0000 (00:17 +0000)]
ELF: Make sections with KeepUnique bit eligible for ICF.

The only restriction is that we cannot merge more than one KeepUnique
section together. This matches gold's behaviour and reduces code size
when using --icf=safe.

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

llvm-svn: 337638

6 years ago[ORC] Re-apply r336760 with fixes.
Lang Hames [Sat, 21 Jul 2018 00:12:05 +0000 (00:12 +0000)]
[ORC] Re-apply r336760 with fixes.

llvm-svn: 337637

6 years ago[NFC] CodeGen: rename memset to bzero
JF Bastien [Fri, 20 Jul 2018 23:37:12 +0000 (23:37 +0000)]
[NFC] CodeGen: rename memset to bzero

The optimization looks for opportunities to emit bzero, not memset. Rename the functions accordingly (and clang-format the diff) because I want to add a fallback optimization which actually tries to generate memset. bzero is still better and it would confuse the code to merge both.

llvm-svn: 337636

6 years ago[Driver] Sanitizer support based on runtime library presence
George Karpenkov [Fri, 20 Jul 2018 23:34:39 +0000 (23:34 +0000)]
[Driver] Sanitizer support based on runtime library presence

The runtime libraries of sanitizers are built in compiler-rt, and Clang
can be built without compiler-rt, or compiler-rt can be configured to
only build certain sanitizers. The driver should provide reasonable
diagnostics and not a link-time error when a runtime library is missing.

This patch changes the driver for OS X to only support sanitizers of
which we can find the runtime libraries. The discussion for this patch
explains the rationale

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

llvm-svn: 337635

6 years agoOmit path to lld binary from lld's error, warning, and log output.
Nico Weber [Fri, 20 Jul 2018 23:09:12 +0000 (23:09 +0000)]
Omit path to lld binary from lld's error, warning, and log output.

lld currently prepends the absolute path to itself to every diagnostic it
emits. This path can be longer than the diagnostic, and makes the actual error
message hard to read.

There isn't a good reason for printing this path: if you want to know which lld
you're running, pass -v to clang – chances are that if you're unsure of this,
you're not only unsure when it errors out. Some people want an indication that
the diagnostic is from the linker though, so instead print just the basename of
the linker's path.

Before:

```
$ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crt1.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crti.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtbegin.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lc
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtend.o: No such file or directory
/Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtn.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

After:

```
$ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld
ld.lld: error: cannot open crt1.o: No such file or directory
ld.lld: error: cannot open crti.o: No such file or directory
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lc
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: cannot open crtend.o: No such file or directory
ld.lld: error: cannot open crtn.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

https://reviews.llvm.org/D49189

llvm-svn: 337634

6 years agoSimplify; no behavior change.
Nico Weber [Fri, 20 Jul 2018 23:06:34 +0000 (23:06 +0000)]
Simplify; no behavior change.

Reviewed as part of https://reviews.llvm.org/D49189

llvm-svn: 337633

6 years ago[clang-doc] Create a script to generate tests
Julie Hockett [Fri, 20 Jul 2018 23:00:34 +0000 (23:00 +0000)]
[clang-doc] Create a script to generate tests

Upstreaming the script I use to generate clang-doc tests (and updating
the existing tests to use it)

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

llvm-svn: 337632

6 years ago[HIP] Register/unregister device fat binary only once
Yaxun Liu [Fri, 20 Jul 2018 22:45:24 +0000 (22:45 +0000)]
[HIP] Register/unregister device fat binary only once

HIP generates one fat binary for all devices after linking. However, for each compilation
unit a ctor function is emitted which register the same fat binary. Measures need to be
taken to make sure the fat binary is only registered once.

Currently each ctor function calls __hipRegisterFatBinary and stores the returned value
to __hip_gpubin_handle. This patch changes the linkage of __hip_gpubin_handle to be linkonce
so that they are shared between LLVM modules. Then this patch adds check of value of
__hip_gpubin_handle to make sure __hipRegisterFatBinary is only called once. The code
is equivalent to

void *_gpubin_handle;
void ctor() {
  if (__hip_gpubin_handle == 0) {
    __hip_gpubin_handle = __hipRegisterFatBinary(...);
  }
  // register kernels and variables.
}
The patch also does similar change to dtors so that __hipUnregisterFatBinary
is called once.

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

llvm-svn: 337631

6 years ago[CMake] Install C++ ABI headers into the right location
Petr Hosek [Fri, 20 Jul 2018 22:45:24 +0000 (22:45 +0000)]
[CMake] Install C++ ABI headers into the right location

This is a follow-up to r335809 and r337118. While libc++ headers are now
installed into the right location in both standard as well as multiarch
runtimes layout, turned out C++ ABI headers are still installed into the
old location in the latter case. This change addresses that.

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

llvm-svn: 337630

6 years agoDisable clang crash-report-modules.m test on Windows again
Reid Kleckner [Fri, 20 Jul 2018 22:36:33 +0000 (22:36 +0000)]
Disable clang crash-report-modules.m test on Windows again

It still appears to be failing:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/12825

$ "rm" "-rf" "C:\b\slave\clang-x86-windows-msvc2015\clang-x86-windows-msvc2015\stage1\tools\clang\test\Driver\Output/crmdir"
Error: 'rm' command failed, [Error 3] The system cannot find the path specified: 'C:\\b\\slave\\clang-x86-windows-msvc2015\\clang-x86-windows-msvc2015\\stage1\\tools\\clang\\test\\Driver\\Output/crmdir\\crash-report-modules-300567.cache\\vfs\\b\\slave\\clang-x86-windows-msvc2015\\clang-x86-windows-msvc2015\\llvm\\tools\\clang\\test\\Driver\\Inputs\\module\\module.modulemap'
error: command failed with exit status: 1

llvm-svn: 337629

6 years ago[PDB] Write the command line after response file expansion
Reid Kleckner [Fri, 20 Jul 2018 22:34:20 +0000 (22:34 +0000)]
[PDB] Write the command line after response file expansion

Summary: Fixes PR38085

Reviewers: ruiu, zturner

Subscribers: llvm-commits

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

llvm-svn: 337628

6 years agoFold dangling-field warning into general initialization lifetime checks.
Richard Smith [Fri, 20 Jul 2018 22:25:55 +0000 (22:25 +0000)]
Fold dangling-field warning into general initialization lifetime checks.

llvm-svn: 337627

6 years agoRe-apply r337595 with fix for LLVM_ENABLE_THREADS=Off.
Lang Hames [Fri, 20 Jul 2018 22:22:19 +0000 (22:22 +0000)]
Re-apply r337595 with fix for LLVM_ENABLE_THREADS=Off.

llvm-svn: 337626

6 years ago[ADT] Only run death tests in !NDEBUG
Benjamin Kramer [Fri, 20 Jul 2018 22:15:09 +0000 (22:15 +0000)]
[ADT] Only run death tests in !NDEBUG

These invoke undefined behavior.

llvm-svn: 337625

6 years ago[Hexagon] Disable packets in test to avoid ordering issues in checks
Krzysztof Parzyszek [Fri, 20 Jul 2018 21:55:55 +0000 (21:55 +0000)]
[Hexagon] Disable packets in test to avoid ordering issues in checks

llvm-svn: 337624

6 years agoChange the cap on the amount of padding for each vtable to 32-byte (previously it...
Peter Collingbourne [Fri, 20 Jul 2018 21:43:20 +0000 (21:43 +0000)]
Change the cap on the amount of padding for each vtable to 32-byte (previously it was 128-byte)

We tested different cap values with a recent commit of Chromium. Our results show that the 32-byte cap yields the smallest binary and all the caps yield similar performance.
Based on the results, we propose to change the cap value to 32-byte.

Patch by Zhaomo Yang!

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

llvm-svn: 337622

6 years agoAMDGPU: Use existing function to check for VGPRs
Matt Arsenault [Fri, 20 Jul 2018 21:20:36 +0000 (21:20 +0000)]
AMDGPU: Use existing function to check for VGPRs

llvm-svn: 337621

6 years agofix typo
Nico Weber [Fri, 20 Jul 2018 21:06:41 +0000 (21:06 +0000)]
fix typo

llvm-svn: 337620

6 years ago[ms] Add __shiftleft128 / __shiftright128 intrinsics
Nico Weber [Fri, 20 Jul 2018 21:02:09 +0000 (21:02 +0000)]
[ms] Add __shiftleft128 / __shiftright128 intrinsics

Carefully match the pattern matched by ISel so that this produces shld / shrd
(unless Subtarget->isSHLDSlow() is true).

Thanks to Craig Topper for providing the LLVM IR pattern that gets successfully
matched.

Fixes PR37755.

llvm-svn: 337619

6 years agoRevert "[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDe...
Benjamin Kramer [Fri, 20 Jul 2018 20:59:46 +0000 (20:59 +0000)]
Revert "[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDemandedVectorElts"

This reverts commit r337547. It triggers an infinite loop.

llvm-svn: 337617