1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

11300 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
508829f1d1 Add SplitKit::isOriginalEndpoint and use it to force live range splitting to terminate.
An original endpoint is an instruction that killed or defined the original live
range before any live ranges were split.

When splitting global live ranges, avoid creating local live ranges without any
original endpoints. We may still create global live ranges without original
endpoints, but such a range won't be split again, and live range splitting still
terminates.

llvm-svn: 126151
2011-02-21 23:09:46 +00:00
Stuart Hastings
d7ca2e5b61 Fix to correctly support attribute((section("__DATA, __common"))).
Radar 9012638.

llvm-svn: 126127
2011-02-21 17:27:17 +00:00
Nadav Rotem
1660c0bc25 Fix 9267; Add vector zext support.
The DAGCombiner folds the zext into complex load instructions. This patch
prevents this optimization on vectors since none of the supported targets
knows how to perform load+vector_zext in one instruction.

llvm-svn: 126080
2011-02-20 12:37:50 +00:00
Devang Patel
d7aee67937 Do not emit empty DW_TAG_lexical_block DIEs. In one test case, size of debug info reduced by almost 7%.
llvm-svn: 126009
2011-02-19 01:31:27 +00:00
Jakob Stoklund Olesen
e2833bf683 Give SplitAnalysis a VRM member to access VirtRegMap::getOriginal().
llvm-svn: 126005
2011-02-19 00:53:42 +00:00
Jakob Stoklund Olesen
45ba3718d4 Missed member rename for naming convention.
llvm-svn: 126003
2011-02-19 00:42:33 +00:00
Jakob Stoklund Olesen
69bc9ac5f7 This method belonged in VirtRegMap.
llvm-svn: 126002
2011-02-19 00:38:43 +00:00
Jakob Stoklund Olesen
6d746aa534 Separate timers for local and global splitting.
llvm-svn: 126001
2011-02-19 00:38:40 +00:00
Devang Patel
d63bce18da Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
This time with a fix that avoids using invalidated DenseMap iterator.

llvm-svn: 125984
2011-02-18 22:43:42 +00:00
Jakob Stoklund Olesen
0dd5f07ac0 Use VirtRegMap's Virt2SplitMap to keep track of the original live range before splitting.
All new virtual registers created for spilling or splitting point back to their original.

llvm-svn: 125980
2011-02-18 22:35:20 +00:00
Oscar Fuentes
6e5d344a2e Move library stuff out of the toplevel CMakeLists.txt file.
llvm-svn: 125968
2011-02-18 22:06:14 +00:00
Jakob Stoklund Olesen
f86a7a2f49 Add VirtRegMap::rewrite() and use it in the new register allocators.
The rewriter works almost identically to -rewriter=trivial, except it also
eliminates any identity copies.

This makes the new register allocators independent of VirtRegRewriter.cpp which
will be going away at the same time as RegAllocLinearScan.

llvm-svn: 125967
2011-02-18 22:03:18 +00:00
Bill Wendling
dd9b7a90a7 Reapply r114997 now that the buildbots have been updated.
llvm-svn: 125960
2011-02-18 21:12:58 +00:00
Cameron Zwarich
f6fa19a03f Roll out r125794 to help diagnose the llvm-gcc-i386-linux-selfhost failure.
llvm-svn: 125830
2011-02-18 04:58:10 +00:00
Jakob Stoklund Olesen
9af1f4da20 Trim debugging output.
llvm-svn: 125802
2011-02-18 00:32:47 +00:00
Devang Patel
b6f55191b3 Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
llvm-svn: 125794
2011-02-17 23:33:27 +00:00
Jakob Stoklund Olesen
c710f55d9d Add basic register allocator statistics.
llvm-svn: 125789
2011-02-17 22:53:48 +00:00
Jakob Stoklund Olesen
65f52c387c Split local live ranges.
A local live range is live in a single basic block. If such a range fails to
allocate, try to find a sub-range that would get a larger spill weight than its
interference.

llvm-svn: 125764
2011-02-17 19:13:53 +00:00
Duncan Sands
9b4a2b4fe0 Fix wrong logic in promotion of signed mul-with-overflow (I pointed this out at
the time but presumably my email got lost).  Examples where the previous logic
got it wrong: (1) a signed i8 multiply of 64 by 2 overflows, but the high part is
zero; (2) a signed i8 multiple of -128 by 2 overflows, but the high part is all
ones. 

llvm-svn: 125748
2011-02-17 12:42:48 +00:00
Cameron Zwarich
443d4193ef Switch to SmallVector in SimpleRegisterCoalescing for a 3.5% speedup on 403.gcc.
llvm-svn: 125728
2011-02-17 06:52:07 +00:00
Cameron Zwarich
ebcd35fd5a Adjust indenting of arguments.
llvm-svn: 125727
2011-02-17 06:13:46 +00:00
Cameron Zwarich
5ea289952e Return Changed from SplitPHIEdges rather than always returning true.
llvm-svn: 125726
2011-02-17 06:13:43 +00:00
Stuart Hastings
47e45a32a8 Swap VT and DebugLoc operands of getExtLoad() for consistency with
other getNode() methods.  Radar 9002173.

llvm-svn: 125665
2011-02-16 16:23:55 +00:00
Eric Christopher
25956e0c47 Refactor zero folding slightly. Clean up todo.
llvm-svn: 125651
2011-02-16 04:50:12 +00:00
Eric Christopher
8965ba39fb The change for PR9190 wasn't quite right. We need to avoid making the
transformation if we can't legally create a build vector of the correct
type. Check that we can make the transformation first, and add a TODO to
refactor this code with similar cases.

Fixes: PR9223 and rdar://9000350
llvm-svn: 125631
2011-02-16 01:10:03 +00:00
Evan Cheng
1a5aa79d0e Remove a duplicated check.
llvm-svn: 125625
2011-02-16 00:37:02 +00:00
Devang Patel
d5b7c28519 Ignore DBG_VALUE machine instructions while constructing instruction ranges based on location info.
Machine instruction range consisting of only DBG_VALUE MIs only contributes consecutive labels in assembly output, which is harmless, and empty scope entry in DebugInfo, which confuses debugger tools.

llvm-svn: 125577
2011-02-15 17:56:09 +00:00
Duncan Sands
061150ac1b Spelling fix: consequtive -> consecutive.
llvm-svn: 125563
2011-02-15 09:23:02 +00:00
Evan Cheng
c6f645610e Fix thinko. Cmp can be the first instruction in a MBB.
llvm-svn: 125552
2011-02-15 05:00:24 +00:00
Chris Lattner
db204cbe42 convert ConstantVector::get to use ArrayRef.
llvm-svn: 125537
2011-02-15 00:14:00 +00:00
Jakob Stoklund Olesen
70f48f08c1 Move more fragments of spill weight calculation into CalcSpillWeights.h
Simplify the spill weight calculation a bit by bypassing
getApproximateInstructionCount() and using LiveInterval::getSize() directly.
This changes the computed spill weights, but only by a constant factor in each
function. It should not affect how spill weights compare against each other, and
so it shouldn't affect code generation.

llvm-svn: 125530
2011-02-14 23:15:38 +00:00
Rafael Espindola
3c32af5834 Switch llvm to using comdats. For now always use groups with a single
section.

llvm-svn: 125526
2011-02-14 22:23:49 +00:00
Evan Cheng
3685f86688 Fix PR8854. Track inserted copies to avoid read before write. Sorry, it's hard to reduce a sensible small test case.
llvm-svn: 125523
2011-02-14 21:50:37 +00:00
Chris Lattner
ee7f7c2494 revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.

llvm-svn: 125504
2011-02-14 18:15:46 +00:00
Rafael Espindola
a667a598aa Move broken HasCommonSymbols to ELFWriter.cpp.
llvm-svn: 125490
2011-02-14 16:51:08 +00:00
Chris Lattner
34f32cb4c2 Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom.  Change various clients to simplify their code.

llvm-svn: 125487
2011-02-14 07:55:32 +00:00
Chris Lattner
68d9fae34e fix PR9210 by implementing some type legalization logic for
vector fp conversions.

llvm-svn: 125482
2011-02-14 06:30:45 +00:00
Chris Lattner
2552afcae6 fix two comment thinkos
llvm-svn: 125481
2011-02-14 06:14:42 +00:00
Cameron Zwarich
781aa81cd7 Add some statistics to StrongPHIElimination.
llvm-svn: 125477
2011-02-14 02:09:18 +00:00
Cameron Zwarich
9e4c747e53 Add a statistic to PHIElimination tracking the number of critical edges split.
llvm-svn: 125476
2011-02-14 02:09:11 +00:00
Chris Lattner
bcf2d46d8a Enhance ComputeMaskedBits to know that aligned frameindexes
have their low bits set to zero.  This allows us to optimize
out explicit stack alignment code like in stack-align.ll:test4 when
it is redundant.

Doing this causes the code generator to start turning FI+cst into
FI|cst all over the place, which is general goodness (that is the
canonical form) except that various pieces of the code generator
don't handle OR aggressively.  Fix this by introducing a new
SelectionDAG::isBaseWithConstantOffset predicate, and using it
in places that are looking for ADD(X,CST).  The ARM backend in
particular was missing a lot of addressing mode folding opportunities
around OR.

llvm-svn: 125470
2011-02-13 22:25:43 +00:00
Chris Lattner
c9c0de6faf Revisit my fix for PR9028: the issue is that DAGCombine was
generating i8 shift amounts for things like i1024 types.  Add
an assert in getNode to prevent this from occuring in the future,
fix the buggy transformation, revert my previous patch, and
document this gotcha in ISDOpcodes.h

llvm-svn: 125465
2011-02-13 19:09:16 +00:00
Chris Lattner
378faeecc8 when legalizing extremely wide shifts, make sure that
the shift amounts are in a suitably wide type so that
we don't generate out of range constant shift amounts.

This fixes PR9028.

llvm-svn: 125458
2011-02-13 09:10:56 +00:00
Chris Lattner
47e8019142 fix visitShift to properly zero extend the shift amount if the provided operand
is narrower than the shift register.  Doing an anyext provides undefined bits in
the top part of the register.

llvm-svn: 125457
2011-02-13 09:02:52 +00:00
Nadav Rotem
367d73ccb6 A fix for 9165.
The DAGCombiner created illegal BUILD_VECTOR operations.
The patch added a check that either illegal operations are
allowed or that the created operation is legal.

llvm-svn: 125435
2011-02-12 14:40:33 +00:00
Nadav Rotem
19fb107f1e SimplifySelectOps can only handle selects with a scalar condition. Add a check
that the condition is not a vector.

llvm-svn: 125398
2011-02-11 19:57:47 +00:00
Nadav Rotem
7cd5180574 Fix #9190
The bug happens when the DAGCombiner attempts to optimize one of the patterns
of the SUB opcode. It tries to create a zero of type v2i64. This type is legal
on 32bit machines, but the initializer of this vector (i64) is target dependent.
Currently, the initializer attempts to create an i64 zero constant, which fails.
Added a flag to tell the DAGCombiner to create a legal zero, if we require that
the pass would generate legal types.

llvm-svn: 125391
2011-02-11 19:20:37 +00:00
Evan Cheng
5a42a6a20f After 3-addressifying a two-address instruction, update the register maps; add a missing check when considering whether it's profitable to commute. rdar://8977508.
llvm-svn: 125259
2011-02-10 02:20:55 +00:00
Jakob Stoklund Olesen
52f108703d Delete unused code for analyzing and splitting around loops.
Loop splitting is better handled by the more generic global region splitting
based on the edge bundle graph.

llvm-svn: 125243
2011-02-09 23:56:18 +00:00
Jakob Stoklund Olesen
e4c85b1fd5 Simplify using the new leaveIntvBefore()
llvm-svn: 125238
2011-02-09 23:33:02 +00:00