[llvm] r206732 - Implement builtins for safe division: safe.sdiv.iN, safe.udiv.iN, safe.srem.iN,
sabre at nondot.org
Tue Apr 22 15:20:13 PDT 2014
On Apr 22, 2014, at 8:19 AM, Eric Christopher <echristo at gmail.com> wrote:
>> nsw/nuw flags can be dropped by any IR pass, but we need these checks to be preserved.
>> In that past, I’ve been in favor of representing control flow directly within the IR, as opposed to using intrinsics like llvm.arith.with.overflow. However, the precedent has been set, and I admit this makes it much easier to guarantee reasonable codegen on a given platform.
> IR changes should be reasonable and useful across a wide array of uses
> or necessary for correctness. I don't know that this meets the
> guidelines there. It seems like you're arguing a general completeness
> of IR, but there are lots of places that we could do that. You also
> didn't explain why you couldn't use a TTI based pass during
> late-optimization to solve this same problem.
I think we should discuss this on llvmdev. There should be a proposal, outlining the problem to be solved, along with why the other obvious approaches are worse than this one.
More information about the llvm-commits