xref: /aosp_15_r20/external/llvm/test/Transforms/SCCP/apint-basictest2.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; and phi instruction should be eliminated.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -sccp -S | not grep phi
5*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -sccp -S | not grep add
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine i128 @test(i1 %B) {
8*9880d681SAndroid Build Coastguard Worker	br i1 %B, label %BB1, label %BB2
9*9880d681SAndroid Build Coastguard WorkerBB1:
10*9880d681SAndroid Build Coastguard Worker	%Val = add i128 0, 1
11*9880d681SAndroid Build Coastguard Worker	br label %BB3
12*9880d681SAndroid Build Coastguard WorkerBB2:
13*9880d681SAndroid Build Coastguard Worker	br label %BB3
14*9880d681SAndroid Build Coastguard WorkerBB3:
15*9880d681SAndroid Build Coastguard Worker	%Ret = phi i128 [%Val, %BB1], [1, %BB2]
16*9880d681SAndroid Build Coastguard Worker	ret i128 %Ret
17*9880d681SAndroid Build Coastguard Worker}
18