llvm-6502/lib
Bill Wendling 6259d51c91 If we have a load of a global address that's not modified during the
function, then go ahead and hoist it out of the loop. This is the result:

$ cat a.c
volatile int G;

int A(int N) {
  for (; N > 0; --N)
    G++;
}
$ llc -o - -relocation-model=pic
_A:
...
LBB1_2: # bb
        movl    L_G$non_lazy_ptr-"L1$pb"(%eax), %esi
        incl    (%esi)
        incl    %edx
        cmpl    %ecx, %edx
        jne     LBB1_2  # bb
...
$ llc -o - -relocation-model=pic -machine-licm
_A:
...
        movl    L_G$non_lazy_ptr-"L1$pb"(%eax), %eax
LBB1_2: # bb
        incl    (%eax)
        incl    %edx
        cmpl    %ecx, %edx
        jne     LBB1_2  # bb
...

I'm limiting this to the MOV32rm x86 instruction for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45444 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 03:18:58 +00:00
..
Analysis Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Archive Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
AsmParser Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Bitcode Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
CodeGen use simplified operand addition methods. 2007-12-30 00:57:42 +00:00
Debugger Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
ExecutionEngine Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Linker Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Support Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
System Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Target If we have a load of a global address that's not modified during the 2007-12-30 03:18:58 +00:00
Transforms Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
VMCore Remove attribution from file headers, per discussion on llvmdev. 2007-12-29 20:36:04 +00:00
Makefile remove attribution from lib Makefiles. 2007-12-29 20:09:26 +00:00