[llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/storepointer-compare.llx

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 10 16:12:46 PDT 2004



Changes in directory llvm/test/Regression/Transforms/GlobalOpt:

storepointer-compare.llx added (r1.1)
---
Log message:

Another testcase.  We should be able to devirtualize the call even though
we cannot completely eliminate the global.


---
Diffs of the changes:  (+28 -0)

Index: llvm/test/Regression/Transforms/GlobalOpt/storepointer-compare.llx
diff -c /dev/null llvm/test/Regression/Transforms/GlobalOpt/storepointer-compare.llx:1.1
*** /dev/null	Sun Oct 10 18:12:43 2004
--- llvm/test/Regression/Transforms/GlobalOpt/storepointer-compare.llx	Sun Oct 10 18:12:33 2004
***************
*** 0 ****
--- 1,28 ----
+ ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep 'call void %Actual'
+ 
+ ; Check that a comparison does not prevent an indirect call from being made 
+ ; direct.  The global will still remain, but indirect call elim is still good.
+ 
+ %G = internal global void ()* null
+ 
+ implementation
+ 
+ internal void %Actual() {
+ 	ret void
+ }
+ 
+ void %init() {
+ 	store void()* %Actual, void()** %G
+ 	ret void
+ }
+ 
+ void %doit() {
+ 	%FP = load void()** %G
+ 	%CC = seteq void()* %FP, null
+ 	br bool %CC, label %isNull, label %DoCall
+ DoCall:
+ 	call void %FP()
+ 	ret void
+ isNull:
+ 	ret void
+ }






More information about the llvm-commits mailing list