[llvm-bugs] [Bug 38715] New: Clang with -polly-vectorizer=polly fails to compile brotli/dec/decode.c with assert "Unexpected scalar dependence in region!"
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Aug 27 02:25:09 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38715
Bug ID: 38715
Summary: Clang with -polly-vectorizer=polly fails to compile
brotli/dec/decode.c with assert "Unexpected scalar
dependence in region!"
Product: Polly
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Other
Assignee: polly-dev at googlegroups.com
Reporter: orivej at gmx.fr
CC: llvm-bugs at lists.llvm.org
Created attachment 20772
--> https://bugs.llvm.org/attachment.cgi?id=20772&action=edit
brotli/dec/decode.c reproducer source
I have tested Clang 7.0.0-rc2 and Clang from trunk at 340723 on Linux.
Steps to reproduce:
git clone git://github.com/google/brotli -b v1.0.5
cd brotli/
mkdir build
cd build/
cmake -GNinja -DCMAKE_C_FLAGS='-O3 -mllvm -polly -mllvm
-polly-vectorizer=polly' ..
ninja CMakeFiles/brotlidec.dir/c/dec/decode.c.o
The generated reproducer is attached.
Stack trace leading to the assertion failure:
#9 0x000000000359a256 polly::BlockGenerator::getNewValue(polly::ScopStmt&,
llvm::Value*, llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >&, llvm::DenseMap<llvm::Loop const*,
llvm::SCEV const*, llvm::DenseMapInfo<llvm::Loop const*>,
llvm::detail::DenseMapPair<llvm::Loop const*, llvm::SCEV const*> >&,
llvm::Loop*) const //tools/polly/lib/CodeGen/BlockGenerators.cpp:220:10
#10 0x000000000359f16f
polly::VectorBlockGenerator::getVectorValue(polly::ScopStmt&, llvm::Value*,
llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >&,
llvm::SmallVector<llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >, 8u>&, llvm::Loop*)
//tools/polly/lib/CodeGen/BlockGenerators.cpp:1041:9
#11 0x00000000035a0912
polly::VectorBlockGenerator::copyBinaryInst(polly::ScopStmt&,
llvm::BinaryOperator*, llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >&,
llvm::SmallVector<llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >, 8u>&)
//tools/polly/lib/CodeGen/BlockGenerators.cpp:1191:12
#12 0x00000000035a1521
polly::VectorBlockGenerator::copyInstruction(polly::ScopStmt&,
llvm::Instruction*, llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >&,
llvm::SmallVector<llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>,
llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value> >,
llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value> > >, 8u>&, isl_id_to_ast_expr*)
//tools/polly/lib/CodeGen/BlockGenerators.cpp:1333:7
#13 0x00000000035a1b33 polly::VectorBlockGenerator::copyStmt(polly::ScopStmt&,
isl_id_to_ast_expr*) //tools/polly/lib/CodeGen/BlockGenerators.cpp:0:5
#14 0x00000000035c355e
polly::VectorBlockGenerator::generate(polly::BlockGenerator&, polly::ScopStmt&,
std::vector<llvm::DenseMap<llvm::Loop const*, llvm::SCEV const*,
llvm::DenseMapInfo<llvm::Loop const*>, llvm::detail::DenseMapPair<llvm::Loop
const*, llvm::SCEV const*> >, std::allocator<llvm::DenseMap<llvm::Loop const*,
llvm::SCEV const*, llvm::DenseMapInfo<llvm::Loop const*>,
llvm::detail::DenseMapPair<llvm::Loop const*, llvm::SCEV const*> > > >&,
isl_map*, isl_id_to_ast_expr*)
//tools/polly/include/polly/CodeGen/BlockGenerators.h:643:15
#15 0x00000000035bb270 IslNodeBuilder::createUserVector(isl_ast_node*,
std::vector<llvm::Value*, std::allocator<llvm::Value*> >&, isl_id*,
isl_union_map*) //tools/polly/lib/CodeGen/IslNodeBuilder.cpp:394:27
#16 0x00000000035bc0c3 IslNodeBuilder::createForVector(isl_ast_node*, int)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:460:5
#17 0x00000000035bd991 IslNodeBuilder::createFor(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:751:7
#18 0x00000000035bc9af IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1001:5
#19 0x00000000035be661 IslNodeBuilder::createBlock(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:985:59
#20 0x00000000035bc9fa IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1010:5
#21 0x00000000035bc7fc
IslNodeBuilder::createForSequential(isl::noexceptions::ast_node, bool)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:556:3
#22 0x00000000035bda18 IslNodeBuilder::createFor(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:761:3
#23 0x00000000035bc9af IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1001:5
#24 0x000000000355e279 CodeGen(polly::Scop&, polly::IslAstInfo&,
llvm::LoopInfo&, llvm::DominatorTree&, llvm::ScalarEvolution&,
llvm::RegionInfo&) //tools/polly/lib/CodeGen/CodeGeneration.cpp:296:17
#25 0x000000000355ef29 (anonymous
namespace)::CodeGeneration::runOnScop(polly::Scop&)
//tools/polly/lib/CodeGen/CodeGeneration.cpp:349:5
#26 0x000000000355307e polly::ScopPass::runOnRegion(llvm::Region*,
llvm::RGPassManager&) //tools/polly/lib/Analysis/ScopPass.cpp:34:5
#27 0x00000000016281ed llvm::RGPassManager::runOnFunction(llvm::Function&)
//lib/Analysis/RegionPass.cpp:97:23
#28 0x0000000001e51d4b llvm::FPPassManager::runOnFunction(llvm::Function&)
//lib/IR/LegacyPassManager.cpp:1588:23
#29 0x0000000001e520a5 llvm::FPPassManager::runOnModule(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1611:16
#30 0x0000000001e528b8 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1671:23
#31 0x0000000001e5238a llvm::legacy::PassManagerImpl::run(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1776:16
#32 0x0000000001e52e11 llvm::legacy::PassManager::run(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1807:3
#33 0x00000000029d8990 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
//tools/clang/lib/CodeGen/BackendUtil.cpp:845:21
#34 0x00000000029d55f6 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
//tools/clang/lib/CodeGen/BackendUtil.cpp:1273:15
#35 0x0000000003a40ecc
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
//tools/clang/lib/CodeGen/CodeGenAction.cpp:293:7
#36 0x0000000004e346f4 clang::ParseAST(clang::Sema&, bool, bool)
//tools/clang/lib/Parse/ParseAST.cpp:177:12
#37 0x000000000326904c clang::ASTFrontendAction::ExecuteAction()
//tools/clang/lib/Frontend/FrontendAction.cpp:1013:1
#38 0x0000000003a3e363 clang::CodeGenAction::ExecuteAction()
//tools/clang/lib/CodeGen/CodeGenAction.cpp:1045:1
#39 0x0000000003268aa0 clang::FrontendAction::Execute()
//tools/clang/lib/Frontend/FrontendAction.cpp:914:7
#40 0x00000000031e4cef
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
//tools/clang/lib/Frontend/CompilerInstance.cpp:962:7
#41 0x00000000034043ec
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
//tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:257:8
#42 0x0000000000fb0943 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) //tools/clang/tools/driver/cc1_main.cpp:218:11
#43 0x0000000000fa3752 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) //tools/clang/tools/driver/driver.cpp:310:5
#44 0x0000000000fa2388 main //tools/clang/tools/driver/driver.cpp:382:5
--
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/20180827/ed5c3419/attachment-0001.html>
More information about the llvm-bugs
mailing list