platform/upstream/llvm.git
7 years ago[X86][SSE] Dropped -mcpu from bitcast+setcc tests
Simon Pilgrim [Thu, 6 Jul 2017 18:27:34 +0000 (18:27 +0000)]
[X86][SSE] Dropped -mcpu from bitcast+setcc tests

Use triple and attribute only for consistency

Added SSE2/AVX tests on 256-bit vectors to test PACKSS behaviour

llvm-svn: 307289

7 years agoFix spelling in comments. NFCI.
Simon Pilgrim [Thu, 6 Jul 2017 18:17:07 +0000 (18:17 +0000)]
Fix spelling in comments. NFCI.

llvm-svn: 307288

7 years agoWorking through testcases, converting to run_to_source_breakpoint.
Jim Ingham [Thu, 6 Jul 2017 18:06:25 +0000 (18:06 +0000)]
Working through testcases, converting to run_to_source_breakpoint.

llvm-svn: 307287

7 years agoBitcode: Include any strings added to the string table in the module hash.
Peter Collingbourne [Thu, 6 Jul 2017 17:56:01 +0000 (17:56 +0000)]
Bitcode: Include any strings added to the string table in the module hash.

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

llvm-svn: 307286

7 years ago[opt-viewer] Move under tools, install it
Adam Nemet [Thu, 6 Jul 2017 17:51:15 +0000 (17:51 +0000)]
[opt-viewer] Move under tools, install it

We weren't installing opt-viewer and co before, this fixes the omission.  I am
also moving the tools from utils/ to tools/.  I believe that this is more
appropriate since these tools have matured greatly in the past year through
contributions by multiple people (thanks!) so they are ready to become
external tools.

The tools are installed under <install>/share/opt-viewer/.

I am *not* adding the llvm- prefix.  If people feel strongly about adding
that, this is probably a good time since the new location will require some
mental adjustment anyway.

Fixes PR33521

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

llvm-svn: 307285

7 years agoMore fixup for r307281: Move the #includes to sanitizer_linux.cc
Kuba Mracek [Thu, 6 Jul 2017 17:45:01 +0000 (17:45 +0000)]
More fixup for r307281: Move the #includes to sanitizer_linux.cc

llvm-svn: 307284

7 years agoFixup for r307281: Also move GetKernelAreaSize into sanitizer_linux.cc
Kuba Mracek [Thu, 6 Jul 2017 17:17:50 +0000 (17:17 +0000)]
Fixup for r307281:  Also move GetKernelAreaSize into sanitizer_linux.cc

llvm-svn: 307282

7 years ago[sanitizer] Split GetMaxVirtualAddress into separate Linux version and Mac version...
Kuba Mracek [Thu, 6 Jul 2017 17:13:40 +0000 (17:13 +0000)]
[sanitizer] Split GetMaxVirtualAddress into separate Linux version and Mac version [NFC]

The logic in GetMaxVirtualAddress is already pretty complex, and I want to get rid of the hardcoded value for iOS/AArch64, which would need adding more Darwin-specific code, so let's split the implementation into sanitizer_linux.cc and sanitizer_mac.cc files. NFC.

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

llvm-svn: 307281

7 years agoFix pdb-scopes.test
Reid Kleckner [Thu, 6 Jul 2017 16:41:15 +0000 (16:41 +0000)]
Fix pdb-scopes.test

llvm-svn: 307280

7 years agoRemove redundant argument. NFC.
Rafael Espindola [Thu, 6 Jul 2017 16:40:44 +0000 (16:40 +0000)]
Remove redundant argument. NFC.

llvm-svn: 307279

7 years ago[PDB] Fill in "Parent" and "End" fields of scope-like symbol records
Reid Kleckner [Thu, 6 Jul 2017 16:39:32 +0000 (16:39 +0000)]
[PDB] Fill in "Parent" and "End" fields of scope-like symbol records

Summary:
There are a variety of records that open scopes: function scopes, block
scopes, and inlined call site scopes. These symbol records contain
Parent and End fields with the offsets of other symbol records. The End
field contains the offset of the matching S_END or S_INLINESITE_END
record. The Parent field contains the offset of the parent record, or 0
if this is a top-level scope (i.e. a function).

With this change, `llvm-pdbutil pretty -all` no longer crashes on PDBs
produced by LLD. I haven't tried a real debugger yet.

Reviewers: zturner, ruiu

Subscribers: llvm-commits

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

llvm-svn: 307278

7 years agoThis reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
Sjoerd Meijer [Thu, 6 Jul 2017 16:37:31 +0000 (16:37 +0000)]
This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
problems in testing, see comments in D34161 for some more details.
A fix is in progres in D35011, but a revert seems better now as the fix will
probably take some more time to land.

llvm-svn: 307277

7 years ago[SimplifyCFG] Move a portion of an if statement that should already be implied to...
Craig Topper [Thu, 6 Jul 2017 16:29:43 +0000 (16:29 +0000)]
[SimplifyCFG]  Move a portion of an if statement that should already be implied to an assert

Summary: In this code we got to Dom by following the predecessor link of BB. So it stands to reason that BB should also show up as a successor of Dom's terminator right? There isn't a way to have the CFG connect in only one direction is there?

Reviewers: jmolloy, davide, mcrosier

Reviewed By: mcrosier

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 307276

7 years ago[InstCombine] Change helper method to a file local static method. NFC
Craig Topper [Thu, 6 Jul 2017 16:24:23 +0000 (16:24 +0000)]
[InstCombine] Change helper method to a file local static method. NFC

llvm-svn: 307275

7 years ago[InstCombine] Clarify comment to mention other transform that it does. NFC
Craig Topper [Thu, 6 Jul 2017 16:24:22 +0000 (16:24 +0000)]
[InstCombine] Clarify comment to mention other transform that it does. NFC

llvm-svn: 307274

7 years ago[InstCombine] Add single use checks to SimplifyBSwap to ensure we are really saving...
Craig Topper [Thu, 6 Jul 2017 16:24:21 +0000 (16:24 +0000)]
[InstCombine] Add single use checks to SimplifyBSwap to ensure we are really saving instructions

Bswap isn't a simple operation so we need to make sure we are really removing a call to it before doing these simplifications.

For the case when both LHS and RHS are bswaps I've allowed it to be moved if either LHS or RHS has a single use since that at least allows us to move it later where it might find another bswap to combine with and it decreases the use count on the other side so maybe the other user can be optimized.

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

llvm-svn: 307273

7 years ago[OpenMP] Extend CLANG target options with device offloading kind.
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:22:21 +0000 (16:22 +0000)]
[OpenMP] Extend CLANG target options with device offloading kind.

Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld

Reviewed By: hfinkel

Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits

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

llvm-svn: 307272

7 years ago[OpenMP] Customize CUDA-based tool chain selection
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:08:15 +0000 (16:08 +0000)]
[OpenMP] Customize CUDA-based tool chain selection

Summary: This patch provides a generic way of selecting CUDA based tool chains as host-device pairs.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: Hahnfeld

Subscribers: rengolin, cfe-commits

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

llvm-svn: 307271

7 years ago[InstCombine] Don't create extra ConstantInt objects in foldSelectICmpAnd. NFCI
Craig Topper [Thu, 6 Jul 2017 15:58:54 +0000 (15:58 +0000)]
[InstCombine] Don't create extra ConstantInt objects in foldSelectICmpAnd. NFCI

Instead just use APInt objects and only create a ConstantInt at the end if we need it for the Offset.

llvm-svn: 307270

7 years ago[LSR] Narrow search space by filtering non-optimal formulae with the same ScaledReg...
Wei Mi [Thu, 6 Jul 2017 15:52:14 +0000 (15:52 +0000)]
[LSR] Narrow search space by filtering non-optimal formulae with the same ScaledReg and Scale.

When the formulae search space is huge, LSR uses a series of heuristic to keep
pruning the search space until the number of possible solutions are within
certain limit.

The big hammer of the series of heuristics is NarrowSearchSpaceByPickingWinnerRegs,
which picks the register which is used by the most LSRUses and deletes the other
formulae which don't use the register. This is a effective way to prune the search
space, but quite often not a good way to keep the best solution. We saw cases before
that the heuristic pruned the best formula candidate out of search space.

To relieve the problem, we introduce a new heuristic called
NarrowSearchSpaceByFilterFormulaWithSameScaledReg. The basic idea is in order to
reduce the search space while keeping the best formula, we want to keep as many
formulae with different Scale and ScaledReg as possible. That is because the central
idea of LSR is to choose a group of loop induction variables and use those induction
variables to represent LSRUses. An induction variable candidate is often represented
by the Scale and ScaledReg in a formula. If we have more formulae with different
ScaledReg and Scale to choose, we have better opportunity to find the best solution.
That is why we believe pruning search space by only keeping the best formula with the
same Scale and ScaledReg should be more effective than PickingWinnerReg. And we use
two criteria to choose the best formula with the same Scale and ScaledReg. The first
criteria is to select the formula using less non shared registers, and the second
criteria is to select the formula with less cost got from RateFormula. The patch
implements the heuristic before NarrowSearchSpaceByPickingWinnerRegs, which is the
last resort.

Testing shows we get 1.8% and 2% on two internal benchmarks on x86. llvm nightly
testsuite performance is neutral. We also tried lsr-exp-narrow and it didn't help
on the two improved internal cases we saw.

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

llvm-svn: 307269

7 years ago[X86][SSE4A] Add support for shuffle combining to INSERTQI.
Simon Pilgrim [Thu, 6 Jul 2017 15:34:17 +0000 (15:34 +0000)]
[X86][SSE4A] Add support for shuffle combining to INSERTQI.

llvm-svn: 307268

7 years ago[CGP, x86] update test checks; NFC
Sanjay Patel [Thu, 6 Jul 2017 15:31:38 +0000 (15:31 +0000)]
[CGP, x86] update test checks; NFC

This was auto-generated using an older version of the script,
and that version does not work with phis, so if we enable
expansion it will go bad.

llvm-svn: 307267

7 years agoAdd a test harness
Jonathan Roelofs [Thu, 6 Jul 2017 15:20:12 +0000 (15:20 +0000)]
Add a test harness

Mostly cargo-culted from libcxxabi, since the unwinder was forked from there in
the first place. There may still be cruft that's only applicable to libcxxabi,
but that can be addressed in-tree.

https://reviews.llvm.org/D35038

llvm-svn: 307266

7 years ago[X86][SSE4A] Add test showing missed opportunities to combine INSERTQI shuffle
Simon Pilgrim [Thu, 6 Jul 2017 14:52:24 +0000 (14:52 +0000)]
[X86][SSE4A] Add test showing missed opportunities to combine INSERTQI shuffle

llvm-svn: 307265

7 years ago[clang-format] Add TextProto language name, NFC
Krasimir Georgiev [Thu, 6 Jul 2017 14:39:39 +0000 (14:39 +0000)]
[clang-format] Add TextProto language name, NFC

llvm-svn: 307264

7 years agoDoxygen formatting. NFCI
Joel Jones [Thu, 6 Jul 2017 14:17:36 +0000 (14:17 +0000)]
Doxygen formatting. NFCI

llvm-svn: 307263

7 years ago[x86] fix over-specified triple and auto-generate checks; NFC
Sanjay Patel [Thu, 6 Jul 2017 14:15:15 +0000 (14:15 +0000)]
[x86] fix over-specified triple and auto-generate checks; NFC

llvm-svn: 307262

7 years ago[clang-format] Add space between a message field key and the opening bracket in proto...
Krasimir Georgiev [Thu, 6 Jul 2017 13:58:29 +0000 (13:58 +0000)]
[clang-format] Add space between a message field key and the opening bracket in proto messages

Summary:
This patch updates the formatting of message fields of type `a{...}` to `a {...}`
for proto messages.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 307261

7 years ago[Polly] [PPCGCodeGeneration] Teach `must_kills` to kill scalars that are local to...
Siddharth Bhat [Thu, 6 Jul 2017 13:42:42 +0000 (13:42 +0000)]
[Polly] [PPCGCodeGeneration] Teach `must_kills` to kill scalars that are local to the scop.

- By definition, we can pass something as a `kill` to PPCG if we know
that no data can flow across a kill.
- This is useful for more complex examples where we have scalars that
are local to a scop.
- If the local is only used within a scop, we are free to kill it.

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

llvm-svn: 307260

7 years ago[MachineVerifier] Add check that tied physregs aren't different.
Mikael Holmen [Thu, 6 Jul 2017 13:18:21 +0000 (13:18 +0000)]
[MachineVerifier] Add check that tied physregs aren't different.

Summary: Added MachineVerifier code to check register ties more thoroughly, especially so that physical registers that are tied are the same. This may help e.g. when creating MIR files.

Original patch by Jesper Antonsson

Reviewers: stoklund, sanjoy, qcolombet

Reviewed By: qcolombet

Subscribers: qcolombet, llvm-commits

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

llvm-svn: 307259

7 years agoFixes to Dockerfile scripts.
Ilya Biryukov [Thu, 6 Jul 2017 13:10:55 +0000 (13:10 +0000)]
Fixes to Dockerfile scripts.

- Put buildfiles into /tmp/clang-build/build, instead of /tmp/clang-build.
  We checkout the sources to /tmp/clang-build/src and running
  cmake in /tmp/clang-build was done by mistake.
- Don't add an extra ';' at the start of enabled projects list.
  It worked either way, but looked strange.
- Minor comment update.

llvm-svn: 307258

7 years ago[X86][SSE] combineX86ShuffleChain - merge duplicate creations of integer mask types
Simon Pilgrim [Thu, 6 Jul 2017 13:09:19 +0000 (13:09 +0000)]
[X86][SSE] combineX86ShuffleChain - merge duplicate creations of integer mask types

llvm-svn: 307257

7 years agoMade a script to build docker images easier to use.
Ilya Biryukov [Thu, 6 Jul 2017 12:46:51 +0000 (12:46 +0000)]
Made a script to build docker images easier to use.

Summary:
- Removed double indirection via command-line args (i.e. two `--`
  options of `build_docker_image.sh`).
- Added a comment on how to build 2-stage clang install into the
  `build_docker_image.sh`, it used to be only in the `docs/Docker.rst`.

Reviewers: klimek, mehdi_amini

Reviewed By: klimek

Subscribers: llvm-commits

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

llvm-svn: 307256

7 years ago[X86][SSE] combineX86ShuffleChain - merge duplicate 'Zeroable' element masks
Simon Pilgrim [Thu, 6 Jul 2017 12:40:10 +0000 (12:40 +0000)]
[X86][SSE] combineX86ShuffleChain - merge duplicate 'Zeroable' element masks

llvm-svn: 307255

7 years ago[X86][SSE4A] Add support for shuffle combining to EXTRQ.
Simon Pilgrim [Thu, 6 Jul 2017 12:22:58 +0000 (12:22 +0000)]
[X86][SSE4A] Add support for shuffle combining to EXTRQ.

llvm-svn: 307254

7 years agoFix a copy-paste error in r307161
Pavel Labath [Thu, 6 Jul 2017 11:43:25 +0000 (11:43 +0000)]
Fix a copy-paste error in r307161

llvm-svn: 307253

7 years agoRevert "Android.rules: build x86 tests with -mstackrealign"
Pavel Labath [Thu, 6 Jul 2017 11:43:20 +0000 (11:43 +0000)]
Revert "Android.rules: build x86 tests with -mstackrealign"

Starting with android ndk r15, clang much more tests are affected by the
-mstackrealign bugl (now nearly all functions are affected, and not just
the ones requiring 16-byte alignment). Due to their numbers, Xfailing
all of them is not a viable option, so we will just have to declare this
configuration unsupported, and wait until ndk ships a clang version that
has this bug fixed.

llvm-svn: 307252

7 years ago[X86][SSE4A] Add scheduling tests for SSE4A instructions
Simon Pilgrim [Thu, 6 Jul 2017 11:26:43 +0000 (11:26 +0000)]
[X86][SSE4A] Add scheduling tests for SSE4A instructions

llvm-svn: 307251

7 years ago[X86][SSE4A] Split EXTRQ/INSERTQ shuffle matching from lowering. NFCI.
Simon Pilgrim [Thu, 6 Jul 2017 11:06:54 +0000 (11:06 +0000)]
[X86][SSE4A] Split EXTRQ/INSERTQ shuffle matching from lowering. NFCI.

First step toward supporting shuffle combining to EXTRQ/INSERTQ.

llvm-svn: 307250

7 years agoRevert "Revert "Revert "[IndVars] Canonicalize comparisons between non-negative value...
Max Kazantsev [Thu, 6 Jul 2017 10:47:13 +0000 (10:47 +0000)]
Revert "Revert "Revert "[IndVars] Canonicalize comparisons between non-negative values and indvars"""

It appears that the problem is still there. Needs more analysis to understand why
SaturatedMultiply test fails.

llvm-svn: 307249

7 years ago[globalisel][tablegen] Rename and re-comment render functions to match the new MatchT...
Daniel Sanders [Thu, 6 Jul 2017 10:37:17 +0000 (10:37 +0000)]
[globalisel][tablegen] Rename and re-comment render functions to match the new MatchTables. NFC.

The conversion to MatchTable left the function names and comments referring to
C++ statements and expressions. Updated the names and comments to account for
the fact that they're no longer unconstrained statements/expressions.

llvm-svn: 307248

7 years ago[RegisterCoalescer] Fix for SubRange join unreachable
David Stuttard [Thu, 6 Jul 2017 10:07:57 +0000 (10:07 +0000)]
[RegisterCoalescer] Fix for SubRange join unreachable

Summary:
During remat, some subranges might end up having invalid segments which caused problems for later
coalescing.

Added in a check to remove segments that are invalidated as part of the remat.

See http://llvm.org/PR33524

Subscribers: MatzeB, qcolombet

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

llvm-svn: 307247

7 years ago[globalisel][tablegen] Rename and re-comment to match the new MatchTables. NFC.
Daniel Sanders [Thu, 6 Jul 2017 10:06:12 +0000 (10:06 +0000)]
[globalisel][tablegen] Rename and re-comment to match the new MatchTables. NFC.

The conversion to MatchTable left the function names and comments referring to
C++ statements and expressions. Updated the names and comments to account for
the fact that they're no longer unconstrained statements/expressions.

llvm-svn: 307246

7 years ago[ARM] GlobalISel: Map s32 G_FCMP in reg bank select
Diana Picus [Thu, 6 Jul 2017 09:57:46 +0000 (09:57 +0000)]
[ARM] GlobalISel: Map s32 G_FCMP in reg bank select

Map hard G_FCMP operands to FPR and the result to GPR.

llvm-svn: 307245

7 years agoRevert "Revert "[IndVars] Canonicalize comparisons between non-negative values and...
Max Kazantsev [Thu, 6 Jul 2017 09:57:41 +0000 (09:57 +0000)]
Revert "Revert "[IndVars] Canonicalize comparisons between non-negative values and indvars""

It seems that the patch was reverted by mistake. Clang testing showed failure of the
MathExtras.SaturatingMultiply test, however I was unable to reproduce the issue on the
fresh code base and was able to confirm that the transformation introduced by the change
does not happen in the said test. This gives a strong confidence that the actual reason of
the failure of the initial patch was somewhere else, and that problem now seems to be
fixed. Re-submitting the change to confirm that.

llvm-svn: 307244

7 years ago[ARM] GlobalISel: Legalize G_FCMP for s32
Diana Picus [Thu, 6 Jul 2017 09:09:33 +0000 (09:09 +0000)]
[ARM] GlobalISel: Legalize G_FCMP for s32

This covers both hard and soft float.

Hard float is easy, since it's just Legal.

Soft float is more involved, because there are several different ways to
handle it based on the predicate: one and ueq need not only one, but two
libcalls to get a result. Furthermore, we have large differences between
the values returned by the AEABI and GNU functions.

AEABI functions return a nice 1 or 0 representing true and respectively
false. GNU functions generally return a value that needs to be compared
against 0 (e.g. for ogt, the value returned by the libcall is > 0 for
true).  We could introduce redundant comparisons for AEABI as well, but
they don't seem easy to remove afterwards, so we do different processing
based on whether or not the result really needs to be compared against
something (and just truncate if it doesn't).

llvm-svn: 307243

7 years ago[DWARF] - Provide default implementation for getSectionLoadAddress() method of Loaded...
George Rimar [Thu, 6 Jul 2017 08:46:01 +0000 (08:46 +0000)]
[DWARF] - Provide default implementation for getSectionLoadAddress() method of LoadedObjectInfo

It is a bit unconvinent that client should implement this method
even if not use it. Patch provides default implementation.

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

llvm-svn: 307242

7 years ago[clangd] Add support for per-file extra flags
Krasimir Georgiev [Thu, 6 Jul 2017 08:44:54 +0000 (08:44 +0000)]
[clangd] Add support for per-file extra flags

Summary:
This patch adds the ability to specify user-defined extra flags per opened file
through the LSP layer. This is a non-standard extension to the protocol.
I've already created a feature request about it for upstream lsp:
https://github.com/Microsoft/language-server-protocol/issues/255

The particular use-case is ycmd, which has a python script for figuring out
extra flags per file:
https://github.com/Valloric/ycmd#flagsforfile-filename-kwargs-

Reviewers: ilya-biryukov, klimek, bkramer

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 307241

7 years ago[globalisel][tablegen] Import rules containing intrinsic_wo_chain.
Daniel Sanders [Thu, 6 Jul 2017 08:12:20 +0000 (08:12 +0000)]
[globalisel][tablegen] Import rules containing intrinsic_wo_chain.

Summary:
As of this patch, 1018 out of 3938 rules are currently imported.

Depends on D32275

Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar

Reviewed By: qcolombet

Subscribers: dberris, igorb, llvm-commits

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

llvm-svn: 307240

7 years ago[ARM] GlobalISel: Widen s1, s8, s16 G_CONSTANT
Diana Picus [Thu, 6 Jul 2017 08:04:16 +0000 (08:04 +0000)]
[ARM] GlobalISel: Widen s1, s8, s16 G_CONSTANT

Get the legalizer to widen small constants.

llvm-svn: 307239

7 years ago[OpenCL] Test on image access modifiers and image type can only be a type of a functi...
Egor Churaev [Thu, 6 Jul 2017 07:06:11 +0000 (07:06 +0000)]
[OpenCL] Test on image access modifiers and image type can only be a type of a function argument.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

llvm-svn: 307238

7 years agoFix -Wunused-function by making function declarations in a header non-static
David Blaikie [Thu, 6 Jul 2017 05:33:32 +0000 (05:33 +0000)]
Fix -Wunused-function by making function declarations in a header non-static

Also avoids ODR violations by ensuring names used in headers find the
same entity, not different, file-local entities in each translation
unit.

llvm-svn: 307237

7 years agoSimplify InstrProfRecord tests, eliminating named temporaries in favor of braced...
David Blaikie [Thu, 6 Jul 2017 05:19:17 +0000 (05:19 +0000)]
Simplify InstrProfRecord tests, eliminating named temporaries in favor of braced init args

This will also simplify an API transition and class renaming coming
soon.

llvm-svn: 307236

7 years ago[lit] Fix unit test discovery for Visual Studio builds.
David L. Jones [Thu, 6 Jul 2017 03:23:18 +0000 (03:23 +0000)]
[lit] Fix unit test discovery for Visual Studio builds.

Fix by Andrew Ng!

The Visual Studio build can contain output for multiple configuration types (
e.g. Debug, Release & RelWithDebInfo) within the same build output
directory. Therefore when discovering unit tests, the "build mode" sub directory
containing the appropriate configuration is included in the search. This sub
directory may not always be present, so a test for its existence is required.

Reviewers: zturner, modocache, dlj

Reviewed By: zturner, dlj

Subscribers: grimar, bd1976llvm, gbreynoo, edd, jhenderson, llvm-commits

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

llvm-svn: 307235

7 years agoAdd a lldbutils routine that gathers up the boiler-plate
Jim Ingham [Thu, 6 Jul 2017 02:18:16 +0000 (02:18 +0000)]
Add a lldbutils routine that gathers up the boiler-plate
to make a target, set a source regex breakpoint, run to
the breakpoint and find the thread that hit the breakpoint.

Start the process of replacing the boiler plate with this
routine.

llvm-svn: 307234

7 years ago[Sanitizers] Consolidate internal errno definitions.
Alex Shlyapnikov [Thu, 6 Jul 2017 00:50:57 +0000 (00:50 +0000)]
[Sanitizers] Consolidate internal errno definitions.

Move internal errno definitions to common to be shared by all sanitizers
and to be used by allocators.

llvm-svn: 307233

7 years ago[modules ts] Do not emit strong function definitions from the module interface unit...
Richard Smith [Thu, 6 Jul 2017 00:30:00 +0000 (00:30 +0000)]
[modules ts] Do not emit strong function definitions from the module interface unit in every user.

llvm-svn: 307232

7 years ago[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS...
Richard Smith [Thu, 6 Jul 2017 00:29:13 +0000 (00:29 +0000)]
[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS flag to work if copy-pasted.

llvm-svn: 307231

7 years agoFix incomplete type test on OS X; workaround weird DYLD_LIBRARY_PATH behavior
Eric Fiselier [Thu, 6 Jul 2017 00:29:09 +0000 (00:29 +0000)]
Fix incomplete type test on OS X; workaround weird DYLD_LIBRARY_PATH behavior

llvm-svn: 307230

7 years agoAvoid constructing GlobalExtensions only to find out it is empty.
Frederich Munch [Thu, 6 Jul 2017 00:09:09 +0000 (00:09 +0000)]
Avoid constructing GlobalExtensions only to find out it is empty.

Summary:
GlobalExtensions is dereferenced twice, once for iteration and then a check if it is empty.
As a ManagedStatic this dereference forces it's construction which is unnecessary.

Reviewers: efriedma, davide, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: chapuni, llvm-commits, mehdi_amini

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

llvm-svn: 307229

7 years agoadd googlemock include dir to lldb-gtest Xcode target
Tim Hammerquist [Thu, 6 Jul 2017 00:08:54 +0000 (00:08 +0000)]
add googlemock include dir to lldb-gtest Xcode target

Add the googlemock include directory from LLVM to CFLAGS arguments in
Xcode's lldb-gtest.

<rdar://problem/33066993>

llvm-svn: 307228

7 years agoRevert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library."""
Eric Beckmann [Wed, 5 Jul 2017 23:46:06 +0000 (23:46 +0000)]
Revert "Revert "Revert "Switch external cvtres.exe for llvm's own resource library."""

This reverts commit ae21ee0b6cacbc1efaf4d42502e71da2f0eb45c3.

The initial revert was done in order to prevent ongoing errors on
chromium bots such as CrWinClangLLD.  However, this was done haphazardly
and I didn't realize there were test and compilation failures, so this
revert was reverted.  Now that those have been fixed, we can revert the
revert of the revert.

llvm-svn: 307227

7 years agoRevert "Revert "Revert "Replace trivial use of external rc.exe by writing our own...
Eric Beckmann [Wed, 5 Jul 2017 23:45:50 +0000 (23:45 +0000)]
Revert "Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file."""

This reverts commit 5fecbbbe5049665d86834cf69d8f75db4f392308.

The initial revert was done in order to prevent ongoing errors on
chromium bots such as CrWinClangLLD.  However, this was done haphazardly
and I didn't realize there were test and compilation failures, so this
revert was reverted.  Now that those have been fixed, we can revert the
revert of the revert.

llvm-svn: 307226

7 years agoMove fabricateDefaultCommands earlier.
Rafael Espindola [Wed, 5 Jul 2017 23:36:24 +0000 (23:36 +0000)]
Move fabricateDefaultCommands earlier.

It is now just after the OutputSections are created, which is as early
as it can possibly go.

llvm-svn: 307225

7 years ago[IR] Use CmpInst::isFPPredicate/isIntPredicate in a few other places. NFC
Craig Topper [Wed, 5 Jul 2017 23:35:46 +0000 (23:35 +0000)]
[IR] Use CmpInst::isFPPredicate/isIntPredicate in a few other places. NFC

llvm-svn: 307224

7 years agoRemove dummy cast.
Rafael Espindola [Wed, 5 Jul 2017 23:16:38 +0000 (23:16 +0000)]
Remove dummy cast.

llvm-svn: 307220

7 years agoUse Entry::SecSize in a couple of cases.
Rafael Espindola [Wed, 5 Jul 2017 23:06:59 +0000 (23:06 +0000)]
Use Entry::SecSize in a couple of cases.

This avoids having to compute relocation section sizes early, removing
the last use of assignOffsets.

llvm-svn: 307219

7 years agoSuppress -Waligned-allocation-unavailable warning in libc++ test suite
Eric Fiselier [Wed, 5 Jul 2017 22:40:58 +0000 (22:40 +0000)]
Suppress -Waligned-allocation-unavailable warning in libc++ test suite

llvm-svn: 307218

7 years agoSimplify. NFC.
Rafael Espindola [Wed, 5 Jul 2017 22:30:04 +0000 (22:30 +0000)]
Simplify. NFC.

llvm-svn: 307217

7 years ago[GlobalOpt] Remove unreachable blocks before optimizing a function.
Davide Italiano [Wed, 5 Jul 2017 22:28:28 +0000 (22:28 +0000)]
[GlobalOpt] Remove unreachable blocks before optimizing a function.

LLVM's definition of dominance allows instructions that are cyclic
in unreachable blocks, e.g.:

  %pat = select i1 %condition, @global, i16* %pat

because any instruction dominates an instruction in a block that's
not reachable from entry.
So, remove unreachable blocks from the function, because a) there's
no point in analyzing them and b) GlobalOpt should otherwise grow
some more complicated logic to break these cycles.

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

llvm-svn: 307215

7 years agoRemove a function that is now trivial.
Rafael Espindola [Wed, 5 Jul 2017 22:25:38 +0000 (22:25 +0000)]
Remove a function that is now trivial.

llvm-svn: 307214

7 years ago[tsan] Use pthread_sigmask instead of sigprocmask to block signals in a thread on...
Kuba Mracek [Wed, 5 Jul 2017 22:17:44 +0000 (22:17 +0000)]
[tsan] Use pthread_sigmask instead of sigprocmask to block signals in a thread on Darwin

On Darwin, sigprocmask changes the signal mask for the entire process. This has some unwanted consequences, because e.g. internal_start_thread wants to disable signals only in the current thread (to make the new thread inherit the signal mask), which is currently broken on Darwin. This patch switches to pthread_sigmask.

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

llvm-svn: 307212

7 years agoUsing existing variable. NFC.
Rafael Espindola [Wed, 5 Jul 2017 22:15:58 +0000 (22:15 +0000)]
Using existing variable. NFC.

llvm-svn: 307211

7 years ago[IR] Use CmpInst::isIntPredicate()/isFPPredicate in some asserts instead of doing...
Craig Topper [Wed, 5 Jul 2017 22:09:00 +0000 (22:09 +0000)]
[IR] Use CmpInst::isIntPredicate()/isFPPredicate in some asserts instead of doing the equivalent range check. NFC

llvm-svn: 307210

7 years agoRemove two dummy casts. NFC.
Rafael Espindola [Wed, 5 Jul 2017 22:07:20 +0000 (22:07 +0000)]
Remove two dummy casts. NFC.

llvm-svn: 307209

7 years agoFix libcall expansion creating DAG nodes with invalid type post type legalization.
Vadim Chugunov [Wed, 5 Jul 2017 22:01:49 +0000 (22:01 +0000)]
Fix libcall expansion creating DAG nodes with invalid type post type legalization.

If we are lowering a libcall after legalization, we'll split the return type into a pair of legal values.

Patch by Jatin Bhateja and Eli Friedman.

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

llvm-svn: 307207

7 years agoFix wrong website in messages
Jonathan Peyton [Wed, 5 Jul 2017 22:01:05 +0000 (22:01 +0000)]
Fix wrong website in messages

Address user message bug where the messages were sending users to Intel's
website instead of the LLVM OpenMP runtime websites.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=32892

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

llvm-svn: 307206

7 years agoFix std::min ambiguity between uint32 and size_t.
Zachary Turner [Wed, 5 Jul 2017 21:59:20 +0000 (21:59 +0000)]
Fix std::min ambiguity between uint32 and size_t.

llvm-svn: 307205

7 years ago[llvm-pdbutil] Add the ability to truncate stream purpose names.
Zachary Turner [Wed, 5 Jul 2017 21:54:58 +0000 (21:54 +0000)]
[llvm-pdbutil] Add the ability to truncate stream purpose names.

This will be useful for aligning fields to a fixed with in
subsequent patches.

llvm-svn: 307204

7 years ago[DependenceAnalysis] Make sure base objects are the same when comparing GEPs
Brendon Cahoon [Wed, 5 Jul 2017 21:35:47 +0000 (21:35 +0000)]
[DependenceAnalysis] Make sure base objects are the same when comparing GEPs

The dependence analysis was returning incorrect information when using the GEPs
to compute dependences. The analysis uses the GEP indices under certain
conditions, but was doing it incorrectly when the base objects of the GEP are
aliases, but pointing to different locations in the same array.

This patch adds another check for the base objects. If the base pointer SCEVs
are not equal, then the dependence analysis should fall back on the path
that uses the whole SCEV for the dependence check. This fixes PR33567.

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

llvm-svn: 307203

7 years agoFix test case in pre-C++11 mode; address Aaron Ballman's code review.
Douglas Gregor [Wed, 5 Jul 2017 21:12:37 +0000 (21:12 +0000)]
Fix test case in pre-C++11 mode; address Aaron Ballman's code review.

llvm-svn: 307202

7 years agoFix one more reference to lit.util.capture()
Michael Zolotukhin [Wed, 5 Jul 2017 21:06:11 +0000 (21:06 +0000)]
Fix one more reference to lit.util.capture()

The capture method was removed in r306643.

llvm-svn: 307201

7 years agoAdded more info on silent master to the doc.
Galina Kistanova [Wed, 5 Jul 2017 20:45:44 +0000 (20:45 +0000)]
Added more info on silent master to the doc.

llvm-svn: 307200

7 years ago[InstCombine] Use CmpInst::Predicate with m_Cmp instead of ICmpInst::Predicate. NFC
Craig Topper [Wed, 5 Jul 2017 20:31:00 +0000 (20:31 +0000)]
[InstCombine] Use CmpInst::Predicate with m_Cmp instead of ICmpInst::Predicate. NFC

There isn't really an ICmpInst version so we're just accessing the CmpInst version through inheritance.

llvm-svn: 307199

7 years ago[WebAssembly] Fix types for address taken functions
Sam Clegg [Wed, 5 Jul 2017 20:25:08 +0000 (20:25 +0000)]
[WebAssembly] Fix types for address taken functions

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

llvm-svn: 307198

7 years agoCope with Range-v3's CONCEPT_REQUIRES idiom
Douglas Gregor [Wed, 5 Jul 2017 20:20:15 +0000 (20:20 +0000)]
Cope with Range-v3's CONCEPT_REQUIRES idiom

llvm-svn: 307197

7 years agoCustomize the SFINAE diagnostics for enable_if to provide the failed condition.
Douglas Gregor [Wed, 5 Jul 2017 20:20:14 +0000 (20:20 +0000)]
Customize the SFINAE diagnostics for enable_if to provide the failed condition.

When enable_if disables a particular overload resolution candidate,
rummage through the enable_if condition to find the specific condition
that caused the failure. For example, if we have something like:

    template<
      typename Iter,
      typename = std::enable_if_t<Random_access_iterator<Iter> &&
                                  Comparable<Iterator_value_type<Iter>>>>
    void mysort(Iter first, Iter last) {}

and we call "mysort" with "std::list<int>" iterators, we'll get a
diagnostic saying that the "Random_access_iterator<Iter>" requirement
failed. If we call "mysort" with
"std::vector<something_not_comparable>", we'll get a diagnostic saying
that the "Comparable<...>" requirement failed.

llvm-svn: 307196

7 years ago[tablegen] Avoid creating temporary strings
Alexander Shaposhnikov [Wed, 5 Jul 2017 20:14:54 +0000 (20:14 +0000)]
[tablegen] Avoid creating temporary strings

If a method / function returns a StringRef but the
variable is of type const std::string& a temporary string is
created (StringRef has a cast operator to std::string),
which is a suboptimal behavior.

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

Test plan: make check-all

llvm-svn: 307195

7 years ago[WebAssembly] MC: Don't generate extra types for weak alias
Sam Clegg [Wed, 5 Jul 2017 20:09:26 +0000 (20:09 +0000)]
[WebAssembly] MC: Don't generate extra types for weak alias

Previously we were generating a void(void) function type
for a weak alias.  Update the weak-alias test case to
catch this.

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

llvm-svn: 307194

7 years agoAdd docs for -foptimization-record-file=
Brian Gesiak [Wed, 5 Jul 2017 19:55:51 +0000 (19:55 +0000)]
Add docs for -foptimization-record-file=

Summary: The Clang option was previously not included in the User's Manual.

Reviewers: anemet, davidxl, hfinkel

Reviewed By: hfinkel

Subscribers: cfe-commits

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

llvm-svn: 307193

7 years agoAdd a test for relocation addend on mips.
Rafael Espindola [Wed, 5 Jul 2017 19:31:07 +0000 (19:31 +0000)]
Add a test for relocation addend on mips.

An lld test found a bug in a llvm patch I am working on. It is better
to have test coverage for that in llvm too.

llvm-svn: 307192

7 years agoRevert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""
Eric Beckmann [Wed, 5 Jul 2017 19:04:48 +0000 (19:04 +0000)]
Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""

This reverts commit 8c8dce3b8f15d6ebaefc35ce88f15a85c8cdbd6e.

llvm-svn: 307191

7 years agoRevert "Revert "Switch external cvtres.exe for llvm's own resource library.""
Eric Beckmann [Wed, 5 Jul 2017 19:04:33 +0000 (19:04 +0000)]
Revert "Revert "Switch external cvtres.exe for llvm's own resource library.""

This reverts commit 165e578e47f1cd38191120aad23a9020fb5476dd.

Forgot to run tests on this.

llvm-svn: 307190

7 years agoRevert "Switch external cvtres.exe for llvm's own resource library."
Eric Beckmann [Wed, 5 Jul 2017 18:59:16 +0000 (18:59 +0000)]
Revert "Switch external cvtres.exe for llvm's own resource library."

This reverts commit 600d52c278e123dd08bee24c1f00932b55add8de.

This patch still seems to break CrWinClangLLD, reverting until I can
find root problem.

llvm-svn: 307189

7 years agoRevert "Replace trivial use of external rc.exe by writing our own .res file."
Eric Beckmann [Wed, 5 Jul 2017 18:59:01 +0000 (18:59 +0000)]
Revert "Replace trivial use of external rc.exe by writing our own .res file."

This patch still seems to break CrWinClangLLD, reverting this once more
until I can discover root problem.

This reverts commit 3dbbc8ce43be50ffde2b1c655c6d3a25796fe78b.

llvm-svn: 307188

7 years ago[PDB] Add a test that verifies every known type record.
Zachary Turner [Wed, 5 Jul 2017 18:43:25 +0000 (18:43 +0000)]
[PDB] Add a test that verifies every known type record.

We had a lot of one-off tests for this type and that type,
or "every type that happens to be generated by this program
I built".  Eventually I got a bug report filed where we were
crashing on a type that was not covered by any of these tests.
So this test carefully constructs a minimal C++ program that
will cause every type we support to be emitted.  This ensures
full coverage for type records.

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

llvm-svn: 307187

7 years ago[AMDGPU] Move GISel accessor initialization from TargetMachine to Subtarget.
Quentin Colombet [Wed, 5 Jul 2017 18:40:56 +0000 (18:40 +0000)]
[AMDGPU] Move GISel accessor initialization from TargetMachine to Subtarget.

NFC

llvm-svn: 307186

7 years ago[Power9] Disable removing extra swaps on P9.
Sean Fertile [Wed, 5 Jul 2017 18:37:10 +0000 (18:37 +0000)]
[Power9] Disable removing extra swaps on P9.

On power 8 we sometimes insert swaps to deal with the difference between
Little-Endian and Big-Endian. The swap removal pass is supposed to clean up
these swaps. On power 9 we don't need this pass since we do not need to insert
the swaps in the first place.

Commiting on behalf of Stefan Pintilie.
Differential Revision: https://reviews.llvm.org/D34627

llvm-svn: 307185

7 years ago{DAGCombiner] Fold (rot x, 0) -> x
Simon Pilgrim [Wed, 5 Jul 2017 18:27:11 +0000 (18:27 +0000)]
{DAGCombiner] Fold (rot x, 0) -> x

llvm-svn: 307184

7 years ago[X86] Test bitfield loadstore tests on i686 as well
Simon Pilgrim [Wed, 5 Jul 2017 18:09:30 +0000 (18:09 +0000)]
[X86] Test bitfield loadstore tests on i686 as well

llvm-svn: 307182