1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

23952 Commits

Author SHA1 Message Date
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
Duncan Sands
7ca2df2319 LegalizeTypes support for fabs on ppc long double.
llvm-svn: 53613
2008-07-15 15:02:44 +00:00
Matthijs Kooijman
f9532fe71b Allow deadargelim to change return types even though now values were dead. This
again canonicalizes {i32} into i32 and {} into void.

llvm-svn: 53610
2008-07-15 14:42:31 +00:00
Matthijs Kooijman
18c6979fed Revert r53606. It turns out that explicitely tracking the liveness of the
return value as a whole in deadargelim is really not needed now that we simply
rebuild the old return value and actually prevents some canonicalization from
taking place.

This revert stops deadargelim from changing {i32} into i32 for now, but I'll
fix that next.

llvm-svn: 53609
2008-07-15 14:39:36 +00:00
Matthijs Kooijman
f940585c1c Make deadargelim a bit less smart, so it doesn't choke on nested structs as
return values that are still (partially) live. Instead of updating all uses of
a call instruction after removing some elements, it now just rebuilds the
original struct (With undef gaps where the unused values were) and leaves it to
instcombine to clean this up.

The added testcase still fails currently, but this is due to instcombine which
isn't good enough yet. I will fix that part next.

llvm-svn: 53608
2008-07-15 14:03:10 +00:00
Matthijs Kooijman
50a2233b45 Don't use isa when we can reuse a previous dyn_cast.
llvm-svn: 53607
2008-07-15 13:39:08 +00:00
Matthijs Kooijman
4b75601340 Make DeadArgElim keep liveness of the return value as a whole in addition to
only the liveness of partial return values (for functions returning a struct).
This is more explicit to prevent unwanted changes in the return value. 

In particular, deadargelim now canonicalizes a function returning {i32} to
returning i32 and {} to void, if the struct returned is not used in its
entirety, but only the single element is used.

llvm-svn: 53606
2008-07-15 13:36:06 +00:00
Duncan Sands
58eb5e35da LegalizeTypes support for promotion of bswap.
In LegalizeDAG the value is zero-extended to
the new type before byte swapping.  It doesn't
matter how the extension is done since the new
bits are shifted off anyway after the swap, so
extend by any old rubbish bits.  This results
in the final assembler for the testcase being
one line shorter.

llvm-svn: 53604
2008-07-15 10:18:22 +00:00
Duncan Sands
710be60c23 LegalizeTypes support for promotion of SIGN_EXTEND_INREG.
llvm-svn: 53603
2008-07-15 10:14:24 +00:00
Duncan Sands
d2097e5b92 Reorder the integer promotion methods alphabetically.
No change in functionality.

llvm-svn: 53602
2008-07-15 10:12:34 +00:00
Matthijs Kooijman
86a46174fe Let DAE keep a list of live functions, instead of simply marking all arguments
and return values live for those functions. This doesn't change anything yet,
but prepares for the coming commits.

llvm-svn: 53601
2008-07-15 09:11:16 +00:00
Matthijs Kooijman
caa3ed0c99 Split DAE::MarkLive into MarkLive and PropagateLiveness.
llvm-svn: 53600
2008-07-15 09:00:17 +00:00
Matthijs Kooijman
31b7208f7d Pass around const RetOrArg references instead of copying values. Also, mark
RetOrArg::getDescription() as const.

llvm-svn: 53599
2008-07-15 08:56:49 +00:00
Matthijs Kooijman
937016427b Simplify debug code by using RetOrArg::getDescription().
llvm-svn: 53598
2008-07-15 08:53:36 +00:00
Matthijs Kooijman
c9c8644910 Fix indentation (intentionally left out of the previous commit).
llvm-svn: 53592
2008-07-15 08:47:32 +00:00