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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to