<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - BBVectorizer crashes when trying to combine an extract element with non-const 2nd arg"
href="https://llvm.org/bugs/show_bug.cgi?id=25077">25077</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>BBVectorizer crashes when trying to combine an extract element with non-const 2nd arg
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>pekka.jaaskelainen@tut.fi
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=15013" name="attach_15013" title="Test case to produce the crash">attachment 15013</a> <a href="attachment.cgi?id=15013&action=edit" title="Test case to produce the crash">[details]</a></span>
Test case to produce the crash
We get a nice performance improvement in pocl for some benchmarks:
<a href="https://github.com/pocl/pocl/issues/251">https://github.com/pocl/pocl/issues/251</a> however, when enabling it in LLVM 3.7,
there's a regression in our test suite. I isolated the attached test case
which reproduces it. See inside the file, there're some comments pointing out
the issue.
opt -bb-vectorize -O3 testcase.ll -S -o -
opt:
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/include/llvm/Support/Casting.h:237:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
llvm::ConstantInt; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type
= llvm::ConstantInt*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
#0 0x7f0d3ffb411e llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Support/Unix/Signals.inc:437:0
#1 0x7f0d3ffb4433 PrintStackTraceSignalHandler(void*)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Support/Unix/Signals.inc:495:0
#2 0x7f0d3ffb2fd4 SignalHandler(int)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Support/Unix/Signals.inc:210:0
#3 0x7f0d3cf86d40 (/lib/x86_64-linux-gnu/libc.so.6+0x36d40)
#4 0x7f0d3cf86cc9 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x36cc9)
#5 0x7f0d3cf8a0d8 abort (/lib/x86_64-linux-gnu/libc.so.6+0x3a0d8)
#6 0x7f0d3cf7fb86 (/lib/x86_64-linux-gnu/libc.so.6+0x2fb86)
#7 0x7f0d3cf7fc32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x7f0d3e79420f llvm::cast_retty<llvm::ConstantInt, llvm::Value*>::ret_type
llvm::cast<llvm::ConstantInt, llvm::Value>(llvm::Value*)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/include/llvm/Support/Casting.h:239:0
#9 0x7f0d400fe02c (anonymous
namespace)::BBVectorize::getReplacementInput(llvm::LLVMContext&,
llvm::Instruction*, llvm::Instruction*, unsigned int, bool)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Transforms/Vectorize/BBVectorize.cpp:2514:0
#10 0x7f0d400ffd08 (anonymous
namespace)::BBVectorize::getReplacementInputsForPair(llvm::LLVMContext&,
llvm::Instruction*, llvm::Instruction*, llvm::SmallVectorImpl<llvm::Value*>&,
bool)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Transforms/Vectorize/BBVectorize.cpp:2797:0
#11 0x7f0d401019e4 (anonymous
namespace)::BBVectorize::fuseChosenPairs(llvm::BasicBlock&,
std::vector<llvm::Value*, std::allocator<llvm::Value*> >&,
llvm::DenseMap<llvm::Value*, llvm::Value*, llvm::DenseMapInfo<llvm::Value*>,
llvm::detail::DenseMapPair<llvm::Value*, llvm::Value*> >&,
llvm::DenseSet<std::pair<llvm::Value*, llvm::Value*>,
llvm::DenseMapInfo<std::pair<llvm::Value*, llvm::Value*> > >&,
llvm::DenseMap<std::pair<std::pair<llvm::Value*, llvm::Value*>,
std::pair<llvm::Value*, llvm::Value*> >, unsigned int,
llvm::DenseMapInfo<std::pair<std::pair<llvm::Value*, llvm::Value*>,
std::pair<llvm::Value*, llvm::Value*> > >,
llvm::detail::DenseMapPair<std::pair<std::pair<llvm::Value*, llvm::Value*>,
std::pair<llvm::Value*, llvm::Value*> >, unsigned int> >&,
llvm::DenseMap<std::pair<llvm::Value*, llvm::Value*>,
std::vector<std::pair<llvm::Value*, llvm::Value*>,
std::allocator<std::pair<llvm::Value*, llvm::Value*> > >,
llvm::DenseMapInfo<std::pair<llvm::Value*, llvm::Value*> >,
llvm::detail::DenseMapPair<std::pair<llvm::Value*, llvm::Value*>,
std::vector<std::pair<llvm::Value*, llvm::Value*>,
std::allocator<std::pair<llvm::Value*, llvm::Value*> > > > >&,
llvm::DenseMap<std::pair<llvm::Value*, llvm::Value*>,
std::vector<std::pair<llvm::Value*, llvm::Value*>,
std::allocator<std::pair<llvm::Value*, llvm::Value*> > >,
llvm::DenseMapInfo<std::pair<llvm::Value*, llvm::Value*> >,
llvm::detail::DenseMapPair<std::pair<llvm::Value*, llvm::Value*>,
std::vector<std::pair<llvm::Value*, llvm::Value*>,
std::allocator<std::pair<llvm::Value*, llvm::Value*> > > > >&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Transforms/Vectorize/BBVectorize.cpp:3100:0
#12 0x7f0d400f5852 (anonymous
namespace)::BBVectorize::vectorizePairs(llvm::BasicBlock&, bool)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Transforms/Vectorize/BBVectorize.cpp:845:0
#13 0x7f0d400f3dc8 (anonymous
namespace)::BBVectorize::vectorizeBB(llvm::BasicBlock&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Transforms/Vectorize/BBVectorize.cpp:417:0
#14 0x7f0d400f4077 (anonymous
namespace)::BBVectorize::runOnBasicBlock(llvm::BasicBlock&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/Transforms/Vectorize/BBVectorize.cpp:449:0
#15 0x7f0d3f3d5f6d (anonymous
namespace)::BBPassManager::runOnFunction(llvm::Function&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/IR/LegacyPassManager.cpp:1305:0
#16 0x7f0d3f3d6bc8 llvm::FPPassManager::runOnFunction(llvm::Function&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/IR/LegacyPassManager.cpp:1520:0
#17 0x7f0d3f3d6d45 llvm::FPPassManager::runOnModule(llvm::Module&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/IR/LegacyPassManager.cpp:1540:0
#18 0x7f0d3f3d709b (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/IR/LegacyPassManager.cpp:1596:0
#19 0x7f0d3f3d7779 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/IR/LegacyPassManager.cpp:1698:0
#20 0x7f0d3f3d79b3 llvm::legacy::PassManager::run(llvm::Module&)
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/lib/IR/LegacyPassManager.cpp:1730:0
#21 0x488776 main
/mnt/olddisk1/work/llvm-build-temp/llvm-3.7/tools/opt/opt.cpp:603:0
#22 0x7f0d3cf71ec5 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec5)
#23 0x466c89 _start
(/home/visit0r/local/stow/llvm-3.7-newpatches-dbg/bin/opt+0x466c89)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>