Fix an old-style doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173027 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up the formatting and doxygen for the simple inliner a bit. No
functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173028 91177308-0d34-0410-b5e6-96231b3b80d8
Formatting and comment fixes to the always inliner.

Formatting fixes brought to you by clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173029 91177308-0d34-0410-b5e6-96231b3b80d8
Make the inline cost a proper analysis pass. This remains essentially
a dynamic analysis done on each call to the routine. However, now it can
use the standard pass infrastructure to reference other analyses,
instead of a silly setter method. This will become more interesting as
I teach it about more analysis passes.

This updates the two inliner passes to use the inline cost analysis.
Doing so highlights how utterly redundant these two passes are. Either
we should find a cheaper way to do always inlining, or we should merge
the two and just fiddle with the thresholds to get the desired behavior.
I'm leaning increasingly toward the latter as it would also remove the
Inliner sub-class split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173030 91177308-0d34-0410-b5e6-96231b3b80d8
Now that the inline cost analysis is a pass, we can easily have it
depend on and use other analyses (as long as they're either immutable
passes or CGSCC passes of course -- nothing in the pass manager has been
fixed here). Leverage this to thread TargetTransformInfo down through
the inline cost analysis.

No functionality changed here, this just threads things through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173031 91177308-0d34-0410-b5e6-96231b3b80d8
Move the inline cost analysis's primary cost query to TTI instead of the
old CodeMetrics system. TTI has the specific advantage of being
extensible and customizable by targets to reflect target-specific cost
metrics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173032 91177308-0d34-0410-b5e6-96231b3b80d8
Sink InlineCost.cpp into IPA -- it is now officially an interprocedural
analysis. How cute that it wasn't previously. ;]

Part of this confusion stems from the flattened header file tree. Thanks
to Benjamin for pointing out the goof on IRC, and we're considering
un-flattening the headers, so speak now if that would bug you.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173033 91177308-0d34-0410-b5e6-96231b3b80d8
Fix indentation and formatting.

This change brought to by clang-format. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173034 91177308-0d34-0410-b5e6-96231b3b80d8
Switch CodeMetrics itself over to use TTI to determine if an instruction
is free. The whole CodeMetrics API should probably be reworked more, but
this is enough to allow deleting the duplicate code there for computing
whether an instruction is free.

All of the passes using this have been updated to pull in TTI and hand
it to the CodeMetrics stuff. Further, a dead CodeMetrics API
(analyzeFunction) is nuked for lack of users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173036 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SILowerControlFlow.cpp: Fix a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173040 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Derive all sample intrinsics from a single class.

Patch by: Michel Dänzer

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173051 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Take target parameter for sample intrinsics.

Patch by: Michel Dänzer

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173052 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Use unnormalized coordinates for sampling with the RECT target.

Patch by: Michel Dänzer

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173053 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a comment. Induction vars dont need to start at zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173061 91177308-0d34-0410-b5e6-96231b3b80d8
rename "SkipToWord" to "SkipToFourByteBoundary" since a word is not always 4 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173062 91177308-0d34-0410-b5e6-96231b3b80d8
wean Blob handling logic off of banging on NextChar directly.  Instead, make
it reason about the current bit position, which is always independent of the
underlying cursors word size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173063 91177308-0d34-0410-b5e6-96231b3b80d8
Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.

A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173064 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a heinous inefficiency introduced in r149918, wherein reading each byte of a
BLOB (i.e., large, performance intensive data) in a bitcode file was switched to
invoking one virtual method call per byte read.  Now we do one virtual call per
BLOB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173065 91177308-0d34-0410-b5e6-96231b3b80d8
rework the Bitstream reader to actually work a machine word at a time, instead of 32-bits at a time.
This cuts in half the number of virtual methods called to refill that word when compiling on a 64-bit
host, and will make 64-bit read operations faster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173072 91177308-0d34-0410-b5e6-96231b3b80d8
r173072 is causing some regressions on big endian hosts, I don't have time to debug it
so revert it for now.


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