[LLVMbugs] [Bug 23982] New: Infinite DAG combining when targeting AVX2

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 29 06:43:05 PDT 2015


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

            Bug ID: 23982
           Summary: Infinite DAG combining when targeting AVX2
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: chfast at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

When compiling the following test with `llc -mattr=+avx2`:

target triple = "x86_64-unknown-linux-gnu"

define <16 x i1> @test(<16 x i16> %In) {
  br label %Header

Header:                                           ; preds = %Middle, %Header,
%0
  %H = shufflevector <16 x i16> %In, <16 x i16> zeroinitializer, <16 x i32>
<i32 15, i32 17, i32 undef, i32 21, i32 undef, i32 25, i32 27, i32 29, i32 31,
i32 1, i32 3, i32 undef, i32 7, i32 undef, i32 11, i32 13>
  %L = load <8 x i1>, <8 x i1>* undef
  br i1 undef, label %Header, label %Middle

Middle:                                           ; preds = %Header
  br i1 undef, label %Header, label %Footer

Footer:                                           ; preds = %Middle
  %S = select i1 undef, <8 x i1> undef, <8 x i1> %L
  %C = icmp slt <16 x i16> %H, undef
  ret <16 x i1> %C
}

DAGCombiner goes into infinite loop mode. The repeating combining sequence is:

Combining: 0x36247a0: v16i16 = bitcast 0x3623d80 [ORD=2]
 ... into: 0x3622f40: v16i16 = vector_shuffle 0x3621f30,
0x3627c20<16,1,u,3,u,5,6,7,8,9,10,u,12,u,14,15> [ORD=2]

Combining: 0x3627630: v8i32 = X86ISD::BLENDI 0x3629360, 0x36279c0, 0x362b6a0
[ORD=2]

Combining: 0x3629100: v16i16 = bitcast 0x36242e0 [ORD=2]

Combining: 0x36242e0: v32i8 = vselect 0x361f1f0, 0x3623400, 0x36238c0 [ORD=2]
 ... into: 0x3621f30: v32i8 = vector_shuffle 0x3623400,
0x36238c0<32,33,2,3,u,u,6,7,u,u,10,11,12,13,14,15,16,17,18,19,20,21,u,u,24,25,u,u,28,29,30,31>
[ORD=2]

Combining: 0x3629100: v16i16 = bitcast 0x3621f30 [ORD=2]

Combining: 0x3627630: v8i32 = X86ISD::BLENDI 0x3629360, 0x36279c0, 0x362b6a0
[ORD=2]

Combining: 0x3629100: v16i16 = bitcast 0x36242e0 [ORD=2]
 ... into: 0x361f1f0: v16i16 = vector_shuffle 0x3623d80,
0x36247a0<16,1,u,3,u,5,6,7,8,9,10,u,12,u,14,15> [ORD=2]

Combining: 0x3627630: v8i32 = X86ISD::BLENDI 0x3629360, 0x36279c0, 0x362b6a0
[ORD=2]

Combining: 0x3622f40: v16i16 = bitcast 0x3627c20 [ORD=2]

Combining: 0x3627c20: v32i8 = vselect 0x3621f30, 0x3623400, 0x36238c0 [ORD=2]
 ... into: 0x3623d80: v32i8 = vector_shuffle 0x3623400,
0x36238c0<32,33,2,3,u,u,6,7,u,u,10,11,12,13,14,15,16,17,18,19,20,21,u,u,24,25,u,u,28,29,30,31>
[ORD=2]

Combining: 0x3622f40: v16i16 = bitcast 0x3623d80 [ORD=2]

Combining: 0x3627630: v8i32 = X86ISD::BLENDI 0x3629360, 0x36279c0, 0x362b6a0
[ORD=2]

Combining: 0x3622f40: v16i16 = bitcast 0x3627c20 [ORD=2]
 ... into: 0x3621f30: v16i16 = vector_shuffle 0x36242e0,
0x3629100<16,1,u,3,u,5,6,7,8,9,10,u,12,u,14,15> [ORD=2]

-- 
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/20150629/556131cb/attachment.html>


More information about the llvm-bugs mailing list