Commit Graph

112846 Commits

Author SHA1 Message Date
Eric Christopher
c70af25ea4 Use the function template getSubtarget to remove an explicit cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227831 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:29 +00:00
Eric Christopher
b06a938123 Grab TargetInstrInfo off of the MachineFunction and remove
unnecessary class variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:27 +00:00
Eric Christopher
1754d31c4b Remove unused files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:23 +00:00
David Blaikie
fb29a70867 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:35:10 +00:00
Adrian Prantl
b265a82d58 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, ...).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227827 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:31:58 +00:00
Duncan P. N. Exon Smith
0784a4dabb Fix some file headers, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227826 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:20:15 +00:00
Duncan P. N. Exon Smith
63773729ca Support: Add missing header to BlockFrequencyTest.cpp, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:18:07 +00:00
Tom Stellard
d73d1062fe 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227822 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:02:28 +00:00
Tom Stellard
80e70ee18e R600/SI: Merge two test files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:02:23 +00:00
Ahmed Bougacha
0f1a21bcb8 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:55:57 +00:00
Eric Christopher
5fc4d409c6 Since TargetLowering is already subtarget dependent just pass
in the subtarget and stash it in the class so that lookups are
easier and safer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227819 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:27 +00:00
Eric Christopher
f49b8ab731 Use the function template getSubtarget on the MachineFunction
rather than a larger explicit cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:25 +00:00
Eric Christopher
62ba1b5ff1 Remove unused class variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227817 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:23 +00:00
Eric Christopher
dbb436ab54 Remove unused class variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:20 +00:00
Sanjay Patel
f766946abd fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227815 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:47:30 +00:00
Eric Christopher
8115b6b867 Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227814 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:38:43 +00:00
Eric Christopher
aa6be3f734 Remove unnecessary forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:38:40 +00:00
Eric Christopher
eb2eaae1af Remove some unused forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:38:37 +00:00
Jan Wen Voung
1a63641597 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 16:56:50 +00:00
Erik Eckstein
40d542097a 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 12:45:34 +00:00
Lang Hames
0e615f1708 [Orc] Remove one of the OrcMCJITReplacement regression tests while I
investigate a sanitizer bot failure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 06:01:02 +00:00
NAKAMURA Takumi
b497e12c65 gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose DataLayoutPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227783 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 05:47:30 +00:00
Lang Hames
cdb79ba982 [Orc] Regression tests for OrcMCJITReplacement.
Duplicated from the MCJIT regression tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227780 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 05:04:55 +00:00
Lang Hames
c0721c2172 [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227779 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 04:34:02 +00:00
Lang Hames
81ab234344 [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.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 04:32:17 +00:00
Lang Hames
a73abdb680 [Orc] Add sensible defaults for the ObjectLinkingLayer constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227776 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 01:03:10 +00:00
Hal Finkel
a5c1f106b1 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227775 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 22:58:46 +00:00
Hal Finkel
c4b84657f3 [PowerPC] Remove unnecessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 22:03:13 +00:00
Hal Finkel
2a9d9584b4 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227771 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 22:01:29 +00:00
Hal Finkel
dad591a435 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 21:51:22 +00:00
Hal Finkel
2767054823 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227767 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 21:20:58 +00:00
Benjamin Kramer
f9fd8193fb LoopVectorize: Remove initializer list that blocks MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227766 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 21:13:26 +00:00
Hal Finkel
604e1b770c [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 20:16:10 +00:00
Benjamin Kramer
c400986f57 FoldingSetVectorIterator is just a subset of pointee_iterator, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 19:26:05 +00:00
David Majnemer
9e8b7214ed ValueTracking: Make isSafeToSpeculativelyExecute a little cleaner
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 19:10:19 +00:00
Hal Finkel
3bafb64914 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 19:07:41 +00:00
Hal Finkel
ec716cecda [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227758 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 17:52:16 +00:00
Adam Nemet
d46418f870 Include cstddef in EquivalenceClasses.h
This is to try to appease bots complaining that ptrdiff_t is undefined in
LoopAccessAnalysis.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227757 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 17:21:06 +00:00
Adam Nemet
2000a7c9b2 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:15 +00:00
Adam Nemet
497c4df98a [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:11 +00:00
Adam Nemet
4926cfb1da [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:09 +00:00
Adam Nemet
b70daeec8c [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:05 +00:00
Michael Kuperstein
acd5f13c88 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:04 +00:00
Adam Nemet
114a93ecd2 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:04 +00:00
Adam Nemet
bddcf8ba3a [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:02 +00:00
Adam Nemet
8a1d3fe962 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:00 +00:00
Adam Nemet
f986a7f39c [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:55:58 +00:00
Adam Nemet
2659684fe3 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:55:56 +00:00
Michael Kuperstein
5b61b8f53c Revert r227728 due to bad line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:15:07 +00:00
Hal Finkel
8f5c829c1e [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 15:03:28 +00:00