Unfortunately LLVM considers division overflow undefined: http://llvm.org/docs/LangRef.html#id109
If it's any use, you can see what Julia ended up doing here: https://github.com/JuliaLang/julia/issues/8188
And thank you for the additional info, I've updated the issue I opened accordingly:
https://github.com/ponylang/ponyc/issues/2858
Unfortunately LLVM considers division overflow undefined: http://llvm.org/docs/LangRef.html#id109
If it's any use, you can see what Julia ended up doing here: https://github.com/JuliaLang/julia/issues/8188