[llvm] r206732 - Implement builtins for safe division: safe.sdiv.iN, safe.udiv.iN, safe.srem.iN,

Eric Christopher echristo at gmail.com
Wed Apr 23 13:50:20 PDT 2014

On Tue, Apr 22, 2014 at 6:45 PM, Andrew Trick <atrick at apple.com> wrote:
> On Apr 22, 2014, at 8:19 AM, Eric Christopher <echristo at gmail.com> wrote:
> One of Michael’s early implementations worked completely within the
> SelectionDAG. We could share that patch if it’s interesting. The goal was to
> mimic the rest of the llvm.arith.with.overflow intrinsics, including
> lowering them through the same codegen mechanism.
> Right. Those are needed for correct behavior. This is not so it
> doesn't seem like a good analogy here.
> I think the new division intrinsics are needed for correct behavior, as much
> as the other overflow intrinsics are. The only difference I can see is that
> architectures typically support reporting overflow on integer add/mul in the
> form of flags. Whereas with division we need to emit some code to do the
> checks.

Can you show some aspect of any standardized language that can't be
handled otherwise?

Also, I've not seen the mail you were mentioning on llvm-dev?


More information about the llvm-commits mailing list