[llvm-commits] CVS: llvm/lib/Target/X86/README.txt
Evan Cheng
evan.cheng at apple.com
Thu Mar 16 14:44:34 PST 2006
Changes in directory llvm/lib/Target/X86:
README.txt updated: 1.65 -> 1.66
---
Log message:
A new entry.
---
Diffs of the changes: (+45 -0)
README.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+)
Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.65 llvm/lib/Target/X86/README.txt:1.66
--- llvm/lib/Target/X86/README.txt:1.65 Wed Mar 8 19:39:46 2006
+++ llvm/lib/Target/X86/README.txt Thu Mar 16 16:44:22 2006
@@ -584,3 +584,48 @@
//===---------------------------------------------------------------------===//
+%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.
+
+//===---------------------------------------------------------------------===//
More information about the llvm-commits
mailing list