On 06/03/2015 06:13 PM, Johannes Doerfert wrote: > Isnt't there a LLVM pass that will do this kind of optimization > (Instcombine)? Yes, it triggers if we mark the sdiv as 'exact'. See r239025. Tobias