Commit Graph

5018 Commits

Author SHA1 Message Date
Dan Gohman 6d5f120c5c Generalize the new code in instcombine's ComputeNumSignBits for handling
and/or to handle more cases (such as this add-sitofp.ll testcase), and
port it to selectiondag's ComputeNumSignBits.

llvm-svn: 51469
2008-05-23 02:28:01 +00:00
Bill Wendling 6e326bf0fb Remove warnings about comparison between signed and unsigned expressions.
llvm-svn: 51465
2008-05-23 01:29:08 +00:00
Dan Gohman 396ed504f1 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51460
2008-05-23 00:34:04 +00:00
Dan Gohman 30ab45d01e Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51459
2008-05-23 00:17:26 +00:00
David Greene 830487035e When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.

llvm-svn: 51440
2008-05-22 21:16:33 +00:00
David Greene 54b52fe13b Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.

llvm-svn: 51439
2008-05-22 21:12:21 +00:00
Evan Cheng a5d27ae586 Fix PR2343. An *interesting* coalescer bug.
BB1:                                                                                                                                                  
  vr1025 = copy vr1024                                                                                                                                
  ..                                                                                                                                                  
BB2:                                                                                                                                                  
  vr1024 = op                                                                                                                                         
         = op vr1025                                                                                                                                     
  <loop eventually branch back to BB1>

Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.

llvm-svn: 51394
2008-05-21 22:34:12 +00:00
Dan Gohman fe13618682 Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.

llvm-svn: 51348
2008-05-20 20:59:51 +00:00
Dan Gohman c1a4e212a3 Code simplification.
llvm-svn: 51345
2008-05-20 20:56:33 +00:00
Evan Cheng 0609ab646b More local spiller complexity!
If local spiller optimization turns some instruction into an identity copy, it will be removed. If the output register happens to be dead (and source is obviously killed), transfer the kill / dead information to last use / def in the same MBB.

llvm-svn: 51306
2008-05-20 08:13:21 +00:00
Evan Cheng c8b028daa4 Don't spill dead def.
llvm-svn: 51305
2008-05-20 08:10:37 +00:00
Dale Johannesen 5bf742f2aa Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.

llvm-svn: 51277
2008-05-19 21:38:18 +00:00
Gabor Greif e1f6e4b21d API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Evan Cheng 9ac3631fa3 If the result of a BIT_CONVERT is a v1* vector, it doesn't mean its source is a v1* vector.
llvm-svn: 51192
2008-05-16 17:19:05 +00:00
Duncan Sands 70424d195a Silence the compiler warning differently. The
original method caused gcc-4.2 to complain.

llvm-svn: 51186
2008-05-16 09:19:16 +00:00
Nate Begeman f79f52282c Actually scalarize the operand to BIT_CONVERT instead of asking someone to do
something with a v1 type.

llvm-svn: 51160
2008-05-15 20:40:58 +00:00
Dan Gohman 12fce7751b IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.

llvm-svn: 51157
2008-05-15 19:50:34 +00:00
Evan Cheng ef377adca0 Make use of vector load and store operations to implement memcpy, memmove, and memset. Currently only X86 target is taking advantage of these.
llvm-svn: 51140
2008-05-15 08:39:06 +00:00
Evan Cheng 4ea9d49590 Use a better idiom to silence compiler warnings.
llvm-svn: 51131
2008-05-14 21:08:07 +00:00
Evan Cheng 0f7fb95e79 Really silence compiler warnings.
llvm-svn: 51126
2008-05-14 20:29:30 +00:00
Evan Cheng a5b0a8d7fe Really silence compiler warnings.
llvm-svn: 51123
2008-05-14 20:26:35 +00:00
Dale Johannesen ce4396bc92 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.

llvm-svn: 51118
2008-05-14 20:12:51 +00:00
Evan Cheng 763ec13862 Silence some compiler warnings.
llvm-svn: 51115
2008-05-14 20:07:51 +00:00
Dan Gohman 3ab94df276 When bit-twiddling CondCode values for integer comparisons produces
SETOEQ, is it does with (SETEQ & SETULE), map it to SETEQ.

llvm-svn: 51112
2008-05-14 18:17:09 +00:00
Dan Gohman fd3e3003f3 Whitespace cleanups.
llvm-svn: 51089
2008-05-14 00:43:10 +00:00
Evan Cheng 1120279ae6 Instead of a vector load, shuffle and then extract an element. Load the element from address with an offset.
pshufd $1, (%rdi), %xmm0
        movd %xmm0, %eax
=>
        movl 4(%rdi), %eax

llvm-svn: 51026
2008-05-13 08:35:03 +00:00
Dan Gohman 0479aa5c0b Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.

llvm-svn: 51022
2008-05-13 02:05:11 +00:00
Dan Gohman d78c400b5b Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.

llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Nate Begeman b87e63a730 Teach Legalize how to scalarize VSETCC
Teach X86 a few more vsetcc patterns.  Custom lowering for unsupported ones is next.

llvm-svn: 51009
2008-05-12 23:09:43 +00:00
Evan Cheng b980f6fb3d Xform bitconvert(build_pair(load a, load b)) to a single load if the load locations are at the right offset from each other.
llvm-svn: 51008
2008-05-12 23:04:07 +00:00
Dale Johannesen 9d29283fc7 Be more aggressive about tail-merging small blocks
if those blocks consist entirely of common instructions;
merging will not add an extra branch in this case.

llvm-svn: 51006
2008-05-12 22:53:12 +00:00
Bill Wendling 6b8bd513d4 Constify isSourceDefinedByImplicitDef function. Otherwise, just formatting
changes that don't change functionality.

llvm-svn: 51004
2008-05-12 22:15:05 +00:00
Dale Johannesen c4c4d8e1f7 Further rework of tail merge algorithm. Not quite
semantically identical, but little difference in
either results or execution speed; but it's much
easier to read, at least IMO.

llvm-svn: 50999
2008-05-12 20:33:57 +00:00
Evan Cheng 2609d5e779 Refactor isConsecutiveLoad from X86 to TargetLowering so DAG combiner can make use of it.
llvm-svn: 50991
2008-05-12 19:56:52 +00:00
Bill Wendling 2930845065 Revert the previous commit. Go ahead and hoist rematerializable instructions.
llvm-svn: 50990
2008-05-12 19:47:18 +00:00
Nate Begeman cfcb56091b Add support for vicmp/vfcmp codegen, more legalize support coming.
This is necessary to unbreak the build.

llvm-svn: 50988
2008-05-12 19:40:03 +00:00
Bill Wendling 70613b84da One real change - don't hoist something that's trivially rematerializable. It's
possible for it to produce worse code than before.

The rest of this patch is code cleanup.

llvm-svn: 50987
2008-05-12 19:38:32 +00:00
Dan Gohman ecb77385ab Fix a missing break in the ISD::FLT_ROUNDS_ handling. Patch by giuma!
llvm-svn: 50967
2008-05-12 16:07:15 +00:00
Evan Cheng bec201fa06 If all sources of a PHI node are defined by an implicit_def, just emit an implicit_def instead of a copy.
llvm-svn: 50927
2008-05-10 00:17:50 +00:00
Bill Wendling 19e3c857b8 Cosmetic changes:
- Comment fixes.
 - Moar whitespace.
 - Made ivars "private" by default.
No functionality change.

llvm-svn: 50926
2008-05-10 00:12:52 +00:00
Dale Johannesen 66da8b5334 Remove an evil vector bool. Cosmetic refactoring,
no functional change.

llvm-svn: 50921
2008-05-09 23:28:24 +00:00
Dale Johannesen cff7df201c Rewrite tail merging algorithm to handle the
case where there are multiple blocks with a large
number of common tail instructions more efficiently
(compile time optimization).

llvm-svn: 50916
2008-05-09 21:24:35 +00:00
Duncan Sands 9897eee483 Get exception handling working again on 64 bit
Darwin.  This is a hack of course, but it does
at least look at the right thing: gotpcrel means
that this is already an offset, so an explicit
offset is not needed (and wrong).  I think this
is good enough for the moment: Anton is working
on something better.

llvm-svn: 50850
2008-05-08 12:33:11 +00:00
Anton Korobeynikov fc2edad4ae Turn StripPointerCast() into a method
llvm-svn: 50836
2008-05-07 22:54:15 +00:00
Duncan Sands e2b0bf43a7 Output correct exception handling and frame info
on x86-64 linux.  This causes no regressions on
32 bit linux and 32 bit ppc.  More tests pass
on 64 bit ppc with no regressions.  I didn't
turn on eh on 64 bit linux because the intrinsics
needed to compile the eh runtime aren't done
yet.  But if you turn it on and link with the
mainline runtime then eh seems to work fine
on x86-64 linux with this patch.  Thanks to
Dale for testing.  The main point of the patch
is that if you output that some object is
encoded using 4 bytes you had better not output
8 bytes for it: the patch makes everything
consistent.

llvm-svn: 50825
2008-05-07 19:11:09 +00:00
Evan Cheng 7ca4a67ca1 Yet another nasty spiller bug.
%ecx = op
store %cl<kill>, (addr)
(addr) = op %al

It's not safe to unfold the last operand and eliminate store even though %cl is marked kill. It's a sub-register use which means one of its super-register(s) may be used below.

llvm-svn: 50794
2008-05-07 00:49:28 +00:00
Dan Gohman 5a3eecdfd8 Fix a bug in the ComputeMaskedBits logic for multiply.
llvm-svn: 50793
2008-05-07 00:35:55 +00:00
Anton Korobeynikov 82c02b28f3 Make StripPointerCast a common function (should we mak it method of Value instead?)
llvm-svn: 50775
2008-05-06 22:52:30 +00:00
Dan Gohman 6a2da37c0e Make several variable declarations static.
llvm-svn: 50696
2008-05-06 01:53:16 +00:00
Dan Gohman a8b7e78f54 Remove uses of llvm/System/IncludeFile.h that are no longer needed.
llvm-svn: 50695
2008-05-06 01:32:53 +00:00