[llvm-bugs] [Bug 30366] New: Assertion `this->getType()->isVectorTy() && "Only valid for vectors!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 13 05:56:39 PDT 2016


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

            Bug ID: 30366
           Summary: Assertion `this->getType()->isVectorTy() && "Only
                    valid for vectors!"' failed.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17254
  --> https://llvm.org/bugs/attachment.cgi?id=17254&action=edit
Reproducer

Instcombine crashes on the attached input if doing
opt -S red.ll -instcombine


#0  0x00007ffff67bfc37 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff67c3028 in __GI_abort () at abort.c:89
#2  0x00007ffff67b8bf6 in __assert_fail_base (fmt=0x7ffff69093b8 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=assertion at entry=0x39957c6 "this->getType()->isVectorTy() &&
\"Only valid for vectors!\"", file=file at entry=0x3994909
"../lib/IR/Constants.cpp", line=line at entry=1295, 
    function=function at entry=0x3995801 "llvm::Constant
*llvm::Constant::getSplatValue() const") at assert.c:92
#3  0x00007ffff67b8ca2 in __GI___assert_fail (assertion=0x39957c6
"this->getType()->isVectorTy() && \"Only valid for vectors!\"", file=0x3994909
"../lib/IR/Constants.cpp", 
    line=1295, function=0x3995801 "llvm::Constant
*llvm::Constant::getSplatValue() const") at assert.c:101
#4  0x00000000021ba5c8 in llvm::Constant::getSplatValue (this=0x4bff360) at
../lib/IR/Constants.cpp:1295
#5  0x00000000021ba6c6 in llvm::Constant::getUniqueInteger (this=0x4bff360) at
../lib/IR/Constants.cpp:1318
#6  0x00000000024f0cc6 in foldUDivShl (Op0=0x4c1a3c8, Op1=0x4bff3a8, I=...,
IC=...) at ../lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1007
#7  0x00000000024ed542 in llvm::InstCombiner::visitUDiv (this=0x7fffffffcfc0,
I=...) at ../lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1109
#8  0x0000000002472883 in llvm::InstVisitor<llvm::InstCombiner,
llvm::Instruction*>::visit (this=0x7fffffffcfc0, I=...) at
../include/llvm/IR/Instruction.def:130
#9  0x000000000246dbbc in llvm::InstCombiner::run (this=0x7fffffffcfc0) at
../lib/Transforms/InstCombine/InstructionCombining.cpp:2932
#10 0x000000000246e5f4 in combineInstructionsOverFunction (F=..., Worklist=...,
AA=0x4c1a360, AC=..., TLI=..., DT=..., TTI=..., ExpensiveCombines=true, LI=0x0)
    at ../lib/Transforms/InstCombine/InstructionCombining.cpp:3167
#11 0x000000000246e89f in llvm::InstructionCombiningPass::runOnFunction
(this=0x4c14940, F=...) at
../lib/Transforms/InstCombine/InstructionCombining.cpp:3225
#12 0x00000000022ba68d in llvm::FPPassManager::runOnFunction (this=0x4c15390,
F=...) at ../lib/IR/LegacyPassManager.cpp:1533
#13 0x00000000022ba9c5 in llvm::FPPassManager::runOnModule (this=0x4c15390,
M=...) at ../lib/IR/LegacyPassManager.cpp:1554
#14 0x00000000022bb1ae in (anonymous namespace)::MPPassManager::runOnModule
(this=0x4bffc50, M=...) at ../lib/IR/LegacyPassManager.cpp:1610
#15 0x00000000022bacab in llvm::legacy::PassManagerImpl::run (this=0x4bff6d0,
M=...) at ../lib/IR/LegacyPassManager.cpp:1713
#16 0x00000000022bb6f1 in llvm::legacy::PassManager::run (this=0x7fffffffdc20,
M=...) at ../lib/IR/LegacyPassManager.cpp:1744
#17 0x0000000000a4d689 in main (argc=4, argv=0x7fffffffe108) at
../tools/opt/opt.cpp:705

up a couple of times:

#4  0x00000000021ba5c8 in llvm::Constant::getSplatValue (this=0x4bff360) at
../lib/IR/Constants.cpp:1295
1295      assert(this->getType()->isVectorTy() && "Only valid for vectors!");
(gdb) call dump()
i16 shl (i16 1, i16 ptrtoint ([1 x i16]* @b to i16))
(gdb) up
#5  0x00000000021ba6c6 in llvm::Constant::getUniqueInteger (this=0x4bff360) at
../lib/IR/Constants.cpp:1318
1318      assert(this->getSplatValue() && "Doesn't contain a unique integer!");
(gdb) l
1313    }
1314
1315    const APInt &Constant::getUniqueInteger() const {
1316      if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
1317        return CI->getValue();
1318      assert(this->getSplatValue() && "Doesn't contain a unique integer!");
1319      const Constant *C = this->getAggregateElement(0U);
1320      assert(C && isa<ConstantInt>(C) && "Not a vector of numbers!");
1321      return cast<ConstantInt>(C)->getValue();
1322    }
(gdb)

so it expects a constant in Constant::getUniqueInteger but it's a constant
expression instead and then it crashes?

-- 
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/20160913/f6eac36c/attachment.html>


More information about the llvm-bugs mailing list