[llvm-bugs] [Bug 44069] New: Infinite shuffle+extract legalization loop

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 19 16:01:35 PST 2019


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: unassignedbugs at nondot.org
          Reporter: aemerson at apple.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191120/0ca395d0/attachment-0001.html>


More information about the llvm-bugs mailing list