Commit Graph

84044 Commits

Author SHA1 Message Date
Akira Hatanaka
b4f921b1f0 Delete mips64 target machine classes. mips target machines can be used in place
of them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161080 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 21:39:17 +00:00
Akira Hatanaka
1d53f1bbab Let PEI::calculateFrameObjectOffsets compute the final stack size rather than
computing it in MipsFrameLowering::emitPrologue.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161078 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 21:28:49 +00:00
Akira Hatanaka
1d165f1c25 Expand DYNAMIC_STACKALLOC nodes rather than doing custom-lowering.
The frame object which points to the dynamically allocated area will not be
needed after changes are made to cease reserving call frames.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161076 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 20:54:48 +00:00
Manman Ren
f99efdf329 MachineSink: Sort the successors before trying to find SuccToSinkTo.
Use stable_sort instead of sort. Follow-up to r161062.

rdar://11980766


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161075 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 20:45:38 +00:00
Jakob Stoklund Olesen
5f8e8bd656 Compute instruction depths through the current trace.
Assuming infinite issue width, compute the earliest each instruction in
the trace can issue, when considering the latency of data dependencies.
The issue cycle is record as a 'depth' from the beginning of the trace.

This is half the computation required to find the length of the critical
path through the trace. Heights are next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 20:44:38 +00:00
Jakob Stoklund Olesen
64e2973bf7 Rename CT -> MTM. MachineTraceMetrics is abbreviated MTM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161072 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 20:25:13 +00:00
Akira Hatanaka
603f69dc2c Define ADJCALLSTACKDOWN/UP nodes. These nodes are emitted regardless of whether
or not it is in mips16 mode. Define MipsPseudo (mode-independant pseudo) and
PseudoSE (mips32/64 pseudo) classes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 19:13:07 +00:00
Akira Hatanaka
c4388d4199 Change name of class MipsInst to InstSE to distinguish it from mips16's
instruction class. SE stands for standard encoding.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161069 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:55:01 +00:00
Akira Hatanaka
e2d529ac11 When store nodes or memcpy nodes are created to copy the function call
arguments to the stack in MipsISelLowering::LowerCall, use stack pointer and
integer offset operands rather than frame object operands.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161068 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:46:41 +00:00
Chad Rosier
d97f3a5ab0 [x86 frame lowering] In 32-bit mode, use ESI as the base pointer.
Previously, we were using EBX, but PIC requires the GOT to be in EBX before 
function calls via PLT GOT pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:29:21 +00:00
Ted Kremenek
521ed460e9 Use regex instead of special casing clang and llvm libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:23:44 +00:00
Akira Hatanaka
36bcc11236 Fix type of LUXC1 and SUXC1. These instructions were incorrectly defined as
single-precision load and store.

Also avoid selecting LUXC1 and SUXC1 instructions during isel. It is incorrect
to map unaligned floating point load/store nodes to these instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:16:49 +00:00
Manman Ren
53b59d1d97 MachineSink: Sort the successors before trying to find SuccToSinkTo.
One motivating example is to sink an instruction from a basic block which has
two successors: one outside the loop, the other inside the loop. We should try
to sink the instruction outside the loop.

rdar://11980766


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:10:39 +00:00
Micah Villmow
8c574be2fe Conform to LLVM coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161061 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 18:07:43 +00:00
Micah Villmow
683826765c Don't generate ordered or unordered comparison operations if it is not legal to do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 16:48:03 +00:00
Chandler Carruth
06bd8ca8c2 Implement copy and move assignment for TinyPtrVector. These try to
re-use allocated vectors as much as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161041 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 09:42:24 +00:00
Sylvestre Ledru
3f5054f922 Fix some minor typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161037 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 07:05:57 +00:00
Craig Topper
19dbe2f5f0 Use uint8_t to store the InstructionContext table. Saves 768 bytes of static data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161034 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 06:15:39 +00:00
Craig Topper
de9e333e18 Tidy up. Move for loop index declarations into for statements. Use unsigned instead of uint16_t for loop indices. Use unsigned instead of uint32_t for arguments to raw_ostream.indent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161033 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 06:02:05 +00:00
Craig Topper
e08789f5e2 Tidy up function argument formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 05:42:02 +00:00
Craig Topper
a31359a529 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161031 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 05:28:41 +00:00
Craig Topper
9840009ff8 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 05:27:01 +00:00
Craig Topper
c60685e320 Make INSTRUCTION_SPECIFIER_FIELDS match X86DisassemblerCommon.h. Also remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 05:18:26 +00:00
Craig Topper
a40476f9cc Tidy up trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161027 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 04:58:05 +00:00
Craig Topper
5592b4567d Tidy up trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 04:38:27 +00:00
Chandler Carruth
b4c28fc93f Clean up trailing whitespace and unnecessary blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161025 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 04:13:57 +00:00
Chandler Carruth
40dab1059e Bring TinyPtrVector under test. Somehow we never picked up unit tests
for this class. These tests exercise most of the basic properties, but
the API for TinyPtrVector is very strange currently. My plan is to start
fleshing out the API to match that of SmallVector, but I wanted a test
for what is there first.

Sadly, it doesn't look reasonable to just re-use the SmallVector tests,
as this container can only ever store pointers, and much of the
SmallVector testing is to get construction and destruction right.

Just to get this basic test working, I had to add value_type to the
interface.

While here I found a subtle bug in the combination of 'erase', 'begin',
and 'end'. Both 'begin' and 'end' wanted to use a null pointer to
indicate the "end" iterator of an empty vector, regardless of whether
there is actually a vector allocated or the pointer union is null.
Everything else was fine with this except for erase. If you erase the
last element of a vector after it has held more than one element, we
return the end iterator of the underlying SmallVector which need not be
a null pointer. Instead, simply use the pointer, and poniter + size()
begin/end definitions in the tiny case, and delegate to the inner vector
whenever it is present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161024 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 02:48:31 +00:00
Jakob Stoklund Olesen
34af6f597b Clear kill flags in removeCopyByCommutingDef().
We are extending live ranges, so kill flags are not accurate. They
aren't needed until they are recomputed after RA anyway.

<rdar://problem/11950722>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161023 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 02:47:24 +00:00
Manman Ren
1123614317 Reverse order of the two branches at end of a basic block if it is profitable.
We branch to the successor with higher edge weight first.
Convert from
     je    LBB4_8  --> to outer loop
     jmp   LBB4_14 --> to inner loop
to
     jne   LBB4_14
     jmp   LBB4_8

PR12750
rdar: 11393714


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161018 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 01:11:07 +00:00
Andrew Trick
8b5704f958 Use the latest MachineRegisterInfo APIs. No functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 23:48:17 +00:00
Andrew Trick
0492a8c530 Added MachineRegisterInfo::hasOneDef()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161009 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 23:48:14 +00:00
Andrew Trick
269120cd9b Inline MachineRegisterInfo::hasOneUse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 23:48:12 +00:00
Chandler Carruth
5eb301740c Extend the InstVisitor to visit the specialized classes wrapping
CallInst for intrinsics. This allows users of the InstVisitor that would
like to special case certain very common intrinsics to do so naturally
in keeping with the type hierarchy's utility classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 23:45:06 +00:00
Jakob Stoklund Olesen
2f6b62b09f Avoid looking at stale data in verifyAnalysis().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161004 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 23:15:12 +00:00
Jakob Stoklund Olesen
1c899cf47c Allow traces to enter nested loops.
This lets traces include the final iteration of a nested loop above the
center block, and the first iteration of a nested loop below the center
block.

We still don't allow traces to contain backedges, and traces are
truncated where they would leave a loop, as seen from the center block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 23:15:10 +00:00
Jim Grosbach
9714644a38 Keep empty assembly macro argument values in the middle of the list.
Empty macro arguments at the end of the list should be as-if not specified at
all, but those in the middle of the list need to be kept so as not to screw
up the positional numbering. E.g.:
.macro foo
foo_-bash___:
  nop
.endm

foo 1, 2, 3, 4
foo 1, , 3, 4

Should create two labels, "foo_1_2_3_4" and "foo_1__3_4".

rdar://11948769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 22:44:17 +00:00
Chandler Carruth
ba1f580f33 Move the SmallVector unit tests to be type-parameterized so that we can
test more than a single instantiation of SmallVector.

Add testing for 0, 1, 2, and 4 element sized "small" buffers. These
appear to be essentially untested in the unit tests until now.

Fix several tests to be robust in the face of a '0' small buffer. As
a consequence of this size buffer, the growth patterns are actually
observable in the test -- yes this means that many tests never caused
a grow to occur before. For some tests I've merely added a reserve call
to normalize behavior. For others, the growth is actually interesting,
and so I captured the fact that growth would occur and adjusted the
assertions to not assume how rapidly growth occured.

Also update the specialization for a '0' small buffer length to have all
the same interface points as the normal small vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161001 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 22:17:52 +00:00
Jakob Stoklund Olesen
20f13c50d8 Clarify invalidation strategy in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160997 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 21:16:22 +00:00
Nick Lewycky
ead66027e8 Fix grammar-o. Fixes PR13482!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 21:10:51 +00:00
Jakob Stoklund Olesen
8e54ab5c76 Assert that all trace candidate blocks have been visited by the PO.
When computing a trace, all the candidates for pred/succ must have been
visited. Filter out back-edges first, though. The PO traversal ignores
them.

Thanks to Andy for spotting this in review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 21:10:27 +00:00
Jakob Stoklund Olesen
ef6c76c984 Hook into PassManager's analysis verification.
By overriding Pass::verifyAnalysis(), the pass contents will be verified
by the pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160994 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 20:57:50 +00:00
Pete Cooper
32ecfb4158 Consider address spaces for hashing and CSEing DAG nodes. Otherwise two loads from different x86 segments but the same address would get CSEd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 20:23:19 +00:00
Eric Christopher
b7e22efa2b Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160981 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 20:09:37 +00:00
Kevin Enderby
5af4de18ef Fix a bug in ARMMachObjectWriter::RecordRelocation() in ARMMachObjectWriter.cpp
where the other_half of the movt and movw relocation entries needs to get set
and only with the 16 bits of the other half.

rdar://10038370


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 18:46:15 +00:00
Jakob Stoklund Olesen
3f63a58978 Add MachineInstr::isTransient().
This is a cleaned up version of the isFree() function in
MachineTraceMetrics.cpp.

Transient instructions are very unlikely to produce any code in the
final output. Either because they get eliminated by RegisterCoalescing,
or because they are pseudo-instructions like labels and debug values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 18:34:14 +00:00
Jakob Stoklund Olesen
a1b2bf7979 Add MachineTraceMetrics::verify().
This function verifies the consistency of cached data in the
MachineTraceMetrics analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160976 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 18:34:11 +00:00
Jakob Stoklund Olesen
ee31ae12e8 Verify that the CFG hasn't changed during invalidate().
The MachineTraceMetrics analysis must be invalidated before modifying
the CFG. This will catch some of the violations of that rule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160969 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 17:36:49 +00:00
Jakob Stoklund Olesen
f192b507a3 Add MachineBasicBlock::isPredecessor().
A->isPredecessor(B) is the same as B->isSuccessor(A), but it can
tolerate a B that is null or dangling. This shouldn't happen normally,
but it it useful for verification code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160968 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 17:36:47 +00:00
Nadav Rotem
97baaeaeb2 When constant folding GEP expressions, keep the address space information of pointers.
Together with Ran Chachick <ran.chachick@intel.com>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160954 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 07:25:20 +00:00
Craig Topper
818f609459 Mark MOVZX16/MOVSX16 as neverHasSideEffects/mayLoad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160953 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-30 07:14:07 +00:00