platform/upstream/llvm.git
6 years ago[CodeGen] Unify MBB reference format in both MIR and debug output
Francis Visoiu Mistrih [Mon, 4 Dec 2017 17:18:51 +0000 (17:18 +0000)]
[CodeGen] Unify MBB reference format in both MIR and debug output

As part of the unification of the debug format and the MIR format, print
MBB references as '%bb.5'.

The MIR printer prints the IR name of a MBB only for block definitions.

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g'
* find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g'
* grep -nr 'BB#' and fix

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

llvm-svn: 319665

6 years agoFix function pointer tail calls in armv8-M.base
Pablo Barrio [Mon, 4 Dec 2017 16:55:49 +0000 (16:55 +0000)]
Fix function pointer tail calls in armv8-M.base

Summary:
The compiler fails with the following error message:

fatal error: error in backend: ran out of registers during
register allocation

Tail call optimization for Armv8-M.base fails to meet all the required
constraints when handling calls to function pointers where the
arguments take up r0-r3. This is because the pointer to the
function to be called can only be stored in r0-r3, but these are
all occupied by arguments. This patch makes sure that tail call
optimization does not try to handle this type of calls.

Reviewers: chill, MatzeB, olista01, rengolin, efriedma

Reviewed By: olista01, efriedma

Subscribers: efriedma, aemerson, javed.absar, llvm-commits, kristof.beyls

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

llvm-svn: 319664

6 years agoRevert "[cmake] Enable zlib support on windows"
Pavel Labath [Mon, 4 Dec 2017 16:46:20 +0000 (16:46 +0000)]
Revert "[cmake] Enable zlib support on windows"

This reverts commit r319533 as it broke llvm-config --system-libs output
and everything that depends on it (which is mostly out of tree or
downstream folks, but includes a couple of llvm buildbots as well).

I think I have a fix for this in D40779, but I want someone to look
review it first. In the mean time, I am reverting this change, as it
seems to break a lot of people.

llvm-svn: 319663

6 years ago[AMDGPU] SDWA: add support for PRESERVE into SDWA peephole.
Sam Kolton [Mon, 4 Dec 2017 16:22:32 +0000 (16:22 +0000)]
[AMDGPU] SDWA: add support for PRESERVE into SDWA peephole.

Summary:

Reviewers: arsenm, vpykhtin, rampitec

Subscribers: kzhuravl, wdng, nhaehnle, mgorny, yaxunl, dstuttard, tpr, t-tye

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

llvm-svn: 319662

6 years ago[OPENMP] Codegen for `distribute simd` directive.
Alexey Bataev [Mon, 4 Dec 2017 15:38:33 +0000 (15:38 +0000)]
[OPENMP] Codegen for `distribute simd` directive.

Initial codegen support for `distribute simd` directive.

llvm-svn: 319661

6 years ago[ARM] CodeGen test
Sam Parker [Mon, 4 Dec 2017 15:14:59 +0000 (15:14 +0000)]
[ARM] CodeGen test

Add another and + load DAG combine test.

llvm-svn: 319660

6 years ago[Loop Predication] Teach LP about reverse loops
Anna Thomas [Mon, 4 Dec 2017 15:11:48 +0000 (15:11 +0000)]
[Loop Predication] Teach LP about reverse loops

Summary:
Currently, we only support predication for forward loops with step
of 1.  This patch enables loop predication for reverse or
countdownLoops, which satisfy the following conditions:
   1. The step of the IV is -1.
   2. The loop has a singe latch as B(X) = X <pred>
latchLimit with pred as s> or u>
   3. The IV of the guard is the decrement
IV of the latch condition (Guard is: G(X) = X-1 u< guardLimit).

This patch was downstream for a while and is the last series of patches
that's from our LP implementation downstream.

Reviewers: apilipenko, mkazantsev, sanjoy

Subscribers: llvm-commits

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

llvm-svn: 319659

6 years ago[OpenCL] Define __IMAGE_SUPPORT__ macro for SPIR
Sven van Haastregt [Mon, 4 Dec 2017 15:01:08 +0000 (15:01 +0000)]
[OpenCL] Define __IMAGE_SUPPORT__ macro for SPIR

Add #define __IMAGE_SUPPORT__ 1 for SPIR targets to indicate that SPIR
supports images.

Patch by Dmitry Borisenkov.

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

llvm-svn: 319658

6 years ago[NVPTX] Assign valid global names
Jonas Hahnfeld [Mon, 4 Dec 2017 14:19:33 +0000 (14:19 +0000)]
[NVPTX] Assign valid global names

PTX requires that identifiers consist only of [a-zA-Z0-9_$]. The
existing pass already ensured this for globals and this patch adds
the cleanup for functions with local linkage.

However, there was a different problem in the case of collisions
of the adjusted name: The ValueSymbolTable then automatically
appended ".N" with increasing Ns to get a unique name while helping
the ABI demangling. Special case this behavior to omit the dots and
append N directly. This will always give us legal names according
to the PTX requirements.

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

llvm-svn: 319657

6 years ago[NFC][lit] Use proper semantic versioning names for variables
Jonas Devlieghere [Mon, 4 Dec 2017 14:01:34 +0000 (14:01 +0000)]
[NFC][lit] Use proper semantic versioning names for variables

The variable named `minor` was actually pointing to the patch part of
the version. While I was changing this I also made the check for Apple
clang more robust by checking both patch and minor rather than just
minor.

llvm-svn: 319656

6 years ago[clangd] Split CodeComplete into a separate file. NFC
Sam McCall [Mon, 4 Dec 2017 13:49:59 +0000 (13:49 +0000)]
[clangd] Split CodeComplete into a separate file. NFC

Summary: Shared details of ClangdUnit and CodeComplete moved to a new Compiler file.

Reviewers: ilya-biryukov

Subscribers: klimek, mgorny, cfe-commits

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

llvm-svn: 319655

6 years agoRevert r319649 - [Asm, ARM] Add fallback diag for multiple invalid operands
Oliver Stannard [Mon, 4 Dec 2017 13:42:22 +0000 (13:42 +0000)]
Revert r319649 - [Asm, ARM] Add fallback diag for multiple invalid operands

This is causing a failure in the llvm-clang-x86_64-expensive-checks-win
buildbot, and I can't reproduce it locally, so reverting until I can work out
what is wrong.

llvm-svn: 319654

6 years agoMakefile.rules: compile all tests with -fno-limit-debug-info
Pavel Labath [Mon, 4 Dec 2017 13:31:56 +0000 (13:31 +0000)]
Makefile.rules: compile all tests with -fno-limit-debug-info

Summary:
This flag is on by default for darwin and freebsd, but off for linux.
Without it, clang will sometimes not emit debug info for types like
std::string. Whether it does this, and which tests will fail because of
that depends on the linux distro and c++ library version.

A bunch of tests were already setting these flags manually, but here
instead I take a whole sale approach and enable this flag for all tests.
Any test which does not want to have this flag (right now we have one
such test) can turn it off explicitly via
CFLAGS_EXTRAS+=$(LIMIT_DEBUG_INFO_FLAGS)

This fixes a bunch of data formatter tests on red-hat.

Reviewers: davide, jankratochvil

Subscribers: emaste, aprantl, krytarowski, JDevlieghere, lldb-commits

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

llvm-svn: 319653

6 years agoRevert "[ValueTracking] Pass only a single lambda to computeKnownBitsFromShiftOperato...
Sam McCall [Mon, 4 Dec 2017 12:51:49 +0000 (12:51 +0000)]
Revert "[ValueTracking] Pass only a single lambda to computeKnownBitsFromShiftOperator by using KnownBits struct instead of separate APInts. NFCI"

This reverts commit r319624, which seems to cause a miscompile (breaks the
multistage PPC buildbots)

llvm-svn: 319652

6 years agoAMDGPU: fix missing s_waitcnt
Tim Corringham [Mon, 4 Dec 2017 12:30:49 +0000 (12:30 +0000)]
AMDGPU: fix missing s_waitcnt

Summary:
The pass that inserts s_waitcnt instructions where needed propagated
info used to track dependencies for each block by iterating over the
predecessor blocks. The iteration was terminated when a predecessor
that had not yet been processed was encountered. Any info in blocks
later in the list was therefore not processed, leading to the
possiblility of a required s_waitcnt not being inserted.

The fix is simply to change the "break" to "continue" for the
relevant loops, so that all visited blocks are processed. This
is likely what was intended when the code was written.

There is no test case provided for this fix because:
1) the only example that reproduces this is large and resistant to
being reduced
2) the change is trivial

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

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

llvm-svn: 319651

6 years agoMove __tsan::Vector to __sanitizer
Kamil Rytarowski [Mon, 4 Dec 2017 12:30:09 +0000 (12:30 +0000)]
Move __tsan::Vector to __sanitizer

Summary:
The low-fat STL-like vector container will be reused in MSan.

It is needed to implement an atexit(3) interceptor on NetBSD/amd64 in MSan.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc

Reviewed By: dvyukov

Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 319650

6 years ago[Asm, ARM] Add fallback diag for multiple invalid operands
Oliver Stannard [Mon, 4 Dec 2017 12:02:32 +0000 (12:02 +0000)]
[Asm, ARM] Add fallback diag for multiple invalid operands

This adds a "invalid operands for instruction" diagnostic for
instructions where there is an instruction encoding with the correct
mnemonic and which is available for this target, but where multiple
operands do not match those which were provided. This makes it clear
that there is some combination of operands that is valid for the current
target, which the default diagnostic of "invalid instruction" does not.

Since this is a very general error, we only emit it if we don't have a
more specific error.

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

llvm-svn: 319649

6 years ago[ELF] Add BYTE expression to test case for non-contiguous relro [NFC]
Peter Smith [Mon, 4 Dec 2017 10:34:15 +0000 (10:34 +0000)]
[ELF] Add BYTE expression to test case for non-contiguous relro [NFC]

As well as location counter expressions. The data generating expressions
such as BYTE can generate a non-zero sized OutputSection that will report
0 until assignAddresses() is called. Add an example to the existing test
case relro-non-contiguous-script-data.s.

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

llvm-svn: 319648

6 years ago[clangd] GlobalCompilationDatabase interface changes
Sam McCall [Mon, 4 Dec 2017 10:08:45 +0000 (10:08 +0000)]
[clangd] GlobalCompilationDatabase interface changes

Summary:
- GlobalCompilationDatabase now returns a single command (that's all we use)
- fallback flags are now part of the GlobalCompilationDatabase.
  There's a default implementation that they can optionally customize.
- this allows us to avoid invoking the fallback logic on two separate codepaths
- race on extra flags fixed by locking the mutex
- made GCD const-correct (DBGCD does have mutating methods)

Reviewers: hokein

Subscribers: klimek, cfe-commits, ilya-biryukov

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

llvm-svn: 319647

6 years ago[TwoAddressInstructionPass] Bugfix in handling of sunk instructions.
Jonas Paulsson [Mon, 4 Dec 2017 10:03:14 +0000 (10:03 +0000)]
[TwoAddressInstructionPass]  Bugfix in handling of sunk instructions.

An instruction returned by TII->convertToThreeAddress() may contain a %noreg
(undef) operand, which is not expected by tryInstructionTransform(). So if
this MI is sunk to a lower point in MBB, it must be skipped when later
encountered.

A new set SunkInstrs is used for this purpose.

Note: there is no test supplied here, as this was triggered on SystemZ while
working on a review of instruction flags. A test case for this bugfix will be
included in the upcoming SystemZ commit.

Review: Quentin Colombet
https://reviews.llvm.org/D40711

llvm-svn: 319646

6 years ago[DAGCombine] Remove isAndLoadExtLoad arguments
Sam Parker [Mon, 4 Dec 2017 09:48:26 +0000 (09:48 +0000)]
[DAGCombine] Remove isAndLoadExtLoad arguments

Both LoadedVT and NarrowLoad are passed as references and neither
of them are used by any of its callers.

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

llvm-svn: 319645

6 years ago[AArch64] Allow using emulated tls on platforms other than ELF
Martin Storsjo [Mon, 4 Dec 2017 09:09:04 +0000 (09:09 +0000)]
[AArch64] Allow using emulated tls on platforms other than ELF

This matches how it is done on X86.

This allows using emulated tls on windows; in MinGW environments,
native tls isn't supported at the moment.

Set the right Data*bitsDirective for windows to match the existing
tests for other platforms. Make parts of the existing tests a regex,
to allow matching .section .rdata for windows, to avoid having to
duplicate the rest of the tests for windows.

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

llvm-svn: 319644

6 years ago[ARM] Allow using emulated tls on platforms other than ELF
Martin Storsjo [Mon, 4 Dec 2017 09:08:55 +0000 (09:08 +0000)]
[ARM] Allow using emulated tls on platforms other than ELF

This matches how it is done on X86.

This allows using emulated tls on windows; in MinGW environments,
native tls isn't supported at the moment.

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

llvm-svn: 319643

6 years agoFix bug where we wouldn't break columns over the limit.
Manuel Klimek [Mon, 4 Dec 2017 08:53:16 +0000 (08:53 +0000)]
Fix bug where we wouldn't break columns over the limit.

Before, we would not break:
  int a = foo(/* trailing */);
when the end of /* trailing */ was exactly the column limit; the reason
is that block comments can have an unbreakable tail length - in this case
2, for the trailing ");"; we would unconditionally account that when
calculating the column state at the end of the token, but not correctly
add it into the remaining column length before, as we do for string
literals.
The fix is to correctly account the trailing unbreakable sequence length
into our formatting decisions for block comments. Line comments cannot
have a trailing unbreakable sequence, so no change is needed for them.

llvm-svn: 319642

6 years ago[X86] Allow VPMAXUQ/VPMAXSQ/VPMINUQ/VPMINSQ to be used with 128/256 bit vectors when...
Craig Topper [Mon, 4 Dec 2017 07:21:01 +0000 (07:21 +0000)]
[X86] Allow VPMAXUQ/VPMAXSQ/VPMINUQ/VPMINSQ to be used with 128/256 bit vectors when AVX512 is enabled.

These instructions can be used by widening to 512-bits and extracting back to 128/256. We do similar to several other instructions already.

llvm-svn: 319641

6 years ago[X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering.
Craig Topper [Mon, 4 Dec 2017 05:38:44 +0000 (05:38 +0000)]
[X86] Don't turn UINT_TO_FP into SINT_TO_FP during lowering.

We already do this as a DAG combine. The version during lowering can only trigger if known bits changes something that improves known bits analysis. But this means we should be improving known bits analysis to work on the unlowered form instead.

llvm-svn: 319640

6 years ago[SelectionDAG] Teach computeKnownBits some improvements to ISD::SRL with a non-splat...
Craig Topper [Mon, 4 Dec 2017 05:38:42 +0000 (05:38 +0000)]
[SelectionDAG] Teach computeKnownBits some improvements to ISD::SRL with a non-splat constant shift amount.

If we have a non-splat constant shift amount, the minimum shift amount can be used to infer the number of zero upper bits of the result. There's probably a lot more that we can do here, but this
fixes a case where I wanted to infer the sign bit as zero when all the shift amounts are non-zero.

llvm-svn: 319639

6 years ago[analyzer] Don't treat lambda-captures float constexprs as undefined
Devin Coughlin [Mon, 4 Dec 2017 04:46:47 +0000 (04:46 +0000)]
[analyzer] Don't treat lambda-captures float constexprs as undefined

RegionStore has special logic to evaluate captured constexpr variables.
However, if the constexpr initializer cannot be evaluated as an integer, the
value is treated as undefined. This leads to false positives when, for example,
a constexpr float is captured by a lambda.

To fix this, treat a constexpr capture that cannot be evaluated as unknown
rather than undefined.

rdar://problem/35784662

llvm-svn: 319638

6 years ago[X86][AVX512] Tag PH2PS/PS2PH conversion instructions scheduler classes
Simon Pilgrim [Sun, 3 Dec 2017 21:43:54 +0000 (21:43 +0000)]
[X86][AVX512] Tag PH2PS/PS2PH conversion instructions scheduler classes

llvm-svn: 319637

6 years ago[X86][AVX512] Tag packed F2I/I2F/F2F conversion instructions scheduler class
Simon Pilgrim [Sun, 3 Dec 2017 21:16:12 +0000 (21:16 +0000)]
[X86][AVX512] Tag packed F2I/I2F/F2F conversion instructions scheduler class

llvm-svn: 319636

6 years ago[X86][AVX512] Regenerate schedule tests.
Simon Pilgrim [Sun, 3 Dec 2017 21:07:36 +0000 (21:07 +0000)]
[X86][AVX512] Regenerate schedule tests.

llvm-svn: 319635

6 years ago[X86][SSE] Remove unused IIC_SSE_CVT_PI2PS_RR/IIC_SSE_CVT_PI2PS_RM itineraries
Simon Pilgrim [Sun, 3 Dec 2017 20:57:04 +0000 (20:57 +0000)]
[X86][SSE] Remove unused IIC_SSE_CVT_PI2PS_RR/IIC_SSE_CVT_PI2PS_RM itineraries

llvm-svn: 319634

6 years ago[ASTImporter] Add unit tests for UsingDecl and UsingShadowDecl
Aleksei Sidorin [Sun, 3 Dec 2017 16:04:07 +0000 (16:04 +0000)]
[ASTImporter] Add unit tests for UsingDecl and UsingShadowDecl

Patch by Kareem Khazem!

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

llvm-svn: 319632

6 years agoCorrected a typo in the building libc++ docs
Hamza Sood [Sun, 3 Dec 2017 10:18:35 +0000 (10:18 +0000)]
Corrected a typo in the building libc++ docs

llvm-svn: 319631

6 years agoCodeGen: Fix SelectionDAGISel::LowerArguments for sret addr space
Yaxun Liu [Sun, 3 Dec 2017 03:31:45 +0000 (03:31 +0000)]
CodeGen: Fix SelectionDAGISel::LowerArguments for sret addr space

SelectionDAGISel::LowerArguments assumes sret addr space is 0, which is
not true for amdgcn---amdgiz target.

This patch fixes that.

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

llvm-svn: 319630

6 years agoRevert "[CodeGen] Add initial support for union members in TBAA"
Hal Finkel [Sun, 3 Dec 2017 03:10:13 +0000 (03:10 +0000)]
Revert "[CodeGen] Add initial support for union members in TBAA"

This reverts commit r319413. See PR35503.

We can't use "union member" as the access type here like this.

llvm-svn: 319629

6 years ago[SelectionDAG] Use the inlined APInt shift methods since we've already bounds checked...
Craig Topper [Sun, 3 Dec 2017 03:07:09 +0000 (03:07 +0000)]
[SelectionDAG] Use the inlined APInt shift methods since we've already bounds checked the shift.

The version that takes APInt is out of line. The 'unsigned' version optimizes for the common case of single word APInts.

llvm-svn: 319628

6 years agoReland "[WebAssembly] Add support for visibility flag""
Sam Clegg [Sun, 3 Dec 2017 02:38:04 +0000 (02:38 +0000)]
Reland "[WebAssembly] Add support for visibility flag""

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish

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

llvm-svn: 319627

6 years agoReland "[WebAssembly] Add visibility flag to Wasm symbol flags""
Sam Clegg [Sun, 3 Dec 2017 01:19:23 +0000 (01:19 +0000)]
Reland "[WebAssembly] Add visibility flag to Wasm symbol flags""

Original change was rL319488.

This was reverted rL319602 due to a gcc 7.1 warning.

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

llvm-svn: 319626

6 years agoFix typo in emitted attribute name
Matt Arsenault [Sun, 3 Dec 2017 00:03:01 +0000 (00:03 +0000)]
Fix typo in emitted attribute name

Fixes build when using this attribute combination
on an intrinsic.

llvm-svn: 319625

6 years ago[ValueTracking] Pass only a single lambda to computeKnownBitsFromShiftOperator by...
Craig Topper [Sat, 2 Dec 2017 23:42:17 +0000 (23:42 +0000)]
[ValueTracking] Pass only a single lambda to computeKnownBitsFromShiftOperator by using KnownBits struct instead of separate APInts. NFCI

llvm-svn: 319624

6 years ago[WebAssembly] Pass through --undefined to Wasm LLD
Sam Clegg [Sat, 2 Dec 2017 23:11:13 +0000 (23:11 +0000)]
[WebAssembly] Pass through --undefined to Wasm LLD

This is a follow-on to D40724 (Wasm entrypoint changes #1,
add `--undefined` argument to LLD).

Patch by Nicholas Wilson

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

llvm-svn: 319623

6 years agoCodeGen: Fix pointer info in SplitVecOp_EXTRACT_VECTOR_ELT/SplitVecRes_INSERT_VECTOR_ELT
Yaxun Liu [Sat, 2 Dec 2017 22:13:22 +0000 (22:13 +0000)]
CodeGen: Fix pointer info in SplitVecOp_EXTRACT_VECTOR_ELT/SplitVecRes_INSERT_VECTOR_ELT

Two issues found when doing codegen for splitting vector with non-zero alloca addr space:

DAGTypeLegalizer::SplitVecRes_INSERT_VECTOR_ELT/SplitVecOp_EXTRACT_VECTOR_ELT uses dummy pointer info for creating
SDStore. Since one pointer operand contains multiply and add, InferPointerInfo is unable to
infer the correct pointer info, which ends up with a dummy pointer info for the target to lower
store and results in isel failure. The fix is to introduce MachinePointerInfo::getUnknownStack to
represent MachinePointerInfo which is known in alloca address space but without other information.

TargetLowering::getVectorElementPointer uses value type of pointer in addr space 0 for
multiplication of index and then add it to the pointer. However the pointer may be in an addr
space which has different size than addr space 0. The fix is to use the pointer value type for
index multiplication.

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

llvm-svn: 319622

6 years agoFix assume-filename handling in clang-format.el
Philipp Stephani [Sat, 2 Dec 2017 21:18:14 +0000 (21:18 +0000)]
Fix assume-filename handling in clang-format.el

Summary:
When 'buffer-file-name' is nil 'call-process-region' returned a segmentation fault error.

This was a problem when using clang-format-buffer on an orgmode source code editing buffer.

I fixed this problem by excluding the '-assume-filename' argument when 'buffer-file-name' is nil.

To make it a bit more flexible I also added an optional argument, 'assume-file-name', to specify an assume-filename that overrides 'buffer-file-name'.

Reviewers: klimek, djasper, phst, phi

Reviewed By: phst, phi

Subscribers: phi, jholewinski, mgorny, javed.absar, eraman, cfe-commits

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

llvm-svn: 319621

6 years ago[cmake] Re-commit: Remove redundant call to cmake when building host tools.
Don Hinton [Sat, 2 Dec 2017 19:12:38 +0000 (19:12 +0000)]
[cmake] Re-commit: Remove redundant call to cmake when building host tools.

Also pass CMAKE_(C|CXX)_COMPILER to add_custom_command.

Summary:
Remove the redundant, config-time call to cmake when
building host tools for cross compiles or optimized tablegen..

The config-time call to cmake is redundant because it will always get
called again when the CONFIGURE_LLVM_${target_name} target fires at
build-time.  This speeds up initial configuration, but has no affect
on build behavior.

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

llvm-svn: 319620

6 years ago[CodeGen] fix mapping from fmod calls to frem instruction
Sanjay Patel [Sat, 2 Dec 2017 17:52:00 +0000 (17:52 +0000)]
[CodeGen] fix mapping from fmod calls to frem instruction

Similar to D40044 and discussed in D40594.

llvm-svn: 319619

6 years ago[CodeGen] remove stale comment; NFC
Sanjay Patel [Sat, 2 Dec 2017 16:29:34 +0000 (16:29 +0000)]
[CodeGen] remove stale comment; NFC

The libm functions with LLVM intrinsic twins were moved above this blob with:
https://reviews.llvm.org/rL319593

llvm-svn: 319618

6 years ago[llvm-readobj] Remove redundant local variables to reduce the code. NFC
Simon Atanasyan [Sat, 2 Dec 2017 13:06:40 +0000 (13:06 +0000)]
[llvm-readobj] Remove redundant local variables to reduce the code. NFC

llvm-svn: 319617

6 years ago[llvm-readobj] Print static MIPS GOT
Simon Atanasyan [Sat, 2 Dec 2017 13:06:35 +0000 (13:06 +0000)]
[llvm-readobj] Print static MIPS GOT

If a linked binary file contains a dynamic section, the GOT layout
defined by the dynamic section entries. In a statically linked file
the GOT is just a series of entries. This change teaches `llvm-readobj`
to print the GOT in that case. That provides a feature parity with GNU
`readelf`.

llvm-svn: 319616

6 years ago[llvm-readobj] Delete unused method argument. NFC
Simon Atanasyan [Sat, 2 Dec 2017 13:06:27 +0000 (13:06 +0000)]
[llvm-readobj] Delete unused method argument. NFC

llvm-svn: 319615

6 years ago[X86][SSE] Cleanup float/int conversion scheduler itinerary classes
Simon Pilgrim [Sat, 2 Dec 2017 12:27:44 +0000 (12:27 +0000)]
[X86][SSE] Cleanup float/int conversion scheduler itinerary classes

Makes it easier to grok where each is supposed to be used, mainly useful for adding to the AVX512 instructions but hopefully can be used more in SSE/AVX as well.

llvm-svn: 319614

6 years ago[X86] Fix copy paste mistake in test case for r319612.
Craig Topper [Sat, 2 Dec 2017 08:39:02 +0000 (08:39 +0000)]
[X86] Fix copy paste mistake in test case for r319612.

llvm-svn: 319613

6 years ago[X86] Teach the assembler to support %db8-%db15 as aliases for %dr8-%dr15.
Craig Topper [Sat, 2 Dec 2017 08:27:46 +0000 (08:27 +0000)]
[X86] Teach the assembler to support %db8-%db15 as aliases for %dr8-%dr15.

llvm-svn: 319612

6 years ago[X86] Support %dr8-%dr15 in the assembler.
Craig Topper [Sat, 2 Dec 2017 08:27:45 +0000 (08:27 +0000)]
[X86] Support %dr8-%dr15 in the assembler.

Apparently I failed to make this work when I fixed it in the disassembler way back in r224862.

llvm-svn: 319611

6 years agoCMAKE: help CheckAtomic find check_library_exists
Martell Malone [Sat, 2 Dec 2017 07:17:01 +0000 (07:17 +0000)]
CMAKE: help CheckAtomic find check_library_exists

lldb fails to build standalone on x86

-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Failed
CMake Error at CheckAtomic.cmake:66 (check_library_exists):
  Unknown CMake command "check_library_exists".
Call Stack (most recent call first):
  LLDBStandalone.cmake:90 (include)
CMakeLists.txt:3 (include)

Reviewed By: rnk

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

llvm-svn: 319610

6 years ago[ARC] Add instruction subset for the ARC backend.
Tatyana Krasnukha [Sat, 2 Dec 2017 05:25:17 +0000 (05:25 +0000)]
[ARC] Add instruction subset for the ARC backend.

Reviewers: petecoup, kparzysz

Reviewed By: petecoup

Subscribers: llvm-commits

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

llvm-svn: 319609

6 years ago[clangd] Avoid enum in bitfields, can't satisfy old GCC and new MSVC
Sam McCall [Sat, 2 Dec 2017 04:15:55 +0000 (04:15 +0000)]
[clangd] Avoid enum in bitfields, can't satisfy old GCC and new MSVC

llvm-svn: 319608

6 years ago[DAG][AArch64] Disable post-legalization store
Nirav Dave [Sat, 2 Dec 2017 04:01:26 +0000 (04:01 +0000)]
[DAG][AArch64] Disable post-legalization store

Disable post-legalization store for AArch64 backend which is causing
errors out-of-tree.

llvm-svn: 319607

6 years ago[clangd] Fix FuzzyMatch tests on windows, NFC
Sam McCall [Sat, 2 Dec 2017 03:35:19 +0000 (03:35 +0000)]
[clangd] Fix FuzzyMatch tests on windows, NFC

Without specifying the signedness of the underlying type for Action,
packing it in a 1-bit field may restrict its range to [-1, 0] which
can't represent Match.

llvm-svn: 319606

6 years agoPR35456: Track definedness of variable template specializations separately from
Richard Smith [Sat, 2 Dec 2017 02:48:42 +0000 (02:48 +0000)]
PR35456: Track definedness of variable template specializations separately from
whether they have an initializer.

We cannot distinguish between a declaration of a variable template
specialization and a definition of one that lacks an initializer without this,
and would previously mistake the latter for the former.

llvm-svn: 319605

6 years ago[clangd] Try to appease gcc constexpr bug (58541)
Sam McCall [Sat, 2 Dec 2017 02:28:29 +0000 (02:28 +0000)]
[clangd] Try to appease gcc constexpr bug (58541)

llvm-svn: 319604

6 years ago[WebAssembly] Revert r319592 "Add support for visibility flag"
Heejin Ahn [Sat, 2 Dec 2017 02:05:50 +0000 (02:05 +0000)]
[WebAssembly] Revert r319592 "Add support for visibility flag"

r319488 reportedly broke one of LLVM bots (ubuntu-gcc7.1-werror), and this patch
depends on that patch.
See http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3369 for
details.

llvm-svn: 319603

6 years ago[WebAssembly] Revert r319488 "Add visibility flag to Wasm symbol flags"
Heejin Ahn [Sat, 2 Dec 2017 02:05:06 +0000 (02:05 +0000)]
[WebAssembly] Revert r319488 "Add visibility flag to Wasm symbol flags"

This patch reportedly broke one of LLVM bots (ubuntu-gcc7.1-werror).

See http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3369 for
details.

llvm-svn: 319602

6 years agoMove comment back to being next to the code it's a comment for.
Richard Smith [Sat, 2 Dec 2017 00:55:48 +0000 (00:55 +0000)]
Move comment back to being next to the code it's a comment for.

llvm-svn: 319601

6 years agoCache modulo values for the .gnu.hash section.
Rui Ueyama [Sat, 2 Dec 2017 00:37:13 +0000 (00:37 +0000)]
Cache modulo values for the .gnu.hash section.

This change actually makes the linker slightly faster. My observation
is that, with this patch, link time of clang without debug is about 1%
faster.

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

llvm-svn: 319600

6 years agoAdd a symbols subcommand to lldb-test.
Zachary Turner [Sat, 2 Dec 2017 00:15:29 +0000 (00:15 +0000)]
Add a symbols subcommand to lldb-test.

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

llvm-svn: 319599

6 years agoDon't use llvm::EnablePrettyStackTrace on macOS.
Jim Ingham [Sat, 2 Dec 2017 00:11:18 +0000 (00:11 +0000)]
Don't use llvm::EnablePrettyStackTrace on macOS.

LLDB.framework gets loaded into Xcode and other
frameworks, and this is inserting a signal handler into
the process even when lldb isn't used.  I have a bunch
of reports of this SignalHandler blowing out the stack,
which renders crash reports for the crash useless.

And in any case libraries really shouldn't be installing
signal handlers.

I only turned this off for APPLE platforms, I'll let
the maintainers of other platforms decide what policy
they want to have w.r.t. this.

llvm-svn: 319598

6 years agoFix warning in DynamicLoaderDarwinKernel.cpp, NFC
Vedant Kumar [Fri, 1 Dec 2017 23:53:01 +0000 (23:53 +0000)]
Fix warning in DynamicLoaderDarwinKernel.cpp, NFC

llvm-svn: 319597

6 years agoFix warnings in JSON.cpp, NFC
Vedant Kumar [Fri, 1 Dec 2017 23:29:04 +0000 (23:29 +0000)]
Fix warnings in JSON.cpp, NFC

These asserts are no-ops, and are supplanted by -Wcovered-switch.

llvm-svn: 319596

6 years agoFix warnings in DNBDataRef.cpp, NFC
Vedant Kumar [Fri, 1 Dec 2017 23:24:12 +0000 (23:24 +0000)]
Fix warnings in DNBDataRef.cpp, NFC

llvm-svn: 319595

6 years ago[AST] Try to fix build bot with modules broken r319589. However real fix may belong...
Eugene Zelenko [Fri, 1 Dec 2017 23:23:28 +0000 (23:23 +0000)]
[AST] Try to fix build bot with modules broken r319589. However real fix may belong to other place.

llvm-svn: 319594

6 years ago[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics
Sanjay Patel [Fri, 1 Dec 2017 23:15:52 +0000 (23:15 +0000)]
[CodeGen] convert math libcalls/builtins to equivalent LLVM intrinsics

There are 20 LLVM math intrinsics that correspond to mathlib calls according to the LangRef:
http://llvm.org/docs/LangRef.html#standard-c-library-intrinsics

We were only converting 3 mathlib calls (sqrt, fma, pow) and 12 builtin calls (ceil, copysign,
fabs, floor, fma, fmax, fmin, nearbyint, pow, rint, round, trunc) to their intrinsic-equivalents.

This patch pulls the transforms together and handles all 20 cases. The switch is guarded by a
check for const-ness to make sure we're not doing the transform if errno could possibly be set by
the libcall or builtin.

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

llvm-svn: 319593

6 years ago[WebAssembly] Add support for visibility flag
Sam Clegg [Fri, 1 Dec 2017 22:37:25 +0000 (22:37 +0000)]
[WebAssembly] Add support for visibility flag

Patch by Nicholas Wilson

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

llvm-svn: 319592

6 years agoRevert "[X86] Improvement in CodeGen instruction selection for LEAs."
Matt Morehouse [Fri, 1 Dec 2017 22:20:26 +0000 (22:20 +0000)]
Revert "[X86] Improvement in CodeGen instruction selection for LEAs."

This reverts r319543, due to ASan bot breakage.

llvm-svn: 319591

6 years ago[libFuzzer] add a flag -malloc_limit_mb
Kostya Serebryany [Fri, 1 Dec 2017 22:12:04 +0000 (22:12 +0000)]
[libFuzzer] add a flag -malloc_limit_mb

llvm-svn: 319590

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 1 Dec 2017 22:04:49 +0000 (22:04 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 319589

6 years ago[MachineOutliner] NFC: Throw out self-intersections on candidates early
Jessica Paquette [Fri, 1 Dec 2017 21:56:56 +0000 (21:56 +0000)]
[MachineOutliner] NFC: Throw out self-intersections on candidates early

Currently, the outliner considers candidates that intersect with themselves in
the candidate pruning step. That is, candidates of the form "AA" in ranges like
"AAAAAA". In that range, it looks like there are 5 instances of "AA" that could
possibly be outlined, and that's considered in the benefit calculation.

However, only at most 3 instances of "AA" could ever be outlined in "AAAAAA".
Thus, it's possible to pass through "AA" to the candidate selection step even
though it's *never* the case that "AA" could be outlined. This makes it so that
when we find candidates, we consider only non-overlapping occurrences of that
candidate.

llvm-svn: 319588

6 years ago[DAG][ARM] Revert "Reenable post-legalize store merge"
Nirav Dave [Fri, 1 Dec 2017 21:55:47 +0000 (21:55 +0000)]
[DAG][ARM] Revert "Reenable post-legalize store merge"

due to failures in AArch and ARM code gen.

llvm-svn: 319587

6 years ago[MC] Handle unknown literal register numbers in .cfi_* directives
Jake Ehrlich [Fri, 1 Dec 2017 21:44:27 +0000 (21:44 +0000)]
[MC] Handle unknown literal register numbers in .cfi_* directives

r230670 introduced a step to map EH register numbers to standard
DWARF register numbers. This failed to consider the case when a
user .cfi_* directive uses an integer literal rather than a
register name, to specify a DWARF register number that has no
corresponding LLVM register number (e.g. a special register that
the compiler and assembler have no name for).

Fixes PR34028.

Patch by Roland McGrath

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

llvm-svn: 319586

6 years ago[OPENMP] Emit `__tgt_target_teams` for all teams directives.
Alexey Bataev [Fri, 1 Dec 2017 21:31:08 +0000 (21:31 +0000)]
[OPENMP] Emit `__tgt_target_teams` for all teams directives.

Previously we emitted `__tgt_target_teams` only for standalone teams
directives. This patch allows emit this function for all teams-based
directives.

llvm-svn: 319585

6 years ago[c++17] When deducing the type of a non-type template parameter from the type
Richard Smith [Fri, 1 Dec 2017 21:24:36 +0000 (21:24 +0000)]
[c++17] When deducing the type of a non-type template parameter from the type
of its argument, perform function-to-pointer and array-to-pointer decay on the
parameter type first.

Otherwise deduction will fail, as the type of the argument will be decayed.

llvm-svn: 319584

6 years ago[IndVars] Fix a bug introduced in r317012
Philip Reames [Fri, 1 Dec 2017 20:57:19 +0000 (20:57 +0000)]
[IndVars] Fix a bug introduced in r317012

Turns out we can have comparisons which are indirect users of the induction variable that we can make invariant.  In this case, there is no loop invariant value contributing and we'd fail an assert.

The test case was found by a java fuzzer and reduced.  It's a real cornercase.  You have to have a static loop which we've already proven only executes once, but haven't broken the backedge on, and an inner phi whose result can be constant folded by SCEV using exit count reasoning but not proven by isKnownPredicate.  To my knowledge, only the fuzzer has hit this case.

llvm-svn: 319583

6 years ago[cmake] Revert (rL319574): Resubmit Remove redundant call to cmake when building...
Don Hinton [Fri, 1 Dec 2017 20:46:45 +0000 (20:46 +0000)]
[cmake] Revert (rL319574): Resubmit Remove redundant call to cmake when building host tools.

Still fails for some bots.

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

llvm-svn: 319582

6 years ago[opt-remarks] If hotness threshold is set, ignore remarks without hotness
Adam Nemet [Fri, 1 Dec 2017 20:41:38 +0000 (20:41 +0000)]
[opt-remarks] If hotness threshold is set, ignore remarks without hotness

These are blocks that haven't not been executed during training.  For large
projects this could make a significant difference.  For the project, I was
looking at, I got an order of magnitude decrease in the size of the total YAML
files with this and r319235.

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

Re-commit after fixing the failing testcase in rL319576, rL319577 and
rL319578.

llvm-svn: 319581

6 years agoPrevent vain lldb::user_id_t 0xffffffff lookups
Jan Kratochvil [Fri, 1 Dec 2017 20:14:09 +0000 (20:14 +0000)]
Prevent vain lldb::user_id_t 0xffffffff lookups

I have found LLDB commonly looks up lldb::user_id_t 0xffffffff failing to find
its DIE. One would rather expect LLDB_INVALID_UID == 0xffffffffffffffff in such
case.

DWARFASTParserClang.cpp:495
492             type_sp.reset(
493                 new Type(die.GetID(), dwarf, type_name_const_str, byte_size, NULL,
494                          DIERef(encoding_uid).GetUID(dwarf), encoding_data_type,
495                          &decl, clang_type, resolve_state));
encoding_uid = (DWARFFormValue) {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}}
-> DIERef::DIERef(const DWARFFormValue &form_value = {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}})
-> (DIERef) {cu_offset = 0xffffffff, die_offset = 0xffffffff}
-> lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf = 0x61d00000b480) const
-> Type::Type(lldb::user_id_t encoding_uid = 0xffffffff)
But 0xffffffff !=
#define LLDB_INVALID_UID UINT64_MAX

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

llvm-svn: 319580

6 years ago[clangd] Define constants in the right namespace. NFC
Sam McCall [Fri, 1 Dec 2017 20:03:19 +0000 (20:03 +0000)]
[clangd] Define constants in the right namespace. NFC

llvm-svn: 319579

6 years agoFix the second part of the broken comment from r306079
Adam Nemet [Fri, 1 Dec 2017 19:59:45 +0000 (19:59 +0000)]
Fix the second part of the broken comment from r306079

The driver-based test is still not identical to the front-end line, remove the
hotness threshold from there and add a new front-end based test with
threshold.

llvm-svn: 319578

6 years agoFix opt-remark with hotness testcase for sample-based PGO
Adam Nemet [Fri, 1 Dec 2017 19:59:42 +0000 (19:59 +0000)]
Fix opt-remark with hotness testcase for sample-based PGO

1. Require hotness on all remark lines with -verify.

3. Fix the samplePGO file to actually produce hotness on each line.

The second remark has hotness 60 rather 30 which I don't quite understand but
testing this is strictly better than before.  It also unblocks the commit of
D40678.

llvm-svn: 319577

6 years agoPartially fix comment in test broken in r306079 and r306948
Adam Nemet [Fri, 1 Dec 2017 19:59:37 +0000 (19:59 +0000)]
Partially fix comment in test broken in r306079 and r306948

A RUN line was referring to the previous RUN line but a new test was added in
between them.  Just reorder the lines.

Note this still does not completely fix this the brokenness of the comment as
the driver-based test gained a new hotness-threshold argument in r306948 but
I'll fix that is a separate commit.

llvm-svn: 319576

6 years ago[ubsan] Re-commit: lit changes for lld testing, future lto testing.
Roman Lebedev [Fri, 1 Dec 2017 19:36:29 +0000 (19:36 +0000)]
[ubsan] Re-commit: lit changes for lld testing, future lto testing.

Summary:
As discussed in https://github.com/google/oss-fuzz/issues/933,
it would be really awesome to be able to use ThinLTO for fuzzing.
However, as @kcc has pointed out, it is currently undefined (untested)
whether the sanitizers actually function properly with LLD and/or LTO.

This patch is inspired by the cfi test, which already do test with LTO
(and/or LLD), since LTO is required for CFI to function.

I started with UBSan, because it's cmakelists / lit.* files appeared
to be the cleanest. This patch adds the infrastructure to easily add
LLD and/or LTO sub-variants of the existing lit test configurations.

Also, this patch adds the LLD flavor, that explicitly does use LLD to link.
The check-ubsan does pass on my machine. And to minimize the [initial]
potential buildbot breakage i have put some restrictions on this flavour.

Please review carefully, i have not worked with lit/sanitizer tests before.

The original attempt, r319525 was reverted in r319526 due
to the failures in compiler-rt standalone builds.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc

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

llvm-svn: 319575

6 years ago[cmake] Resubmit Remove redundant call to cmake when building host tools.
Don Hinton [Fri, 1 Dec 2017 19:35:56 +0000 (19:35 +0000)]
[cmake] Resubmit Remove redundant call to cmake when building host tools.

Only pass Native to LLVM_TARGETS_TO_BUILD.

Summary:
Remove the redundant, config-time call to cmake when
building host tools for cross compiles or optimized tablegen..

The config-time call to cmake is redundant because it will always get
called again when the CONFIGURE_LLVM_${target_name} target fires at
build-time.  This speeds up initial configuration, but has no affect
on build behavior.

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

llvm-svn: 319574

6 years ago[DAGCombine] Simplify ISD::AND handling in ReduceLoadWidth
Eli Friedman [Fri, 1 Dec 2017 19:33:56 +0000 (19:33 +0000)]
[DAGCombine] Simplify ISD::AND handling in ReduceLoadWidth

Followup to D39595. Removes a bunch of redundant checks.

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

llvm-svn: 319573

6 years ago[libFuzzer] remove stale flags; NFC
Kostya Serebryany [Fri, 1 Dec 2017 19:24:06 +0000 (19:24 +0000)]
[libFuzzer] remove stale flags; NFC

llvm-svn: 319572

6 years ago[libFuzzer] add an experimental search heuristic flag -reduce_depth
Kostya Serebryany [Fri, 1 Dec 2017 19:18:38 +0000 (19:18 +0000)]
[libFuzzer] add an experimental search heuristic flag -reduce_depth

llvm-svn: 319571

6 years ago[compiler-rt] Remove out of date comment
Shoaib Meenai [Fri, 1 Dec 2017 19:06:30 +0000 (19:06 +0000)]
[compiler-rt] Remove out of date comment

Per beanz, building compiler-rt standalone is a pretty important use
case, so the comment is very out of date.

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

llvm-svn: 319570

6 years ago[compiler-rt] Add install-*-stripped targets
Shoaib Meenai [Fri, 1 Dec 2017 19:06:29 +0000 (19:06 +0000)]
[compiler-rt] Add install-*-stripped targets

These targets strip during installation, and are required to support
install-distribution-stripped in LLVM (to support a stripped
distribution). LLVM has an add_llvm_install_targets function for this
purpose, but we can't rely on LLVM being present.

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

llvm-svn: 319569

6 years ago[X86][AVX512] Tag subvector extract/insert instructions scheduler classes
Simon Pilgrim [Fri, 1 Dec 2017 18:40:32 +0000 (18:40 +0000)]
[X86][AVX512] Tag subvector extract/insert instructions scheduler classes

llvm-svn: 319568

6 years ago[IR] Avoid dangling else warning. NFC.
Benjamin Kramer [Fri, 1 Dec 2017 18:39:58 +0000 (18:39 +0000)]
[IR] Avoid dangling else warning. NFC.

llvm-svn: 319567

6 years agoIR printing improvement for loop passes - handle -print-module-scope
Fedor Sergeev [Fri, 1 Dec 2017 18:33:58 +0000 (18:33 +0000)]
IR printing improvement for loop passes - handle -print-module-scope

Summary:
Adding support for -print-module-scope similar to how it is
being done for function passes. This option causes loop-pass printer
to emit a whole-module IR instead of just a loop itself.

Reviewers: sanjoy, silvas, weimingz

Reviewed By: sanjoy

Subscribers: apilipenko, skatkov, llvm-commits

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

llvm-svn: 319566

6 years agoAdd test for pr35478.
Rafael Espindola [Fri, 1 Dec 2017 18:28:12 +0000 (18:28 +0000)]
Add test for pr35478.

This would have found the regression in r318924.

Thanks to James Henderson for finding the issue!

llvm-svn: 319565