If it's signed int, unless you know the value is positive you can't just shift right 1--if the result of the shift is negative, you have to add 1.
To replace a signed division with ashr, you have to know that for all negative inputs, the value of the bits shifted out are all 0.