[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll

Chris Lattner lattner at cs.uiuc.edu
Tue Jan 13 23:54:01 PST 2004


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

2004-01-13-InstCombineInvokePHI.ll added (r1.1)

---
Log message:

new testcase


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

Index: llvm/test/Regression/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll:1.1
*** /dev/null	Tue Jan 13 23:53:21 2004
--- llvm/test/Regression/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll	Tue Jan 13 23:53:11 2004
***************
*** 0 ****
--- 1,24 ----
+ ; Test for a problem afflicting several C++ programs in the testsuite.  The 
+ ; instcombine pass is trying to get rid of the cast in the invoke instruction, 
+ ; inserting a cast of the return value after the PHI instruction, but which is
+ ; used by the PHI instruction.  This is bad: because of the semantics of the
+ ; invoke instruction, we really cannot perform this transformation at all at
+ ; least without splitting the critical edge.
+ ;
+ ; RUN: llvm-as < %s | opt -instcombine -disable-output
+ 
+ declare sbyte* %test()
+ 
+ int %foo() {
+ entry:
+   br bool true, label %cont, label %call
+ call:
+   %P = invoke int*()* cast (sbyte*()* %test to int*()*)()
+        to label %cont except label %N
+ cont:
+   %P2 = phi int* [%P, %call], [null, %entry]
+   %V = load int* %P2
+   ret int %V
+ N:
+   ret int 0
+ }





More information about the llvm-commits mailing list