[llvm-bugs] [Bug 51575] New: [InstSimplify] rotating all-ones is still all-ones

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Aug 22 05:52:19 PDT 2021


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

            Bug ID: 51575
           Summary: [InstSimplify] rotating all-ones is still all-ones
           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

I'm not sure if there's overlap between this and related rotate bugs, but
filing it so we have a reference:

define i32 @src(i32 %shamt) {
  %r = lshr i32 -1, %shamt
  %s = sub i32 32, %shamt
  %l = shl i32 -1, %s
  %o = or i32 %r, %l
  ret i32 %o
}

define i32 @tgt(i32 %shamt) {
  ret i32 -1
}

https://alive2.llvm.org/ce/z/gDke_c

We do handle the sibling rotate-of-zero (probably via known bits or simpler
folds since all bits are the same in that case).

-- 
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/20210822/5db04ec8/attachment.html>


More information about the llvm-bugs mailing list