LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 27035 - [polly] Assert in lib/Analysis/ScopInfo.cpp:3952 caused by trunk@261866
Summary: [polly] Assert in lib/Analysis/ScopInfo.cpp:3952 caused by trunk@261866
Status: RESOLVED FIXED
Alias: None
Product: Polly
Classification: Unclassified
Component: Optimizer (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P normal
Assignee: Johannes Doerfert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-22 16:46 PDT by Lawrence
Modified: 2016-03-24 08:51 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
reduced testcase (1.27 KB, application/octet-stream)
2016-03-22 16:46 PDT, Lawrence
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lawrence 2016-03-22 16:46:23 PDT
Created attachment 16073 [details]
reduced testcase

The trackback:
 AAA PollyUseRuntimeAliasChecks=1opt: /prj/llvm-arm/home/lawrence/llvmtrunk_latest/src/llvm/tools/polly/lib/Analysis/ScopInfo.cpp:3952: bool polly::ScopInfo::buildAccessMemIntrinsic(polly::MemAccInst, llvm::Loop *, llvm::Region *, const ScopDetection::BoxedLoopsSetTy *, const InvariantLoadsSetTy &): Assertion `DestPtrSCEV' failed.
#0 0x00000000010b83c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0x10b83c8)
#1 0x00000000010b68d6 llvm::sys::RunSignalHandlers() (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0x10b68d6)
#2 0x00000000010b8be9 SignalHandler(int) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0x10b8be9)
#3 0x00007f3ca7536cb0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xfcb0)
#4 0x00007f3ca68780d5 gsignal /build/eglibc-rrybNj/eglibc-2.15/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:64:0
#5 0x00007f3ca687b83b abort /build/eglibc-rrybNj/eglibc-2.15/stdlib/abort.c:93:0
#6 0x00007f3ca6870d9e __assert_fail_base /build/eglibc-rrybNj/eglibc-2.15/assert/assert.c:55:0
#7 0x00007f3ca6870e42 (/lib/x86_64-linux-gnu/libc.so.6+0x2ee42)
#8 0x00007f3ca640127c polly::ScopInfo::buildAccessMemIntrinsic(polly::MemAccInst, llvm::Loop*, llvm::Region*, llvm::SetVector<llvm::Loop const*, std::__1::vector<llvm::Loop const*, std::__1::allocator<llvm::Loop const*> >, llvm::DenseSet<llvm::Loop const*, llvm::DenseMapInfo<llvm::Loop const*> > > const*, llvm::SetVector<llvm::AssertingVH<llvm::LoadInst>, std::__1::vector<llvm::AssertingVH<llvm::LoadInst>, std::__1::allocator<llvm::AssertingVH<llvm::LoadInst> > >, llvm::DenseSet<llvm::AssertingVH<llvm::LoadInst>, llvm::DenseMapInfo<llvm::AssertingVH<llvm::LoadInst> > > > const&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/lib/LLVMPolly.so+0x7c27c)
#9 0x00007f3ca6401e83 polly::ScopInfo::buildMemoryAccess(polly::MemAccInst, llvm::Loop*, llvm::Region*, llvm::SetVector<llvm::Loop const*, std::__1::vector<llvm::Loop const*, std::__1::allocator<llvm::Loop const*> >, llvm::DenseSet<llvm::Loop const*, llvm::DenseMapInfo<llvm::Loop const*> > > const*, llvm::SetVector<llvm::AssertingVH<llvm::LoadInst>, std::__1::vector<llvm::AssertingVH<llvm::LoadInst>, std::__1::allocator<llvm::AssertingVH<llvm::LoadInst> > >, llvm::DenseSet<llvm::AssertingVH<llvm::LoadInst>, llvm::DenseMapInfo<llvm::AssertingVH<llvm::LoadInst> > > > const&, std::__1::map<llvm::Instruction const*, polly::MemAcc, std::__1::less<llvm::Instruction const*>, std::__1::allocator<std::__1::pair<llvm::Instruction const* const, polly::MemAcc> > > const&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/lib/LLVMPolly.so+0x7ce83)
#10 0x00007f3ca640270d polly::ScopInfo::buildAccessFunctions(llvm::Region&, llvm::BasicBlock&, std::__1::map<llvm::Instruction const*, polly::MemAcc, std::__1::less<llvm::Instruction const*>, std::__1::allocator<std::__1::pair<llvm::Instruction const* const, polly::MemAcc> > > const&, llvm::Region*, bool) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/lib/LLVMPolly.so+0x7d70d)
#11 0x00007f3ca640224a polly::ScopInfo::buildAccessFunctions(llvm::Region&, llvm::Region&, std::__1::map<llvm::Instruction const*, polly::MemAcc, std::__1::less<llvm::Instruction const*>, std::__1::allocator<std::__1::pair<llvm::Instruction const* const, polly::MemAcc> > > const&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/lib/LLVMPolly.so+0x7d24a)
#12 0x00007f3ca64034dc polly::ScopInfo::buildScop(llvm::Region&, llvm::AssumptionCache&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/lib/LLVMPolly.so+0x7e4dc)
#13 0x00007f3ca6403e17 polly::ScopInfo::runOnRegion(llvm::Region*, llvm::RGPassManager&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/lib/LLVMPolly.so+0x7ee17)
#14 0x000000000094d0b9 llvm::RGPassManager::runOnFunction(llvm::Function&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0x94d0b9)
#15 0x0000000000ce5b9d llvm::FPPassManager::runOnFunction(llvm::Function&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0xce5b9d)
#16 0x0000000000ce5deb llvm::FPPassManager::runOnModule(llvm::Module&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0xce5deb)
#17 0x0000000000ce6392 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0xce6392)
#18 0x00000000005b2b7b main (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0x5b2b7b)
#19 0x00007f3ca686376d __libc_start_main /build/eglibc-rrybNj/eglibc-2.15/csu/libc-start.c:258:0
#20 0x00000000005a337d _start (/prj/llvm-arm/home/lawrence/llvmtrunk_latest/build_release/llvm/bin/opt+0x5a337d)


Command to reproduce:
bin/opt -load your_LLVMPolly.so -polly-process-unprofitable -polly-scops -debug-only=polly-scops -polly-detect-track-failures=false -S bugpoint-reduced-simplified.ll

This is caused by following patch:
commit c674474a8e1dcafc63f860722328234c29eaeb06
Author: Johannes Doerfert <doerfert@cs.uni-saarland.de>
Date:   Thu Feb 25 14:08:48 2016 +0000

    Support calls with known ModRef function behaviour

      Check the ModRefBehaviour of functions in order to decide whether or
      not a call instruction might be acceptable.

    Differential Revision: http://reviews.llvm.org/D5227


    git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@261866 91177308-0d34-0410-b5e6-96231b3b80d8


Today's latest trunk still have the same issue.
Comment 1 Lawrence 2016-03-22 16:47:34 PDT
Hi, Johannes, assigned to you because caused by your patch, could you please take a look? thx.
Comment 2 Johannes Doerfert 2016-03-22 18:19:43 PDT
I will.
Comment 3 Tobias Grosser 2016-03-23 01:45:51 PDT
As this feature is rather new, I temporarily disabled it as a quick solution.

https://llvm.org/svn/llvm-project/polly/trunk@264140

We can enable it again when this bug has been addressed.
Comment 4 Johannes Doerfert 2016-03-24 08:51:20 PDT
Fixed in r264284. Thanks for the test case!