diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-03-16 22:44:22 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-16 22:44:22 +0000 |
commit | 2771d21c50e93c04d4b1e03a0d998a7ca5b45015 (patch) | |
tree | ae3a62309a04fdbd97d8c7b6fb7d18d05669b478 | |
parent | 1ad9b3a3cc27c1cf960bd3f72ca8c6b39954b451 (diff) |
A new entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26810 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/README.txt | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index 651d472902..595409ff8b 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -584,3 +584,48 @@ Optimize copysign(x, *y) to use an integer load from y. //===---------------------------------------------------------------------===// +%X = weak global int 0 + +void %foo(int %N) { + %N = cast int %N to uint + %tmp.24 = setgt int %N, 0 + br bool %tmp.24, label %no_exit, label %return + +no_exit: + %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ] + %i.0.0 = cast uint %indvar to int + volatile store int %i.0.0, int* %X + %indvar.next = add uint %indvar, 1 + %exitcond = seteq uint %indvar.next, %N + br bool %exitcond, label %return, label %no_exit + +return: + ret void +} + +compiles into: + + .text + .align 4 + .globl _foo +_foo: + movl 4(%esp), %eax + cmpl $1, %eax + jl LBB_foo_4 # return +LBB_foo_1: # no_exit.preheader + xorl %ecx, %ecx +LBB_foo_2: # no_exit + movl L_X$non_lazy_ptr, %edx + movl %ecx, (%edx) + incl %ecx + cmpl %eax, %ecx + jne LBB_foo_2 # no_exit +LBB_foo_3: # return.loopexit +LBB_foo_4: # return + ret + +We should hoist "movl L_X$non_lazy_ptr, %edx" out of the loop after +remateralization is implemented. This can be accomplished with 1) a target +dependent LICM pass or 2) makeing SelectDAG represent the whole function. + +//===---------------------------------------------------------------------===// |