I don’t know what function is executed to transform like the following.
This is my original source IR.
11: ; preds = %11, %0
%12 = phi i64 [ 0, %0 ], [ %15, %11 ]
...
%15 = add nuw nsw i64 %12, 1, !meta !12
...
%17 = getelementptr inbounds [1000 x i16], [1000 x i16]* %1, i64 0, i64 %15
...
%20 = icmp eq i64 %15, 1000
br i1 %20, label %3, label %11, !llvm.loop !12
And after using LoopStrengthReducePass, the output IR is like the following.
11: ; preds = %11, %0
%12 = phi i64 [ 1, %0 ], [ %15, %11 ]
...
%17 = getelementptr inbounds [1000 x i16], [1000 x i16]* %1, i64 0, i64 %12
...
%15 = add nuw nsw i64 %12, 1
...
%20 = icmp eq i64 %15, 1000
br i1 %20, label %3, label %11, !llvm.loop !12
I don’t know what function transforms like this example, and I want to know it. If you know about it, please tell me.
And my metadata like meta
which is added to add instruction is deleted. So I want to know the reason.