You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by llvm-gcc -O2. If we were to run another opt -licm over this then it sinks the store instruction. The problem is that we have more complicated IR at the point of time when LICM actually runs:
What? Loop rotate was the last pass run before -licm. It was the last pass run on the attached testcase .ll file. If loop-rotate isn't doing the right thing then we need to fix that.
Extended Description
This simple C program:
void g(int *);
void f() {
int array[20];
int i;
for (i = 0; i<100; i++) {
array [0] = 0;
}
g(array);
}
is optimized down to:
[...]
bb:
%i.04 = phi i32 [ 0, %entry ], [ %1, %bb ]
store i32 0, i32* %0, align 4
%1 = add nsw i32 %i.04, 1
%exitcond = icmp eq i32 %1, 100
br i1 %exitcond, label %bb2, label %bb
[...]
by llvm-gcc -O2. If we were to run another opt -licm over this then it sinks the store instruction. The problem is that we have more complicated IR at the point of time when LICM actually runs:
[...]
bb:
%3 = phi i32* [ %1, %bb.nph ], [ %2, %bb1 ]
%storemerge1 = phi i32 [ 0, %bb.nph ], [ %storemerge, %bb1 ]
store i32 0, i32* %3, align 4
%4 = add nsw i32 %storemerge1, 1
br label %bb1
bb1:
%storemerge = phi i32 [ %4, %bb ]
%5 = icmp slt i32 %storemerge, 100
br i1 %5, label %bb, label %bb1.bb2_crit_edge
[...]
The full .ll that LICM isn't getting is attached.
The text was updated successfully, but these errors were encountered: