[PATCH] D46760: [InstCombine] Enhance narrowUDivURem.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 11:59:26 PDT 2018


spatel requested changes to this revision.
spatel added a comment.
This revision now requires changes to proceed.

Looked at your example a bit closer, and I don't understand the motivation.

@jlebar improved -correlated-propagation to handle this case in https://reviews.llvm.org/D44102 :

  $ ./opt -correlated-propagation divrem.ll -S
  define i64 @udiv_urem_twouses_xform(i32 %a) {
    %za = zext i32 %a to i64
    %udiv.lhs.trunc = trunc i64 %za to i32
    %udiv.rhs.trunc = trunc i64 33 to i32
    %udiv1 = udiv i32 %udiv.lhs.trunc, %udiv.rhs.trunc
    %udiv.zext = zext i32 %udiv1 to i64
    %urem.lhs.trunc = trunc i64 %za to i32
    %urem.rhs.trunc = trunc i64 33 to i32
    %urem2 = urem i32 %urem.lhs.trunc, %urem.rhs.trunc
    %urem.zext = zext i32 %urem2 to i64
    %uadd = add i64 %udiv.zext, %urem.zext
    ret i64 %uadd
  }


Repository:
  rL LLVM

https://reviews.llvm.org/D46760





More information about the llvm-commits mailing list