[llvm-bugs] [Bug 27617] New: SLPVectorizer asserts in buildtree_rec

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 3 06:14:17 PDT 2016


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

            Bug ID: 27617
           Summary: SLPVectorizer asserts in buildtree_rec
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: jesper.antonsson at ericsson.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16298
  --> https://llvm.org/bugs/attachment.cgi?id=16298&action=edit
minimal llvm assembly language file that triggers the assert

For the attached ll code example and the invocation:
./build-all/bin/opt -S -mcpu=x86-64 -mtriple=x86_64-linux -indvars
-slp-vectorizer -O1 -o /dev/null foo.opt.ll

I get this assert:
opt: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:1005: void (anonymous
namespace)::BoUpSLP::buildTree_rec(ArrayRef<llvm::Value *>, unsigned int):
Assertion `SameTy && "Invalid types!"' failed.

The problem is that two getelementpointer indicies have differing types. Both
have the value 4, but one is of i16 type and one is i64. The recursive call to
gather those values fails with an assert because the types differ.

The simplest fix might be to change the assert to allow this. Something like
this:
-  bool SameTy = getSameType(VL); (void)SameTy;
+  bool SameTy = allConstant(VL) || getSameType(VL); (void)SameTy;

-- 
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/20160503/7e356be5/attachment.html>


More information about the llvm-bugs mailing list