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

            Bug ID: 44069
           Summary: Infinite shuffle+extract legalization loop
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: aemer...@apple.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

The following IR causes a hang with llc -O0 on x86:

define hidden void @foo() unnamed_addr #0 align 2 {
entry:
  %0 = load <4 x float>, <4 x float>* undef, align 16
  %vecext.i4849 = extractelement <4 x float> %0, i32 0
  %1 = load <4 x i32>, <4 x i32>* null, align 16
  %permil281 = shufflevector <4 x i32> %1, <4 x i32> undef, <4 x i32> <i32 1,
i32 1, i32 1, i32 1>
  %2 = bitcast <4 x i32> %permil281 to <4 x float>
  %vecext1.i4794 = extractelement <4 x float> %2, i32 0
  %sub.i4795 = fsub float %vecext1.i4794, %vecext.i4849
  %vecins.i4796 = insertelement <4 x float> %2, float %sub.i4795, i32 0
  store <4 x float> %vecins.i4796, <4 x float>* undef, align 16
  unreachable
}

attributes #0 = { "use-soft-float"="false" }


It seems that there's a combine in X86ISelLowering in
XFormVExtractWithShuffleIntoLoad() which is matching the load->shuffle->extract
element and then generating another shuffle->extractelement, which I assume is
intended for further optimization by DAGCombine. However, it just up in a
legalization loop on the extract.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to