Displaying 1 result from an estimated 1 matches for "5e5af97e".
2016 Mar 03
2
Failure to turn a div by power of 2 into a single shift
Hello,
I have a simple loop like below
int I, j;
for (j = n; j > 1; j = i) {
i = j / 2;
}
The signed division can be safely turned into a single shift since j is
known to be positive from the loop guard. LLVM currently cannot find out j
is positive and compiles the above division into 3 instructions. Any
thoughts on where to fix this?
Thank you in advance,
Haicheng