xref: /aosp_15_r20/external/llvm/test/Transforms/ConstProp/phi.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; This is a basic sanity check for constant propagation.  The add instruction
2*9880d681SAndroid Build Coastguard Worker; should be eliminated.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -constprop -die -S | not grep phi
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i32 @test(i1 %B) {
7*9880d681SAndroid Build Coastguard WorkerBB0:
8*9880d681SAndroid Build Coastguard Worker        br i1 %B, label %BB1, label %BB3
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard WorkerBB1:            ; preds = %BB0
11*9880d681SAndroid Build Coastguard Worker        br label %BB3
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard WorkerBB3:            ; preds = %BB1, %BB0
14*9880d681SAndroid Build Coastguard Worker        %Ret = phi i32 [ 1, %BB0 ], [ 1, %BB1 ]         ; <i32> [#uses=1]
15*9880d681SAndroid Build Coastguard Worker        ret i32 %Ret
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18