[llvm-commits] CVS: llvm/test/Regression/Transforms/TailDup/MergeTest.ll

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 5 20:26:51 PDT 2004



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

MergeTest.ll added (r1.1)
---
Log message:

When tail duplicating these functions, the add instruction should not be
duplicated, even though the block it is in is duplicated.


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

Index: llvm/test/Regression/Transforms/TailDup/MergeTest.ll
diff -c /dev/null llvm/test/Regression/Transforms/TailDup/MergeTest.ll:1.1
*** /dev/null	Tue Oct  5 22:26:48 2004
--- llvm/test/Regression/Transforms/TailDup/MergeTest.ll	Tue Oct  5 22:26:38 2004
***************
*** 0 ****
--- 1,31 ----
+ ; RUN: llvm-as < %s | opt -tailduplicate  | llvm-dis | grep add | not grep uses=1
+ 
+ int %test1(bool %C, int %A, int* %P) {
+ entry:
+         br bool %C, label %L1, label %L2
+ 
+ L1:
+ 	store int 1, int* %P
+         br label %L2
+ 
+ L2:
+ 	%X = add int %A, 17
+ 	ret int %X
+ }
+ 
+ int %test2(bool %C, int %A, int* %P) {
+ entry:
+         br bool %C, label %L1, label %L2
+ 
+ L1:
+ 	store int 1, int* %P
+         br label %L3
+ 
+ L2:
+ 	store int 7, int* %P
+ 	br label %L3
+ L3:
+ 	%X = add int %A, 17
+ 	ret int %X
+ }
+ 






More information about the llvm-commits mailing list