I was checking llvm's constant propagation pass -sccp, with the following program
int a,b,c;
a=1;
b=2;
c=a+b;
I was expecting an output
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
store i32 1, i32* %a, align 4
store i32 2, i32* %b, align 4
store i32 3, i32* %c, align 4 //constant propagation
But I am getting the following output
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
store i32 1, i32* %a, align 4
store i32 2, i32* %b, align 4
%0 = load i32, i32* %a, align 4
%1 = load i32, i32* %b, align 4
%add = add nsw i32 %0, %1 //no constant propagation
store i32 %add, i32* %c, align 4
What I am doing wrong here?