xref: /llvm-project/llvm/test/Transforms/SCCP/apint-ipsccp1.ll (revision 8ebb3eac02a926ffa4298c12834c57aefb2e8579)
1*8ebb3eacSBjorn Pettersson; RUN: opt < %s -passes=ipsccp -S | grep -v "ret i512 undef" | \
2cee313d2SEric Christopher; RUN:   grep "ret i8 2"
3cee313d2SEric Christopher
4cee313d2SEric Christopherdefine internal i512 @test(i1 %B) {
5cee313d2SEric Christopher	br i1 %B, label %BB1, label %BB2
6cee313d2SEric ChristopherBB1:
7cee313d2SEric Christopher	%Val = add i512 0, 1
8cee313d2SEric Christopher	br label %BB3
9cee313d2SEric ChristopherBB2:
10cee313d2SEric Christopher	br label %BB3
11cee313d2SEric ChristopherBB3:
12cee313d2SEric Christopher	%Ret = phi i512 [%Val, %BB1], [2, %BB2]
13cee313d2SEric Christopher	ret i512 %Ret
14cee313d2SEric Christopher}
15cee313d2SEric Christopher
16cee313d2SEric Christopherdefine i8 @caller()
17cee313d2SEric Christopher{
18cee313d2SEric Christopher    %t1 = and i2 2, 1
19cee313d2SEric Christopher    %t11 = trunc i2 %t1 to i1
20cee313d2SEric Christopher    %t2 = call i512 @test(i1 %t11)
21cee313d2SEric Christopher    %t3 = trunc i512 %t2 to i8
22cee313d2SEric Christopher    ret i8 %t3
23cee313d2SEric Christopher}
24cee313d2SEric Christopher
25