Commit Graph

16157 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
c16bf79303 Also compute register mask lists under -new-live-intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 21:56:39 +00:00
Chad Rosier
21edb397b2 Typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 21:41:59 +00:00
Jakob Stoklund Olesen
b18d779b35 Eliminate the IS_PHI_DEF flag and VNInfo::setIsPHIDef().
A value number is a PHI def if and only if it begins at a block
boundary. This can be derived from the def slot, a separate flag is not
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160893 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 21:11:14 +00:00
Jakob Stoklund Olesen
3dfa38a5bf Add a -new-live-intervals experimental option.
This option replaces the existing live interval computation with one
based on LiveRangeCalc.cpp. The new algorithm does not depend on
LiveVariables, and it can be run at any time, before or after leaving
SSA form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 20:58:46 +00:00
Benjamin Kramer
e82fafe9e2 SmallVector: Crank up verbosity of asserts per Chandler's request.
Also add assertions to validate the iterator in the insert method overloads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160882 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 19:05:58 +00:00
Jakob Stoklund Olesen
46c0dc7858 Give MCRegisterInfo an implementation file.
Move some functions from MCRegisterInfo.h that don't need to be inline.

This shrinks llc by 8K.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160865 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 16:25:20 +00:00
Benjamin Kramer
df7c5d4137 SmallVector::erase: Assert that iterators are actually inside the vector.
The rationale here is that it's hard to write loops containing vector erases and
it only shows up if the vector contains non-trivial objects leading to crashes
when forming them out of garbage memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160854 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 09:10:25 +00:00
Jakob Stoklund Olesen
0371cd8b1c Eliminate the large XXXSubRegTable constant arrays.
These tables were indexed by [register][subreg index] which made them,
very large and sparse.

Replace them with lists of sub-register indexes that match the existing
lists of sub-registers. MCRI::getSubReg() becomes a very short linear
search, like getSubRegIndex() already was.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27 00:10:51 +00:00
Jakob Stoklund Olesen
2ca6b3c374 Remove support for 'CompositeIndices' and sub-register cycles.
Now that the weird X86 sub_ss and sub_sd sub-register indexes are gone,
there is no longer a need for the CompositeIndices construct in .td
files. Sub-register index composition can be specified on the
SubRegIndex itself using the ComposedOf field.

Also enforce unique names for sub-registers in TableGen. The same
sub-register cannot be available with multiple sub-register indexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160842 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 23:39:50 +00:00
Micah Villmow
b3fb028ebd Add support for v16i32/v16i64 into the code generator. This is required for backends that use i32/i64 vectors for the getSetCCResultType function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 21:22:00 +00:00
Chad Rosier
ad2b592cf9 Make comments in Debug.cpp and Debug.h consistent. Rename SetCurrentDebugType;
Function names should be camel case, and start with a lower case letter.  No
functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 20:38:52 +00:00
Jakob Stoklund Olesen
9f63e10427 Start scaffolding for a MachineTraceMetrics analysis pass.
This is still a work in progress.

Out-of-order CPUs usually execute instructions from multiple basic
blocks simultaneously, so it is necessary to look at longer traces when
estimating the performance effects of code transformations.

The MachineTraceMetrics analysis will pick a typical trace through a
given basic block and provide performance metrics for the trace. Metrics
will include:

- Instruction count through the trace.
- Issue count per functional unit.
- Critical path length, and per-instruction 'slack'.

These metrics can be used to determine the performance limiting factor
when executing the trace, and how it will be affected by a code
transformation.

Initially, this will be used by the early if-conversion pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 18:38:11 +00:00
Dan Gohman
27db99fcee Add a floor intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160791 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 17:43:27 +00:00
Jakob Stoklund Olesen
303c909d5b Differentially encode all MC register lists.
This simplifies MCRegisterInfo and shrinks the target descriptions a bit
more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160758 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-25 21:41:37 +00:00
Nuno Lopes
6e699bf38d revert r160742: it's breaking CMake build
original commit msg:
MemoryBuiltins: add support to determine the size of strdup'ed non-constant strings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160751 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-25 18:49:28 +00:00
Nuno Lopes
e3094283e3 MemoryBuiltins: add support to determine the size of strdup'ed non-constant strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160742 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-25 17:29:22 +00:00
Nuno Lopes
a536835230 add EmitStrNLen()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160741 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-25 17:18:59 +00:00
Nuno Lopes
51004dff92 make all Emit*() functions consult the TargetLibraryInfo information before creating a call to a library function.
Update all clients to pass the TLI information around.
Previous draft reviewed by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160733 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-25 16:46:31 +00:00
Rafael Espindola
cde227bc2a In order to correctly compile
struct s {
  double x1;
  float x2;
};
__attribute__((regparm(3))) struct s f(int a, int b, int c);
void g(void) {
  f(41, 42, 43);
}

We need to be able to represent passing the address of s to f (sret) in a
register (inreg). Turns out that all that is needed is to not mark them as
mutually incompatible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160695 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 21:40:17 +00:00
Michael J. Spencer
9669f74976 [Object] Remove unneeded const_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160692 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 21:07:56 +00:00
Nuno Lopes
8d32463a9f add a few more functions to TargetLibraryInfo:
fputc, memchr, memcmp, putchar, puts, strchr, strncmp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160690 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 21:00:36 +00:00
Anshuman Dasgupta
9dc5b3e6c4 Add new interfaces to support ldd's ReaderElf.cpp.
Patch by Sid Manning!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160685 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 19:48:24 +00:00
Nuno Lopes
0841e63ede TargetLibraryInfo: add strn?cat, strn?cpy, and strn?len
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 17:25:06 +00:00
Richard Trieu
5e31044e11 Add operator== to APSInt. This will compare the signed bit before doing
the comparison.  This prevents large unsigned integers from being equal to
signed negative integers of the same bit width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160642 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 20:24:23 +00:00
Nadav Rotem
f4341e4155 Doxygenify the comments of ISD nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160623 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 09:04:00 +00:00
Sylvestre Ledru
c8e41c5917 Fix a typo (the the => the)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160621 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 08:51:15 +00:00
NAKAMURA Takumi
2864de7c2d autoconf: Re-introduce LLVM_HOSTTRIPLE since r143500, as rework of PR11060.
cmake: Add LLVM_HOSTTRIPLE. For now, it is same as TARGET_TRIPLE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160609 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-22 03:04:52 +00:00
Akira Hatanaka
b7dd9fc678 Add VK_Mips_HIGHER and VK_Mips_HIGHEST to MCSymbolRefExpr::VariantKind.
Test case will be added later when long branch patch is checked in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160597 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 02:15:19 +00:00
Nuno Lopes
c606c3ff91 baby steps toward fixing some problems with inbound GEPs that overflow, as discussed 2 months ago or so.
Make sure we do not emit index computations with NSW flags so that we dont get an undef value if the GEP overflows

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160589 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 23:07:40 +00:00
Nuno Lopes
78435f6bb7 move the bounds checking pass to the instrumentation folder, where it belongs. I dunno why in the world I dropped it in the Scalar folder in the first place.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160587 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 22:39:33 +00:00
Benjamin Kramer
e288cd100f Remove unused private member variables uncovered by the recent changes to clang's -Wunused-private-field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160583 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 22:05:57 +00:00
Galina Kistanova
428ff6a644 Fix few warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:30:52 +00:00
Daniel Dunbar
d79637b940 raw_ostream: Add a has_colors() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160558 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 18:29:41 +00:00
Daniel Dunbar
7d83658140 Process: Add sys::Process::FileDescriptorHasColors().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160557 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 18:29:38 +00:00
Owen Anderson
0fcaaafd1a Make RegisterOperand a subclass of DAGOperand so that RegisterOperands can be passed into multiclasses that take DAGOperands as multiclass parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160540 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 03:38:19 +00:00
Benjamin Kramer
4cdd17ef47 Pull the simple parts of DenseMapInfo<DebugLoc> inline and prune includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160507 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 15:00:34 +00:00
Alexey Samsonov
71d94f8055 DebugInfo library: add support for fetching absolute paths to source files
(instead of basenames) from DWARF. Use this behavior in llvm-dwarfdump tool.

Reviewed by Benjamin Kramer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 07:03:58 +00:00
Galina Kistanova
72ea0c9ffa Fixed few warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160493 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 04:50:12 +00:00
Bill Wendling
8c51e3995d Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 00:01:33 +00:00
Bill Wendling
17689b13be Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160472 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 00:01:00 +00:00
Bill Wendling
aa7507d68d Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 23:58:37 +00:00
Jordan Rose
6ef4996b09 Allow PointerIntPairs to be created from const void *.
For a measure of safety, this conversion is only permitted if the
stored pointer type can also be created from a const void *.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160456 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 21:58:49 +00:00
Simon Atanasyan
6aef977e85 Add some missed ELF constants definitions:
- section types
- dynamic table entries tags
- state flags for DT_FLAGS_1 entry

The patch reviewed by Rafael Espindola.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160433 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 14:12:32 +00:00
NAKAMURA Takumi
2e14d27cc4 Update config.h.cmake corresponding to config.h.in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 09:17:02 +00:00
Andrew Trick
18a1b616ea SCEVTraversal: Add a visited set.
Expression trees may be DAGs. Make sure traversal has linear complexity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160426 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18 05:14:03 +00:00
Jakob Stoklund Olesen
1cacae0f29 Fix broken ipo_ext_iterator constructors.
These functions have obviously never been used before.
They should be identical to the idf_ext_iterator counterparts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160381 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 17:57:25 +00:00
Jakob Stoklund Olesen
31f18eeb2b Allow for customized graph edge pruning in PostOrderIterator.h
Make it possible to prune individual graph edges from a post-order
traversal by specializing the po_iterator_storage template. Previously,
it was only possible to prune full graph nodes. Edge pruning makes it
possible to remove loop back-edges, for example.

Also replace the existing DFSetTraits customization hook with a
po_iterator_storage method for observing the post-order. DFSetTraits was
only used by LoopIterator.h which now provides a po_iterator_storage
specialization.

Thanks to Sean and Chandler for reviewing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160366 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 15:35:40 +00:00
Simon Atanasyan
7072551feb Revert commit r160307. We decide to move builtins selection to the backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160352 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 08:14:45 +00:00
Jim Grosbach
ac915b48d8 TableGen: Allow conditional instruction pattern in multiclass.
Define a 'null_frag' SDPatternOperator node, which if referenced in an
instruction Pattern, results in the pattern being collapsed to be as-if
'[]' had been specified instead. This allows supporting a multiclass
definition where some instaniations have ISel patterns associated and
others do not.

For example,
multiclass myMulti<RegisterClass rc, SDPatternOperator OpNode = null_frag> {
  def _x : myI<(outs rc:), (ins rc:), []>;
  def _r : myI<(outs rc:), (ins rc:), [(set rc:, (OpNode rc:))]>;
}

defm foo : myMulti<GRa, not>;
defm bar : myMulti<GRb>;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160333 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17 00:47:06 +00:00
Simon Atanasyan
f6978ddbec MIPS: Create two definitions for __builtin_mips_shll_qb builtin.
The first variant accepts immediate number as the second argument.
The second variant accepts register operand as the second argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 18:51:39 +00:00