[llvm-bugs] [Bug 40891] New: [X86] DAG combine infinite loop caused by combineTruncatedArithmetic trying to truncate a bitcast of a build vector of constants

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 27 12:04:18 PST 2019


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

            Bug ID: 40891
           Summary: [X86] DAG combine infinite loop caused by
                    combineTruncatedArithmetic trying to truncate a
                    bitcast of a build vector of constants
           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

The following test case causes a DAG combine infinite loop when compiled for
avx2 in 32-bit mode

define <8 x i32> @foo(<8 x i64> %x, <4 x i64> %y) {
  %a = shufflevector <4 x i64> %y, <4 x i64> <i64 12345, i64 67890, i64 13579,
i64 24680>, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %b = and <8 x i64> %x, %a
  %c = trunc <8 x i64> %b to <8 x i32>
  ret <8 x i32> %c
}

We get in a fight between combienTruncatedArithmetic and
hoistLogicOpWithSameOpcodeHands.

Candidate patch here https://reviews.llvm.org/D58705

Filing this bug so that ISPC which found the bug has something to point to. And
because I probably need to request an 8.0 merge

-- 
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/20190227/e663bf07/attachment.html>


More information about the llvm-bugs mailing list