1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

24066 Commits

Author SHA1 Message Date
Owen Anderson
7b8947cc31 Change the heuristics used in the coalescer, register allocator, and within
live intervals itself to use an instruction count approximation that is 
not affected by inserting empty indices.

llvm-svn: 53937
2008-07-22 22:46:49 +00:00
Evan Cheng
ff0bd19937 Factor out SSE 4 wide shuffle lowering code into its own function. No functionality changes.
llvm-svn: 53933
2008-07-22 21:13:36 +00:00
Evan Cheng
1aa928a8e6 Fix pr2566: incorrect assumption about bit_convert. It doesn't not have to output a vector value. Patch by Nicolas Capens!
llvm-svn: 53932
2008-07-22 20:42:56 +00:00
Devang Patel
4057e8691a While creating temp. file on disk, if the current filename points to a existing directory then create new temp. file inside the directory.
llvm-svn: 53929
2008-07-22 20:02:39 +00:00
Evan Cheng
901d469e05 Fix PR2574: implement v2f32 scalar_to_vector.
llvm-svn: 53927
2008-07-22 18:39:19 +00:00
Devang Patel
86c593ff1d Handle bitcode wrappers.
llvm-svn: 53924
2008-07-22 18:00:36 +00:00
Dan Gohman
727b49bc26 Make the GraphRoot edge look like a chain edge, which is more accurate,
and use the right result number, in the off chance that the graph root
has multiple result values.

llvm-svn: 53923
2008-07-22 17:52:59 +00:00
Anton Korobeynikov
af50b3159f Provide default implementation of different small-sections related stuff
llvm-svn: 53920
2008-07-22 17:09:59 +00:00
Anton Korobeynikov
090eca95ab Tie small stuff to non-small by default on ELF platforms
llvm-svn: 53919
2008-07-22 17:09:41 +00:00
Bruno Cardoso Lopes
a4a3546fec simplified small section logic
llvm-svn: 53912
2008-07-22 16:24:21 +00:00
Anton Korobeynikov
f13fbd6879 Fix encoding of atomic compare and swap for i64
llvm-svn: 53911
2008-07-22 16:22:48 +00:00
Bruno Cardoso Lopes
1253b2ac48 Added small section asm emition logic for mips.
Fixed small bug.

llvm-svn: 53908
2008-07-22 15:34:27 +00:00
Bruno Cardoso Lopes
96ab649026 Basic support for small sections
llvm-svn: 53907
2008-07-22 15:26:53 +00:00
Bill Wendling
5e6c729e8b Remove another tab.
llvm-svn: 53904
2008-07-22 08:54:38 +00:00
Bill Wendling
1b355889f6 More tab removals.
llvm-svn: 53903
2008-07-22 08:50:44 +00:00
Bill Wendling
87b1a0950c Another buildbot test commit.
llvm-svn: 53896
2008-07-22 00:53:37 +00:00
Dan Gohman
184839a58d Fix a typo in a comment.
llvm-svn: 53894
2008-07-22 00:52:04 +00:00
Dan Gohman
cb26a8abeb Fix multiple-return-value-to-first-class-aggregates autoupgrade to
correctly handle the case where multiple-return-value constructs
were used to return one or zero values.

llvm-svn: 53890
2008-07-22 00:36:48 +00:00
Bill Wendling
e0e8ecd5e9 Trivial check-in to test buildbot. No functionality change.
llvm-svn: 53889
2008-07-22 00:28:47 +00:00
Dan Gohman
183bd17a66 InsertValue and ExtractValue constant expressions are always
folded. Remove code that handled the case where they aren't
folded, and remove bitcode reader/writer support for them.

llvm-svn: 53887
2008-07-21 23:30:30 +00:00
Dan Gohman
e0ed9af577 Fix grammaros in comments.
llvm-svn: 53884
2008-07-21 22:38:59 +00:00
Dan Gohman
8f7b6c8113 Fix a bug in LSR's dead-PHI cleanup. If a PHI has a def-use chain that
leads into a cycle involving a different PHI, LSR got stuck running
around that cycle looking for the original PHI. To avoid this, keep
track of visited PHIs and stop searching if we see one more than once.
This fixes PR2570.

llvm-svn: 53879
2008-07-21 21:45:02 +00:00
Dan Gohman
b024b0eedd Enhance the GraphWriter support for edge destinations, and teach the
SelectionDAG graph writer to make use of them. Now, nodes with multiple
values are displayed as such, with incoming edges pointing to the
specific value they use.

llvm-svn: 53875
2008-07-21 21:06:55 +00:00
Dan Gohman
dd84251894 After early-lowering the FORMAL_ARGUMENTS node, delete it.
llvm-svn: 53874
2008-07-21 21:04:07 +00:00
Evan Cheng
a2bb31372d Eliminate a compilation warning.
llvm-svn: 53873
2008-07-21 20:02:45 +00:00
Dan Gohman
b91bef08a7 Add titles to the various SelectionDAG viewGraph calls
that include useful information like the name of the
block being viewed and the current phase of compilation.

llvm-svn: 53872
2008-07-21 20:00:07 +00:00
Dan Gohman
8a07776d39 Fix uses of underscore-capital names.
llvm-svn: 53870
2008-07-21 19:48:15 +00:00
Bruno Cardoso Lopes
e6a9345187 Added initial support for small sections on Mips.
Added gp_rel relocations to support addressing small section contents.
Added command line to specify small section threshold in bytes.

llvm-svn: 53869
2008-07-21 18:52:34 +00:00
Dan Gohman
8f718c75f0 Now that the MachineInstr leaks are fixed, enable leak checking
in the MachineInstr clone code.

llvm-svn: 53868
2008-07-21 18:47:29 +00:00
Anton Korobeynikov
78bab0e7f2 Use better variable names
llvm-svn: 53859
2008-07-21 18:29:23 +00:00
Anton Korobeynikov
3d4c55bb7a Don't use larger alignment.
llvm-svn: 53857
2008-07-21 18:25:17 +00:00
Duncan Sands
6e31474e71 Add VerifyNode, a place to put sanity checks on
generic SDNode's (nodes with their own constructors
should do sanity checking in the constructor).  Add
sanity checks for BUILD_VECTOR and fix all the places
that were producing bogus BUILD_VECTORs, as found by
"make check".  My favorite is the BUILD_VECTOR with
only two operands that was being used to build a
vector with four elements!

llvm-svn: 53850
2008-07-21 10:20:31 +00:00
Evan Cheng
ffd51ccf6b Use movaps instead of movups to spill 16-byte vector values when default alignment is >= 16. This fixes some massive performance regressions.
llvm-svn: 53844
2008-07-21 06:34:17 +00:00
Nick Lewycky
cc7b41c130 Revert r53812 -- premature. LegalizeTypes isn't actually on yet!
llvm-svn: 53816
2008-07-21 04:03:00 +00:00
Nick Lewycky
ea4a155439 Switch on the use of arbitrary precision integers in scalar evolution. This will
bail after 256-bits to avoid producing code that the backends can't handle.
Previously, we capped it at 64-bits, preferring to miscompile in those cases.

This change also reverts much of r52248 because the invariants the code was
expecting are now being met.

llvm-svn: 53812
2008-07-21 02:51:31 +00:00
Wojciech Matyjewicz
f9ef4917c9 This header isn't necessary now.
llvm-svn: 53811
2008-07-20 17:35:32 +00:00
Wojciech Matyjewicz
eea926ec20 Fix PR2088. Use modulo linear equation solver to compute loop iteration
count.

llvm-svn: 53810
2008-07-20 15:55:14 +00:00
Bill Wendling
98b6e63176 Fix for first part of PR2562. Generate the "pinsrw" instruction for inserts
into v4i16 vectors.

llvm-svn: 53807
2008-07-20 02:32:23 +00:00
Bill Wendling
73f5ecdbea Pull r53795 from Gaz into mainline:
If .loc and .file aren't used, always emit the "debug_line" section. This
requires at least one entry in the line matrix. So if there's nothing to emit
into the matrix, emit an end of matrix value anyway.

llvm-svn: 53803
2008-07-20 00:11:19 +00:00
Anton Korobeynikov
b49440f266 Unbreak build: 'DarwinTargetAsmInfo' was already taken as PPC TAI flavour.
llvm-svn: 53801
2008-07-19 21:44:57 +00:00
Duncan Sands
ad24fa3ff4 Make sure custom lowering for LegalizeTypes
returns a node with the right number of
return values.  This fixes codegen of
Generic/cast-fp.ll, Generic/fp_to_int.ll
and PowerPC/multiple-return-values.ll
when using -march=ppc32 -mattr=+64bit.

llvm-svn: 53794
2008-07-19 16:26:02 +00:00
Anton Korobeynikov
cab6b6d44d Use chars, where possible
llvm-svn: 53791
2008-07-19 13:16:32 +00:00
Anton Korobeynikov
099f340556 Switch MIPS to new ELFTargetAsmInfo. Add few FIXMEs.
llvm-svn: 53790
2008-07-19 13:16:11 +00:00
Anton Korobeynikov
449fb584e4 Fix a FIXME :)
llvm-svn: 53789
2008-07-19 13:15:46 +00:00
Anton Korobeynikov
5c0eb7e991 Use generic ELFTargetAsmInfo and DarwinTargetAsmInfo for X86 code
llvm-svn: 53788
2008-07-19 13:15:21 +00:00
Anton Korobeynikov
5298428cff Add TargetAsmInfo stuff for all darwin-based targets
llvm-svn: 53787
2008-07-19 13:14:46 +00:00
Anton Korobeynikov
3724600253 Add TargetAsmInfo for all ELF-based targets
llvm-svn: 53786
2008-07-19 13:14:11 +00:00
Anton Korobeynikov
6e00357dd6 Use aligned stack spills, where possible. This fixes PR2549.
llvm-svn: 53784
2008-07-19 06:30:51 +00:00
Evan Cheng
5ed6b9f0ae Fix a memory leak in LiveIntervalAnalysis.
llvm-svn: 53779
2008-07-19 00:37:25 +00:00
Duncan Sands
ef45c602b6 Softfloat support for FDIV. Patch by
Richard Pennington.

llvm-svn: 53773
2008-07-18 21:18:48 +00:00
Duncan Sands
39da9f4a43 Eliminate unused variable.
llvm-svn: 53772
2008-07-18 21:07:41 +00:00
Duncan Sands
b4646d7dbe Supress a gcc-4.3 warning.
llvm-svn: 53771
2008-07-18 21:06:02 +00:00
Duncan Sands
3d68e2ff9c Revert 53729, after waking up in the middle of
the night realising that it was wrong :)  I
think the reason the same type was being used
for the shufflevec of indices as for the actual
indices is so that if one of them needs splitting
then so does the other.  After my patch it might
be that the indices need splitting but not the
rest, yet there is no good way of handling that.
I think the right solution is to not have the
shufflevec be an operand at all: just have it
be the list of numbers it actually is, stored
as extra info in the node.

llvm-svn: 53768
2008-07-18 20:12:05 +00:00
Dan Gohman
b97c076af4 In the CBackend, use casts to force integer add, subtract, and
multiply to be done as unsigned, so that they have well defined
behavior on overflow. This fixes PR2408.

llvm-svn: 53767
2008-07-18 18:43:12 +00:00
Dan Gohman
e119f3db46 Fix a LocalSpiller leak. This fixes tramp3d-v4.
llvm-svn: 53766
2008-07-18 18:28:56 +00:00
Owen Anderson
8500aba55a Make PRE actually handle critical edges (by splitting them). Confirmed that bootstrap passes with this change.
llvm-svn: 53762
2008-07-18 18:03:38 +00:00
Owen Anderson
bba5ddaf0f Reapply r53735. My last patch fixed the failures Dan observed.
llvm-svn: 53761
2008-07-18 17:49:43 +00:00
Owen Anderson
736e4b3a3f Add some checks that got lost in the shuffle. This fixes 464.h264ref.
llvm-svn: 53760
2008-07-18 17:46:41 +00:00
Dan Gohman
4dc7526774 Revert r53735. It broke SPEC 464.h264ref.
llvm-svn: 53757
2008-07-18 16:44:49 +00:00
Chris Lattner
0429684d2d verify limits-fndefn.c from the GCC testsuite before the
heat death of the universe, fixing an O(N^2) problem in the
size of a basic block.

llvm-svn: 53749
2008-07-18 05:23:39 +00:00
Dan Gohman
f38f99ccc5 Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks.
Fix a leak that this turned up in LowerSubregs.cpp.
And, comment a leak in LiveIntervalAnalysis.cpp.

llvm-svn: 53746
2008-07-17 23:49:46 +00:00
Dan Gohman
c666c01e65 When printing MemOperand nodes, only use print() for
PseudoSourceValue values, which never have names. Use getName()
for all other values, because we want to print just a short summary
of the value, not the entire instruction.

llvm-svn: 53738
2008-07-17 21:12:16 +00:00
Owen Anderson
8e971c22fd Use MergeBlockIntoPredecessor to simplify some code.
llvm-svn: 53735
2008-07-17 20:00:46 +00:00
Evan Cheng
d26080487b Subreg live interval valno may not have a corresponding def machineinstr since it's less precise.
llvm-svn: 53734
2008-07-17 19:48:53 +00:00
Owen Anderson
cb787a2004 Make MergeBlockIntoPredecessor more aggressive when the same successor appears
more than once.

llvm-svn: 53731
2008-07-17 19:42:29 +00:00
Owen Anderson
5524271234 Enable PRE. My last batch of changes fixed the miscompile.
llvm-svn: 53730
2008-07-17 19:41:00 +00:00
Duncan Sands
08ea7c0351 Use a legal type for elements of the vector_shuffle
mask.  These are just indices into the shuffled vector
so their type is unrelated to the type of the
shuffled elements (which is what was being used before).
This fixes vec_shuffle-11.ll when using LegalizeTypes.
What seems to have happened is that Dan's recent change
r53687, which corrected the result type of the shuffle,
somehow caused LegalizeTypes to notice that the mask
operand was a BUILD_VECTOR with a legal type but elements
of an illegal type (i64).  LegalizeTypes legalized this
by introducing a new BUILD_VECTOR of i32 and bitcasting
it to the old type.  But the mask operand is not supposed
to be a bitcast but a straight BUILD_VECTOR of constants,
causing a crash.

llvm-svn: 53729
2008-07-17 19:28:41 +00:00
Dan Gohman
8981962672 Add a new function, ReplaceAllUsesOfValuesWith, which handles bulk
replacement of multiple values. This is slightly more efficient
than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically
could be optimized even further. However, an important property of this
new function is that it handles the case where the source value set and
destination value set overlap. This makes it feasible for isel to use
SelectNodeTo in many very common cases, which is advantageous because
SelectNodeTo avoids a temporary node and it doesn't require CSEMap
updates for users of values that don't change position.

Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to
handle operand lists more efficiently, and to correctly handle a number
of corner cases to which its new wider use exposes it.

This commit also includes a change to the encoding of post-isel opcodes
in SDNodes; now instead of being sandwiched between the target-independent
pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel
opcodes are now represented as negative values. This makes it possible
to test if an opcode is pre-isel or post-isel without having to know
the size of the current target's post-isel instruction set.

These changes speed up llc overall by 3% and reduce memory usage by 10%
on the InstructionCombining.cpp testcase with -fast and -regalloc=local.

llvm-svn: 53728
2008-07-17 19:10:17 +00:00
Duncan Sands
c3331602f9 LegalizeTypes support for what seems to be the
only missing ppc long double operations: FNEG
and FP_EXTEND.

llvm-svn: 53723
2008-07-17 17:35:14 +00:00
Nate Begeman
64f8f7f6bb Remove unnecessary readme entry
llvm-svn: 53722
2008-07-17 17:21:14 +00:00
Duncan Sands
778e45e748 Turn LegalizeTypes back off again for the moment:
it is breaking Darwin bootstrap due to missing
functionality.

llvm-svn: 53721
2008-07-17 17:06:03 +00:00
Nate Begeman
61f6c21028 Fix a typo in last commit
llvm-svn: 53720
2008-07-17 17:04:58 +00:00
Nate Begeman
af01bfff99 SSE codegen for vsetcc nodes
llvm-svn: 53719
2008-07-17 16:51:19 +00:00
Matthijs Kooijman
5ec5e264e4 Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.
llvm-svn: 53716
2008-07-17 11:59:53 +00:00
Chris Lattner
eccd57d118 Fix PR2553
llvm-svn: 53715
2008-07-17 06:07:20 +00:00
Mon P Wang
57cd9d6e5a When lowering certain atomics, we need to copy the memoperand from the old
atomic operation to the new one.

llvm-svn: 53714
2008-07-17 04:54:06 +00:00
Duncan Sands
41aeb22c1d Factorize some code for determining which libcall to use.
llvm-svn: 53713
2008-07-17 02:36:29 +00:00
Evan Cheng
a7598b31ee Inliner tweak. Function calls should cost more than one instruction!
llvm-svn: 53712
2008-07-17 01:31:49 +00:00
Owen Anderson
7fb36c8bba Factor MergeBlockIntoPredecessor out into BasicBlockUtils.
llvm-svn: 53705
2008-07-17 00:01:40 +00:00
Devang Patel
a6c5ff690a Mark function used by asm block as used, otherwise optimizer may not see the use and may delete the function.
llvm-svn: 53692
2008-07-16 17:54:34 +00:00
Owen Anderson
f91aa3b22f There's no need to iterate block merging and PRE. In fact, iterating the latter
could cause problems for memdep when it breaks critical edges.

llvm-svn: 53691
2008-07-16 17:52:31 +00:00
Scott Michel
ba160e6396 Somehow, custom lowering of i64 multiplications got dropped along the way.
llvm-svn: 53689
2008-07-16 17:17:29 +00:00
Dan Gohman
4c8c8e3aad Fix the result type of X86's truncate to i8.
llvm-svn: 53688
2008-07-16 16:20:48 +00:00
Dan Gohman
0025513482 Fix the result type of a VECTOR_SHUFFLE+BIT_CONVERT dagcombine. This
was turned up by some new SelectionDAG assertion checks that I'm
working on.

llvm-svn: 53687
2008-07-16 16:13:58 +00:00
Duncan Sands
3448d4087f Add support for promoting and expanding AssertZext
and AssertSext.  Needed when passing huge integer
parameters with the zeroext or signext attributes.

llvm-svn: 53684
2008-07-16 16:03:07 +00:00
Dan Gohman
2638ec5b4c Fix a comment to say nonnegative instead of positive.
llvm-svn: 53681
2008-07-16 15:57:10 +00:00
Dan Gohman
bc29205ccc Add an assert to check for empty flags for MachineMemOperand.
llvm-svn: 53680
2008-07-16 15:56:42 +00:00
Matthijs Kooijman
ceee0ddd1b Redo InstCombiner::visitExtractValueInst. Instead of using the (complicate)
FindInsertedValue, it now performs a number of simple transformations that
should result in the same effect when applied iteratively.

llvm-svn: 53673
2008-07-16 12:55:45 +00:00
Duncan Sands
b753d27377 Reorder methods alphabetically. No functionality change.
While this is not a wonderful organizing principle, it
does make it easy to find routines, and clear where to
insert new ones.

llvm-svn: 53672
2008-07-16 11:41:33 +00:00
Duncan Sands
b2e1ddbd0b Turn on LegalizeTypes by default.
llvm-svn: 53671
2008-07-16 11:36:51 +00:00
Matthijs Kooijman
96d9bcbdf6 Don't use ++idx_begin when I actually mean idx_begin + 1, especially since we
also use *idx_begin in the same expression, giving unpredictable results.

This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html

llvm-svn: 53670
2008-07-16 10:47:35 +00:00
Evan Cheng
7218339189 Fix PR2296. Do not transform x86_sse2_storel_dq into a full-width store.
llvm-svn: 53666
2008-07-16 07:28:14 +00:00
Evan Cheng
face16f9d8 x86-64 PIC JIT fixes: do not generate the extra load for external GV's.
llvm-svn: 53661
2008-07-16 01:34:02 +00:00
Evan Cheng
cabfd3f78c X86-64 PIC jump table values are different from x86-32 cases, they are dest - table base.
llvm-svn: 53660
2008-07-16 01:33:08 +00:00
Dan Gohman
8cf62e122f TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little.
llvm-svn: 53639
2008-07-15 18:37:51 +00:00
Dan Gohman
c4400b8618 SelectionDAG::AssignNodeIds is unused.
llvm-svn: 53636
2008-07-15 18:29:32 +00:00
Dan Gohman
c9b72806d7 Don't sort SDNodes by their addresses in SelectionDAG::dump. Instead,
just use the AllNodes order, which is at least relatively stable
across runs.

llvm-svn: 53632
2008-07-15 18:18:54 +00:00
Owen Anderson
e12f7904ff Revert this, as it seems to still be broken.
llvm-svn: 53627
2008-07-15 17:59:02 +00:00
Owen Anderson
73bdb28e89 Enable local PRE by default.
llvm-svn: 53616
2008-07-15 16:28:23 +00:00
Owen Anderson
f1b3898e7f Have GVN do a pre-pass over the CFG that folds away unconditional branches where possible. This allows local PRE to be more aggressive.
llvm-svn: 53615
2008-07-15 16:28:06 +00:00