[PATCH] D20327: [InstCombine] transform multiplication overflow check written as a > (UINT_MAX /u b) to umul.with.overflow

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 11:42:55 PDT 2016


sanjoy added a comment.

The conclusions / guidelines decided from the earlier work were

1. The optimizer should not introduce these intrinsics early in the pipeline, since there are passes that don't understand them yet.
2. CGP should do a best-effort replacement of arithmetic with overflow intrinsics (i.e. this change should live in CGP).
3. If the programmer really would have liked the codegen to use overflow bits in the CPU flags, then she need to use ` __builtin_umull_overflow` etc. directly.

@regehr is there some specific reason it helps to canonicalize like this?


http://reviews.llvm.org/D20327





More information about the llvm-commits mailing list