[llvm-bugs] [Bug 27808] New: SROA: 3.7 generates vector select with undef, 3.8/trunk generates vector select with phi

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 18 16:25:35 PDT 2016


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

            Bug ID: 27808
           Summary: SROA: 3.7 generates vector select with undef,
                    3.8/trunk generates vector select with phi
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: pjcoup at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16385
  --> https://llvm.org/bugs/attachment.cgi?id=16385&action=edit
sroa.ll

For the attached sroa.ll, trunk LLVM and 3.8 SROA generates seemingly poorer
code than 3.7 (phi + select with phi instead of select with undef):

@@ -10,6 +11,7 @@
   br label %for.cond

 for.cond:                                         ; preds = %for.body, %entry
+  %tmp.1.0 = phi <16 x i8> [ undef, %entry ], [ %tmp.1.0.vecblend, %for.body ]
   %i.0 = phi i32 [ 0, %entry ], [ %nexti, %for.body ]
   %cmp = icmp slt i32 %i.0, %n
   br i1 %cmp, label %for.body, label %for.cond.cleanup
@@ -22,7 +24,7 @@
   %b.1 = load <16 x i8>, <16 x i8>* %bidx.1, align 16
   %bld = shufflevector <16 x i8> %b.1, <16 x i8> undef, <4 x i32> <i32 0, i32
1, i32 2, i32 3>
   %tmp.1.0.vec.expand = shufflevector <4 x i8> %bld, <4 x i8> undef, <16 x
i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef,
i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef,
i32 undef>
-  %tmp.1.0.vecblend = select <16 x i1> <i1 true, i1 true, i1 true, i1 true, i1
false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1
false, i1 false, i1 false, i1 false>, <16 x i8> %tmp.1.0.vec.expand, <16 x i8>
undef
+  %tmp.1.0.vecblend = select <16 x i1> <i1 true, i1 true, i1 true, i1 true, i1
false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1
false, i1 false, i1 false, i1 false>, <16 x i8> %tmp.1.0.vec.expand, <16 x i8>
%tmp.1.0
   %cvt = call <4 x i32> @convert(<16 x i8> %tmp.1.0.vecblend)
   %aidx.1 = getelementptr <4 x i32>, <4 x i32>* %a, i32 %i.0
   store <4 x i32> %cvt, <4 x i32>* %aidx.1, align 16

Reproduce with opt -sroa sroa.ll
Is this an expected change for 3.8?

-- 
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/20160518/91f6191c/attachment.html>


More information about the llvm-bugs mailing list