2009-09-11 20:01:28 +02:00
|
|
|
; RUN: opt < %s -tailduplicate -taildup-threshold=2 -S | grep add | not grep uses=1
|
2004-10-06 05:26:38 +02:00
|
|
|
|
2008-03-10 08:21:50 +01:00
|
|
|
define i32 @test1(i1 %C, i32 %A, i32* %P) {
|
2004-10-06 05:26:38 +02:00
|
|
|
entry:
|
2008-03-10 08:21:50 +01:00
|
|
|
br i1 %C, label %L1, label %L2
|
|
|
|
L1: ; preds = %entry
|
|
|
|
store i32 1, i32* %P
|
|
|
|
br label %L2
|
|
|
|
L2: ; preds = %L1, %entry
|
|
|
|
%X = add i32 %A, 17 ; <i32> [#uses=1]
|
|
|
|
ret i32 %X
|
2004-10-06 05:26:38 +02:00
|
|
|
}
|
|
|
|
|
2008-03-10 08:21:50 +01:00
|
|
|
define i32 @test2(i1 %C, i32 %A, i32* %P) {
|
2004-10-06 05:26:38 +02:00
|
|
|
entry:
|
2008-03-10 08:21:50 +01:00
|
|
|
br i1 %C, label %L1, label %L2
|
|
|
|
L1: ; preds = %entry
|
|
|
|
store i32 1, i32* %P
|
|
|
|
br label %L3
|
|
|
|
L2: ; preds = %entry
|
|
|
|
store i32 7, i32* %P
|
2004-10-06 05:26:38 +02:00
|
|
|
br label %L3
|
2008-03-10 08:21:50 +01:00
|
|
|
L3: ; preds = %L2, %L1
|
|
|
|
%X = add i32 %A, 17 ; <i32> [#uses=1]
|
|
|
|
ret i32 %X
|
2004-10-06 05:26:38 +02:00
|
|
|
}
|
|
|
|
|