[llvm-bugs] [Bug 44426] New: [InstCombine] sub (select %c, %x, %y), %x -> select %c, 0, (sub %y, %x)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 1 12:43:47 PST 2020


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

            Bug ID: 44426
           Summary: [InstCombine] sub (select %c, %x, %y), %x -> select
                    %c, 0, (sub %y, %x)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: lebedev.ri at gmail.com
                CC: llvm-bugs at lists.llvm.org

Name: sub (select %c, %x, %y), %x -> select %c, 0, (sub %y, %x)
  %o = select i1 %c, i64 %x, i64 %y
  %r = sub i64 %o, %x
=>
  %n = sub i64 %y, %x
  %r = select i1 %c, i64 0, i64 %n

https://rise4fun.com/Alive/D5U

This can allow further folding to happen:
https://godbolt.org/z/atBtSx

-- 
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/20200101/c95fc3dc/attachment.html>


More information about the llvm-bugs mailing list