[llvm-bugs] [Bug 33841] New: [X86] Favor shlx/shrx over shl/srl x, cl for (shift x (and y, (BitWidth-1)))

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 18 14:23:18 PDT 2017


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

            Bug ID: 33841
           Summary: [X86] Favor shlx/shrx over shl/srl x, cl for (shift x
                    (and y, (BitWidth-1)))
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: craig.topper at gmail.com
                CC: llvm-bugs at lists.llvm.org

It looks like we're missing patterns to favor shlx/shrx when the shift amount
is being masked with an and.

We should add shlx/shrx to this section of X86InstrCompiler.td

defm : MaskedShiftAmountPats<shl, "SHL">;
defm : MaskedShiftAmountPats<srl, "SHR">;
defm : MaskedShiftAmountPats<sra, "SAR">;
defm : MaskedShiftAmountPats<rotl, "ROL">;
defm : MaskedShiftAmountPats<rotr, "ROR">;

-- 
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/20170718/71054657/attachment.html>


More information about the llvm-bugs mailing list