[llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll

Chris Lattner lattner at cs.uiuc.edu
Wed Oct 13 22:13:04 PDT 2004



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

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

When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.  In this case
promoting the phi to a select is silly because we will always have to do the
call conditionally.  As such, select promotion is actually a pessimization.


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

Index: llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll
diff -c /dev/null llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll:1.1
*** /dev/null	Thu Oct 14 00:13:00 2004
--- llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll	Thu Oct 14 00:12:50 2004
***************
*** 0 ****
--- 1,29 ----
+ ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep select
+ 
+ ;; The PHI node in this example should not be turned into a select, as we are
+ ;; not able to ifcvt the entire block.  As such, converting to a select just 
+ ;; introduces inefficiency without saving copies.
+ 
+ int %bar(bool %C) {
+ entry:
+         br bool %C, label %then, label %endif
+ 
+ then:
+         %tmp.3 = call int %qux()
+         br label %endif
+ 
+ endif:
+ 	%R = phi int [123, %entry], [12312, %then]
+ 	;; stuff to disable tail duplication
+         call int %qux()
+         call int %qux()
+         call int %qux()
+         call int %qux()
+         call int %qux()
+         call int %qux()
+         call int %qux()
+         ret int %R
+ }
+ 
+ declare int %qux()
+ 






More information about the llvm-commits mailing list