oota-llvm.git
9 years agoProvide the same ABI regardless of NDEBUG
Dmitri Gribenko [Thu, 19 Feb 2015 05:30:16 +0000 (05:30 +0000)]
Provide the same ABI regardless of NDEBUG

For projects depending on LLVM, I find it very useful to combine a
release-no-asserts build of LLVM with a debug+asserts build of the dependent
project.  The motivation is that when developing a dependent project, you are
debugging that project itself, not LLVM.  In my usecase, a significant part of
the runtime is spent in LLVM optimization passes, so I would like to build LLVM
without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides
depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra
symbols when NDEBUG is not defined.  Thus, it is not possible to enable
assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols
that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229819 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.
Lang Hames [Thu, 19 Feb 2015 01:32:43 +0000 (01:32 +0000)]
[Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.

The new JIT doesn't IRGen stubs until they're referenced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229807 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
Lang Hames [Thu, 19 Feb 2015 01:31:25 +0000 (01:31 +0000)]
[Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
up before returning them to the available pool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229806 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove the local subtarget variable from the SystemZ asm printer
Eric Christopher [Thu, 19 Feb 2015 01:26:28 +0000 (01:26 +0000)]
Remove the local subtarget variable from the SystemZ asm printer
and update the two calls accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229805 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove a few more calls to TargetMachine::getSubtarget from the
Eric Christopher [Thu, 19 Feb 2015 01:10:55 +0000 (01:10 +0000)]
Remove a few more calls to TargetMachine::getSubtarget from the
R600 port.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229804 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGrab the subtarget off of the machine function for the R600
Eric Christopher [Thu, 19 Feb 2015 01:10:53 +0000 (01:10 +0000)]
Grab the subtarget off of the machine function for the R600
asm printer and clean up a bunch of uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229803 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove the DisasmEnabled AsmPrinter variable and just look it
Eric Christopher [Thu, 19 Feb 2015 01:10:49 +0000 (01:10 +0000)]
Remove the DisasmEnabled AsmPrinter variable and just look it
up on the subtarget where it's set anyhow than looking it up
2-3 times in the same place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229802 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:07 +0000 (00:45 +0000)]
MC: Remove NullStreamer hook, as it is redundant with NullTargetStreamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229799 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:04 +0000 (00:45 +0000)]
llvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229798 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIntroduce Target::createNullTargetStreamer and use it from IRObjectFile.
Peter Collingbourne [Thu, 19 Feb 2015 00:45:02 +0000 (00:45 +0000)]
Introduce Target::createNullTargetStreamer and use it from IRObjectFile.

A null MCTargetStreamer allows IRObjectFile to ignore target-specific
directives. Previously we were crashing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229797 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[objc-arc] Introduce the concept of RCIdentity and rename all relevant functions...
Michael Gottesman [Thu, 19 Feb 2015 00:42:38 +0000 (00:42 +0000)]
[objc-arc] Introduce the concept of RCIdentity and rename all relevant functions to use that name. NFC.

The RCIdentity root ("Reference Count Identity Root") of a value V is a
dominating value U for which retaining or releasing U is equivalent to
retaining or releasing V. In other words, ARC operations on V are
equivalent to ARC operations on U.

This is a useful property to ascertain since we can use this in the ARC
optimizer to make it easier to match up ARC operations by always mapping
ARC operations to RCIdentityRoots instead of pointers themselves. Then
we perform pairing of retains, releases which are applied to the same
RCIdentityRoot.

In general, the two ways that we see RCIdentical values in ObjC are via:

  1. PointerCasts
  2. Forwarding Calls that return their argument verbatim.

As such in ObjC, two RCIdentical pointers must always point to the same
memory location.

Previously this concept was implicit in the code and various methods
that dealt with this concept were given functional names that did not
conform to any name in the "ARC" model. This often times resulted in
code that was hard for the non-ARC acquanted to understand resulting in
unhappiness and confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229796 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.
Michael Gottesman [Thu, 19 Feb 2015 00:42:34 +0000 (00:42 +0000)]
[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.

NFC. Makes it clearer what this method is actually supposed to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229795 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[objc-arc-contract] Refactor out tryToPeepholeInstruction into its own method. NFC.
Michael Gottesman [Thu, 19 Feb 2015 00:42:30 +0000 (00:42 +0000)]
[objc-arc-contract] Refactor out tryToPeepholeInstruction into its own method. NFC.

The main method of ObjCARCContract is really large and busy. By refactoring this
out, it becomes easier to reason about.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229794 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[objc-arc-contract] Reorganize the code a bit and make the debug output easier to...
Michael Gottesman [Thu, 19 Feb 2015 00:42:27 +0000 (00:42 +0000)]
[objc-arc-contract] Reorganize the code a bit and make the debug output easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229793 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Drop scope from MDTemplateParameter
Duncan P. N. Exon Smith [Thu, 19 Feb 2015 00:37:21 +0000 (00:37 +0000)]
IR: Drop scope from MDTemplateParameter

Follow-up to r229740, which removed `DITemplate*::getContext()` after my
upgrade script revealed that scopes are always `nullptr` for template
parameters.  This is the other shoe: drop `scope:` from
`MDTemplateParameter` and its two subclasses.  (Note: a bitcode upgrade
would be pointless, since the hierarchy hasn't been moved into place.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229791 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAvoid using a self-referential initializer and fix up uses.
Eric Christopher [Thu, 19 Feb 2015 00:22:47 +0000 (00:22 +0000)]
Avoid using a self-referential initializer and fix up uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229790 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago80-column fixups.
Eric Christopher [Thu, 19 Feb 2015 00:15:33 +0000 (00:15 +0000)]
80-column fixups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229789 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove all use of is64bit off of NVPTXSubtarget and clean up code
Eric Christopher [Thu, 19 Feb 2015 00:08:27 +0000 (00:08 +0000)]
Remove all use of is64bit off of NVPTXSubtarget and clean up code
accordingly. This changes the constructors of a number of classes
that don't need to know the subtarget's 64-bitness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229787 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove all use of getDrvInterface off of NVPTXSubtarget and clean
Eric Christopher [Thu, 19 Feb 2015 00:08:23 +0000 (00:08 +0000)]
Remove all use of getDrvInterface off of NVPTXSubtarget and clean
up code accordingly. Delete code that was checking for all cases
of an enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229786 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMigrate the NVPTX backend asm printer to a per function subtarget.
Eric Christopher [Thu, 19 Feb 2015 00:08:14 +0000 (00:08 +0000)]
Migrate the NVPTX backend asm printer to a per function subtarget.

This involved moving two non-subtarget dependent features (64-bitness
and the driver interface) to the NVPTX target machine and updating
the uses (or migrating around the subtarget use for ease of review).
Otherwise use the cached subtarget or create a default subtarget
based on the TargetMachine cpu and feature string for the module
level assembler emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229785 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Merge checks for a recently added test case that is the same on
Chandler Carruth [Wed, 18 Feb 2015 23:20:49 +0000 (23:20 +0000)]
[x86] Merge checks for a recently added test case that is the same on
all SSE variants and AVX variants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229770 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Allow MDSubrange to have 'count: -1'
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 23:17:51 +0000 (23:17 +0000)]
IR: Allow MDSubrange to have 'count: -1'

It turns out that `count: -1` is a special value indicating an empty
array, such as `Values` in:

    struct T {
      unsigned Count;
      int Values[];
    };

Handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229769 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd an IR-to-IR test for dwarf EH preparation using opt
Reid Kleckner [Wed, 18 Feb 2015 23:17:41 +0000 (23:17 +0000)]
Add an IR-to-IR test for dwarf EH preparation using opt

This tests the simple resume instruction elimination logic that we have
before making some changes to it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229768 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.
Lang Hames [Wed, 18 Feb 2015 23:16:09 +0000 (23:16 +0000)]
[Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229765 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Lang Hames [Wed, 18 Feb 2015 23:08:56 +0000 (23:08 +0000)]
[Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229761 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
Lang Hames [Wed, 18 Feb 2015 23:07:13 +0000 (23:07 +0000)]
[Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
function body pointer in the fully lazy orc/kaleidoscope tutorial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229760 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objdump] Fixing crash when printing symbols in ELF sections with special types.
Colin LeMahieu [Wed, 18 Feb 2015 23:00:22 +0000 (23:00 +0000)]
[Objdump] Fixing crash when printing symbols in ELF sections with special types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229759 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoStyle and formatting fixes for r229715
Andrew Kaylor [Wed, 18 Feb 2015 22:52:18 +0000 (22:52 +0000)]
Style and formatting fixes for r229715

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229758 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCMake: Fix add_lit_target for the case where a test suite has zero target dependencies.
Peter Collingbourne [Wed, 18 Feb 2015 22:25:35 +0000 (22:25 +0000)]
CMake: Fix add_lit_target for the case where a test suite has zero target dependencies.

This can happen with a standalone project containing a test suite with no
internal dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229753 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Fix READLANE and WRITELANE lane select for VI
Marek Olsak [Wed, 18 Feb 2015 22:12:45 +0000 (22:12 +0000)]
R600/SI: Fix READLANE and WRITELANE lane select for VI

VOP2 declares vsrc1, but VOP3 declares src1.
We can't use the same "ins" if the operands have different names in VOP2
and VOP3 encodings.

This fixes a hang in geometry shaders which spill M0 on VI.
(BTW it doesn't look like M0 needs spilling and the spilling seems
duplicated 3 times)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229752 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Simplify verification of AMDGPU::OPERAND_REG_INLINE_C
Marek Olsak [Wed, 18 Feb 2015 22:12:41 +0000 (22:12 +0000)]
R600/SI: Simplify verification of AMDGPU::OPERAND_REG_INLINE_C

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229751 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Remove explicit VOP operand checking
Marek Olsak [Wed, 18 Feb 2015 22:12:37 +0000 (22:12 +0000)]
R600/SI: Remove explicit VOP operand checking

This should be handled by the OperandType checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229750 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Swap order of name and value in MDEnum
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 21:16:33 +0000 (21:16 +0000)]
IR: Swap order of name and value in MDEnum

Put the name before the value in assembly for `MDEnum`.  While working
on the testcase upgrade script for the new hierarchy, I noticed that it
"looks nicer" to have the name first, since it lines the names up in the
(somewhat typical) case that they have a common prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229747 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Add MDCompositeTypeBase::replace*()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:47:52 +0000 (20:47 +0000)]
IR: Add MDCompositeTypeBase::replace*()

Add `replaceElements()`, `replaceVTableHolder()`, and
`replaceTemplateParams()` to `MDCompositeTypeBase`.  Included an
assertion in `replaceElements()` to match the one in
`DICompositeType::replaceArrays()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229744 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Add MDCompileUnit::replace*()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:36:09 +0000 (20:36 +0000)]
IR: Add MDCompileUnit::replace*()

Add `MDCompileUnit::replaceGlobalVariables()` and
`MDCompileUnit::replaceSubprograms()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229743 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Add MDSubprogram::replaceFunction()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:32:57 +0000 (20:32 +0000)]
IR: Add MDSubprogram::replaceFunction()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229742 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Drop the scope in DI template parameters
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 20:30:45 +0000 (20:30 +0000)]
IR: Drop the scope in DI template parameters

The scope/context is always the compile unit, which we replace with
`nullptr` anyway (via `getNonCompileUnitScope()`).  Drop it explicitly.

I noticed this field was always null while writing testcase upgrade
scripts to transition to the new hierarchy.  Seems wasteful to
transition it over if it's already out-of-use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229740 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix -DNDEBUG -Werror build after r229733
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 19:56:50 +0000 (19:56 +0000)]
Fix -DNDEBUG -Werror build after r229733

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229736 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agodos2unix the WinEH file and tests
Reid Kleckner [Wed, 18 Feb 2015 19:52:46 +0000 (19:52 +0000)]
dos2unix the WinEH file and tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229735 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: isScopeRef() should check isScope()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 19:46:02 +0000 (19:46 +0000)]
IR: isScopeRef() should check isScope()

r229733 removed an invalid use of `DIScopeRef`, so now we can enforce
that a `DIScopeRef` is actually a scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229734 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Avoid DIScopeRef in DIImportedEntity::getEntity()
Duncan P. N. Exon Smith [Wed, 18 Feb 2015 19:39:36 +0000 (19:39 +0000)]
IR: Avoid DIScopeRef in DIImportedEntity::getEntity()

`DIImportedEntity::getEntity()` currently returns a `DIScopeRef`, but
the nodes it references aren't always `DIScope`s.  In particular, it can
reference global variables.

Introduce `DIDescriptorRef` to avoid the lie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229733 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake frem.ll flush after calling printf.
Zachary Turner [Wed, 18 Feb 2015 19:32:28 +0000 (19:32 +0000)]
Make frem.ll flush after calling printf.

Without this, the test was flaky, and FileCheck would sometimes
not detect any input on stdin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229732 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPartial fix for bug 22589
Sanjoy Das [Wed, 18 Feb 2015 19:32:25 +0000 (19:32 +0000)]
Partial fix for bug 22589

Don't spend the entire iteration space in the scalar loop prologue if
computing the trip count overflows.  This change also gets rid of the
backedge check in the prologue loop and the extra check for
overflowing trip-count.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229731 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoModify llvm-readobj to dump symbol record bytes.
Zachary Turner [Wed, 18 Feb 2015 19:32:05 +0000 (19:32 +0000)]
Modify llvm-readobj to dump symbol record bytes.

This will help us study the format of individual symbol
records more closely.

Differential Revision: http://reviews.llvm.org/D7664
Reviewed by: Timur Iskhodzhanov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229730 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdding install targets for individual LLVM tools and libraries.
Chris Bieneman [Wed, 18 Feb 2015 19:25:47 +0000 (19:25 +0000)]
Adding install targets for individual LLVM tools and libraries.

Summary:
* add_llvm_tool and add_llvm_library now add install-${name} targets to install specific components
* added installhdrs target to install just the LLVM headers
* The above changes only apply for single-configuration generators (Ninja, Makefiles...), not for multi-configuration generators (Visual Studio, Xcode...)

Reviewers: pete

Reviewed By: pete

Subscribers: pete, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229727 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Don't combine expansion regions with code regions
Justin Bogner [Wed, 18 Feb 2015 19:01:06 +0000 (19:01 +0000)]
InstrProf: Don't combine expansion regions with code regions

This was leading to duplicate counts when a code region happened to
overlap exactly with an expansion. The combining behaviour only makes
sense for code regions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229723 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove unused member variables (-Wunused-private-field)
David Blaikie [Wed, 18 Feb 2015 18:52:49 +0000 (18:52 +0000)]
Remove unused member variables (-Wunused-private-field)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229722 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixing a CMake developer warning.
Chris Bieneman [Wed, 18 Feb 2015 18:52:11 +0000 (18:52 +0000)]
Fixing a CMake developer warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229721 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEnable standard so versioning for libLLVM.
Chris Bieneman [Wed, 18 Feb 2015 18:52:06 +0000 (18:52 +0000)]
Enable standard so versioning for libLLVM.

Summary: This resolves Bugzilla bug 15493.

Reviewers: chapuni, pete

Reviewed By: pete

Subscribers: pete, llvm-commits

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

Conflicts:
cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229720 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Handle unknown functions if they consist only of zero-regions
Justin Bogner [Wed, 18 Feb 2015 18:40:46 +0000 (18:40 +0000)]
InstrProf: Handle unknown functions if they consist only of zero-regions

This comes up when we generate coverage for a function but don't end
up emitting the function at all - dead static functions or inline
functions that aren't referenced in a particular TU, for example. In
these cases we'd like to show that the function was never called,
which is trivially true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229717 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdding implementation to outline C++ catch handlers for native Windows 64 exception...
Andrew Kaylor [Wed, 18 Feb 2015 18:31:51 +0000 (18:31 +0000)]
Adding implementation to outline C++ catch handlers for native Windows 64 exception handling.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229715 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Make CoverageMapping testable and add a basic unit test
Justin Bogner [Wed, 18 Feb 2015 18:01:14 +0000 (18:01 +0000)]
InstrProf: Make CoverageMapping testable and add a basic unit test

Make CoverageMapping easier to create, so that we can write targeted
unit tests for its internals, and add a some infrastructure to write
these tests. Finally, add a simple unit test for basic functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229709 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator
Jozef Kolek [Wed, 18 Feb 2015 17:33:56 +0000 (17:33 +0000)]
[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229706 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips][microMIPS] Implement JALX instruction
Jozef Kolek [Wed, 18 Feb 2015 17:15:48 +0000 (17:15 +0000)]
[mips][microMIPS] Implement JALX instruction

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229702 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Add backend support for Mips32r[35] and Mips64r[35].
Daniel Sanders [Wed, 18 Feb 2015 16:24:50 +0000 (16:24 +0000)]
[mips] Add backend support for Mips32r[35] and Mips64r[35].

Summary:
These ISA's didn't add any instructions so they are almost identical to
Mips32r2 and Mips64r2. Even the ELF e_flags are the same, However the ISA
revision in .MIPS.abiflags is 3 or 5 respectively instead of 2.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: tomatabacu, llvm-commits, atanasyan

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229695 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis patch adds the VSX logical instructions introduced in the Power ISA 2.07. It...
Kit Barton [Wed, 18 Feb 2015 16:21:46 +0000 (16:21 +0000)]
This patch adds the VSX logical instructions introduced in the Power ISA 2.07. It also removes the added complexity that favors VMX versions of the three instructions.

Phabricator review: http://reviews.llvm.org/D7616

Commiting on Nemanja's behalf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229694 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Don't set isCodeGenOnly = 1 on all instructions
Tom Stellard [Wed, 18 Feb 2015 16:08:17 +0000 (16:08 +0000)]
R600/SI: Don't set isCodeGenOnly = 1 on all instructions

We only need to set this on pseudo instructions which won't
be used by the assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229689 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add missing VOP1 instructions
Tom Stellard [Wed, 18 Feb 2015 16:08:15 +0000 (16:08 +0000)]
R600/SI: Add missing VOP1 instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229688 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add missing VOP2 instructions
Tom Stellard [Wed, 18 Feb 2015 16:08:14 +0000 (16:08 +0000)]
R600/SI: Add missing VOP2 instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229687 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add definition for S_CBRANCH_G_FORK
Tom Stellard [Wed, 18 Feb 2015 16:08:13 +0000 (16:08 +0000)]
R600/SI: Add definition for S_CBRANCH_G_FORK

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add missing SOP1 instructions
Tom Stellard [Wed, 18 Feb 2015 16:08:11 +0000 (16:08 +0000)]
R600/SI: Add missing SOP1 instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229685 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Refactor SOP2 definitions
Tom Stellard [Wed, 18 Feb 2015 16:08:09 +0000 (16:08 +0000)]
R600/SI: Refactor SOP2 definitions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229684 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Avoid redundant sign extension of the result of binary bitwise instructions.
Vasileios Kalintiris [Wed, 18 Feb 2015 14:57:05 +0000 (14:57 +0000)]
[mips] Avoid redundant sign extension of the result of binary bitwise instructions.

Reviewers: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229675 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoX86: Use bitset to manage a bag of bits. NFC.
Benjamin Kramer [Wed, 18 Feb 2015 14:10:44 +0000 (14:10 +0000)]
X86: Use bitset to manage a bag of bits. NFC.

Doesn't matter in terms of memory usage or perf here, but it's a neat
simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229672 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] [IAS] Fix using .cpsetup with local labels (PR22518).
Toma Tabacu [Wed, 18 Feb 2015 13:46:53 +0000 (13:46 +0000)]
[mips] [IAS] Fix using .cpsetup with local labels (PR22518).

Summary:
Parse for an MCExpr instead of an Identifier and use the symbol for relocations, not just the symbol's name.

This fixes errors when using local labels in .cpsetup (PR22518).

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: seanbruno, emaste, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229671 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Tighten the assertions to document that canonicalization has
Chandler Carruth [Wed, 18 Feb 2015 11:46:29 +0000 (11:46 +0000)]
[x86] Tighten the assertions to document that canonicalization has
actually removed all but a *very* small number of choices for v2i64.
Also remove dead code handling cases that simply cannot arise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229670 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Switch an if which is trivially true to an assert. NFC
Chandler Carruth [Wed, 18 Feb 2015 11:46:27 +0000 (11:46 +0000)]
[x86] Switch an if which is trivially true to an assert. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229669 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Remove some more 'bit' nomenclature from the generic shift
Chandler Carruth [Wed, 18 Feb 2015 11:46:23 +0000 (11:46 +0000)]
[x86] Remove some more 'bit' nomenclature from the generic shift
lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229668 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MSan][MIPS] VarArgHelper for MIPS64
Mohit K. Bhakkad [Wed, 18 Feb 2015 11:41:24 +0000 (11:41 +0000)]
[MSan][MIPS] VarArgHelper for MIPS64

Reviewers: Reviewers: eugenis, kcc, samsonov, petarj

Subscribers: dsanders, sagar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229667 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Fold together the two shift lowering strategies. They were doing
Chandler Carruth [Wed, 18 Feb 2015 10:40:38 +0000 (10:40 +0000)]
[x86] Fold together the two shift lowering strategies. They were doing
quite literally the same work, we just need to special case the >64-bit
element shift code emission to emit the byte shift instructions and
offsets. This also makes reasoning about each of the vector lowering
strategies easier as we don't have to remember to use both forms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229662 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Add missing M/R class CPUs
Bradley Smith [Wed, 18 Feb 2015 10:33:30 +0000 (10:33 +0000)]
[ARM] Add missing M/R class CPUs

Add some of the missing M and R class Cortex CPUs, namely:

Cortex-M0+ (called Cortex-M0plus for GCC compatibility)
Cortex-M1
SC000
SC300
Cortex-R5

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229660 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFixes two issue in SimplifyDemandedBits of sext_in_reg:
Michael Kuperstein [Wed, 18 Feb 2015 09:43:40 +0000 (09:43 +0000)]
Fixes two issue in SimplifyDemandedBits of sext_in_reg:
1) We should not try to simplify if the sext has multiple uses
2) There is no need to simplify is the source value is already sign-extended.

Patch by Gil Rapaport <gil.rapaport@intel.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229659 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Clean up warning
Ulrich Weigand [Wed, 18 Feb 2015 09:42:23 +0000 (09:42 +0000)]
[SystemZ] Clean up warning

Removed (unreachable) default case in switch to clean up warning:

lib/Target/SystemZ/SystemZISelLowering.cpp:1974:5:
error: default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229658 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Refactor the bit shift code the same as I just did the byte shift
Chandler Carruth [Wed, 18 Feb 2015 09:19:58 +0000 (09:19 +0000)]
[x86] Refactor the bit shift code the same as I just did the byte shift
code.

While this didn't have the miscompile (it used MatchLeft consistently)
it missed some cases where it could use right shifts. I've added a test
case Craig Topper came up with to exercise the right shift matching.

This code is really identical between the two. I'm going to merge them
next so that we don't keep two copies of all of this logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229655 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Support all TLS access models - CodeGen part
Ulrich Weigand [Wed, 18 Feb 2015 09:13:27 +0000 (09:13 +0000)]
[SystemZ] Support all TLS access models - CodeGen part

The current SystemZ back-end only supports the local-exec TLS access model.
This patch adds all required CodeGen support for the other TLS models, which
means in particular:

- Expand initial-exec TLS accesses by loading TLS offsets from the GOT
  using @indntpoff relocations.

- Expand general-dynamic and local-dynamic accesses by generating the
  appropriate calls to __tls_get_offset.  Note that this routine has
  a non-standard ABI and requires loading the GOT pointer into %r12,
  so the patch also adds support for the GLOBAL_OFFSET_TABLE ISD node.

- Add a new platform-specific optimization pass to remove redundant
  __tls_get_offset calls in the local-dynamic model (modeled after
  the corresponding X86 pass).

- Add test cases verifying all access models and optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229654 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTesting commit access
Igor Laevsky [Wed, 18 Feb 2015 09:11:50 +0000 (09:11 +0000)]
Testing commit access

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229653 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Support all TLS access models - MC part
Ulrich Weigand [Wed, 18 Feb 2015 09:11:36 +0000 (09:11 +0000)]
[SystemZ] Support all TLS access models - MC part

The current SystemZ back-end only supports the local-exec TLS access model.
This patch adds all required MC support for the other TLS models, which
means in particular:

- Support additional relocation types for
  Initial-exec model: R_390_TLS_IEENT
  Local-dynamic-model: R_390_TLS_LDO32, R_390_TLS_LDO64,
                       R_390_TLS_LDM32, R_390_TLS_LDM64, R_390_TLS_LDCALL
  General-dynamic model: R_390_TLS_GD32, R_390_TLS_GD64, R_390_TLS_GDCALL

- Support assembler syntax to generate additional relocations
  for use with __tls_get_offset calls:
    :tls_gdcall:
    :tls_ldcall:

The patch also adds a new test to verify fixups and relocations,
and removes the (already unused) FK_390_PLT16DBL/FK_390_PLT32DBL
fixup kinds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229652 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReformat.
NAKAMURA Takumi [Wed, 18 Feb 2015 08:36:14 +0000 (08:36 +0000)]
Reformat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229651 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r229622: "[LoopAccesses] Make VectorizerParams global" and others. r229622...
NAKAMURA Takumi [Wed, 18 Feb 2015 08:34:47 +0000 (08:34 +0000)]
Revert r229622: "[LoopAccesses] Make VectorizerParams global" and others. r229622 brought cyclic dependencies between Analysis and Vector.

  r229622: "[LoopAccesses] Make VectorizerParams global"
  r229623: "[LoopAccesses] Stash the report from the analysis rather than emitting it"
  r229624: "[LoopAccesses] Cache the result of canVectorizeMemory"
  r229626: "[LoopAccesses] Create the analysis pass"
  r229628: "[LoopAccesses] Change debug messages from LV to LAA"
  r229630: "[LoopAccesses] Add canAnalyzeLoop"
  r229631: "[LoopAccesses] Add missing const to APIs in VectorizationReport"
  r229632: "[LoopAccesses] Split out LoopAccessReport from VectorizerReport"
  r229633: "[LoopAccesses] Add -analyze support"
  r229634: "[LoopAccesses] Change LAA:getInfo to return a constant reference"
  r229638: "Analysis: fix buildbots"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229650 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoNFC: Use range-based for loops and more consistent naming.
Daniel Jasper [Wed, 18 Feb 2015 08:19:16 +0000 (08:19 +0000)]
NFC: Use range-based for loops and more consistent naming.

No functional changes intended.

(I plan on doing some modifications to this function and would like to
have as few unrelated changes as possible in the patch)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229649 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove experimental options to control machine block placement.
Daniel Jasper [Wed, 18 Feb 2015 08:18:07 +0000 (08:18 +0000)]
Remove experimental options to control machine block placement.

This reverts r226034. Benchmarking with those flags has not revealed
anything interesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229648 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMinor fix after 229495.
Elena Demikhovsky [Wed, 18 Feb 2015 08:09:28 +0000 (08:09 +0000)]
Minor fix after 229495.
Removed metadata and function attributes from the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229647 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAddress post commit review on r229600.
Sanjoy Das [Wed, 18 Feb 2015 08:03:22 +0000 (08:03 +0000)]
Address post commit review on r229600.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229646 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAVX-512: Added support for FP instructions with embedded rounding mode.
Elena Demikhovsky [Wed, 18 Feb 2015 07:59:20 +0000 (07:59 +0000)]
AVX-512: Added support for FP instructions with embedded rounding mode.
By Asaf Badouh <asaf.badouh@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229645 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Add another test case for the bug fixed in r229642. With the bug a vpsrldq...
Craig Topper [Wed, 18 Feb 2015 07:45:43 +0000 (07:45 +0000)]
[X86] Add another test case for the bug fixed in r229642. With the bug a vpsrldq was emitted instead of pslldq.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229643 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[x86] Rewrite the byte shift detection to not use boolean variables to
Chandler Carruth [Wed, 18 Feb 2015 07:13:48 +0000 (07:13 +0000)]
[x86] Rewrite the byte shift detection to not use boolean variables to
track state.

I didn't like this in the code review because the pattern tends to be
error prone, but I didn't see a clear way to rewrite it. Turns out that
there were bugs here, I found them when fuzz testing our shuffle
lowering for correctness on x86.

The core of the problem is that we need to consistently test all our
preconditions for the same directionality of shift and the same input
vector. Instead, formulate this as two predicates (one doesn't depend on
the input in any way), pass things like the directionality and input
vector as inputs, and loop over the alternatives.

This fixes a pattern of very rare miscompiles coming out of this code.
Turned up roughly 4 out of every 1 million v8 shuffles in my fuzz
testing. The new code is over half a million test runs with no failures
yet. I've also fuzzed every other function in the lowering code with
over 3.5 million test cases and not discovered any other miscompiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229642 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Remove AVX512 pslldq/psrldq shift intrinsics. They aren't implemented yet and...
Craig Topper [Wed, 18 Feb 2015 06:24:49 +0000 (06:24 +0000)]
[X86] Remove AVX512 pslldq/psrldq shift intrinsics. They aren't implemented yet and when they are they should be done with shuffles like SSE2 and AVX2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229641 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Remove AVX2 and SSE2 pslldq and psrldq intrinsics. We can represent them in...
Craig Topper [Wed, 18 Feb 2015 06:24:44 +0000 (06:24 +0000)]
[X86] Remove AVX2 and SSE2 pslldq and psrldq intrinsics. We can represent them in IR with vector shuffles now. All their uses have been removed from clang in favor of shuffles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229640 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAnalysis: fix buildbots
Saleem Abdulrasool [Wed, 18 Feb 2015 05:09:50 +0000 (05:09 +0000)]
Analysis: fix buildbots

This should fix the compilation failure on the MSVC buildbots which find a
std::make_unique and llvm::make_unique via ADL, resulting in ambiguity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229638 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Change LAA:getInfo to return a constant reference
Adam Nemet [Wed, 18 Feb 2015 03:44:33 +0000 (03:44 +0000)]
[LoopAccesses] Change LAA:getInfo to return a constant reference

As expected, this required a few more const-correctness fixes.

Based on Hal's feedback on D7684.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229634 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Add -analyze support
Adam Nemet [Wed, 18 Feb 2015 03:44:30 +0000 (03:44 +0000)]
[LoopAccesses] Add -analyze support

The LoopInfo in combination with depth_first is used to enumerate the
loops.

Right now -analyze is not yet complete.  It only prints the result of
the analysis, the report and the run-time checks.  Printing the unsafe
depedences will require a bit more reshuffling which I'd like to do in a
follow-on to this patchset.  Unsafe dependences are currently checked
via -debug-only=loop-accesses in the new test.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229633 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Split out LoopAccessReport from VectorizerReport
Adam Nemet [Wed, 18 Feb 2015 03:44:25 +0000 (03:44 +0000)]
[LoopAccesses] Split out LoopAccessReport from VectorizerReport

The only difference between these two is that VectorizerReport adds a
vectorizer-specific prefix to its messages.  When LAA is used in the
vectorizer context the prefix is added when we promote the
LoopAccessReport into a VectorizerReport via one of the constructors.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229632 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Add missing const to APIs in VectorizationReport
Adam Nemet [Wed, 18 Feb 2015 03:44:20 +0000 (03:44 +0000)]
[LoopAccesses] Add missing const to APIs in VectorizationReport

When I split out LoopAccessReport from this, I need to create some temps
so constness becomes necessary.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229631 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Add canAnalyzeLoop
Adam Nemet [Wed, 18 Feb 2015 03:44:08 +0000 (03:44 +0000)]
[LoopAccesses] Add canAnalyzeLoop

This allows the analysis to be attempted with any loop.  This feature
will be used with -analysis.  (LV only requests the analysis on loops
that have already satisfied these tests.)

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229630 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Factor out RuntimePointerCheck::needsChecking
Adam Nemet [Wed, 18 Feb 2015 03:43:58 +0000 (03:43 +0000)]
[LoopAccesses] Factor out RuntimePointerCheck::needsChecking

Will be used by the new RuntimePointerCheck::print.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229629 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Change debug messages from LV to LAA
Adam Nemet [Wed, 18 Feb 2015 03:43:37 +0000 (03:43 +0000)]
[LoopAccesses] Change debug messages from LV to LAA

Also add pass name as an argument to VectorizationReport::emitAnalysis.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229628 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Modify test to also check symbolic strides with memchecks
Adam Nemet [Wed, 18 Feb 2015 03:43:32 +0000 (03:43 +0000)]
[LoopAccesses] Modify test to also check symbolic strides with memchecks

See the comment in the code.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229627 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Create the analysis pass
Adam Nemet [Wed, 18 Feb 2015 03:43:24 +0000 (03:43 +0000)]
[LoopAccesses] Create the analysis pass

This is a function pass that runs the analysis on demand.  The analysis
can be initiated by querying the loop access info via LAA::getInfo.  It
either returns the cached info or runs the analysis.

Symbolic stride information continues to reside outside of this analysis
pass. We may move it inside later but it's not a priority for me right
now.  The idea is that Loop Distribution won't support run-time stride
checking at least initially.

This means that when querying the analysis, symbolic stride information
can be provided optionally.  Whether stride information is used can
invalidate the cache entry and rerun the analysis.  Note that if the
loop does not have any symbolic stride, the entry should be preserved
across Loop Distribution and LV.

Since currently the only user of the pass is LV, I just check that the
symbolic stride information didn't change when using a cached result.

On the LV side, LoopVectorizationLegality requests the info object
corresponding to the loop from the analysis pass.  A large chunk of the
diff is due to LAI becoming a pointer from a reference.

A test will be added as part of the -analyze patch.

Also tested that with AVX, we generate identical assembly output for the
testsuite (including the external testsuite) before and after.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229626 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Make blockNeedsPredication static
Adam Nemet [Wed, 18 Feb 2015 03:43:19 +0000 (03:43 +0000)]
[LoopAccesses] Make blockNeedsPredication static

blockNeedsPredication is in LoopAccess in order to share it with the
vectorizer.  It's a utility needed by LoopAccess not strictly provided
by it but it's a good place to share it.  This makes the function static
so that it no longer required to create an LoopAccessInfo instance in
order to access it from LV.

This was actually causing problems because it would have required
creating LAI much earlier that LV::canVectorizeMemory().

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229625 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LoopAccesses] Cache the result of canVectorizeMemory
Adam Nemet [Wed, 18 Feb 2015 03:42:57 +0000 (03:42 +0000)]
[LoopAccesses] Cache the result of canVectorizeMemory

LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis.  canVectorizeMemory is renamed to analyzeLoop which
computes the result.  canVectorizeMemory becomes the query function for
the cached result.

This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229624 91177308-0d34-0410-b5e6-96231b3b80d8