[llvm-bugs] [Bug 41294] New: loop-vectorize crashed :Assertion `isValidElementType(ElementType) && "Element type of a VectorType must " "be an integer, floating point, or " "pointer type."' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 29 04:27:31 PDT 2019


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

            Bug ID: 41294
           Summary: loop-vectorize crashed :Assertion
                    `isValidElementType(ElementType) && "Element type of a
                    VectorType must " "be an integer, floating point, or "
                    "pointer type."' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: cszide at 163.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21702
  --> https://bugs.llvm.org/attachment.cgi?id=21702&action=edit
.bc file of the source code

$clang -v
clang version 9.0.0 (trunk 355281)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jack-zhou/Documents/llvm/llvm_truck/llvm/build4/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$clang -O3 -c -emit-llvm  -mllvm -disable-llvm-optzns small.c

$opt -functionattrs -loop-rotate -licm -sroa  small.bc -o small-opt.bc

$opt opt -loop-vectorize small-opt.bc
opt: /home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/Type.cpp:609: static
llvm::VectorType* llvm::VectorType::get(llvm::Type*, unsigned int): Assertion
`isValidElementType(ElementType) && "Element type of a VectorType must " "be an
integer, floating point, or " "pointer type."' failed.
Stack dump:
0.      Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/build2/bin/opt -loop-vectorize
small-opt.bc 
1.      Running pass 'Function Pass Manager' on module 'small-opt.bc'.
2.      Running pass 'Loop Vectorization' on function '@e'
 #0 0x0000560de8b10b7b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Unix/Signals.inc:494:0
 #1 0x0000560de8b10c0e PrintStackTraceSignalHandler(void*)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Unix/Signals.inc:558:0
 #2 0x0000560de8b0eb92 llvm::sys::RunSignalHandlers()
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Signals.cpp:68:0
 #3 0x0000560de8b1059d SignalHandler(int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Unix/Signals.inc:357:0
 #4 0x00007f1a7ed85890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007f1a7da37e97 gsignal
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f1a7da39801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f1a7da2939a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x00007f1a7da29412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x0000560de8316100 llvm::VectorType::get(llvm::Type*, unsigned int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/Type.cpp:607:0
#10 0x0000560de753024e
llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value
const*>, unsigned int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/include/llvm/CodeGen/BasicTTIImpl.h:539:0
#11 0x0000560de752e1fe
llvm::TargetTransformInfo::Model<llvm::X86TTIImpl>::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value
const*>, unsigned int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/include/llvm/Analysis/TargetTransformInfo.h:1369:0
#12 0x0000560de7be454c
llvm::TargetTransformInfo::getOperandsScalarizationOverhead(llvm::ArrayRef<llvm::Value
const*>, unsigned int) const
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Analysis/TargetTransformInfo.cpp:255:0
#13 0x0000560de8c66f4c getScalarizationOverhead(llvm::Instruction*, unsigned
int, llvm::TargetTransformInfo const&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3059:0
#14 0x0000560de8c75d33
llvm::LoopVectorizationCostModel::getInstructionCost(llvm::Instruction*,
unsigned int, llvm::Type*&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6020:0
#15 0x0000560de8c740bd
llvm::LoopVectorizationCostModel::getInstructionCost(llvm::Instruction*,
unsigned int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5643:0
#16 0x0000560de8c73100 llvm::LoopVectorizationCostModel::expectedCost(unsigned
int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5408:0
#17 0x0000560de8c70281
llvm::LoopVectorizationCostModel::selectVectorizationFactor(unsigned int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4829:0
#18 0x0000560de8c767ba llvm::LoopVectorizationPlanner::plan(bool, unsigned int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6160:0
#19 0x0000560de8c7cecb llvm::LoopVectorizePass::processLoop(llvm::Loop*)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7322:0
#20 0x0000560de8c7df43 llvm::LoopVectorizePass::runImpl(llvm::Function&,
llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&,
llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*,
llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&,
std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&,
llvm::OptimizationRemarkEmitter&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7539:0
#21 0x0000560de8c5f6f4 (anonymous
namespace)::LoopVectorize::runOnFunction(llvm::Function&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1463:0
#22 0x0000560de82911fc llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1643:0
#23 0x0000560de8291473 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1678:0
#24 0x0000560de8291844 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1743:0
#25 0x0000560de8291fd3 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1856:0
#26 0x0000560de82921c5 llvm::legacy::PassManager::run(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1888:0
#27 0x0000560de64ef15f main
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/tools/opt/opt.cpp:862:0
#28 0x00007f1a7da1ab97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#29 0x0000560de64b0cba _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm/build2/bin/opt+0x1808cba)
Aborted (core dumped)

By using godbolt, it shows that llvm 7/truck version also has this bug.
------------------------------------------------
c;
struct {
  unsigned : 20;
  signed a;
  signed b
} d() {
}
e() {
  for (; c; c++)
    d();
}

-- 
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/20190329/315f2aab/attachment-0001.html>


More information about the llvm-bugs mailing list