[llvm-bugs] [Bug 51565] New: Missing transformation rotate(X, Z) == rotate(Y, Z) ---> X == Y

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 20 14:44:21 PDT 2021


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

            Bug ID: 51565
           Summary: Missing transformation rotate(X,Z) == rotate(Y,Z) --->
                    X == Y
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

// Rotate(X,Z) == Rotate(Y,Z) ---> X == Y
// Rotate(X,Z) != Rotate(Y,Z) ---> X != Y

bool test(unsigned long long x, unsigned long long y) {
  unsigned long long rx = (x << 32) | (x >> 32);
  unsigned long long ry = (y << 32) | (y >> 32);
  return rx != ry;
}

Trunk -O2:
test(unsigned long long, unsigned long long):                              #
@test(unsigned long long, unsigned long long)
        rol     rdi, 32
        rol     rsi, 32
        cmp     rdi, rsi
        setne   al
        ret

https://godbolt.org/z/Kb6zr8Wa3


Alive:
https://alive2.llvm.org/ce/z/HuEvjC

-- 
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/20210820/9548f2a3/attachment.html>


More information about the llvm-bugs mailing list