commit | e9e5731866d5cdb14c19176e33f1c8b536507647 | [log] [tgz] |
---|---|---|
author | Sanjay Patel <spatel@rotateright.com> | Tue Jun 26 16:30:00 2018 +0000 |
committer | Sanjay Patel <spatel@rotateright.com> | Tue Jun 26 16:30:00 2018 +0000 |
tree | fd875f51789237cc1cda789432e5a4cf09e052c1 | |
parent | 40be0055aeade298b85832480bb646520a80df88 [diff] |
[InstCombine] fold urem with sext bool divisor Similar to other patches in this series: https://reviews.llvm.org/rL335512 https://reviews.llvm.org/rL335527 https://reviews.llvm.org/rL335597 https://reviews.llvm.org/rL335616 ...this is filling a gap in analysis that is exposed by an unrelated select-of-constants transform. I didn't see a way to unify the sext cases because each div/rem opcode results in a different fold. Note that in this case, the backend might want to convert the select into math: Name: sext urem %e = sext i1 %x to i32 %r = urem i32 %y, %e => %c = icmp eq i32 %y, -1 %z = zext i1 %c to i32 %r = add i32 %z, %y git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335622 91177308-0d34-0410-b5e6-96231b3b80d8