[llvm-bugs] [Bug 25077] New: BBVectorizer crashes when trying to combine an extract element with non-const 2nd arg

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 6 09:47:19 PDT 2015


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

            Bug ID: 25077
           Summary: BBVectorizer crashes when trying to combine an extract
                    element with non-const 2nd arg
           Product: new-bugs
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: pekka.jaaskelainen at tut.fi
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15013
  --> https://llvm.org/bugs/attachment.cgi?id=15013&action=edit
Test case to produce the crash

We get a nice performance improvement in pocl for some benchmarks:
https://github.com/pocl/pocl/issues/251  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)

-- 
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/20151006/86ff5c70/attachment.html>


More information about the llvm-bugs mailing list