platform/upstream/llvm.git
9 years agoIR: Split out DebugInfoMetadata.h, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 18:53:21 +0000 (18:53 +0000)]
IR: Split out DebugInfoMetadata.h, NFC

Move debug-info-centred `Metadata` subclasses into their own
header/source file.  A couple of private template functions are needed
from both `Metadata.cpp` and `DebugInfoMetadata.cpp`, so I've moved them
to `lib/IR/MetadataImpl.h`.

llvm-svn: 227835

9 years agoUpdate CMake build for removed files.
Eric Christopher [Mon, 2 Feb 2015 18:52:49 +0000 (18:52 +0000)]
Update CMake build for removed files.

llvm-svn: 227834

9 years agoMake SBTarget::Launch() respect the stop_at_entry argument.
Zachary Turner [Mon, 2 Feb 2015 18:50:01 +0000 (18:50 +0000)]
Make SBTarget::Launch() respect the stop_at_entry argument.

Patch by Ilia K
Differential Revision: http://reviews.llvm.org/D7271

llvm-svn: 227833

9 years agoGet TargetRegisterInfo and TargetInstrInfo off of the MachineFunction
Eric Christopher [Mon, 2 Feb 2015 18:46:31 +0000 (18:46 +0000)]
Get TargetRegisterInfo and TargetInstrInfo off of the MachineFunction
and remove unnecessary class variables.

llvm-svn: 227832

9 years agoUse the function template getSubtarget to remove an explicit cast.
Eric Christopher [Mon, 2 Feb 2015 18:46:29 +0000 (18:46 +0000)]
Use the function template getSubtarget to remove an explicit cast.

llvm-svn: 227831

9 years agoGrab TargetInstrInfo off of the MachineFunction and remove
Eric Christopher [Mon, 2 Feb 2015 18:46:27 +0000 (18:46 +0000)]
Grab TargetInstrInfo off of the MachineFunction and remove
unnecessary class variables.

llvm-svn: 227830

9 years agoRemove unused files.
Eric Christopher [Mon, 2 Feb 2015 18:46:23 +0000 (18:46 +0000)]
Remove unused files.

llvm-svn: 227829

9 years agoSTLExtras: Provide less/equal functors with templated function call operators, plus...
David Blaikie [Mon, 2 Feb 2015 18:35:10 +0000 (18:35 +0000)]
STLExtras: Provide less/equal functors with templated function call operators, plus a deref'ing functor template utility

Similar to the C++14 void specializations of these templates, useful as
a stop-gap until LLVM switches to '14.

Example use-cases in tblgen because I saw some functors that looked like
they could be simplified/refactored.

Reviewers: dexonsmith

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

llvm-svn: 227828

9 years agoDebug Info: Relax assertion in isUnsignedDIType() to allow floats to be
Adrian Prantl [Mon, 2 Feb 2015 18:31:58 +0000 (18:31 +0000)]
Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be
described by integer constants. This is a bit ugly, but if the source
language allows arbitrary type casting, the debug info must follow suit.

For example:
  void foo() {
    float a;
    *(int *)&a = 0;
  }
For the curious: SROA replaces the float alloca with an i32 alloca, which
is then optimized away and described via dbg.value(i32 0, ...).

llvm-svn: 227827

9 years agoFix some file headers, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 18:20:15 +0000 (18:20 +0000)]
Fix some file headers, NFC

llvm-svn: 227826

9 years agoSupport: Add missing header to BlockFrequencyTest.cpp, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 18:18:07 +0000 (18:18 +0000)]
Support: Add missing header to BlockFrequencyTest.cpp, NFC

llvm-svn: 227825

9 years agoFix PR#22433. The algorithm is_partitioned was testing an item in the middle of the...
Marshall Clow [Mon, 2 Feb 2015 18:16:35 +0000 (18:16 +0000)]
Fix PR#22433. The algorithm is_partitioned was testing an item in the middle of the sequence twice.

llvm-svn: 227824

9 years agoR600/SI: 64-bit and larger memory access must be at least 4-byte aligned
Tom Stellard [Mon, 2 Feb 2015 18:02:28 +0000 (18:02 +0000)]
R600/SI: 64-bit and larger memory access must be at least 4-byte aligned

This is true for SI only. CI+ supports unaligned memory accesses,
but this requires driver support, so for now we disallow unaligned
accesses for all GCN targets.

llvm-svn: 227822

9 years agoR600/SI: Merge two test files
Tom Stellard [Mon, 2 Feb 2015 18:02:23 +0000 (18:02 +0000)]
R600/SI: Merge two test files

llvm-svn: 227821

9 years ago[AArch64] Prefer DUP/MOV ("CPY") to INS for vector_extract.
Ahmed Bougacha [Mon, 2 Feb 2015 17:55:57 +0000 (17:55 +0000)]
[AArch64] Prefer DUP/MOV ("CPY") to INS for vector_extract.

This avoids a partial false dependency on the previous content of
the upper lanes of the destination vector register.

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

llvm-svn: 227820

9 years agoSince TargetLowering is already subtarget dependent just pass
Eric Christopher [Mon, 2 Feb 2015 17:52:27 +0000 (17:52 +0000)]
Since TargetLowering is already subtarget dependent just pass
in the subtarget and stash it in the class so that lookups are
easier and safer.

llvm-svn: 227819

9 years agoUse the function template getSubtarget on the MachineFunction
Eric Christopher [Mon, 2 Feb 2015 17:52:25 +0000 (17:52 +0000)]
Use the function template getSubtarget on the MachineFunction
rather than a larger explicit cast.

llvm-svn: 227818

9 years agoRemove unused class variable.
Eric Christopher [Mon, 2 Feb 2015 17:52:23 +0000 (17:52 +0000)]
Remove unused class variable.

llvm-svn: 227817

9 years agoRemove unused class variable.
Eric Christopher [Mon, 2 Feb 2015 17:52:20 +0000 (17:52 +0000)]
Remove unused class variable.

llvm-svn: 227816

9 years agofix typo
Sanjay Patel [Mon, 2 Feb 2015 17:47:30 +0000 (17:47 +0000)]
fix typo

llvm-svn: 227815

9 years agoReuse a bunch of cached subtargets and remove getSubtarget calls
Eric Christopher [Mon, 2 Feb 2015 17:38:43 +0000 (17:38 +0000)]
Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

llvm-svn: 227814

9 years agoRemove unnecessary forward declaration.
Eric Christopher [Mon, 2 Feb 2015 17:38:40 +0000 (17:38 +0000)]
Remove unnecessary forward declaration.

llvm-svn: 227813

9 years agoRemove some unused forward declarations.
Eric Christopher [Mon, 2 Feb 2015 17:38:37 +0000 (17:38 +0000)]
Remove some unused forward declarations.

llvm-svn: 227812

9 years agoFix PR#22427. The implementation of inplace_merge had a \'small data set\' optimizati...
Marshall Clow [Mon, 2 Feb 2015 17:35:53 +0000 (17:35 +0000)]
Fix PR#22427. The implementation of inplace_merge had a \'small data set\' optimization; if either half of the merge was small (i.e, less than 9 items), it did an inplace merge rather than allocating a buffer and doing a faster/smarter merge. However, this failed to satisfy the complexity requirements in the standard. Remove that code. Add tests to check the complexity, and add the same tests for std::merge, since we are in that section of the test suite anyway.

llvm-svn: 227811

9 years agoFix log file generation in lldb-mi.
Hafiz Abid Qadeer [Mon, 2 Feb 2015 17:08:25 +0000 (17:08 +0000)]
Fix log file generation in lldb-mi.

When it runs, lldb-mi creates a log file. There is an option --noLog
to disable the creation but it does not work and you end up with log
file. This happens as log is enabled in a few places in the code
although it has been disabled by this option.

This commit tried to fix the problem in the following way.

Log file generation is disabled by default.
You can enable it by giving --log option. It is the only way to enable
it. Rest of the call have been removed.

So the code basically remove the calls that enable the log
unconditionally and changes the option --noLog to --log.

llvm-svn: 227810

9 years agoFix ARM peephole optimizeCompare to avoid optimizing unsigned cmp to 0.
Jan Wen Voung [Mon, 2 Feb 2015 16:56:50 +0000 (16:56 +0000)]
Fix ARM peephole optimizeCompare to avoid optimizing unsigned cmp to 0.

Summary:
Previously it only avoided optimizing signed comparisons to 0.
Sometimes the DAGCombiner will optimize the unsigned comparisons
to 0 before it gets to the peephole pass, but sometimes it doesn't.

Fix for PR22373.

Test Plan: test/CodeGen/ARM/sub-cmp-peephole.ll

Reviewers: jfb, manmanren

Subscribers: aemerson, llvm-commits

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

llvm-svn: 227809

9 years agoReorder a couple of operations in inplace_merge so that we can meet the complexity...
Marshall Clow [Mon, 2 Feb 2015 16:44:11 +0000 (16:44 +0000)]
Reorder a couple of operations in inplace_merge so that we can meet the complexity guidelines mandated by the standard. References PR22427

llvm-svn: 227808

9 years ago[FIX] Updated test case (fixed names -> regular expressions)
Johannes Doerfert [Mon, 2 Feb 2015 16:13:36 +0000 (16:13 +0000)]
[FIX] Updated test case (fixed names -> regular expressions)

llvm-svn: 227807

9 years agoRevert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc
Jonathan Roelofs [Mon, 2 Feb 2015 15:56:43 +0000 (15:56 +0000)]
Revert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc

This change is causing a driver crash on libcxx-libcxxabi-x86_64-linux-ubuntu-msan

llvm-svn: 227806

9 years ago[FIX] Partially fix the pointer negation crash
Johannes Doerfert [Mon, 2 Feb 2015 15:25:09 +0000 (15:25 +0000)]
[FIX] Partially fix the pointer negation crash

llvm-svn: 227805

9 years agoUse fseek/ftell instead of fseeko/ftello when Newlib is the libc
Jonathan Roelofs [Mon, 2 Feb 2015 15:04:29 +0000 (15:04 +0000)]
Use fseek/ftell instead of fseeko/ftello when Newlib is the libc

http://reviews.llvm.org/D6626

llvm-svn: 227804

9 years ago[ASan/Win] Add some diagnostics to help investigate Mprotect failures
Timur Iskhodzhanov [Mon, 2 Feb 2015 15:04:23 +0000 (15:04 +0000)]
[ASan/Win] Add some diagnostics to help investigate Mprotect failures

llvm-svn: 227803

9 years ago[FIX] Check non-deterministic isl output
Johannes Doerfert [Mon, 2 Feb 2015 14:07:02 +0000 (14:07 +0000)]
[FIX] Check non-deterministic isl output

llvm-svn: 227802

9 years ago[NFC] Drop the "scattering" tuple name
Johannes Doerfert [Mon, 2 Feb 2015 13:45:54 +0000 (13:45 +0000)]
[NFC] Drop the "scattering" tuple name

llvm-svn: 227801

9 years agoFix: SLPVectorizer crashes with assertion when vectorizing a cmp instruction.
Erik Eckstein [Mon, 2 Feb 2015 12:45:34 +0000 (12:45 +0000)]
Fix: SLPVectorizer crashes with assertion when vectorizing a cmp instruction.

The commit r225977 uncovered this bug. The problem was that the vectorizer tried to
read the second operand of an already deleted instruction.
The bug didn't show up before r225977 because the freed memory still contained a non-null pointer.
With r225977 deletion of instructions is delayed and the read operand pointer is always null.

llvm-svn: 227800

9 years ago[ASan/Win] Add a test case for r208215 [stack buffer overflow in <iostream>]
Timur Iskhodzhanov [Mon, 2 Feb 2015 12:31:11 +0000 (12:31 +0000)]
[ASan/Win] Add a test case for r208215 [stack buffer overflow in <iostream>]

The issue re-appears if one uses the -fsanitize-blacklist= flag,
so it's time to have a test case.

llvm-svn: 227799

9 years agoMake --thread argument optional for various commands.
Hafiz Abid Qadeer [Mon, 2 Feb 2015 12:17:33 +0000 (12:17 +0000)]
Make --thread argument optional for various commands.
Currently it was marked as mandatory for many commands. Although it
is recommended that fronends generate this argument, it is not
mandatory. GDB seems to treat it as optional too.

llvm-svn: 227798

9 years agoFix missed #endif in rL227790.
Viktor Kutuzov [Mon, 2 Feb 2015 10:48:38 +0000 (10:48 +0000)]
Fix missed #endif in rL227790.

llvm-svn: 227797

9 years agoMS ABI: Implement support for 'novtable'
David Majnemer [Mon, 2 Feb 2015 10:22:20 +0000 (10:22 +0000)]
MS ABI: Implement support for 'novtable'

It is common for COM interface classes to be marked as 'novtable' to
tell the compiler that constructors and destructors should not reference
virtual function tables.

This commit implements this feature in clang.

llvm-svn: 227796

9 years ago[Sanitizers] Intercept ether functions on FreeBSD
Viktor Kutuzov [Mon, 2 Feb 2015 10:00:23 +0000 (10:00 +0000)]
[Sanitizers] Intercept ether functions on FreeBSD
Committed unreviewed with permission.

llvm-svn: 227795

9 years ago[Sanitizers] Intercept memrchr() on FreeBSD
Viktor Kutuzov [Mon, 2 Feb 2015 09:58:30 +0000 (09:58 +0000)]
[Sanitizers] Intercept memrchr() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 227794

9 years ago[Sanitizers] Intercept getpwnam_r() on FreeBSD
Viktor Kutuzov [Mon, 2 Feb 2015 09:56:11 +0000 (09:56 +0000)]
[Sanitizers] Intercept getpwnam_r() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 227793

9 years ago[Sanitizers] Intercept getpwent_r() on FreeBSD
Viktor Kutuzov [Mon, 2 Feb 2015 09:53:02 +0000 (09:53 +0000)]
[Sanitizers] Intercept getpwent_r() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 227792

9 years ago[Sanitizers] Intercept getpwent() on FreeBSD
Viktor Kutuzov [Mon, 2 Feb 2015 09:49:28 +0000 (09:49 +0000)]
[Sanitizers] Intercept getpwent() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 227791

9 years ago[Msan] Disable unit tests for non-FreeBSD functions on FreeBSD
Viktor Kutuzov [Mon, 2 Feb 2015 09:46:07 +0000 (09:46 +0000)]
[Msan] Disable unit tests for non-FreeBSD functions on FreeBSD
Differential Revision: http://reviews.llvm.org/D7252

llvm-svn: 227790

9 years ago[Sanitizers] Re-apply the fix ordering initialization of coverage and guard arrays
Viktor Kutuzov [Mon, 2 Feb 2015 09:38:10 +0000 (09:38 +0000)]
[Sanitizers] Re-apply the fix ordering initialization of coverage and guard arrays
Original commit: http://reviews.llvm.org/rL226440
Related review: http://reviews.llvm.org/D6892

llvm-svn: 227789

9 years ago[ELF] Implement action for OUTPUT linker script command
Davide Italiano [Mon, 2 Feb 2015 06:28:12 +0000 (06:28 +0000)]
[ELF] Implement action for OUTPUT linker script command

Reviewed by: ruiu, shankarke

llvm-svn: 227787

9 years ago[ELF] Support for parsing OUTPUT command in LinkerScript
Davide Italiano [Mon, 2 Feb 2015 06:21:23 +0000 (06:21 +0000)]
[ELF] Support for parsing OUTPUT command in LinkerScript

Differential Revision: D7326
Reviewed by: rafaelauler, shankarke, ruiu

llvm-svn: 227786

9 years ago[Orc] Remove one of the OrcMCJITReplacement regression tests while I
Lang Hames [Mon, 2 Feb 2015 06:01:02 +0000 (06:01 +0000)]
[Orc] Remove one of the OrcMCJITReplacement regression tests while I
investigate a sanitizer bot failure.

llvm-svn: 227785

9 years ago[ELF] Determine default search directories from Context.
Shankar Easwaran [Mon, 2 Feb 2015 06:00:04 +0000 (06:00 +0000)]
[ELF] Determine default search directories from Context.

Target specific LinkingContext's  determine the default search directory.

No change in functionality.

llvm-svn: 227784

9 years agogold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose...
NAKAMURA Takumi [Mon, 2 Feb 2015 05:47:30 +0000 (05:47 +0000)]
gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose DataLayoutPass.

llvm-svn: 227783

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 2 Feb 2015 05:38:59 +0000 (05:38 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 227782

9 years agoFollow-up to r217302: Don't crash on ~A::A in a postfix expr suffix followed by '<'.
Nico Weber [Mon, 2 Feb 2015 05:33:50 +0000 (05:33 +0000)]
Follow-up to r217302: Don't crash on ~A::A in a postfix expr suffix followed by '<'.

This used to crash, complaining "ObjectType and scope specifier cannot coexist":

    struct A { } b = b.~A::A <int>;

The only other caller of ParseOptionalCXXScopeSpecifier() that passes in a
non-empty ObjectType clears the ObjectType of the scope specifier comes back
non-empty (see the tok::period case in Parser::ParsePostfixExpressionSuffix()),
so do that here too.

Found by SLi's bot.

llvm-svn: 227781

9 years ago[Orc] Regression tests for OrcMCJITReplacement.
Lang Hames [Mon, 2 Feb 2015 05:04:55 +0000 (05:04 +0000)]
[Orc] Regression tests for OrcMCJITReplacement.

Duplicated from the MCJIT regression tests.

llvm-svn: 227780

9 years ago[Orc] Remove the OwnedModules list from OrcMCJITReplacement and use
Lang Hames [Mon, 2 Feb 2015 04:34:02 +0000 (04:34 +0000)]
[Orc] Remove the OwnedModules list from OrcMCJITReplacement and use
ExecutionEngine's Modules list instead.

This makes the owned modules visibile to ExecutionEngine. In particular,
it is required for ExecutionEngine::runStaticConstructorsAndDestructors to
work.

Regression tests for Orc (which test this issue) will be committed shortly.

llvm-svn: 227779

9 years ago[Orc] Make the ObjectLinkingLayer take ownership of object files until
Lang Hames [Mon, 2 Feb 2015 04:32:17 +0000 (04:32 +0000)]
[Orc] Make the ObjectLinkingLayer take ownership of object files until
finalization time.

As currently implemented, RuntimeDyldELF requires the original object
file to be avaible when relocations are being resolved. This patch
ensures that the ObjectLinkingLayer preserves it until then. In the
future RuntimeDyldELF should be rewritten to remove this requirement, at
which point this patch can be reverted.

Regression test cases for Orc (which include coverage of this bug) will
be committed shortly.

llvm-svn: 227778

9 years agoRemove a comment I accidentally added in r227581. No behavior change.
Nico Weber [Mon, 2 Feb 2015 04:18:38 +0000 (04:18 +0000)]
Remove a comment I accidentally added in r227581. No behavior change.

llvm-svn: 227777

9 years ago[Orc] Add sensible defaults for the ObjectLinkingLayer constructor.
Lang Hames [Mon, 2 Feb 2015 01:03:10 +0000 (01:03 +0000)]
[Orc] Add sensible defaults for the ObjectLinkingLayer constructor.

llvm-svn: 227776

9 years ago[PowerPC] Put PPCEarlyReturn into its own source file
Hal Finkel [Sun, 1 Feb 2015 22:58:46 +0000 (22:58 +0000)]
[PowerPC] Put PPCEarlyReturn into its own source file

PPCInstrInfo.cpp has ended up containing several small MI-level passes, and
this is making the file harder to read than necessary. Split out
PPCEarlyReturn into its own source file. NFC.

Now that PPCInstrInfo.cpp does not also contain pass implementations, I hope
that it will be slightly less unwieldy.

llvm-svn: 227775

9 years agoAllow objc_bridge(id) to be used on typedefs of [cv] void*.
John McCall [Sun, 1 Feb 2015 22:34:06 +0000 (22:34 +0000)]
Allow objc_bridge(id) to be used on typedefs of [cv] void*.

rdar://19678874

llvm-svn: 227774

9 years ago[X86] Add other flavors of AVX512 cmpps/cmppd intrinsics.
Craig Topper [Sun, 1 Feb 2015 22:27:40 +0000 (22:27 +0000)]
[X86] Add other flavors of AVX512 cmpps/cmppd intrinsics.

llvm-svn: 227773

9 years ago[PowerPC] Remove unnecessary include
Hal Finkel [Sun, 1 Feb 2015 22:03:13 +0000 (22:03 +0000)]
[PowerPC] Remove unnecessary include

llvm-svn: 227772

9 years ago[PowerPC] Put PPCVSXCopy into its own source file
Hal Finkel [Sun, 1 Feb 2015 22:01:29 +0000 (22:01 +0000)]
[PowerPC] Put PPCVSXCopy into its own source file

PPCInstrInfo.cpp has ended up containing several small MI-level passes, and
this is making the file harder to read than necessary. Split out
PPCVSXCopy into its own source file. NFC.

llvm-svn: 227771

9 years ago[PowerPC] Put PPCVSXFMAMutate into its own source file
Hal Finkel [Sun, 1 Feb 2015 21:51:22 +0000 (21:51 +0000)]
[PowerPC] Put PPCVSXFMAMutate into its own source file

PPCInstrInfo.cpp has ended up containing several small MI-level passes, and
this is making the file harder to read than necessary. Split out
PPCVSXFMAMutate into its own source file. NFC.

llvm-svn: 227770

9 years ago[X86] Add the AVX512 exp2a23 intrinsics.
Craig Topper [Sun, 1 Feb 2015 21:34:11 +0000 (21:34 +0000)]
[X86] Add the AVX512 exp2a23 intrinsics.

llvm-svn: 227769

9 years agoRemove decltype in an attempt to fix the MSVC build.
Benjamin Kramer [Sun, 1 Feb 2015 21:32:12 +0000 (21:32 +0000)]
Remove decltype in an attempt to fix the MSVC build.

C++ is hard, attempt #1 of n.

llvm-svn: 227768

9 years ago[PowerPC] Remove the PPCVSXCopyCleanup pass
Hal Finkel [Sun, 1 Feb 2015 21:20:58 +0000 (21:20 +0000)]
[PowerPC] Remove the PPCVSXCopyCleanup pass

This MI-level pass was necessary when VSX support was first being developed,
specifically, before the ABI code had been updated to use VSX registers for
arguments (the register assignments did not change, in a physical sense, but
the VSX super-registers are now used). Unfortunately, I never went back and
removed this pass after that was done. I believe this code is now effectively
dead.

llvm-svn: 227767

9 years agoLoopVectorize: Remove initializer list that blocks MSVC.
Benjamin Kramer [Sun, 1 Feb 2015 21:13:26 +0000 (21:13 +0000)]
LoopVectorize: Remove initializer list that blocks MSVC.

llvm-svn: 227766

9 years agoActually we can just inline the base typedef and use the injected class name for...
Benjamin Kramer [Sun, 1 Feb 2015 20:47:51 +0000 (20:47 +0000)]
Actually we can just inline the base typedef and use the injected class name for the base class.

llvm-svn: 227765

9 years agoReimplement iterator wrappers on top of llvm::iterator_adaptor_base.
Benjamin Kramer [Sun, 1 Feb 2015 20:31:36 +0000 (20:31 +0000)]
Reimplement iterator wrappers on top of llvm::iterator_adaptor_base.

Eliminates a ton of boilerplate proxying the iterator methods. NFC.

llvm-svn: 227764

9 years ago[PowerPC] Add implicit ops to conditional returns in PPCEarlyReturn
Hal Finkel [Sun, 1 Feb 2015 20:16:10 +0000 (20:16 +0000)]
[PowerPC] Add implicit ops to conditional returns in PPCEarlyReturn

When PPCEarlyReturn, it should really copy implicit ops from the old return
instruction to the new one. This currently does not matter much, because we run
PPCEarlyReturn very late in the pipeline (there is nothing to do DCE on
definitions of those registers). However, for completeness, we should do it
anyway.

Noticed by inspection (and there should be no functional change); thus, no
test case.

llvm-svn: 227763

9 years ago[X86] Add test for avx512er builtins that I forgot to commit with changes to the...
Craig Topper [Sun, 1 Feb 2015 19:56:51 +0000 (19:56 +0000)]
[X86] Add test for avx512er builtins that I forgot to commit with changes to the header file.

llvm-svn: 227762

9 years agoFoldingSetVectorIterator is just a subset of pointee_iterator, remove it.
Benjamin Kramer [Sun, 1 Feb 2015 19:26:05 +0000 (19:26 +0000)]
FoldingSetVectorIterator is just a subset of pointee_iterator, remove it.

llvm-svn: 227761

9 years agoValueTracking: Make isSafeToSpeculativelyExecute a little cleaner
David Majnemer [Sun, 1 Feb 2015 19:10:19 +0000 (19:10 +0000)]
ValueTracking: Make isSafeToSpeculativelyExecute a little cleaner

No functional change intended.

llvm-svn: 227760

9 years ago[PowerPC] VSX stores don't also read
Hal Finkel [Sun, 1 Feb 2015 19:07:41 +0000 (19:07 +0000)]
[PowerPC] VSX stores don't also read

The VSX store instructions were also picking up an implicit "may read" from the
default pattern, which was an intrinsic (and we don't currently have a way of
specifying write-only intrinsics).

This was causing MI verification to fail for VSX spill restores.

llvm-svn: 227759

9 years ago[PowerPC] Better scheduling for isel on P7/P8
Hal Finkel [Sun, 1 Feb 2015 17:52:16 +0000 (17:52 +0000)]
[PowerPC] Better scheduling for isel on P7/P8

isel is actually a cracked instruction on the P7/P8, and must start a dispatch
group. The scheduling model should reflect this so that we don't bunch too many
of them together when possible.

Thanks to Bill Schmidt and Pat Haugen for helping to sort this out.

llvm-svn: 227758

9 years agoInclude cstddef in EquivalenceClasses.h
Adam Nemet [Sun, 1 Feb 2015 17:21:06 +0000 (17:21 +0000)]
Include cstddef in EquivalenceClasses.h

This is to try to appease bots complaining that ptrdiff_t is undefined in
LoopAccessAnalysis.cpp.

llvm-svn: 227757

9 years ago[LoopVectorize] Move LoopAccessAnalysis to its own module
Adam Nemet [Sun, 1 Feb 2015 16:56:15 +0000 (16:56 +0000)]
[LoopVectorize] Move LoopAccessAnalysis to its own module

Other than moving code and adding the boilerplate for the new files, the code
being moved is unchanged.

There are a few global functions that are shared with the rest of the
LoopVectorizer.  I moved these to the new module as well (emitLoopAnalysis,
stripIntegerCast, replaceSymbolicStrideSCEV) along with the Report class used
by emitLoopAnalysis.  There is probably room for further improvement in this
area.

I kept DEBUG_TYPE "loop-vectorize" because it's used as the PassName with
emitOptimizationRemarkAnalysis.  This will obviously have to change.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227756

9 years ago[LoopVectorize] Move RuntimePointerCheck under LoopAccessAnalysis
Adam Nemet [Sun, 1 Feb 2015 16:56:11 +0000 (16:56 +0000)]
[LoopVectorize] Move RuntimePointerCheck under LoopAccessAnalysis

This class needs to remain public because it's used by
LoopVectorizationLegality::addRuntimeCheck.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227755

9 years ago[LoopVectorize] Pass parameters explicitly to MemoryDepChecker
Adam Nemet [Sun, 1 Feb 2015 16:56:09 +0000 (16:56 +0000)]
[LoopVectorize] Pass parameters explicitly to MemoryDepChecker

Rather than using globals use a structure to pass parameters from the
vectorizer.  This prepares the class to be moved outside the LoopVectorizer.

It's not great how all this is passed through in LoopAccessAnalysis but this
is all expected to change once the class start servicing the Loop Distribution
pass as well where some of these parameters make no sense.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227754

9 years ago[LoopVectorize] Make hasVectorInstrinsicScalarOpd inline
Adam Nemet [Sun, 1 Feb 2015 16:56:05 +0000 (16:56 +0000)]
[LoopVectorize] Make hasVectorInstrinsicScalarOpd inline

VectorUtils.h needs to be included in LoopAccessAnalysis.cpp for
getIntrinsicIDForCall but hasVectorInstrinsicScalarOpd is not used by this
module.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227753

9 years ago[X86] Convert esp-relative movs of function arguments to pushes, step 2
Michael Kuperstein [Sun, 1 Feb 2015 16:56:04 +0000 (16:56 +0000)]
[X86] Convert esp-relative movs of function arguments to pushes, step 2

This moves the transformation introduced in r223757 into a separate MI pass.
This allows it to cover many more cases (not only cases where there must be a
reserved call frame), and perform rudimentary call folding. It still doesn't
have a heuristic, so it is enabled only for optsize/minsize, with stack
alignment <= 8, where it ought to be a fairly clear win.

(Re-commit of r227728)

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

llvm-svn: 227752

9 years ago[LoopVectorize] Split out LoopAccessAnalysis from LoopVectorizationLegality
Adam Nemet [Sun, 1 Feb 2015 16:56:04 +0000 (16:56 +0000)]
[LoopVectorize] Split out LoopAccessAnalysis from LoopVectorizationLegality

Move the canVectorizeMemory functionality from LoopVectorizationLegality to a
new class LoopAccessAnalysis and forward users.

Currently the collection of the symbolic stride information is kept with
LoopVectorizationLegality and it becomes an input to LoopAccessAnalysis.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227751

9 years ago[LoopVectorize] Add accessors for Num{Stores,Loads,PredStores} in AccessAnalysis
Adam Nemet [Sun, 1 Feb 2015 16:56:02 +0000 (16:56 +0000)]
[LoopVectorize] Add accessors for Num{Stores,Loads,PredStores} in AccessAnalysis

These members are moving to LoopAccessAnalysis.  The accessors help to hide
this.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227750

9 years ago[LoopVectorize] Rename the Report class to VectorizationReport
Adam Nemet [Sun, 1 Feb 2015 16:56:00 +0000 (16:56 +0000)]
[LoopVectorize] Rename the Report class to VectorizationReport

This class will become public in the new LoopAccessAnalysis header so the name
needs to be more global.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227749

9 years ago[LoopVectorize] Factor out duplicated code into Report::emitAnalysis
Adam Nemet [Sun, 1 Feb 2015 16:55:58 +0000 (16:55 +0000)]
[LoopVectorize] Factor out duplicated code into Report::emitAnalysis

The logic in emitAnalysis is duplicated across multiple functions.  This
splits it into a function.  Another use will be added by the patchset.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227748

9 years ago[LoopVectorize] Split out RuntimePointerCheck from LoopVectorizationLegality
Adam Nemet [Sun, 1 Feb 2015 16:55:56 +0000 (16:55 +0000)]
[LoopVectorize] Split out RuntimePointerCheck from LoopVectorizationLegality

RuntimePointerCheck will be used through LoopAccessAnalysis in
LoopVectorizationLegality.  Later in the patchset it will become a local class
of LoopAccessAnalysis.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

llvm-svn: 227747

9 years agoRevert r227728 due to bad line endings.
Michael Kuperstein [Sun, 1 Feb 2015 16:15:07 +0000 (16:15 +0000)]
Revert r227728 due to bad line endings.

llvm-svn: 227746

9 years ago[PowerPC] Make r2 allocatable on PPC64/ELF for some leaf functions
Hal Finkel [Sun, 1 Feb 2015 15:03:28 +0000 (15:03 +0000)]
[PowerPC] Make r2 allocatable on PPC64/ELF for some leaf functions

The TOC base pointer is passed in r2, and we normally reserve this register so
that we can depend on it being there. However, for leaf functions, and
specifically those leaf functions that don't do any TOC access of their own
(which is generally due to accessing the constant pool, using TLS, etc.),
we can treat r2 as an ordinary callee-saved register (it must be callee-saved
because, for local direct calls, the linker will not insert any save/restore
code).

The allocation order has been changed slightly for PPC64/ELF systems to put r2
at the end of the list (while leaving it near the beginning for Darwin systems
to prevent unnecessary output changes). While r2 is allocatable, using it still
requires spill/restore traffic, and thus comes at the end of the list.

llvm-svn: 227745

9 years agoFix some bashims. More information on https://wiki.ubuntu.com/DashAsBinSh. Reported...
Sylvestre Ledru [Sun, 1 Feb 2015 14:55:43 +0000 (14:55 +0000)]
Fix some bashims. More information on https://wiki.ubuntu.com/DashAsBinSh. Reported initially on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772302 & https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772301

llvm-svn: 227744

9 years ago[multiversion] Kill FunctionTargetTransformInfo, TTI itself is now
Chandler Carruth [Sun, 1 Feb 2015 14:37:03 +0000 (14:37 +0000)]
[multiversion] Kill FunctionTargetTransformInfo, TTI itself is now
per-function and supports the exact desired interface.

llvm-svn: 227743

9 years ago[multiversion] Remove the function parameter from the unrolling
Chandler Carruth [Sun, 1 Feb 2015 14:31:23 +0000 (14:31 +0000)]
[multiversion] Remove the function parameter from the unrolling
preferences interface on TTI now that all of TTI is per-function.

llvm-svn: 227741

9 years ago[multiversion] Switch the TTI queries from TargetMachine to Subtarget
Chandler Carruth [Sun, 1 Feb 2015 14:22:17 +0000 (14:22 +0000)]
[multiversion] Switch the TTI queries from TargetMachine to Subtarget
now that we have a correct and cached subtarget specific to the
function.

Also, finish providing a cached per-function subtarget in the core
LLVMTargetMachine -- that layer hadn't switched over yet.

The only use of the TargetMachine was to re-lookup a subtarget for
a particular function to work around the fact that TTI was immutable.
Now that it is per-function and we haved a cached subtarget, use it.

This still leaves a few interfaces with real warts on them where we were
passing Function objects through the TTI interface. I'll remove these
and clean their usage up in subsequent commits now that this isn't
necessary.

llvm-svn: 227738

9 years ago[multiversion] Remove the cached TargetMachine pointer from the
Chandler Carruth [Sun, 1 Feb 2015 14:01:15 +0000 (14:01 +0000)]
[multiversion] Remove the cached TargetMachine pointer from the
intermediate TTI implementation template and instead query up to the
derived class for both the TargetMachine and the TargetLowering.

Most of the derived types had a TLI cached already and there is no need
to store a less precisely typed target machine pointer.

This will in turn make it much cleaner to look up the TLI via
a per-function subtarget instead of the generic subtarget, and it will
pave the way toward pulling the subtarget used for unroll preferences
into the same form once we are *always* using the function to look up
the correct subtarget.

llvm-svn: 227737

9 years ago[multiversion] Remove another place we were "handling" nullptr even
Chandler Carruth [Sun, 1 Feb 2015 13:21:04 +0000 (13:21 +0000)]
[multiversion] Remove another place we were "handling" nullptr even
though it was never a reasonable input.

llvm-svn: 227736

9 years ago[multiversion] Switch all of the targets over to use the
Chandler Carruth [Sun, 1 Feb 2015 13:20:00 +0000 (13:20 +0000)]
[multiversion] Switch all of the targets over to use the
TargetIRAnalysis access path directly rather than implementing getTTI.

This even removes getTTI from the interface. It's more efficient for
each target to just register a precise callback that creates their
specific TTI.

As part of this, all of the targets which are building their subtargets
individually per-function now build their TTI instance with the function
and thus look up the correct subtarget and cache it. NVPTX, R600, and
XCore currently don't leverage this functionality, but its trivial for
them to add it now.

llvm-svn: 227735

9 years ago[multiversion] Remove a false freedom to leave the TargetMachine pointer
Chandler Carruth [Sun, 1 Feb 2015 12:38:24 +0000 (12:38 +0000)]
[multiversion] Remove a false freedom to leave the TargetMachine pointer
null.

For some reason some of the original TTI code supported a null target
machine. This seems to have been legacy, and I made matters worse when
refactoring this code by spreading that pattern further through the
various targets.

The TargetMachine can't actually be null, and it doesn't make sense to
support that use case. I've now consistently removed it and removed all
of the code trying to cope with that situation. This is probably good,
as several targets *didn't* cope with it being null despite the null
default argument in their constructors. =]

llvm-svn: 227734

9 years agoEarlyCSE: Replace custom hash mixing with Hashing.h
Benjamin Kramer [Sun, 1 Feb 2015 12:30:59 +0000 (12:30 +0000)]
EarlyCSE: Replace custom hash mixing with Hashing.h

Brings it in line with the other hashes in EarlyCSE.

llvm-svn: 227733

9 years ago[multiversion] Update Clang for the API change in LLVM r227731.
Chandler Carruth [Sun, 1 Feb 2015 12:26:23 +0000 (12:26 +0000)]
[multiversion] Update Clang for the API change in LLVM r227731.

This moves all of the PassManager <-> Target communication to use the
new pass manager's TargetIRAnalysis even with the old pass manager. See
the LLVM commit for some of why things are moving in this direction, but
the short version is that this will enable us to create per-function
TargetTransformInfo objects that have correct subtarget information for
that function.

llvm-svn: 227732

9 years ago[multiversion] Implement the old pass manager's TTI wrapper pass in
Chandler Carruth [Sun, 1 Feb 2015 12:26:09 +0000 (12:26 +0000)]
[multiversion] Implement the old pass manager's TTI wrapper pass in
terms of the new pass manager's TargetIRAnalysis.

Yep, this is one of the nicer bits of the new pass manager's design.
Passes can in many cases operate in a vacuum and so we can just nest
things when convenient. This is particularly convenient here as I can
now consolidate all of the TargetMachine logic on this analysis.

The most important change here is that this pushes the function we need
TTI for all the way into the TargetMachine, and re-creates the TTI
object for each function rather than re-using it for each function.
We're now prepared to teach the targets to produce function-specific TTI
objects with specific subtargets cached, etc.

One piece of feedback I'd love here is whether its worth renaming any of
this stuff. None of the names really seem that awesome to me at this
point, but TargetTransformInfoWrapperPass is particularly ... odd.
TargetIRAnalysisWrapper might make more sense. I would want to do that
rename separately anyways, but let me know what you think.

llvm-svn: 227731