Skip to content
Commit d60ae33d authored by Haicheng Wu's avatar Haicheng Wu
Browse files

[CVP] Convert an SDiv to a UDiv if both operands are known to be nonnegative

The motivating example is this

for (j = n; j > 1; j = i) {
   i = j / 2;
}

The signed division is safely to be changed to an unsigned division (j is known
to be larger than 1 from the loop guard) and later turned into a single shift
without considering the sign bit.

llvm-svn: 263406
parent 4251d377
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment