eli.friedman added a subscriber: eli.friedman. eli.friedman added a comment. You might want to consider special-casing division by a constant integer. For example, on x86, we can convert a 16-bit unsigned divide by a constant into a pmulhuw+psrlw. https://reviews.llvm.org/D22918