Commit Graph

11282 Commits

Author SHA1 Message Date
Chris Lattner 9f0db32625 Implement Transforms/SimplifyCFG/return-merge.ll
This actually causes us to turn code like:

  return C ? A : B;

into a select instruction.

llvm-svn: 12617
2004-04-02 18:13:43 +00:00
Chris Lattner 99c9b9c02f New testcase
llvm-svn: 12616
2004-04-02 18:12:49 +00:00
Alkis Evlogimenos d64e904e27 Clean up code a bit.
llvm-svn: 12615
2004-04-02 18:11:32 +00:00
Brian Gaeke 2845936a34 Only strip symbols if emitting bytecode to the assembly file.
Move lowerselect pass to come after preselection.  Move machine
code construction and stack slots pass to come right before instruction
selection. This is to help fix perlbmk.

Update comments.

Make the sequence of passes in addPassesToJITCompile look more like
the sequence of passes in addPassesToEmitAssembly, including support
for -print-machineinstrs.

llvm-svn: 12614
2004-04-02 17:52:40 +00:00
Brian Gaeke cc24411c0a Add support for constant select expressions. Clarify the assertion failure msg.
llvm-svn: 12613
2004-04-02 17:52:29 +00:00
Chris Lattner 3838243d04 Minor speedup
llvm-svn: 12612
2004-04-02 16:28:32 +00:00
Alkis Evlogimenos fe66caa9a0 Fix type in comments
llvm-svn: 12611
2004-04-02 16:02:50 +00:00
Alkis Evlogimenos 5fc4772d5e Fix type in instruction builder instantiation
llvm-svn: 12610
2004-04-02 15:51:03 +00:00
Chris Lattner a45a216ff6 Make the verifier API more complete and useful.
Patch contributed by Reid Spencer

llvm-svn: 12609
2004-04-02 15:45:08 +00:00
Chris Lattner b753dd1cb4 Make the verifier API more complete and useful
llvm-svn: 12608
2004-04-02 15:44:33 +00:00
Alkis Evlogimenos d186ed02e4 Add more ADC and SBB variants
llvm-svn: 12607
2004-04-02 07:11:10 +00:00
Chris Lattner bcf2623cab minor formatting change
llvm-svn: 12606
2004-04-02 06:32:45 +00:00
Chris Lattner a413b08580 Fix two pretty serious bugs:
1. Each time the loop extractor extracted a loop, we would leak a module.
  2. When we extracted a loop, we didn't add the new function to the list of
     miscompiled functions.  Thus if the bug was in a loop nest and we
     extracted it, we could actually *LOSE THE BUG*, which is very bad.

With these patches, bugpoint has successfully found a bug for me in a function
with several nested loops, and cut it down to just one of them. :) :)

llvm-svn: 12605
2004-04-02 06:32:17 +00:00
Chris Lattner af67dac7f4 Fix a fairly nasty bug that prevented bugpoint from working quite right when
hacking on programs with two functions that have the same name.

llvm-svn: 12604
2004-04-02 06:30:33 +00:00
Chris Lattner 73c141ac71 If the program returns a non-zero exit value, don't leave files laying
around

llvm-svn: 12603
2004-04-02 05:33:06 +00:00
Chris Lattner 46e18c7f87 Fix wonky header
Address PR305: LLVM tools will happily spew bytecode onto your terminal

llvm-svn: 12602
2004-04-02 05:06:57 +00:00
Chris Lattner 3af1fffd3c Add new function
llvm-svn: 12601
2004-04-02 05:04:12 +00:00
Chris Lattner 454e18317d Add new function, autoconf support required tho
llvm-svn: 12600
2004-04-02 05:04:03 +00:00
Chris Lattner fd8f46b1cd Bug fixed
llvm-svn: 12598
2004-04-01 20:31:29 +00:00
Chris Lattner c24019c825 Fix PR310 and TailDup/2004-04-01-DemoteRegToStack.llx
llvm-svn: 12597
2004-04-01 20:28:45 +00:00
Chris Lattner 914a7d0d90 New testcase for PR310
llvm-svn: 12596
2004-04-01 20:28:35 +00:00
Chris Lattner 59fdf74968 Remove some assertions that are now bogus with the last patch I put in
llvm-svn: 12595
2004-04-01 19:21:46 +00:00
Chris Lattner ff03fe3b13 Bug fixed
llvm-svn: 12593
2004-04-01 19:09:49 +00:00
Chris Lattner 146d0df5e4 Fix PR306: Loop simplify incorrectly updates dominator information
Testcase: LoopSimplify/2004-04-01-IncorrectDomUpdate.ll

llvm-svn: 12592
2004-04-01 19:06:07 +00:00
Chris Lattner f475a12626 New testcase for PR306
llvm-svn: 12591
2004-04-01 19:05:54 +00:00
Misha Brukman b78259a57d Fix grammar.
llvm-svn: 12590
2004-04-01 17:15:42 +00:00
Chris Lattner b28dd11e33 Add support for select constant expressions to the CBE, fixing SIOD
llvm-svn: 12589
2004-04-01 05:28:26 +00:00
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