[llvm-bugs] [Bug 52402] New: [InstCombine] fold multiply and equality compare with constant

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 4 07:01:56 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52402

            Bug ID: 52402
           Summary: [InstCombine] fold multiply and equality compare with
                    constant
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org

Forking this off from bug 52289 - I don't know what the generalization is, but
we're missing some kind of overflowing/shifting/multiplying magic:

define i1 @src(i32 %x) {
  %m = mul i32 %x, 1355350016 ; 0x50c90000
  %r = icmp eq i32 %m, 65536  ; 0x00010000
  ret i1 %r
}

define i1 @tgt(i32 %x) {
  %t = trunc i32 %x to i16
  %r = icmp eq i16 %t, 51577 ; 0xc979
  ret i1 %r
}


https://alive2.llvm.org/ce/z/7Ft6jA

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211104/41be43b5/attachment-0001.html>


More information about the llvm-bugs mailing list