Commit Graph

11253 Commits

Author SHA1 Message Date
Chris Lattner bc7e35b3b1 Simplify code by using the more powerful BuildMI forms.
Implement a small optimization.  In test/Regression/CodeGen/X86/select.ll,
we now generate this for foldSel3:

foldSel3:
        mov %AL, BYTE PTR [%ESP + 4]
        fld DWORD PTR [%ESP + 8]
        fld DWORD PTR [%ESP + 12]
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %ECX, DWORD PTR [%ESP + 20]
        cmp %EAX, %ECX
        fxch %ST(1)
        fcmovae %ST(0), %ST(1)
***     fstp %ST(1)
        ret

Instead of:

foldSel3:
        mov %AL, BYTE PTR [%ESP + 4]
        fld DWORD PTR [%ESP + 8]
        fld DWORD PTR [%ESP + 12]
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %ECX, DWORD PTR [%ESP + 20]
        cmp %EAX, %ECX
        fxch %ST(1)
        fcmovae %ST(0), %ST(1)
***     fxch %ST(1)
***     fstp %ST(0)
        ret

In practice, this only effects code size: performance should be basically
unaffected.

llvm-svn: 12588
2004-04-01 04:06:09 +00:00
Chris Lattner 3c8561442c Wrap at 80 cols
llvm-svn: 12587
2004-04-01 04:03:27 +00:00
Chris Lattner fb893edbe3 Allow converting a builder to an iterator
llvm-svn: 12586
2004-04-01 04:03:10 +00:00
Chris Lattner cfbc023153 Tests for fp cmov's that I forgot to check in earlier
llvm-svn: 12585
2004-04-01 03:47:56 +00:00
Chris Lattner 1a7e43c5cf Clear out all of the changes. Reset version numbers to 1.3
add note about select

llvm-svn: 12584
2004-04-01 00:41:31 +00:00
Brian Gaeke 8f177d9171 Add clear() forwarding method.
llvm-svn: 12580
2004-03-31 22:43:12 +00:00
Chris Lattner d55509c281 Generate slightly smaller code, "test R, R" instead of "cmp R, 0"
llvm-svn: 12579
2004-03-31 22:22:36 +00:00
Chris Lattner a4b15f04c6 The X86 backend no longer needs the select lowering pass.
llvm-svn: 12578
2004-03-31 22:03:46 +00:00
Chris Lattner 37a7f09d80 Codegen FP select instructions into X86 conditional moves. Annoyingly enough
the X86 does not support a full set of fp cmove instructions, so we can't always
fold the condition into the select.  :(  Yuck.

llvm-svn: 12577
2004-03-31 22:03:35 +00:00
Chris Lattner c07c95816a Add support for floating point conditional move instructions
llvm-svn: 12576
2004-03-31 22:02:36 +00:00
Chris Lattner cbb4ed9ef2 Add support for FP cmoves
llvm-svn: 12575
2004-03-31 22:02:21 +00:00
Chris Lattner 9fe1646804 Add FP conditional move instructions, which annoyingly have special properties
that require the asmwriter to be extended (printing implicit uses before the
explicit operands)

llvm-svn: 12574
2004-03-31 22:02:13 +00:00
Chris Lattner 61fab1409d Add warning
llvm-svn: 12573
2004-03-31 22:00:30 +00:00
Chris Lattner afbafb55ea MBB::remove should not modify the iterator passed in
llvm-svn: 12572
2004-03-31 21:59:59 +00:00
Chris Lattner acccf32aa3 MachineBasicBlock::remove should not modify the iterator passed in
llvm-svn: 12571
2004-03-31 21:59:29 +00:00
Chris Lattner 7c92c296ba Improve description, add warning
llvm-svn: 12570
2004-03-31 21:59:07 +00:00
Chris Lattner 49ed8ad580 MachineBasicBlock::remove should not change the iterator passed into it
llvm-svn: 12569
2004-03-31 21:58:50 +00:00
Brian Gaeke 623710bf2f Factor out getStaticStackSize from InsertPrologCode(), so that I can more
easily steal it for a separate use in the reoptimizer.

llvm-svn: 12568
2004-03-31 20:58:37 +00:00
Brian Gaeke 77e78a4531 Use the true, decoded name of the archive member in getObjectType.
In ReadArchiveBuffer, make sure that MemberName is set in the case where
getObjectType would want to return SVR4LongFilename.

llvm-svn: 12567
2004-03-31 19:51:00 +00:00
Chris Lattner c0ba90e35c Avoid TRUE and FALSE which apparently conflict with some macros on OSX
llvm-svn: 12566
2004-03-31 03:49:47 +00:00
Chris Lattner 709f03e2dd Fix linking of constant expr casts due to type resolution changes. With
this and the other patches 253.perlbmk links again.

llvm-svn: 12565
2004-03-31 02:58:28 +00:00
Chris Lattner 467cb2bc5d Add support for constant expr casts
llvm-svn: 12564
2004-03-31 02:56:11 +00:00
Chris Lattner 974efc72be Add support for reading constantexpr select instructions
llvm-svn: 12563
2004-03-31 02:53:59 +00:00
Chris Lattner b7897ce431 Fix a latent bug in select constantexpr handling that was broke 253.perlbmk
llvm-svn: 12562
2004-03-30 22:51:03 +00:00
Alkis Evlogimenos a333b1382f Correctly update LiveVariables when an instruction changes
llvm-svn: 12561
2004-03-30 22:44:39 +00:00
Chris Lattner 32817f5985 Fold comparisons into select instructions, making much better code and
using our broad selection of movcc instructions.  :)

llvm-svn: 12560
2004-03-30 22:39:09 +00:00
Chris Lattner 2dfdad631f Test folding comparisons into select instructions
llvm-svn: 12559
2004-03-30 22:37:04 +00:00
Chris Lattner f78f843adf New testcase. This now codegens to:
max:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        cmp %EAX, %ECX
        cmovle %EAX, %ECX
        ret

Someone should really implement passing arguments through registers for
known-internal functions.  :)

llvm-svn: 12558
2004-03-30 22:36:52 +00:00
Chris Lattner 358c97e7ae Implement spill code folding for all of the conditional move instructions
llvm-svn: 12554
2004-03-30 21:29:47 +00:00
Chris Lattner 53b58cb854 Add direct support for integer select instructions, though we still don't support
folding compares into the select yet.

llvm-svn: 12553
2004-03-30 21:22:00 +00:00
Chris Lattner b5d47a9420 New testcase for select instructions
llvm-svn: 12552
2004-03-30 21:21:14 +00:00
Chris Lattner deab5e212d Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx
llvm-svn: 12551
2004-03-30 20:58:25 +00:00
Chris Lattner 090516fe93 New testcase that crashes the assembler
llvm-svn: 12550
2004-03-30 20:58:00 +00:00
Chris Lattner 1563983d81 Fix some serious bugs in the cmov descriptions, which didn't cause a problem because
we never generated them

Make indentation a bit more consistent

llvm-svn: 12549
2004-03-30 20:18:02 +00:00
Brian Gaeke ef327be6ed Start cleaning up this pass so that I can debug it.
llvm-svn: 12548
2004-03-30 19:53:46 +00:00
Chris Lattner f17d2d33fb Oops, actually USE the previously computed value
llvm-svn: 12547
2004-03-30 19:45:39 +00:00
Chris Lattner fdf3202d69 Test general value/value selection which we can do now that we use the
select instruction

llvm-svn: 12546
2004-03-30 19:45:11 +00:00
Chris Lattner 81bdcb90ce Now that all the code generators support the select instruction, and the instcombine
pass can eliminate many nasty cases of them, start generating them in the optimizers

llvm-svn: 12545
2004-03-30 19:44:05 +00:00
Chris Lattner 533bc49775 Implement select.ll:test[3-6]
llvm-svn: 12544
2004-03-30 19:37:13 +00:00
Chris Lattner b785d280ec Add some testcases for select simplification
llvm-svn: 12543
2004-03-30 19:36:54 +00:00
Chris Lattner 0048e574fb Fix a fairly major performance problem. If a PHI node had a constant as
an incoming value from a block, the selector would evaluate the constant
at the TOP of the block instead of at the end of the block.  This made the
live range for the constant span the entire block, increasing register
pressure needlessly.

llvm-svn: 12542
2004-03-30 19:10:12 +00:00
Chris Lattner 1a0e9ac2f5 Add the select lowering pass to get initial support for select instructions
llvm-svn: 12541
2004-03-30 18:41:59 +00:00
Chris Lattner 059f390257 Add a simple select instruction lowering pass
llvm-svn: 12540
2004-03-30 18:41:10 +00:00
Chris Lattner 55481f78d3 Add some new methods
llvm-svn: 12539
2004-03-30 00:20:08 +00:00
Brian Gaeke fd02378d3e Don't warn about a null live range if the Value is a ConstantIntegral.
Otherwise, if you're in debugging mode, you get warnings for (apparently)
every immediate constant in the function during reg. allocation.

llvm-svn: 12538
2004-03-29 21:58:41 +00:00
Brian Gaeke 2fe0ac9ade Change how the beginnings and ends of MachineFunctions are printed. Get
rid of the funny cast.

llvm-svn: 12537
2004-03-29 21:58:31 +00:00
Chris Lattner 5152b9ed34 Adjust to new itf
llvm-svn: 12534
2004-03-29 20:42:49 +00:00
Chris Lattner 8582975b62 Relax the interface a bit
llvm-svn: 12533
2004-03-29 20:42:38 +00:00
John Criswell fa2f3686a3 Merged in RELEASE_12.
llvm-svn: 12532
2004-03-29 20:23:11 +00:00
John Criswell d2ff5cf7e8 Merged in RELEASE_12.
This fixes the zlib linking problems.

llvm-svn: 12531
2004-03-29 20:22:30 +00:00