[llvm-bugs] [Bug 46461] New: [X86] reduceBuildVecExtToExtBuildVec breaks uses of opportunity to use broadcast

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 25 16:04:47 PDT 2020


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

            Bug ID: 46461
           Summary: [X86] reduceBuildVecExtToExtBuildVec breaks uses of
                    opportunity to use broadcast
           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: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

This code compiled with avx2 produces multiple vpinsrw instead of just
broadcasting the i32 scalar

define <16 x i32> @bar(i16 %x) {
  %a = zext i16 %x to i32
  %b = insertelement <16 x i32> undef, i32 %a, i32 0
  %c = shufflevector <16 x i32> %b, <16 x i32> undef, <16 x i32>
zeroinitializer
  ret <16 x i32> %c
}


https://godbolt.org/z/K23-jp

Should we disable reduceBuildVecExtToExtBuildVec for splat vectors or should we
improve our broadcast matching? I kind of think that even without native
broadcast we could still use pshufd to broadcast instead of multiple inserts.

-- 
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/20200625/917c5b42/attachment-0001.html>


More information about the llvm-bugs mailing list