[llvm-bugs] [Bug 35874] New: [InstCombine] Support non-uniform constant vectors for mul -> shl

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 9 05:19:57 PST 2018


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

            Bug ID: 35874
           Summary: [InstCombine] Support non-uniform constant vectors for
                    mul -> shl
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: david.majnemer at gmail.com, efriedma at codeaurora.org,
                    llvm-bugs at lists.llvm.org, spatel+llvm at rotateright.com

rL322072 demonstrates several cases where only scalars/uniform-vectors are
actually combined:

e.g.

define <2 x i17> @test2(<2 x i17> %X) {
; CHECK-LABEL: @test2(
; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i17> [[X:%.*]], <i17 10, i17 10>
; CHECK-NEXT:    ret <2 x i17> [[Y]]
;
  %Y = mul <2 x i17> %X, <i17 1024, i17 1024>
  ret <2 x i17> %Y
}

define <2 x i17> @test3(<2 x i17> %X) {
; CHECK-LABEL: @test3(
; CHECK-NEXT:    [[Y:%.*]] = mul <2 x i17> [[X:%.*]], <i17 1024, i17 256>
; CHECK-NEXT:    ret <2 x i17> [[Y]]
;
  %Y = mul <2 x i17> %X, <i17 1024, i17 256>
  ret <2 x i17> %Y
}

It'd be very useful to support non-uniform vectors, possibly through a similar
approach to DAGCombine's matchUnaryPredicate/matchBinaryPredicate mechanism.

This is the tip of iceberg as most InstCombine patterns don't support
non-uniform vectors.

-- 
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/20180109/de00dd4a/attachment-0001.html>


More information about the llvm-bugs mailing list