[LLVMbugs] [Bug 23954] New: [Vectorizer] loop vectorizer crash creating mul with bad operands

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 25 15:03:28 PDT 2015


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

            Bug ID: 23954
           Summary: [Vectorizer] loop vectorizer crash creating mul with
                    bad operands
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: dschuff at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The simple test below crashes with the following assertion:

opt: /s/llvm-upstream/llvm/lib/IR/Instructions.cpp:1702: static
llvm::BinaryOperator
*llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value *,
llvm::Value *, const llvm::Twine &, llvm::Instruction *): Assertion
`S1->getType() == S2->getType() && "Cannot create binary operator with two
operands of differing type!"' failed.

This is called from lib/Transforms/Vectorize/LoopVectorizer.cpp:857

I'll investigate but I'm not too familiar with this code so I though I'd get it
up here too. Pasted below are the full stack trace and the reproducer.


#0  0x00007ffff65b7cc9 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff65bb0d8 in __GI_abort () at abort.c:89
#2  0x00007ffff65b0b86 in __assert_fail_base (fmt=0x7ffff6701830 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=assertion at entry=0x2252449 "S1->getType() == S2->getType() &&
\"Cannot create binary operator with two operands of differing type!\"",
file=file at entry=0x22505e5 "/s/llvm-upstream/llvm/lib/IR/Instructions.cpp",
line=line at entry=1702, 
    function=function at entry=0x22524b0 "static llvm::BinaryOperator
*llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value *,
llvm::Value *, const llvm::Twine &, llvm::Instruction *)") at assert.c:92
#3  0x00007ffff65b0c32 in __GI___assert_fail (
    assertion=0x2252449 "S1->getType() == S2->getType() && \"Cannot create
binary operator with two operands of differing type!\"", 
    file=0x22505e5 "/s/llvm-upstream/llvm/lib/IR/Instructions.cpp", line=1702, 
    function=0x22524b0 "static llvm::BinaryOperator
*llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value *,
llvm::Value *, const llvm::Twine &, llvm::Instruction *)") at assert.c:101
#4  0x00000000013b1022 in llvm::BinaryOperator::Create
(Op=llvm::Instruction::Mul, S1=0x2da9aa0, S2=0x2d943b0, Name=...,
InsertBefore=0x0)
    at /s/llvm-upstream/llvm/lib/IR/Instructions.cpp:1701
#5  0x0000000000b2c512 in llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >::CreateInsertNUWNSWBinOp (
    this=0x7fffffffc188, Opc=llvm::Instruction::Mul, LHS=0x2da9aa0,
RHS=0x2d943b0, Name=..., HasNUW=false, HasNSW=false)
    at /s/llvm-upstream/llvm/include/llvm/IR/IRBuilder.h:705
#6  0x0000000000ef8ccb in llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >::CreateMul (
    this=0x7fffffffc188, LHS=0x2da9aa0, RHS=0x2d943b0, Name=..., HasNUW=false,
HasNSW=false)
    at /s/llvm-upstream/llvm/include/llvm/IR/IRBuilder.h:771
#7  0x00000000019de534 in (anonymous
namespace)::LoopVectorizationLegality::InductionInfo::transform
(this=0x7fffffffbf38, B=..., 
    Index=0x2da9aa0) at
/s/llvm-upstream/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:857
#8  0x00000000019dfd10 in (anonymous
namespace)::InnerLoopVectorizer::createEmptyLoop (this=0x7fffffffc760)
    at /s/llvm-upstream/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2802
#9  0x00000000019d04fb in (anonymous namespace)::InnerLoopVectorizer::vectorize
(this=0x7fffffffc760, L=0x7fffffffccc0)
    at /s/llvm-upstream/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:274
#10 0x00000000019ce1f8 in (anonymous namespace)::LoopVectorize::processLoop
(this=0x2d94180, L=0x2da1750)
    at /s/llvm-upstream/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1667
#11 0x00000000019cd190 in (anonymous namespace)::LoopVectorize::runOnFunction
(this=0x2d94180, F=...)
    at /s/llvm-upstream/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1476
#12 0x00000000013ddacd in llvm::FPPassManager::runOnFunction (this=0x2d95ab0,
F=...)
    at /s/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1520
#13 0x00000000013ddde5 in llvm::FPPassManager::runOnModule (this=0x2d95ab0,
M=...)
    at /s/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1540
#14 0x00000000013de4d0 in (anonymous namespace)::MPPassManager::runOnModule
(this=0x2d91800, M=...)
    at /s/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1596
#15 0x00000000013de0a6 in llvm::legacy::PassManagerImpl::run (this=0x2d91450,
M=...)
    at /s/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1698
#16 0x00000000013de981 in llvm::legacy::PassManager::run (this=0x7fffffffd8f8,
M=...)
    at /s/llvm-upstream/llvm/lib/IR/LegacyPassManager.cpp:1729
#17 0x0000000000798e8c in main (argc=3, argv=0x7fffffffdcd8) at
/s/llvm-upstream/llvm/tools/opt/opt.cpp:599



target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"

; Function Attrs: nounwind uwtable
define i32 @bfd_arch_i386_fill_fill(i64 %p1) #0 {
entry:
  br i1 undef, label %while.end, label %while.body

while.body:                                       ; preds = %while.body, %entry
  %p.05 = phi i8* [ %add.ptr, %while.body ], [ null, %entry ]
  ;%p.05 = i8* 
  %p1.addr.04 = phi i64 [ %sub, %while.body ], [ %p1, %entry ]
  %add.ptr = getelementptr inbounds i8, i8* %p.05, i32 2
  %sub = add nsw i64 %p1.addr.04, -2
  %tobool = icmp eq i64 %sub, 0
  br i1 %tobool, label %while.end, label %while.body

while.end:                                        ; preds = %while.body, %entry
  ret i32 undef
}

attributes #0 = { nounwind uwtable "less-precise-fpmad"="false"
"no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"
"no-infs-fp-math"="false" "no-nans-fp-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="x86-64"
"unsafe-fp-math"="false" "use-soft-float"="false" }

-- 
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/20150625/393e5d2e/attachment.html>


More information about the llvm-bugs mailing list