llvm-6502/lib
Chris Lattner 6b0e3f8907 Make CanFallThrough more intelligent (so it can handle blocks with (e.g.) no
successors), and make island block movement more general.

This compiles CodeGen/X86/2006-04-27-ISelFoldingBug.ll to:

_loadAndRLEsource_no_exit_2E_1_label_2E_0:
        subl $8, %esp
        movl %esi, 4(%esp)
        movl %ebx, (%esp)
        movl 16(%esp), %eax
        movl 12(%esp), %ecx
LBB1_3: #label.0
        movl _last, %edx
        movl %edx, %esi
        incl %esi
        movl %esi, _last
        movl %ecx, %ebx
        # TRUNCATE movb %bl, %bl
        movl _block, %esi
        movb %bl, 1(%esi,%edx)
        cmpl %eax, _last
        jge LBB1_2      #codeRepl5.exitStub
LBB1_4: #label.0
        cmpl $257, %ecx
        je LBB1_2       #codeRepl5.exitStub
LBB1_1: #label.0.no_exit.1_crit_edge.exitStub
        movl $1, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret
LBB1_2: #codeRepl5.exitStub
        xorl %eax, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret

instead of:

_loadAndRLEsource_no_exit_2E_1_label_2E_0:
        subl $8, %esp
        movl %esi, 4(%esp)
        movl %ebx, (%esp)
        movl 16(%esp), %eax
        movl 12(%esp), %ecx
        jmp LBB1_3      #label.0
LBB1_1: #label.0.no_exit.1_crit_edge.exitStub
        movl $1, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret
LBB1_2: #codeRepl5.exitStub
        xorl %eax, %eax
        movl (%esp), %ebx
        movl 4(%esp), %esi
        addl $8, %esp
        ret
LBB1_3: #label.0
        movl _last, %edx
        movl %edx, %esi
        incl %esi
        movl %esi, _last
        movl %ecx, %ebx
        # TRUNCATE movb %bl, %bl
        movl _block, %esi
        movb %bl, 1(%esi,%edx)
        cmpl %eax, _last
        jge LBB1_2      #codeRepl5.exitStub
LBB1_4: #label.0
        cmpl $257, %ecx
        jne LBB1_1      #label.0.no_exit.1_crit_edge.exitStub
        jmp LBB1_2      #codeRepl5.exitStub

... which is much better layout :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-29 21:05:41 +00:00
..
Analysis add a method 2006-10-28 01:24:05 +00:00
Archive For PR797: 2006-08-25 19:54:53 +00:00
AsmParser For PR950: 2006-10-26 06:15:43 +00:00
Bytecode For PR950: 2006-10-26 06:15:43 +00:00
CodeGen Make CanFallThrough more intelligent (so it can handle blocks with (e.g.) no 2006-10-29 21:05:41 +00:00
Debugger For PR950: 2006-10-20 07:07:24 +00:00
ExecutionEngine For PR950: 2006-10-26 06:15:43 +00:00
Linker Adding dllimport, dllexport and external weak linkage types. 2006-09-14 18:23:27 +00:00
Support Try again. 2006-10-29 09:19:59 +00:00
System Use new config.h macro 2006-09-14 06:21:59 +00:00
Target implement the BlockHasNoFallThrough hook 2006-10-28 17:35:02 +00:00
Transforms add option to isCriticalEdge 2006-10-28 06:58:17 +00:00
VMCore Make the Value and Type methods print a newline so it prints nicely in gdb 2006-10-27 18:58:54 +00:00
Makefile Make some changes suggested by Chris: 2006-05-17 22:55:35 +00:00