platform/upstream/llvm.git
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

9 years ago[multiversion] Thread a function argument through all the callers of the
Chandler Carruth [Sun, 1 Feb 2015 12:01:35 +0000 (12:01 +0000)]
[multiversion] Thread a function argument through all the callers of the
getTTI method used to get an actual TTI object.

No functionality changed. This just threads the argument and ensures
code like the inliner can correctly look up the callee's TTI rather than
using a fixed one.

The next change will use this to implement per-function subtarget usage
by TTI. The changes after that should eliminate the need for FTTI as that
will have become the default.

llvm-svn: 227730

9 years ago[X86] Convert esp-relative movs of function arguments to pushes, step 2
Michael Kuperstein [Sun, 1 Feb 2015 11:44:44 +0000 (11:44 +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.

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

llvm-svn: 227728

9 years ago[PM] Clean up a stale comment that came from a differnt pass when
Chandler Carruth [Sun, 1 Feb 2015 11:35:56 +0000 (11:35 +0000)]
[PM] Clean up a stale comment that came from a differnt pass when
I created this header.

llvm-svn: 227727

9 years ago[PM] Port SimplifyCFG to the new pass manager.
Chandler Carruth [Sun, 1 Feb 2015 11:34:21 +0000 (11:34 +0000)]
[PM] Port SimplifyCFG to the new pass manager.

This should be sufficient to replace the initial (minor) function pass
pipeline in Clang with the new pass manager. I'll probably add an (off
by default) flag to do that just to ensure we can get extra testing.

llvm-svn: 227726

9 years ago[PM] Port EarlyCSE to the new pass manager.
Chandler Carruth [Sun, 1 Feb 2015 10:51:23 +0000 (10:51 +0000)]
[PM] Port EarlyCSE to the new pass manager.

I've added RUN lines both to the basic test for EarlyCSE and the
target-specific test, as this serves as a nice test that the TTI layer
in the new pass manager is in fact working well.

llvm-svn: 227725

9 years ago[PM] Teach the module-to-function adaptor to not run function passes
Chandler Carruth [Sun, 1 Feb 2015 10:47:25 +0000 (10:47 +0000)]
[PM] Teach the module-to-function adaptor to not run function passes
over declarations.

This is both quite unproductive and causes things to crash, for example
domtree would just assert.

I've added a declaration and a domtree run to the basic high-level tests
for the new pass manager.

llvm-svn: 227724

9 years ago[PM] Switch to a ranged based for loop. NFC
Chandler Carruth [Sun, 1 Feb 2015 10:40:21 +0000 (10:40 +0000)]
[PM] Switch to a ranged based for loop. NFC

llvm-svn: 227723

9 years ago[X86] Add all intrinsics for scalar rsqrt28/rcp28 to avx512erintrin.h. Add parenthese...
Craig Topper [Sun, 1 Feb 2015 10:15:11 +0000 (10:15 +0000)]
[X86] Add all intrinsics for scalar rsqrt28/rcp28 to avx512erintrin.h. Add parentheses around all macro arguments.

llvm-svn: 227722

9 years ago[PM] Port TTI to the new pass manager, introducing a TargetIRAnalysis to
Chandler Carruth [Sun, 1 Feb 2015 10:11:22 +0000 (10:11 +0000)]
[PM] Port TTI to the new pass manager, introducing a TargetIRAnalysis to
produce it.

This adds a function to the TargetMachine that produces this analysis
via a callback for each function. This in turn faves the way to produce
a *different* TTI per-function with the correct subtarget cached.

I've also done the necessary wiring in the opt tool to thread the target
machine down and make it available to the pass registry so that we can
construct this analysis from a target machine when available.

llvm-svn: 227721

9 years ago[X86] Add a few target specific nodes to 'getTargetNodeName'
Craig Topper [Sun, 1 Feb 2015 10:00:37 +0000 (10:00 +0000)]
[X86] Add a few target specific nodes to 'getTargetNodeName'

llvm-svn: 227720

9 years ago[X86] Flesh out more of the avx512erintrin.h file.
Craig Topper [Sun, 1 Feb 2015 08:52:55 +0000 (08:52 +0000)]
[X86] Flesh out more of the avx512erintrin.h file.

llvm-svn: 227719

9 years agoAVX2: Added 2 more tests for gather intrinsics.
Elena Demikhovsky [Sun, 1 Feb 2015 08:52:15 +0000 (08:52 +0000)]
AVX2: Added 2 more tests for gather intrinsics.

llvm-svn: 227718

9 years agoRemoved assert that doesn't typecheck and breaks debug MSVC build.
Michael Kuperstein [Sun, 1 Feb 2015 08:46:20 +0000 (08:46 +0000)]
Removed assert that doesn't typecheck and breaks debug MSVC build.

llvm-svn: 227717

9 years ago[X86] Use macros in AVX512ER header to allow ICE to be checked for immediate argument.
Craig Topper [Sun, 1 Feb 2015 08:05:12 +0000 (08:05 +0000)]
[X86] Use macros in AVX512ER header to allow ICE to be checked for immediate argument.

llvm-svn: 227716

9 years ago[PM] Refactor the analysis registration and pass pipeline parsing to
Chandler Carruth [Sun, 1 Feb 2015 07:40:05 +0000 (07:40 +0000)]
[PM] Refactor the analysis registration and pass pipeline parsing to
live in a class.

While this isn't really significant right now, I need to expose some
state to the pass construction expressions, and making them get
evaluated within a class context is a nice way to collect members that
they may need to access.

llvm-svn: 227715

9 years ago[X86] Convert some more const ints to ICE in AVX512 builtins.
Craig Topper [Sun, 1 Feb 2015 07:35:43 +0000 (07:35 +0000)]
[X86] Convert some more const ints to ICE in AVX512 builtins.

llvm-svn: 227714

9 years ago[X86] Rename _mm512_valign_epi64/32 intrinsics to _mm512_alignr_epi64/32 to match...
Craig Topper [Sun, 1 Feb 2015 07:35:40 +0000 (07:35 +0000)]
[X86] Rename _mm512_valign_epi64/32 intrinsics to _mm512_alignr_epi64/32 to match Intel docs. Make immediate argument to them an ICE. Fix mask size for the alignd version.

llvm-svn: 227713

9 years ago[X86] Change rounding parameter of all the AVX512 builtins to an ICE.
Craig Topper [Sun, 1 Feb 2015 07:35:35 +0000 (07:35 +0000)]
[X86] Change rounding parameter of all the AVX512 builtins to an ICE.

llvm-svn: 227712

9 years ago[test] Add test for section groups and deadstrip
Shankar Easwaran [Sun, 1 Feb 2015 05:47:02 +0000 (05:47 +0000)]
[test] Add test for section groups and deadstrip

This adds a test that deadstrip should preserve the section group even if there
is only one reference to a function in the group.

llvm-svn: 227711

9 years agoRemove trailing whitespace introduced in r227709.
Davide Italiano [Sun, 1 Feb 2015 05:27:01 +0000 (05:27 +0000)]
Remove trailing whitespace introduced in r227709.

Reported by: shankarke

llvm-svn: 227710

9 years ago[ELF] Don't compare an atom with itself in compareByPosition().
Davide Italiano [Sun, 1 Feb 2015 05:06:45 +0000 (05:06 +0000)]
[ELF] Don't compare an atom with itself in compareByPosition().

This caused some tests to fail on FreeBSD, and Mac OS X.
Some std::sort() implementations will check for strict-weak-ordering
by comparing with the same element, or will compare an element to
itself for 1-element sequence. Take care of this case. Thanks to
chandlerc for explaning that to me.

Reviewed by: ruiu

llvm-svn: 227709

9 years ago[ELF] Implement semantic action for ENTRY linker script command.
Davide Italiano [Sun, 1 Feb 2015 03:27:25 +0000 (03:27 +0000)]
[ELF] Implement semantic action for ENTRY linker script command.

Reviewed by: shankarke, ruiu

llvm-svn: 227708

9 years ago[ELF] Set order of ctors/dtors section
Shankar Easwaran [Sun, 1 Feb 2015 03:21:57 +0000 (03:21 +0000)]
[ELF] Set order of ctors/dtors section

llvm-svn: 227707

9 years ago[ELF] got/got.plt sections are handled as typeGOT
Shankar Easwaran [Sun, 1 Feb 2015 03:21:55 +0000 (03:21 +0000)]
[ELF] got/got.plt sections are handled as typeGOT

The .got and .got.plt sections are already handled as typeGOT. There is no need
to handle these atoms whose contentType is typeData.

llvm-svn: 227706

9 years ago[SeparateConstOffsetFromGEP] skip optnone functions
Jingyue Wu [Sun, 1 Feb 2015 02:34:41 +0000 (02:34 +0000)]
[SeparateConstOffsetFromGEP] skip optnone functions

llvm-svn: 227705

9 years ago[SeparateConstOffsetFromGEP] set PreservesCFG flag
Jingyue Wu [Sun, 1 Feb 2015 02:33:02 +0000 (02:33 +0000)]
[SeparateConstOffsetFromGEP] set PreservesCFG flag

SeparateConstOffsetFromGEP does not change the shape of the control flow graph.

llvm-svn: 227704

9 years ago[NVPTX] Emit .pragma "nounroll" for loops marked with nounroll
Jingyue Wu [Sun, 1 Feb 2015 02:27:45 +0000 (02:27 +0000)]
[NVPTX] Emit .pragma "nounroll" for loops marked with nounroll

Summary:
CUDA driver can unroll loops when jit-compiling PTX. To prevent CUDA
driver from unrolling a loop marked with llvm.loop.unroll.disable is not
unrolled by CUDA driver, we need to emit .pragma "nounroll" at the
header of that loop.

This patch also extracts getting unroll metadata from loop ID metadata
into a shared helper function.

Test Plan: test/CodeGen/NVPTX/nounroll.ll

Reviewers: eliben, meheff, jholewinski

Reviewed By: jholewinski

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 227703

9 years agoFix PR22393. When recursively replacing an aggregate with a smaller
Adrian Prantl [Sun, 1 Feb 2015 00:58:04 +0000 (00:58 +0000)]
Fix PR22393. When recursively replacing an aggregate with a smaller
aggregate or scalar, the debug info needs to refer to the absolute offset
(relative to the entire variable) instead of storing the offset inside
the smaller aggregate.

llvm-svn: 227702

9 years agoAdd missing tags.
Adrian Prantl [Sun, 1 Feb 2015 00:57:31 +0000 (00:57 +0000)]
Add missing tags.

llvm-svn: 227701

9 years ago[CMake] LLVMLTO requires Intrinsics.gen since r227685 introduced llvm/Analysis/Target...
NAKAMURA Takumi [Sun, 1 Feb 2015 00:55:43 +0000 (00:55 +0000)]
[CMake] LLVMLTO requires Intrinsics.gen since r227685 introduced llvm/Analysis/TargetTransformInfo.h.

llvm-svn: 227700

9 years ago[CMake] LLVMTarget requires Intrinsics.gen since r227669 introduced llvm/Analysis...
NAKAMURA Takumi [Sun, 1 Feb 2015 00:55:32 +0000 (00:55 +0000)]
[CMake] LLVMTarget requires Intrinsics.gen since r227669 introduced llvm/Analysis/TargetTransformInfo.h.

llvm-svn: 227699

9 years ago[PM] Remove a bunch of stale TTI creation method declarations. I nuked
Chandler Carruth [Sun, 1 Feb 2015 00:22:15 +0000 (00:22 +0000)]
[PM] Remove a bunch of stale TTI creation method declarations. I nuked
their definitions, but forgot to clean up all the declarations which are
in different files.

llvm-svn: 227698

9 years agoFix typo
Matt Arsenault [Sat, 31 Jan 2015 23:37:27 +0000 (23:37 +0000)]
Fix typo

llvm-svn: 227697

9 years agoFix a typo
Filipe Cabecinhas [Sat, 31 Jan 2015 23:25:54 +0000 (23:25 +0000)]
Fix a typo

We're not that much into metals.

llvm-svn: 227696

9 years agoTweak behavior due to -fexceptions, in C++ mode, imply -fcxx-exceptions
Filipe Cabecinhas [Sat, 31 Jan 2015 23:05:51 +0000 (23:05 +0000)]
Tweak behavior due to -fexceptions, in C++ mode, imply -fcxx-exceptions

Added test

llvm-svn: 227695

9 years agoImplement semantic action for SEARCH_DIR linker script command
Rafael Auler [Sat, 31 Jan 2015 22:42:19 +0000 (22:42 +0000)]
Implement semantic action for SEARCH_DIR linker script command

This is needed, among others by the FreeBSD kernel linker script.

Patch by Davide Italiano!

Reviewers: ruiu, rafaelauler

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

llvm-svn: 227694

9 years agoR600/SI: Only select cvt_flr/cvt_rpi with no NaNs.
Matt Arsenault [Sat, 31 Jan 2015 21:28:13 +0000 (21:28 +0000)]
R600/SI: Only select cvt_flr/cvt_rpi with no NaNs.

These have different behavior from cvt_i32_f32 on NaN.

llvm-svn: 227693

9 years agoX86: silence a GCC warning
Saleem Abdulrasool [Sat, 31 Jan 2015 17:56:11 +0000 (17:56 +0000)]
X86: silence a GCC warning

GCC 4.9 gives the following warning:
  warning: enumeral and non-enumeral type in conditional expression
Cast the enumeral value to an integer within the ternary operation.  NFC.

llvm-svn: 227692

9 years agoRemove unused variable.
Diego Novillo [Sat, 31 Jan 2015 17:17:33 +0000 (17:17 +0000)]
Remove unused variable.

Summary:
This variable is only used inside an assert. This breaks builds with
asserts disabled.

OK for trunk?

Subscribers: llvm-commits

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

llvm-svn: 227691

9 years agoRemoved a spurious semicolon; NFC
Aaron Ballman [Sat, 31 Jan 2015 15:18:47 +0000 (15:18 +0000)]
Removed a spurious semicolon; NFC

llvm-svn: 227690

9 years agoRemoved SSE lane blend findCommutedOpIndices overrides. NFCI.
Simon Pilgrim [Sat, 31 Jan 2015 15:16:30 +0000 (15:16 +0000)]
Removed SSE lane blend findCommutedOpIndices overrides. NFCI.

The default op indices frmo TargetInstrInfo::findCommutedOpIndices are being commuted so we don't need to do this.

llvm-svn: 227689

9 years ago[X86][SSE] Shuffle mask decode support for zero extend, scalar float/double moves...
Simon Pilgrim [Sat, 31 Jan 2015 14:09:36 +0000 (14:09 +0000)]
[X86][SSE] Shuffle mask decode support for zero extend, scalar float/double moves and integer load instructions

This patch adds shuffle mask decodes for integer zero extends (pmovzx** and movq xmm,xmm) and scalar float/double loads/moves (movss/movsd).

Also adds shuffle mask decodes for integer loads (movd/movq).

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

llvm-svn: 227688

9 years ago[PM] Update Clang for the new LLVM API in r227685 for managing the
Chandler Carruth [Sat, 31 Jan 2015 11:18:46 +0000 (11:18 +0000)]
[PM] Update Clang for the new LLVM API in r227685 for managing the
TargetTransformInfo, and unify the code in a single place.

llvm-svn: 227686

9 years ago[PM] Switch the TargetMachine interface from accepting a pass manager
Chandler Carruth [Sat, 31 Jan 2015 11:17:59 +0000 (11:17 +0000)]
[PM] Switch the TargetMachine interface from accepting a pass manager
base which it adds a single analysis pass to, to instead return the type
erased TargetTransformInfo object constructed for that TargetMachine.

This removes all of the pass variants for TTI. There is now a single TTI
*pass* in the Analysis layer. All of the Analysis <-> Target
communication is through the TTI's type erased interface itself. While
the diff is large here, it is nothing more that code motion to make
types available in a header file for use in a different source file
within each target.

I've tried to keep all the doxygen comments and file boilerplate in line
with this move, but let me know if I missed anything.

With this in place, the next step to making TTI work with the new pass
manager is to introduce a really simple new-style analysis that produces
a TTI object via a callback into this routine on the target machine.
Once we have that, we'll have the building blocks necessary to accept
a function argument as well.

llvm-svn: 227685

9 years ago[asan][mips] Fix MIPS64 Asan mapping
Kumar Sukhani [Sat, 31 Jan 2015 10:43:18 +0000 (10:43 +0000)]
[asan][mips] Fix MIPS64 Asan mapping

llvm-svn: 227684

9 years ago[asan][mips] Fix MIPS64 Asan mapping
Kumar Sukhani [Sat, 31 Jan 2015 09:13:58 +0000 (09:13 +0000)]
[asan][mips] Fix MIPS64 Asan mapping

llvm-svn: 227683

9 years agoReplace another std::set in the core of CodeGenRegister, this time with sorted arrays.
Owen Anderson [Sat, 31 Jan 2015 09:13:36 +0000 (09:13 +0000)]
Replace another std::set in the core of CodeGenRegister, this time with sorted arrays.

The hot path through this region of code does lots of batch inserts into sets. By storing them as sorted arrays, we can defer the sorting to the end of the batch, which is dramatically more efficient. This reduces tblgen runtime by 25% on my worst-case target.

llvm-svn: 227682

9 years ago[X86] Make AVX512 integer comparison builtins use unsigned types for the masks.
Craig Topper [Sat, 31 Jan 2015 08:58:36 +0000 (08:58 +0000)]
[X86] Make AVX512 integer comparison builtins use unsigned types for the masks.

llvm-svn: 227681

9 years ago[X86] AVX512 scatter/gather builtins as taking an ICE for scale instead of just a...
Craig Topper [Sat, 31 Jan 2015 08:58:30 +0000 (08:58 +0000)]
[X86] AVX512 scatter/gather builtins as taking an ICE for scale instead of just a const int.

llvm-svn: 227680

9 years ago[X86] Add immediate range checking for a couple XOP builtins.
Craig Topper [Sat, 31 Jan 2015 08:57:52 +0000 (08:57 +0000)]
[X86] Add immediate range checking for a couple XOP builtins.

llvm-svn: 227679

9 years agoChange more of the guts of CodeGenRegister's RegUnit tracking to be based on bit...
Owen Anderson [Sat, 31 Jan 2015 07:49:41 +0000 (07:49 +0000)]
Change more of the guts of CodeGenRegister's RegUnit tracking to be based on bit vectors.

This is a continuation of my prior work to move some of the inner workings for CodeGenRegister to use bit vectors when computing about register units. This is highly beneficial to TableGen runtime on targets with large, dense register files. This patch represents a ~40% runtime reduction over and above my earlier improvement on a stress test of this case.

llvm-svn: 227678

9 years agoclang-format: Fix incorrect handling of leading whitespace.
Daniel Jasper [Sat, 31 Jan 2015 07:05:46 +0000 (07:05 +0000)]
clang-format: Fix incorrect handling of leading whitespace.

Added an assertion that triggered in an existing test case (without
observable differences) and fixed the code.

llvm-svn: 227677

9 years ago[x86] Remove tab characters from avxintrin.h. NFC.
Craig Topper [Sat, 31 Jan 2015 06:33:59 +0000 (06:33 +0000)]
[x86] Remove tab characters from avxintrin.h. NFC.

llvm-svn: 227676

9 years ago[X86] Make order consistent between 'const' and 'int' in one of the intrinsic header...
Craig Topper [Sat, 31 Jan 2015 06:31:30 +0000 (06:31 +0000)]
[X86] Make order consistent between 'const' and 'int' in one of the intrinsic header files. NFC

llvm-svn: 227675

9 years ago[X86] Add range checking to the immediate arguments of many of the SSE/AVX builtins.
Craig Topper [Sat, 31 Jan 2015 06:31:23 +0000 (06:31 +0000)]
[X86] Add range checking to the immediate arguments of many of the SSE/AVX builtins.

llvm-svn: 227674

9 years agollvm-readobj: add a test case for ARM_MOV32(T) base relocation
Saleem Abdulrasool [Sat, 31 Jan 2015 04:46:50 +0000 (04:46 +0000)]
llvm-readobj: add a test case for ARM_MOV32(T) base relocation

Add a trivial binary (int main() { return 0; }) built for Windows on ARM to
ensure that we can correctly identify ARM_MOV32(T) base relocations.  Addresses
post-commit review comments.

llvm-svn: 227673

9 years agoMake atom collections private.
Rui Ueyama [Sat, 31 Jan 2015 04:19:57 +0000 (04:19 +0000)]
Make atom collections private.

These fields were made protected in r193585. The aim of that change is to
expose these fields to SimpleFileWrapper. Because SimpleFileWrapper class
was removed in r227549, we can make them private.

llvm-svn: 227672

9 years agoRemove dead code.
Rui Ueyama [Sat, 31 Jan 2015 04:19:55 +0000 (04:19 +0000)]
Remove dead code.

llvm-svn: 227671

9 years agoARM: make a table more readable (NFC)
Saleem Abdulrasool [Sat, 31 Jan 2015 04:12:06 +0000 (04:12 +0000)]
ARM: make a table more readable (NFC)

This adds some comments and splits the flag calculation on type boundaries to
make the table more readable.  Addresses some post-commit review comments to SVN
r227603.  NFC.

llvm-svn: 227670

9 years ago[PM] Change the core design of the TTI analysis to use a polymorphic
Chandler Carruth [Sat, 31 Jan 2015 03:43:40 +0000 (03:43 +0000)]
[PM] Change the core design of the TTI analysis to use a polymorphic
type erased interface and a single analysis pass rather than an
extremely complex analysis group.

The end result is that the TTI analysis can contain a type erased
implementation that supports the polymorphic TTI interface. We can build
one from a target-specific implementation or from a dummy one in the IR.

I've also factored all of the code into "mix-in"-able base classes,
including CRTP base classes to facilitate calling back up to the most
specialized form when delegating horizontally across the surface. These
aren't as clean as I would like and I'm planning to work on cleaning
some of this up, but I wanted to start by putting into the right form.

There are a number of reasons for this change, and this particular
design. The first and foremost reason is that an analysis group is
complete overkill, and the chaining delegation strategy was so opaque,
confusing, and high overhead that TTI was suffering greatly for it.
Several of the TTI functions had failed to be implemented in all places
because of the chaining-based delegation making there be no checking of
this. A few other functions were implemented with incorrect delegation.
The message to me was very clear working on this -- the delegation and
analysis group structure was too confusing to be useful here.

The other reason of course is that this is *much* more natural fit for
the new pass manager. This will lay the ground work for a type-erased
per-function info object that can look up the correct subtarget and even
cache it.

Yet another benefit is that this will significantly simplify the
interaction of the pass managers and the TargetMachine. See the future
work below.

The downside of this change is that it is very, very verbose. I'm going
to work to improve that, but it is somewhat an implementation necessity
in C++ to do type erasure. =/ I discussed this design really extensively
with Eric and Hal prior to going down this path, and afterward showed
them the result. No one was really thrilled with it, but there doesn't
seem to be a substantially better alternative. Using a base class and
virtual method dispatch would make the code much shorter, but as
discussed in the update to the programmer's manual and elsewhere,
a polymorphic interface feels like the more principled approach even if
this is perhaps the least compelling example of it. ;]

Ultimately, there is still a lot more to be done here, but this was the
huge chunk that I couldn't really split things out of because this was
the interface change to TTI. I've tried to minimize all the other parts
of this. The follow up work should include at least:

1) Improving the TargetMachine interface by having it directly return
   a TTI object. Because we have a non-pass object with value semantics
   and an internal type erasure mechanism, we can narrow the interface
   of the TargetMachine to *just* do what we need: build and return
   a TTI object that we can then insert into the pass pipeline.
2) Make the TTI object be fully specialized for a particular function.
   This will include splitting off a minimal form of it which is
   sufficient for the inliner and the old pass manager.
3) Add a new pass manager analysis which produces TTI objects from the
   target machine for each function. This may actually be done as part
   of #2 in order to use the new analysis to implement #2.
4) Work on narrowing the API between TTI and the targets so that it is
   easier to understand and less verbose to type erase.
5) Work on narrowing the API between TTI and its clients so that it is
   easier to understand and less verbose to forward.
6) Try to improve the CRTP-based delegation. I feel like this code is
   just a bit messy and exacerbating the complexity of implementing
   the TTI in each target.

Many thanks to Eric and Hal for their help here. I ended up blocked on
this somewhat more abruptly than I expected, and so I appreciate getting
it sorted out very quickly.

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

llvm-svn: 227669

9 years ago[modules] When we try to complete the redeclaration chain for a class template
Richard Smith [Sat, 31 Jan 2015 03:04:55 +0000 (03:04 +0000)]
[modules] When we try to complete the redeclaration chain for a class template
specialization, pull in any lazy specializations of the class template.

llvm-svn: 227668

9 years agoARM: support stack probe size on Windows on ARM
Saleem Abdulrasool [Sat, 31 Jan 2015 02:26:37 +0000 (02:26 +0000)]
ARM: support stack probe size on Windows on ARM

Now that -mstack-probe-size is piped through to the backend via the function
attribute as on Windows x86, honour the value to permit handling of non-default
values for stack probes.  This is needed /Gs with the clang-cl driver or
-mstack-probe-size with the clang driver when targeting Windows on ARM.

llvm-svn: 227667

9 years agoELF: Don't use LayoutPass.
Rui Ueyama [Sat, 31 Jan 2015 02:05:01 +0000 (02:05 +0000)]
ELF: Don't use LayoutPass.

Previously we applied the LayoutPass to order atoms and then
apply elf::ArrayOrderPass to sort them again. The first pass is
basically supposed to sort atoms in the normal fashion (which
is to sort symbols in the same order as the input files).
The second pass sorts atoms in {init,fini}_array.<priority> by
priority.

The problem is that the LayoutPass is overkill. It analyzes
references between atoms to make a decision how to sort them.
It's slow, hard to understand, and above all, it doesn't seem
that we need its feature for ELF in the first place.

This patch remove the LayoutPass from ELF pass list. Now all
reordering is done in elf::OrderPass. That pass sorts atoms by
{init,fini}_array, and if they are not in the special section,
they are ordered as the same order as they appear in the command
line. The new code is far easier to understand, faster, and
still able to create valid executables.

Unlike the previous layout pass, elf::OrderPass doesn't count
any attributes of an atom (e.g. permissions) except its
position. It's OK because the writer takes care of them if we
have to.

This patch changes the order of final output, although that's
benign. Tests are updated.

http://reviews.llvm.org/D7278

llvm-svn: 227666

9 years agoRevert "Remove unused function."
Alexey Samsonov [Sat, 31 Jan 2015 01:27:18 +0000 (01:27 +0000)]
Revert "Remove unused function."

This reverts commit r227633. SetEnv was prematurely deleted.

llvm-svn: 227665

9 years ago[fuzzer] add flags to run fuzzer in multiple parallel processes
Kostya Serebryany [Sat, 31 Jan 2015 01:14:40 +0000 (01:14 +0000)]
[fuzzer] add flags to run fuzzer in multiple parallel processes

llvm-svn: 227664

9 years agoDebugInfo: Fix line table for comparisons harder/better for the sake of C (& the...
David Blaikie [Sat, 31 Jan 2015 01:10:11 +0000 (01:10 +0000)]
DebugInfo: Fix line table for comparisons harder/better for the sake of C (& the GDB buildbot)

llvm-svn: 227663

9 years agoRename test file to be more accurate (& free up the file name for a more appropriate...
David Blaikie [Sat, 31 Jan 2015 01:10:09 +0000 (01:10 +0000)]
Rename test file to be more accurate (& free up the file name for a more appropriate test)

llvm-svn: 227662

9 years agoAdd the -section option to llvm-objdump used with -macho that takes the argument
Kevin Enderby [Sat, 31 Jan 2015 00:37:11 +0000 (00:37 +0000)]
Add the -section option to llvm-objdump used with -macho that takes the argument
segname,sectname to specify a Mach-O section to print.  The printing is based on
the section type or section attributes.

The printing of the module initialization and termination section types is printed
with this change.  Printing of other section types will be added next.

llvm-svn: 227649

9 years agoRemove the last vestiges of resetOperationActions.
Eric Christopher [Sat, 31 Jan 2015 00:21:17 +0000 (00:21 +0000)]
Remove the last vestiges of resetOperationActions.

llvm-svn: 227648

9 years agoReuse a bunch of cached subtargets and remove getSubtarget calls
Eric Christopher [Sat, 31 Jan 2015 00:06:45 +0000 (00:06 +0000)]
Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

llvm-svn: 227647

9 years agoAdd PPC test for r227481, but XFAIL because this is actually more work than it appear...
David Blaikie [Fri, 30 Jan 2015 23:52:19 +0000 (23:52 +0000)]
Add PPC test for r227481, but XFAIL because this is actually more work than it appeared to be.

Same sort of bug as on ARM where the cmp+branch are lowered to br_cc
(choosing the branch's debugloc for the br_cc's debugloc) then expanded
out to a cmp and a br, but both using the debug loc of the br_cc, thus
losing fidelity.

llvm-svn: 227645