<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Clang with -polly-vectorizer=polly fails to compile clapack/SRC/dgetri.c with assert "No array access found for instruction!""
   href="https://bugs.llvm.org/show_bug.cgi?id=38716">38716</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang with -polly-vectorizer=polly fails to compile clapack/SRC/dgetri.c with assert "No array access found for instruction!"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Polly
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>polly-dev@googlegroups.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>orivej@gmx.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20774" name="attach_20774" title="dgetri.c (preprocessed)">attachment 20774</a> <a href="attachment.cgi?id=20774&action=edit" title="dgetri.c (preprocessed)">[details]</a></span>
dgetri.c (preprocessed)

I have tested Clang 7.0.0-rc2 and Clang from trunk@340723 on Linux.

Steps to reproduce:

wget <a href="http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz">http://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz</a>
tar xf clapack-3.2.1-CMAKE.tgz
cd clapack-3.2.1-CMAKE/
mkdir build
cd build/
cmake -GNinja -DCMAKE_C_FLAGS='-O3 -mllvm -polly -mllvm
-polly-vectorizer=polly' -Wno-dev ..
ninja SRC/CMakeFiles/lapack.dir/dgetri.c.o

The generated reproducer is attached.

Stack trace leading to the assertion failure:

#9 0x0000000003548df0 polly::ScopStmt::getArrayAccessFor(llvm::Instruction
const*) const //tools/polly/include/polly/ScopInfo.h:1492:13
#10 0x00000000035a0084
polly::VectorBlockGenerator::generateLoad(polly::ScopStmt&, llvm::LoadInst*,
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:1149:23
#11 0x00000000035a143e
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:1313:5
#12 0x00000000035a1b33 polly::VectorBlockGenerator::copyStmt(polly::ScopStmt&,
isl_id_to_ast_expr*) //tools/polly/lib/CodeGen/BlockGenerators.cpp:0:5
#13 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
#14 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
#15 0x00000000035bc0c3 IslNodeBuilder::createForVector(isl_ast_node*, int)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:460:5
#16 0x00000000035bbb93 IslNodeBuilder::createMark(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:411:7
#17 0x00000000035bc996 IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:998:5
#18 0x00000000035bc7fc
IslNodeBuilder::createForSequential(isl::noexceptions::ast_node, bool)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:556:3
#19 0x00000000035bda18 IslNodeBuilder::createFor(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:761:3
#20 0x00000000035bc9af IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1001:5
#21 0x00000000035be661 IslNodeBuilder::createBlock(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:985:59
#22 0x00000000035bc9fa IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1010:5
#23 0x00000000035bbc1e IslNodeBuilder::createMark(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:422:15
#24 0x00000000035bc996 IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:998:5
#25 0x00000000035bc7fc
IslNodeBuilder::createForSequential(isl::noexceptions::ast_node, bool)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:556:3
#26 0x00000000035bda18 IslNodeBuilder::createFor(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:761:3
#27 0x00000000035bc9af IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1001:5
#28 0x00000000035bde8d IslNodeBuilder::createIf(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:801:3
#29 0x00000000035bc9c8 IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1004:5
#30 0x00000000035bbc1e IslNodeBuilder::createMark(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:422:15
#31 0x00000000035bc996 IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:998:5
#32 0x00000000035be661 IslNodeBuilder::createBlock(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:985:59
#33 0x00000000035bc9fa IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1010:5
#34 0x00000000035bde8d IslNodeBuilder::createIf(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:801:3
#35 0x00000000035bc9c8 IslNodeBuilder::create(isl_ast_node*)
//tools/polly/lib/CodeGen/IslNodeBuilder.cpp:1004:5
#36 0x000000000355e279 CodeGen(polly::Scop&, polly::IslAstInfo&,
llvm::LoopInfo&, llvm::DominatorTree&, llvm::ScalarEvolution&,
llvm::RegionInfo&) //tools/polly/lib/CodeGen/CodeGeneration.cpp:296:17
#37 0x000000000355ef29 (anonymous
namespace)::CodeGeneration::runOnScop(polly::Scop&)
//tools/polly/lib/CodeGen/CodeGeneration.cpp:349:5
#38 0x000000000355307e polly::ScopPass::runOnRegion(llvm::Region*,
llvm::RGPassManager&) //tools/polly/lib/Analysis/ScopPass.cpp:34:5
#39 0x00000000016281ed llvm::RGPassManager::runOnFunction(llvm::Function&)
//lib/Analysis/RegionPass.cpp:97:23
#40 0x0000000001e51d4b llvm::FPPassManager::runOnFunction(llvm::Function&)
//lib/IR/LegacyPassManager.cpp:1588:23
#41 0x0000000001e520a5 llvm::FPPassManager::runOnModule(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1611:16
#42 0x0000000001e528b8 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1671:23
#43 0x0000000001e5238a llvm::legacy::PassManagerImpl::run(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1776:16
#44 0x0000000001e52e11 llvm::legacy::PassManager::run(llvm::Module&)
//lib/IR/LegacyPassManager.cpp:1807:3
#45 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
#46 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
#47 0x0000000003a40ecc
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
//tools/clang/lib/CodeGen/CodeGenAction.cpp:293:7
#48 0x0000000004e346f4 clang::ParseAST(clang::Sema&, bool, bool)
//tools/clang/lib/Parse/ParseAST.cpp:177:12
#49 0x000000000326904c clang::ASTFrontendAction::ExecuteAction()
//tools/clang/lib/Frontend/FrontendAction.cpp:1013:1
#50 0x0000000003a3e363 clang::CodeGenAction::ExecuteAction()
//tools/clang/lib/CodeGen/CodeGenAction.cpp:1045:1
#51 0x0000000003268aa0 clang::FrontendAction::Execute()
//tools/clang/lib/Frontend/FrontendAction.cpp:914:7
#52 0x00000000031e4cef
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
//tools/clang/lib/Frontend/CompilerInstance.cpp:962:7
#53 0x00000000034043ec
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
//tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:257:8
#54 0x0000000000fb0943 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) //tools/clang/tools/driver/cc1_main.cpp:218:11
#55 0x0000000000fa3752 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) //tools/clang/tools/driver/driver.cpp:310:5
#56 0x0000000000fa2388 main //tools/clang/tools/driver/driver.cpp:382:5</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>