And

private immutable int[] aaa = [0,1,2,3,4,5,6,7];
int foo() pure nothrow
{
        int sum;
        foreach (int i; aaa)
                sum += i;
        return sum;
}

@_D5immut3aaayAi = constant { i64, i32* } { i64 8, i32* getelementptr inbounds ([8 x i32]* @.constarray, i32 0, i32 0) } @.constarray = internal global [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]

define i32 @_D5immut3fooFNaNbZi() #0 {
forbody:
%tmp15 = load i32* getelementptr inbounds ([8 x i32]* @.constarray, i64 0, i64 0), align 16 %tmp15.1 = load i32* getelementptr inbounds ([8 x i32]* @.constarray, i64 0, i64 1), align 4
  %tmp19.1 = add i32 %tmp15.1, %tmp15
%tmp15.2 = load i32* getelementptr inbounds ([8 x i32]* @.constarray, i64 0, i64 2), align 8
  %tmp19.2 = add i32 %tmp15.2, %tmp19.1
...


while with cast(immutable)[0,1,... :

@_D5immut3aaayAi = constant { i64, i32* } { i64 8, i32* getelementptr inbounds ([8 x i32]* @.dynarrayStorage, i32 0, i32 0) } @.dynarrayStorage = internal unnamed_addr constant [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]

define i32 @_D5immut3fooFNaNbZi() #0 {
endfor:
  ret i32 28
}

Reply via email to