platform/upstream/llvm.git
7 years ago[GlobalISel] Teach the core pipeline not to run if ISel failed.
Quentin Colombet [Sat, 27 Aug 2016 00:18:24 +0000 (00:18 +0000)]
[GlobalISel] Teach the core pipeline not to run if ISel failed.

llvm-svn: 279889

7 years ago[X86] Add baseline test for "odd" shuffles. NFC.
Michael Kuperstein [Sat, 27 Aug 2016 00:10:24 +0000 (00:10 +0000)]
[X86] Add baseline test for "odd" shuffles. NFC.

Adds a baseline test for lowering shuffles where the width of the output
vector is not twice the size of the input vectors. Many of those sequences
are suboptimal, and will hopefully be improved in follow-up patches.

llvm-svn: 279888

7 years ago[asan] first attempt at releasing free-d memory back to the system using madvise...
Kostya Serebryany [Fri, 26 Aug 2016 23:58:42 +0000 (23:58 +0000)]
[asan] first attempt at releasing free-d memory back to the system using madvise. Requires quite some tuning.

llvm-svn: 279887

7 years ago[IRTranslator] Do not abort when the target wants to fall back.
Quentin Colombet [Fri, 26 Aug 2016 23:49:05 +0000 (23:49 +0000)]
[IRTranslator] Do not abort when the target wants to fall back.

Every pass in the GlobalISel pipeline will need to do something similar.

llvm-svn: 279886

7 years ago[MFProperties] Introduce a FailedISel property.
Quentin Colombet [Fri, 26 Aug 2016 23:49:01 +0000 (23:49 +0000)]
[MFProperties] Introduce a FailedISel property.

This is used to communicate that the instruction selection pipeline
failed at some point.
Another way to achieve that would be to have some kind of conditional
scheduling in the PassManager, such that we only schedule a pass based
on the success/failure of another one. The property approach has the
advantage of being lightweight and solve the problem at stake.

llvm-svn: 279885

7 years agoFixed a bad lldbassert() condition.
Sean Callanan [Fri, 26 Aug 2016 23:48:03 +0000 (23:48 +0000)]
Fixed a bad lldbassert() condition.

llvm-svn: 279884

7 years ago[ThinLTO] Move loading of cache entry to client
Teresa Johnson [Fri, 26 Aug 2016 23:29:14 +0000 (23:29 +0000)]
[ThinLTO] Move loading of cache entry to client

Summary:
Have the cache pass back the path to the cache entry when it
is ready to be loaded, instead of a buffer.

For gold-plugin we can simply pass this file back to gold directly,
which avoids expensive writing of a separate tmp file. Ensure
the cache entry is not deleted on cleanup by adjusting the setting
of the IsTemporary flags.

Moved the loading of the buffer into llvm-lto2 to maintain current
behavior.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 279883

7 years agoTables of command options in LLDB benefit from hand-formatting to make it
Kate Stone [Fri, 26 Aug 2016 23:28:47 +0000 (23:28 +0000)]
Tables of command options in LLDB benefit from hand-formatting to make it
easier to scan a set of options with a relatively large number of positional
arguments. This commit standardizes their formatting throughout LLDB and
applies surrounding directives to exempt them from being formatted by
clang-format.

These kinds of exemptions should be rare cases that benefit significantly
from alternative formatting. They also imply a long-term obligation to
maintain their format since the automated tools will not do so.

llvm-svn: 279882

7 years agoAdding document describing the use of the -opt-bisect-limit option.
Andrew Kaylor [Fri, 26 Aug 2016 23:11:48 +0000 (23:11 +0000)]
Adding document describing the use of the -opt-bisect-limit option.

llvm-svn: 279881

7 years ago[asan] Mark symbolize_pc.cc as UNSUPPORTED on i386-apple.
Akira Hatanaka [Fri, 26 Aug 2016 23:08:28 +0000 (23:08 +0000)]
[asan] Mark symbolize_pc.cc as UNSUPPORTED on i386-apple.

atos currently doesn't work well when loaded from 32-bit binaries, which
was causing some of the bots to fail. Disable this test until we can
come up with a better fix.

llvm-svn: 279880

7 years ago[TargetPassConfig] Add a target hook to know what GlobalISel should do on error.
Quentin Colombet [Fri, 26 Aug 2016 22:32:59 +0000 (22:32 +0000)]
[TargetPassConfig] Add a target hook to know what GlobalISel should do on error.

By default, this hook tells GlobalISel to abort (report a fatal error)
when it encounters an error. The alternative will be to fall back on
SDISel.
This fall back will be removed when the bring-up of GlobalISel is over.

llvm-svn: 279879

7 years ago[IRTranslator][NFC] Use DEBUG_TYPE instead of repeating the name.
Quentin Colombet [Fri, 26 Aug 2016 22:32:57 +0000 (22:32 +0000)]
[IRTranslator][NFC] Use DEBUG_TYPE instead of repeating the name.

llvm-svn: 279878

7 years ago[SelectionDAG] Do not run the ISel process on already selected code.
Quentin Colombet [Fri, 26 Aug 2016 22:32:55 +0000 (22:32 +0000)]
[SelectionDAG] Do not run the ISel process on already selected code.

Right now, this cannot happen, but with the fall back path of GlobalISel
it will show up eventually.

llvm-svn: 279877

7 years ago[MachineFunction] Introduce a reset method.
Quentin Colombet [Fri, 26 Aug 2016 22:32:53 +0000 (22:32 +0000)]
[MachineFunction] Introduce a reset method.

This method allows to reset the state of a MachineFunction as if it was
just created. This will be used during the bring-up of GlobalISel to
provide a way to fallback on SelectionDAG. That way, we can start doing
correctness testing even if we are not able to select all functions via
the global instruction selector.

llvm-svn: 279876

7 years agoTableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC
Justin Bogner [Fri, 26 Aug 2016 22:29:36 +0000 (22:29 +0000)]
TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC

This mapping is between pointers, which DenseMap is particularly good
at. Most targets aren't really affected, but if there's a lot of
subregister composition this can shave off a good chunk of time from
generating registers.

llvm-svn: 279875

7 years ago[MFProperties] Introduce a reset method with no argument.
Quentin Colombet [Fri, 26 Aug 2016 22:09:11 +0000 (22:09 +0000)]
[MFProperties] Introduce a reset method with no argument.

This method allows to reset all the properties in one go.

llvm-svn: 279874

7 years ago[MFProperties][NFC] Rename clear into reset to match BitVector naming.
Quentin Colombet [Fri, 26 Aug 2016 22:09:08 +0000 (22:09 +0000)]
[MFProperties][NFC] Rename clear into reset to match BitVector naming.

The name clear is used to reset all the bit in bitvectors and using it
to reset just properties was confusing.

llvm-svn: 279873

7 years agoclang-cl: Support MSVC2015's /validate-charset flag.
Nico Weber [Fri, 26 Aug 2016 21:51:14 +0000 (21:51 +0000)]
clang-cl: Support MSVC2015's /validate-charset flag.

Clang always assumes that files are utf-8. If an invalidly encoded character is
used in an identifier, clang always errors. If it's used in a character
literal, clang warns Winvalid-source-encoding (on by default). Clang never
checks the encoding of things in comments (adding this seems like a nice
feature if it doesn't impact performance).

For cl.exe /utf-8 (which enables /validate-charset), if a bad character is used
in an identifier, it emits both an error and a warning. If it's used in a
literal or a comment, it emits a warning.

So mapping /validate-charset to -Winvalid-source-encoding seems like a fairly
decent fit.

https://reviews.llvm.org/D23945

llvm-svn: 279872

7 years ago[ARM] Adding .arch directives around WMMX unwind code
Renato Golin [Fri, 26 Aug 2016 21:45:39 +0000 (21:45 +0000)]
[ARM] Adding .arch directives around WMMX unwind code

Some unwind code is purposedly old enough to work on previous architecutres
and they're guaranteed to never trigger in newer architectures, so we need
to add .arch directives to tell the compiler/assembler that it's fine and we
know what we're doing.

Fixes PR29149.

llvm-svn: 279871

7 years agoAMDGPU/SI: Canonicalize offset order for merged DS instructions
Tom Stellard [Fri, 26 Aug 2016 21:36:47 +0000 (21:36 +0000)]
AMDGPU/SI: Canonicalize offset order for merged DS instructions

Summary:
If the scheduler clusters the loads, then the offsets will be sorted,
but it is possible for the scheduler to scheduler loads together
without out explicitly clustering them, which would give us non-sorted
offsets.

Also, we will want to do this if we move the load/store optimizer before
the scheduler.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 279870

7 years agoclang-cl: Accept MSVC2015's '/utf-8' flag.
Nico Weber [Fri, 26 Aug 2016 21:26:29 +0000 (21:26 +0000)]
clang-cl: Accept MSVC2015's '/utf-8' flag.

Clang always behaves as if that's passed, so just ignore the flag.

llvm-svn: 279869

7 years agoXXX
Tom Stellard [Fri, 26 Aug 2016 21:16:40 +0000 (21:16 +0000)]
XXX

llvm-svn: 279868

7 years agoAMDGPU/SI: Use a better method for determining the largest pressure sets
Tom Stellard [Fri, 26 Aug 2016 21:16:37 +0000 (21:16 +0000)]
AMDGPU/SI: Use a better method for determining the largest pressure sets

Summary:
There are a few different sgpr pressure sets, but we only care about
the one which covers all of the sgprs.  We were using hard-coded
register pressure set names to determine the reg set id for the
biggest sgpr set.  However, we were using the wrong name, and this
method is pretty fragile, since the reg pressure set names may
change.

The new method just looks for the pressure set that contains the most
reg units and sets that set as our SGPR pressure set.  We've also
adopted the same technique for determining our VGPR pressure set.

Reviewers: arsenm

Subscribers: MatzeB, arsenm, llvm-commits, kzhuravl

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

llvm-svn: 279867

7 years agoclang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.
Nico Weber [Fri, 26 Aug 2016 21:11:43 +0000 (21:11 +0000)]
clang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.

Also makes -fexec-charset accept utf-8 case-insensitively.
Like https://reviews.llvm.org/D23807, but for execution-charset.
Also replace a few .lower() comparisons with equals_lower().

https://reviews.llvm.org/D23938

llvm-svn: 279866

7 years agoRevert "Start reifying error descriptions"
Filipe Cabecinhas [Fri, 26 Aug 2016 20:59:02 +0000 (20:59 +0000)]
Revert "Start reifying error descriptions"

This reverts r279862 to investigate VS failures.

llvm-svn: 279865

7 years ago[CMake] Connect Compiler-RT targets to LLVM Runtimes directory
Chris Bieneman [Fri, 26 Aug 2016 20:52:22 +0000 (20:52 +0000)]
[CMake] Connect Compiler-RT targets to LLVM Runtimes directory

This patch builds on LLVM r279776.

In this patch I've done some cleanup and abstracted three common steps runtime components have in their CMakeLists files, and added a fourth.

The three steps I abstract are:

(1) Add a top-level target (i.e asan, msan, ...)
(2) Set the target properties for sorting files in IDE generators
(3) Make the compiler-rt target depend on the top-level target

The new step is to check if a command named "runtime_register_component" is defined, and to call it with the component name.

The runtime_register_component command is defined in llvm/runtimes/CMakeLists.txt, and presently just adds the component to a list of sub-components, which later gets used to generate target mappings.

With this patch a new workflow for runtimes builds is supported. The new workflow when building runtimes from the LLVM runtimes directory is:

> cmake [...]
> ninja runtimes-configure
> ninja asan

The "runtimes-configure" target builds all the dependencies for configuring the runtimes projects, and runs CMake on the runtimes projects. Running the runtimes CMake generates a list of targets to bind into the top-level CMake so subsequent build invocations will have access to some of Compiler-RT's targets through the top-level build.

Note: This patch does exclude some top-level targets from compiler-rt libraries because they either don't install files (sanitizer_common), or don't have a cooresponding `check` target (stats).
llvm-svn: 279863

7 years agoStart reifying error descriptions
Filipe Cabecinhas [Fri, 26 Aug 2016 20:49:11 +0000 (20:49 +0000)]
Start reifying error descriptions

Summary:
This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 279862

7 years ago[CMake] Expose runtime component check targets
Chris Bieneman [Fri, 26 Aug 2016 20:34:11 +0000 (20:34 +0000)]
[CMake] Expose runtime component check targets

This will expose the check targets for runtime project components into the top-level build. It will enable exposing targets like check-asan.

llvm-svn: 279861

7 years ago[Inliner] Report when inlining fails because callee's def is unavailable
Adam Nemet [Fri, 26 Aug 2016 20:21:05 +0000 (20:21 +0000)]
[Inliner] Report when inlining fails because callee's def is unavailable

Summary:
This is obviously an interesting case because it may motivate code
restructuring or LTO.

Reporting this requires instantiation of ORE in the loop where the call
sites are first gathered.  I've checked compile-time
overhead *with* -Rpass-with-hotness and the worst slow-down was 6% in
mcf and quickly tailing off.  As before without -Rpass-with-hotness
there is no overhead.

Because this could be a pretty noisy diagnostics, it is currently
qualified as 'verbose'.  As of this patch, 'verbose' diagnostics are
only emitted with -Rpass-with-hotness, i.e. when the output is expected
to be filtered.

Reviewers: eraman, chandlerc, davidxl, hfinkel

Subscribers: tejohnson, Prazek, davide, llvm-commits

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

llvm-svn: 279860

7 years agoMake writeToResolutionFile a static helper.
Rafael Espindola [Fri, 26 Aug 2016 20:19:35 +0000 (20:19 +0000)]
Make writeToResolutionFile a static helper.

llvm-svn: 279859

7 years agoTailDuplication: Record blocks that received the duplicated block. NFC.
Kyle Butt [Fri, 26 Aug 2016 20:12:40 +0000 (20:12 +0000)]
TailDuplication: Record blocks that received the duplicated block. NFC.

This will allow tail duplication during layout to handle the cfg changes more
cleanly.

llvm-svn: 279858

7 years ago[CMake] Fixing LLVM_INCLUDE_TESTS for runtimes directory
Chris Bieneman [Fri, 26 Aug 2016 20:08:57 +0000 (20:08 +0000)]
[CMake] Fixing LLVM_INCLUDE_TESTS for runtimes directory

We need to explicitly pass LLVM_INCLUDE_TESTS through from the top-level to the runtimes configuration because it isn't in LLVMConfig.cmake

llvm-svn: 279857

7 years agoStreamline LTO getComdat invocation (NFC)
Teresa Johnson [Fri, 26 Aug 2016 20:07:15 +0000 (20:07 +0000)]
Streamline LTO getComdat invocation (NFC)

We already have obtained a pointer to the underlying GlobalObject,
use it directly to find the comdat, rather than using the
GlobalValue::getComdat which will do the same thing again.

llvm-svn: 279856

7 years ago[StreamExecutor] Fix KernelSpec Doxygen
Jason Henline [Fri, 26 Aug 2016 19:55:32 +0000 (19:55 +0000)]
[StreamExecutor] Fix KernelSpec Doxygen

Summary:
There was a typo where \endcode was spelled as \encode and it was
keeping the whole file document from rendering. I also added in some \c
annotations for inline code stuff to make it look nicer.

Reviewers: jprice

Subscribers: parallel_libs-commits

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

llvm-svn: 279855

7 years agoNext set of additional error checks for invalid Mach-O files for bad LC_SYMTAB’s.
Kevin Enderby [Fri, 26 Aug 2016 19:34:07 +0000 (19:34 +0000)]
Next set of additional error checks for invalid Mach-O files for bad LC_SYMTAB’s.

This contains the missing checks for LC_SYMTAB load command fields.

llvm-svn: 279854

7 years agoSwift Calling Convetion: add support for AArch64.
Manman Ren [Fri, 26 Aug 2016 19:28:17 +0000 (19:28 +0000)]
Swift Calling Convetion: add support for AArch64.

It will just be the same as the regular calling convention.

rdar://28029509

llvm-svn: 279853

7 years agoAArch64: avoid assertion on illegal types in performFDivCombine.
Tim Northover [Fri, 26 Aug 2016 18:52:31 +0000 (18:52 +0000)]
AArch64: avoid assertion on illegal types in performFDivCombine.

In the code to detect fixed-point conversions and make use of AArch64's special
instructions, we weren't prepared for weird types. The fptosi direction got
fixed recently, but not the similar sitofp code.

llvm-svn: 279852

7 years ago[InstCombine] add helper function for icmp (and (sh X, Y), C2), C1 ; NFC
Sanjay Patel [Fri, 26 Aug 2016 18:28:46 +0000 (18:28 +0000)]
[InstCombine] add helper function for icmp (and (sh X, Y), C2), C1 ; NFC

Like other recent changes near here, the goal is to allow vector types for
all of these folds. Splitting things up makes it easier to incrementally
enhance the code and easier to read.

llvm-svn: 279851

7 years agoDon't crash when trying to capture persistent variables in a block.
Sean Callanan [Fri, 26 Aug 2016 18:12:39 +0000 (18:12 +0000)]
Don't crash when trying to capture persistent variables in a block.

Reports an error instead.  We can fix this later to make persistent variables
work, but right now we hit an LLVM assertion if we get this wrong.

<rdar://problem/27770298>

llvm-svn: 279850

7 years ago[AArch64] Avoid materializing constant values when generating csel instructions.
Chad Rosier [Fri, 26 Aug 2016 18:05:50 +0000 (18:05 +0000)]
[AArch64] Avoid materializing constant values when generating csel instructions.

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

llvm-svn: 279849

7 years ago[AsmParser] Placate a -Wmisleading-indentantion warning (GCC7).
Davide Italiano [Fri, 26 Aug 2016 18:05:03 +0000 (18:05 +0000)]
[AsmParser] Placate a -Wmisleading-indentantion warning (GCC7).

llvm-svn: 279848

7 years ago[MC] Move .cv_loc management logic out of MCContext
Reid Kleckner [Fri, 26 Aug 2016 17:58:37 +0000 (17:58 +0000)]
[MC] Move .cv_loc management logic out of MCContext

MCContext already has many tasks, and separating CodeView out from it is
probably a good idea. The .cv_loc tracking was modelled on the DWARF
tracking which lived directly in MCContext.

Removes the inclusion of MCCodeView.h from MCContext.h, so now there are
only 10 build actions while I hack on CodeView support instead of 265.

llvm-svn: 279847

7 years ago[Clang-tidy] Fix some checks documentation style.
Eugene Zelenko [Fri, 26 Aug 2016 17:46:51 +0000 (17:46 +0000)]
[Clang-tidy] Fix some checks documentation style.

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

llvm-svn: 279846

7 years agoGlobalISel: mark G_FPEXT legal from float to double.
Tim Northover [Fri, 26 Aug 2016 17:46:22 +0000 (17:46 +0000)]
GlobalISel: mark G_FPEXT legal from float to double.

llvm-svn: 279845

7 years agoGlobalISel: mark G_FCMP legal on float & double.
Tim Northover [Fri, 26 Aug 2016 17:46:19 +0000 (17:46 +0000)]
GlobalISel: mark G_FCMP legal on float & double.

llvm-svn: 279844

7 years agoGlobalISel: simplify G_ICMP legalization regime.
Tim Northover [Fri, 26 Aug 2016 17:46:17 +0000 (17:46 +0000)]
GlobalISel: simplify G_ICMP legalization regime.

It's unclear how the old

    %res(32) = G_ICMP { s32, s32 } intpred(eq), %0, %1

is actually different from an s1 verison

    %res(1) = G_ICMP { s1, s32 } intpred(eq), %0, %1

so we'll remove it for now.

llvm-svn: 279843

7 years agoGlobalISel: legalize sdiv and srem operations.
Tim Northover [Fri, 26 Aug 2016 17:46:13 +0000 (17:46 +0000)]
GlobalISel: legalize sdiv and srem operations.

llvm-svn: 279842

7 years agoGlobalISel: legalize under-width divisions.
Tim Northover [Fri, 26 Aug 2016 17:46:06 +0000 (17:46 +0000)]
GlobalISel: legalize under-width divisions.

llvm-svn: 279841

7 years agoGlobalISel: mark selects legal
Tim Northover [Fri, 26 Aug 2016 17:46:03 +0000 (17:46 +0000)]
GlobalISel: mark selects legal

llvm-svn: 279840

7 years agoGlobalISel: mark float/int conversions legal
Tim Northover [Fri, 26 Aug 2016 17:45:58 +0000 (17:45 +0000)]
GlobalISel: mark float/int conversions legal

llvm-svn: 279839

7 years agoDon't diagnose non-modular includes when we are not compiling a module.
Manman Ren [Fri, 26 Aug 2016 17:16:46 +0000 (17:16 +0000)]
Don't diagnose non-modular includes when we are not compiling a module.

This is triggered when we are compiling an implementation of a module,
it has relative includes to a VFS-mapped module with umbrella headers.
Currently we will find the real path to headers under the umbrella directory,
but the umbrella directories are using virtual path.

rdar://27951255

Thanks Ben and Richard for reviewing the patch!
Differential Revision: http://reviews.llvm.org/D23858

llvm-svn: 279838

7 years ago[InstCombine] clean up foldICmpAndConstConst(); NFC
Sanjay Patel [Fri, 26 Aug 2016 17:15:22 +0000 (17:15 +0000)]
[InstCombine] clean up foldICmpAndConstConst(); NFC

1. Early exit to reduce indent
2. Fix comments and variable names to match
3. Reformat comments / clang-format code

llvm-svn: 279837

7 years agoMissed a semicolon in r279835
Krzysztof Parzyszek [Fri, 26 Aug 2016 16:50:57 +0000 (16:50 +0000)]
Missed a semicolon in r279835

llvm-svn: 279836

7 years agoAdd some more detailed debugging information in RegisterCoalescer
Krzysztof Parzyszek [Fri, 26 Aug 2016 16:46:14 +0000 (16:46 +0000)]
Add some more detailed debugging information in RegisterCoalescer

llvm-svn: 279835

7 years ago[InstCombine] add helper function for folding of icmp (and X, C2), C; NFC
Sanjay Patel [Fri, 26 Aug 2016 16:42:33 +0000 (16:42 +0000)]
[InstCombine] add helper function for folding of icmp (and X, C2), C; NFC

llvm-svn: 279834

7 years agolimit the number of instructions per block examined by dead store elimination
Bob Haarman [Fri, 26 Aug 2016 16:34:27 +0000 (16:34 +0000)]
limit the number of instructions per block examined by dead store elimination

Summary: Dead store elimination gets very expensive when large numbers of instructions need to be analyzed. This patch limits the number of instructions analyzed per store to the value of the memdep-block-scan-limit parameter (which defaults to 100). This resulted in no observed difference in performance of the generated code, and no change in the statistics for the dead store elimination pass, but improved compilation time on some files by more than an order of magnitude.

Reviewers: dexonsmith, bruno, george.burgess.iv, dberlin, reames, davidxl

Subscribers: davide, chandlerc, dberlin, davidxl, eraman, tejohnson, mbodart, llvm-commits

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

llvm-svn: 279833

7 years agoFileCheck: Minor cleanup of the class Pattern
Saleem Abdulrasool [Fri, 26 Aug 2016 16:18:40 +0000 (16:18 +0000)]
FileCheck: Minor cleanup of the class Pattern

1. Add the "explicit" specifier to the single-argument constructor of Pattern
2. Reorder the fields to remove excessive padding (8 bytes).

Patch by Alexander Shaposhnikov!

llvm-svn: 279832

7 years ago[InstCombine] rename variables in foldICmpAndConstant(); NFC
Sanjay Patel [Fri, 26 Aug 2016 16:14:06 +0000 (16:14 +0000)]
[InstCombine] rename variables in foldICmpAndConstant(); NFC

llvm-svn: 279831

7 years agotest commit
Bob Haarman [Fri, 26 Aug 2016 16:00:04 +0000 (16:00 +0000)]
test commit

llvm-svn: 279830

7 years ago[LoopUnroll] Use OptimizationRemarkEmitter directly not via the analysis pass
Adam Nemet [Fri, 26 Aug 2016 15:58:34 +0000 (15:58 +0000)]
[LoopUnroll] Use OptimizationRemarkEmitter directly not via the analysis pass

We can't mark ORE (a function pass) preserved as required by the loop
passes because that is how we ensure that the required passes like
LazyBFI are all available any time ORE is used.  See the new comments in
the patch.

Instead we use it directly just like the inliner does in D22694.

As expected there is some additional overhead after removing the caching
provided by analysis passes.  The worst case, I measured was
LNT/CINT2006_ref/401.bzip2 which regresses by 12%.  As before, this only
affects -Rpass-with-hotness and not default compilation.

llvm-svn: 279829

7 years ago[InstCombine] rename variables in foldICmpDivConstant(); NFC
Sanjay Patel [Fri, 26 Aug 2016 15:53:01 +0000 (15:53 +0000)]
[InstCombine] rename variables in foldICmpDivConstant(); NFC

Removing the redundant 'CmpRHSV' local variable exposes a bug in the caller
foldICmpShrConstant() - it was sending in the div constant instead of the
cmp constant. But I have not been able to expose this in a regression test
yet - the affected folds all appear to be handled before we ever reach this
code. I'll keep trying to find a case as I make changes to allow vector folds
in both functions.

llvm-svn: 279828

7 years agoAdd support for -fdiagnostics-absolute-paths: printing absolute paths in diagnostics
Hans Wennborg [Fri, 26 Aug 2016 15:45:36 +0000 (15:45 +0000)]
Add support for -fdiagnostics-absolute-paths: printing absolute paths in diagnostics

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

llvm-svn: 279827

7 years agoAdd space between access string and follow-up.
Michael Kruse [Fri, 26 Aug 2016 15:43:52 +0000 (15:43 +0000)]
Add space between access string and follow-up.

llvm-svn: 279826

7 years agoAdd "New access function" to update_check.py classifier.
Michael Kruse [Fri, 26 Aug 2016 15:43:43 +0000 (15:43 +0000)]
Add "New access function" to update_check.py classifier.

Lines with this prefix are printed by JSONImporter.

llvm-svn: 279825

7 years agoAvoid the use of large unsigned values in isl unit test
Tobias Grosser [Fri, 26 Aug 2016 15:42:38 +0000 (15:42 +0000)]
Avoid the use of large unsigned values in isl unit test

isl_val_int_from_ui takes an 'unsigned long' which has on 32-bit and LLP64
windows systems only 32 bit. Hence, make sure we do not use it with constants
that are larger than 32 bit.

Reported-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 279824

7 years ago[lib/LTO] Add an assertion to catch invalid opt levels.
Davide Italiano [Fri, 26 Aug 2016 15:22:59 +0000 (15:22 +0000)]
[lib/LTO] Add an assertion to catch invalid opt levels.

llvm-svn: 279823

7 years ago[AArch64] Avoid materializing constant 1 by using csinc, rather than csel.
Chad Rosier [Fri, 26 Aug 2016 14:01:55 +0000 (14:01 +0000)]
[AArch64] Avoid materializing constant 1 by using csinc, rather than csel.

This is similar to what was done in r261675, but for CSINC rather than CSINV.

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

llvm-svn: 279822

7 years ago[FIX] Access dimensions should correspond to number of dimensions of the accesses...
Roman Gareev [Fri, 26 Aug 2016 13:41:53 +0000 (13:41 +0000)]
[FIX] Access dimensions should correspond to number of dimensions of the accesses array.

llvm-svn: 279821

7 years agoHandle empty functions with debug info in load/store opt pass
Pablo Barrio [Fri, 26 Aug 2016 13:00:39 +0000 (13:00 +0000)]
Handle empty functions with debug info in load/store opt pass

Summary:
In fuctions that contained debug info but were empty otherwise,
the ARM load/store optimizer could abort. This was because
function MergeReturnIntoLDM handled the special case where a
Machine Basic BLock is empty by calling MBB.empty(). However, this
returns false in presence of debug info, although the function
should be considered empty in the eyes of the load/store optimizer.
This has been fixed by handling the case where searching through the
block finds only debug instructions.

Reviewers: rengolin, dexonsmith, llvm-commits, jmolloy

Subscribers: t.p.northover, aemerson, rengolin, samparker

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

llvm-svn: 279820

7 years ago[compiler-rt][XRay] Remove unnecessary assertion.
Dean Michael Berris [Fri, 26 Aug 2016 12:33:33 +0000 (12:33 +0000)]
[compiler-rt][XRay] Remove unnecessary assertion.

This assert only causes issues with signed/unsigned comparisons.

llvm-svn: 279819

7 years agoRevert " [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
Dean Michael Berris [Fri, 26 Aug 2016 12:31:02 +0000 (12:31 +0000)]
Revert "    [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"

This reverts commit 6659b10799b287ad815e49c4f1b01abc4369b03d.

llvm-svn: 279818

7 years agounittests: Make the expected value the first argument in EXPECT_EQ [NFC]
Tobias Grosser [Fri, 26 Aug 2016 12:25:08 +0000 (12:25 +0000)]
unittests: Make the expected value the first argument in EXPECT_EQ [NFC]

This improves the readability of failing test results, as gtest prints always
the first argument as the 'expected value'.

In the previous commit we already changed the tests for isl_valFromAPInt. In
this commit, the tests for IslValToAPInt follow.

Suggested-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 279817

7 years ago [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Dean Michael Berris [Fri, 26 Aug 2016 12:23:20 +0000 (12:23 +0000)]
[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration

    Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

    Reviewers: samsonov, beanz, pcc, rnk

    Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 279816

7 years agoImprove documentation and testing for isl_valFromAPInt
Tobias Grosser [Fri, 26 Aug 2016 12:01:07 +0000 (12:01 +0000)]
Improve documentation and testing for isl_valFromAPInt

The recent unit tests we gained made clear that the semantics of
isl_valFromAPInt are not clear, due to missing documentation. In this change we
document both the calling interface as well as the implementation of
isl_valFromAPInt.

We also make the implementation easier to read by removing integer wrappig in
abs() when passing in the minimal integer value for a given bitwidth. Even
though wrapping and subsequently interpreting the result as unsigned value gives
the correct result, this is far from obvious.  Instead, we explicitly add one
more bit to the input type to ensure that abs will never wrap. This change did
not uncover a bug in the old implementation, but was introduced to increase
readability.

We update the tests to add a test case for this special case and use this
opportunity to also test a number larger than 64 bit. Finally, we order the
arguments of the test cases to make sure the expected output is first. This
helps readability in case of failing test cases as gtest assumes the first value
to be the exected value.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D23917

llvm-svn: 279815

7 years ago[clang-tidy] Some tweaks on header guard checks.
Haojian Wu [Fri, 26 Aug 2016 11:15:38 +0000 (11:15 +0000)]
[clang-tidy] Some tweaks on header guard checks.

* Implement missing storeOption interfaces.
* Remove unnecessary parameter copy in isHeaderFileExtension.
* Fix doc style.

llvm-svn: 279814

7 years agoImprove documentation and testing of APIntFromVal
Tobias Grosser [Fri, 26 Aug 2016 10:43:28 +0000 (10:43 +0000)]
Improve documentation and testing of APIntFromVal

The recent unit tests we gained made clear that the semantics of APIntFromVal
are not clear, due to missing documentation. In this change we document both
the calling interface as well as the implementation of APIntFromVal. We also
make the implementation easier to read by removing the use of magic numbers.
Finally, we add tests to check the bitwidth of the created values as well as
the correct modeling of very large numbers.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D23910

llvm-svn: 279813

7 years agoSwitch linux and android CODE_OWNERS
Pavel Labath [Fri, 26 Aug 2016 10:06:13 +0000 (10:06 +0000)]
Switch linux and android CODE_OWNERS

Summary:
Oleksiy is no longer active in LLDB, I'd like to formally assume ownership of the linux and
android parts.

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 279812

7 years ago[X86][SSE4A] The EXTRQ/INSERTQ bit extraction/insertion ops should be in the integer...
Simon Pilgrim [Fri, 26 Aug 2016 09:55:41 +0000 (09:55 +0000)]
[X86][SSE4A] The EXTRQ/INSERTQ bit extraction/insertion ops should be in the integer domain

llvm-svn: 279811

7 years agoImplement support for --build-id=uuid switch
Eugene Leviant [Fri, 26 Aug 2016 09:55:37 +0000 (09:55 +0000)]
Implement support for --build-id=uuid switch

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

llvm-svn: 279810

7 years ago[ELF] Added test case for PROVIDE and PROVIDE_HIDDEN within section
Eugene Leviant [Fri, 26 Aug 2016 09:48:32 +0000 (09:48 +0000)]
[ELF] Added test case for PROVIDE and PROVIDE_HIDDEN within section

llvm-svn: 279809

7 years agoAdd cmake option to choose whether to use the builtin demangler
Pavel Labath [Fri, 26 Aug 2016 09:47:58 +0000 (09:47 +0000)]
Add cmake option to choose whether to use the builtin demangler

Summary:
Previously the builting demangler was on for platforms that explicitly set a flag by modifying
Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a
compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used
at build time. The flag is only available on non-windows platforms as there the system demangler
is not present (in the form we're trying to use it, at least).
The impact of this change is:
- linux: switches to the builtin demangler
- freebsd, windows: NFC (I hope)
- netbsd: switches to the builtin demangler
- osx cmake build: switches to the builtin demangler (matching the XCode build)

The main motivation for this is the cross-platform case, where it should bring more consistency
by removing the dependency on the host demangler (which can be completely unrelated to the debug
target).

Reviewers: zturner, emaste, krytarowski

Subscribers: emaste, clayborg, lldb-commits

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

llvm-svn: 279808

7 years agoImplement getRandomBytes() function
Eugene Leviant [Fri, 26 Aug 2016 08:14:54 +0000 (08:14 +0000)]
Implement getRandomBytes() function

This function allows getting arbitrary sized block of random bytes.
Primary motivation is support for --build-id=uuid in lld.

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

llvm-svn: 279807

7 years ago[X86][SSE] Add CMPSS/CMPSD intrinsic scalar load folding support.
Craig Topper [Fri, 26 Aug 2016 07:08:00 +0000 (07:08 +0000)]
[X86][SSE] Add CMPSS/CMPSD intrinsic scalar load folding support.

llvm-svn: 279806

7 years ago[compiler-rt][XRay] Initial per-thread inmemory logging implementation
Dean Michael Berris [Fri, 26 Aug 2016 06:39:33 +0000 (06:39 +0000)]
[compiler-rt][XRay] Initial per-thread inmemory logging implementation

Depends on D21612 which implements the building blocks for the compiler-rt
implementation of the XRay runtime. We use a naive in-memory log of fixed-size
entries that get written out to a log file when the buffers are full, and when
the thread exits.

This implementation lays some foundations on to allowing for more complex XRay
records to be written to the log in subsequent changes. It also defines the format
that the function call accounting tool in D21987 will start building upon.

Once D21987 lands, we should be able to start defining more tests using that tool
once the function call accounting tool becomes part of the llvm distribution.

Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge

Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini

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

llvm-svn: 279805

7 years agoReplace subregister uses when processing tied operands
Matt Arsenault [Fri, 26 Aug 2016 06:31:32 +0000 (06:31 +0000)]
Replace subregister uses when processing tied operands

This was for some reason skipping operands that are subregisters
instead of keeping the same subregister index.

v_movreld_b32 expects src0 to be the subregister of the tied
super register use/def.

e.g.

v_movreld_b32 v0, v9, <imp-def, tied3> v[0:3], <imp-use, tied2> v[0:3]

was being replaced with

v[4:7] = copy v[0:3]
v_movreld_b32 v0, v9, <imp-def, tied3> v[4:7], <imp-use, tied2> v[4:7],

which really writes to v[0:3]

llvm-svn: 279804

7 years ago[clang-tidy] Added hh, hxx and hpp to header guard checks.
Mads Ravn [Fri, 26 Aug 2016 05:59:53 +0000 (05:59 +0000)]
[clang-tidy] Added hh, hxx and hpp to header guard checks.

Changed the extension check to include the option of ",h,hh,hpp,hxx" instead of just returning whether the file ended with ".h".

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

llvm-svn: 279803

7 years agoInclude tests only if COMPILER_RT_BUILD_XRAY is ON.
Dean Michael Berris [Fri, 26 Aug 2016 02:39:09 +0000 (02:39 +0000)]
Include tests only if COMPILER_RT_BUILD_XRAY is ON.

This should un-break users that have not re-generated their CMake
configs when they ran it when this was defaulted to OFF. Related to
r277975 post-commit review.

llvm-svn: 279802

7 years agoFix singlton -> singleton typo.
Eric Christopher [Fri, 26 Aug 2016 02:00:21 +0000 (02:00 +0000)]
Fix singlton -> singleton typo.

llvm-svn: 279801

7 years agoMake all the Function implementations different so the compiler won't share them.
Jim Ingham [Fri, 26 Aug 2016 01:27:50 +0000 (01:27 +0000)]
Make all the Function implementations different so the compiler won't share them.

Clang on ARM64 was making the three Function methods with identical bodies have
one implementation that was shared.  That threw off the count of breakpoints, since
we don't count as separate locations three functions with the same address.

I also cleaned up the test case while I was at it.

<rdar://problem/27001915>

llvm-svn: 279800

7 years agoSort list of driver-known file extensions. It was previously approximately
Richard Smith [Fri, 26 Aug 2016 00:41:59 +0000 (00:41 +0000)]
Sort list of driver-known file extensions. It was previously approximately
ordered by length then alphabetically; apply that order consistently.

llvm-svn: 279799

7 years agoAdditional update missed by r279793, should hopefully make the PPC sanitizer bots...
Richard Smith [Fri, 26 Aug 2016 00:30:03 +0000 (00:30 +0000)]
Additional update missed by r279793, should hopefully make the PPC sanitizer bots happy again.

llvm-svn: 279798

7 years agoFix the static_assert added in r279536.
Akira Hatanaka [Fri, 26 Aug 2016 00:22:12 +0000 (00:22 +0000)]
Fix the static_assert added in r279536.

The assertion doesn't always hold true as sizeof(SDNodeBits) isn't equal
to sizeof(uint16_t) for some targets. For example, sizeof(SDNodeBits)
evaluates to 1, not 2, for ARM's APCS targets.

llvm-svn: 279797

7 years ago[libFuzzer] simplify a test to make it pass on the bot
Kostya Serebryany [Fri, 26 Aug 2016 00:18:16 +0000 (00:18 +0000)]
[libFuzzer] simplify a test to make it pass on the bot

llvm-svn: 279796

7 years agoC++ Modules TS: add frontend support for building pcm files from module
Richard Smith [Fri, 26 Aug 2016 00:14:38 +0000 (00:14 +0000)]
C++ Modules TS: add frontend support for building pcm files from module
interface files. At the moment, all declarations (and no macros) are exported,
and 'export' declarations are not supported yet.

llvm-svn: 279794

7 years ago[sanitizer] enable random shuffling the memory chunks inside the allocator, under...
Kostya Serebryany [Fri, 26 Aug 2016 00:06:03 +0000 (00:06 +0000)]
[sanitizer] enable random shuffling the memory chunks inside the allocator, under a flag. Set this flag for the scudo allocator, add a test.

llvm-svn: 279793

7 years ago[libFuzzer] make sure we have symbols on fuzzer tests
Kostya Serebryany [Thu, 25 Aug 2016 23:30:02 +0000 (23:30 +0000)]
[libFuzzer] make sure we have symbols on fuzzer tests

llvm-svn: 279792

7 years ago[asan] remove unused kAsanHeapRightRedzoneMagic (NFC); part 2 (sorry)
Kostya Serebryany [Thu, 25 Aug 2016 22:51:26 +0000 (22:51 +0000)]
[asan] remove unused kAsanHeapRightRedzoneMagic (NFC); part 2 (sorry)

llvm-svn: 279790

7 years ago[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)
Kostya Serebryany [Thu, 25 Aug 2016 22:49:35 +0000 (22:49 +0000)]
[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)

llvm-svn: 279789

7 years agoRevert r274613 because it breaks the test suite with AVX512
Michael Kuperstein [Thu, 25 Aug 2016 22:48:11 +0000 (22:48 +0000)]
Revert r274613 because it breaks the test suite with AVX512

This reverts most of r274613 (AKA r274626) and its follow-ups (r276347, r277289),
due to miscompiles in the test suite. The FastISel change was left in, because
it apparently fixes an unrelated issue.

(Recommit of r279782 which was broken due to a bad merge.)

This fixes 4 out of the 5 test failures in PR29112.

llvm-svn: 279788

7 years ago[libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful...
Kostya Serebryany [Thu, 25 Aug 2016 22:35:08 +0000 (22:35 +0000)]
[libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful: print PCs only after the initial corpus has been read and symbolize them

llvm-svn: 279787