diff options
| author | Bill Wendling <isanbard@gmail.com> | 2007-12-30 03:18:58 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2007-12-30 03:18:58 +0000 |
| commit | 7749a9014b240cdf7c379b5cb7ca81895be636aa (patch) | |
| tree | fa3c92b4ba4a3b605b456eba69665d5b87731c4b /llvm/bindings/ocaml/executionengine/executionengine_ocaml.c | |
| parent | 330aaa79e0413675d0c8a292af60de27809c263b (diff) | |
| download | llvm-7749a9014b240cdf7c379b5cb7ca81895be636aa.zip llvm-7749a9014b240cdf7c379b5cb7ca81895be636aa.tar.gz llvm-7749a9014b240cdf7c379b5cb7ca81895be636aa.tar.bz2 | |
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.
llvm-svn: 45444
Diffstat (limited to 'llvm/bindings/ocaml/executionengine/executionengine_ocaml.c')
0 files changed, 0 insertions, 0 deletions
