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 30953 - [polly] "Unknowns SCEV was neither parameter nor a valid instruction." UNREACHABLE executed at SCEVAffinator.cpp:553
Summary: [polly] "Unknowns SCEV was neither parameter nor a valid instruction." UNREAC...
Status: RESOLVED FIXED
Alias: None
Product: Polly
Classification: Unclassified
Component: Optimizer (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P normal
Assignee: Polly Development Mailinglist
URL:
Keywords:
: 30954 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-08 17:26 PST by Eli Friedman
Modified: 2016-11-10 00:49 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Friedman 2016-11-08 17:26:52 PST
Testcase (reproduce with opt -polly-process-unprofitable -polly-scops):

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7--linux-android"

@.str.2 = external unnamed_addr constant [2 x i8], align 1

define void @dtbmv_(i32* %n, i32* %k, double* %a, i32* %lda) {
entry:
  %0 = load i32, i32* %lda, align 4
  %add = add nsw i32 1, %0
  %idx.neg = sub i32 0, %add
  %add.ptr = getelementptr inbounds double, double* %a, i32 %idx.neg
  %call44 = call i32 @lsame_()
  %1 = load i32, i32* %k, align 4
  %add239 = add nsw i32 %1, 1
  %2 = load i32, i32* %n, align 4
  br label %for.cond282

for.cond282:
  br i1 undef, label %for.body284, label %if.end403.loopexit423

for.body284:
  %tobool288 = icmp ne i32 %call44, 0
  br i1 %tobool288, label %if.then289, label %if.end294

if.then289:
  %mul290 = mul nsw i32 %2, %0
  %add291 = add nsw i32 %add239, %mul290
  %arrayidx292 = getelementptr inbounds double, double* %add.ptr, i32 %add291
  %3 = load double, double* %arrayidx292, align 8
  br label %if.end294

if.end294:
  unreachable

if.end403.loopexit423:
  unreachable
}

declare i32 @lsame_()

Stack trace:

Unknowns SCEV was neither parameter nor a valid instruction.
UNREACHABLE executed at [src]/tools/polly/lib/Support/SCEVAffinator.cpp:553!
#0 0x0000000002a7315c llvm::sys::PrintStackTrace(llvm::raw_ostream&) [src]/lib/Support/Unix/Signals.inc:402:11
#1 0x0000000002a736b9 PrintStackTraceSignalHandler(void*) [src]/lib/Support/Unix/Signals.inc:466:1
#2 0x0000000002a705c7 llvm::sys::RunSignalHandlers() [src]/lib/Support/Signals.cpp:45:5
#3 0x0000000002a73a40 SignalHandler(int) [src]/lib/Support/Unix/Signals.inc:256:1
#4 0x00007f8ca5163330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x00007f8ca3b54c37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x00007f8ca3b58028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#7 0x00000000029a41b0 LLVMInstallFatalErrorHandler [src]/lib/Support/ErrorHandling.cpp:133:0
#8 0x0000000002f155b9 polly::SCEVAffinator::visitUnknown(llvm::SCEVUnknown const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:554:1
#9 0x0000000002f15fb0 llvm::SCEVVisitor<polly::SCEVAffinator, std::__1::pair<isl_pw_aff*, isl_set*> >::visit(llvm::SCEV const*) [src]/include/llvm/Analysis/ScalarEvolutionExpressions.h:463:16
#10 0x0000000002f1391b polly::SCEVAffinator::visit(llvm::SCEV const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:246:12
#11 0x0000000002f147fb polly::SCEVAffinator::visitAddExpr(llvm::SCEVAddExpr const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:389:18
#12 0x0000000002f15ebb llvm::SCEVVisitor<polly::SCEVAffinator, std::__1::pair<isl_pw_aff*, isl_set*> >::visit(llvm::SCEV const*) [src]/include/llvm/Analysis/ScalarEvolutionExpressions.h:451:16
#13 0x0000000002f1391b polly::SCEVAffinator::visit(llvm::SCEV const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:246:12
#14 0x0000000002f149e6 polly::SCEVAffinator::visitMulExpr(llvm::SCEVMulExpr const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:398:17
#15 0x0000000002f15edb llvm::SCEVVisitor<polly::SCEVAffinator, std::__1::pair<isl_pw_aff*, isl_set*> >::visit(llvm::SCEV const*) [src]/include/llvm/Analysis/ScalarEvolutionExpressions.h:453:16
#16 0x0000000002f1391b polly::SCEVAffinator::visit(llvm::SCEV const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:246:12
#17 0x0000000002f14796 polly::SCEVAffinator::visitAddExpr(llvm::SCEVAddExpr const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:386:16
#18 0x0000000002f15ebb llvm::SCEVVisitor<polly::SCEVAffinator, std::__1::pair<isl_pw_aff*, isl_set*> >::visit(llvm::SCEV const*) [src]/include/llvm/Analysis/ScalarEvolutionExpressions.h:451:16
#19 0x0000000002f1391b polly::SCEVAffinator::visit(llvm::SCEV const*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:246:12
#20 0x0000000002f135f7 polly::SCEVAffinator::getPwAff(llvm::SCEV const*, llvm::BasicBlock*) [src]/tools/polly/lib/Support/SCEVAffinator.cpp:146:10
#21 0x0000000002e9c5ab polly::Scop::getPwAff(llvm::SCEV const*, llvm::BasicBlock*, bool) [src]/tools/polly/lib/Analysis/ScopInfo.cpp:3920:15
#22 0x0000000002e99834 polly::MemoryAccess::getPwAff(llvm::SCEV const*) [src]/tools/polly/lib/Analysis/ScopInfo.cpp:943:17
#23 0x0000000002e9a207 polly::MemoryAccess::buildAccessRelation(polly::ScopArrayInfo const*) [src]/tools/polly/lib/Analysis/ScopInfo.cpp:839:17
#24 0x0000000002e9d12d polly::ScopStmt::buildAccessRelations() [src]/tools/polly/lib/Analysis/ScopInfo.cpp:1116:29
#25 0x0000000002e9f272 polly::ScopStmt::init(llvm::LoopInfo&) [src]/tools/polly/lib/Analysis/ScopInfo.cpp:1500:3
#26 0x0000000002ea9513 polly::Scop::init(llvm::AAResults&, llvm::AssumptionCache&, llvm::DominatorTree&, llvm::LoopInfo&) [src]/tools/polly/lib/Analysis/ScopInfo.cpp:3134:5
#27 0x0000000002ee718d polly::ScopBuilder::buildScop(llvm::Region&, llvm::AssumptionCache&) [src]/tools/polly/lib/Analysis/ScopBuilder.cpp:667:1
#28 0x0000000002ee745b polly::ScopBuilder::ScopBuilder(llvm::Region*, llvm::AssumptionCache&, llvm::AAResults&, llvm::DataLayout const&, llvm::DominatorTree&, llvm::LoopInfo&, polly::ScopDetection&, llvm::ScalarEvolution&) [src]/tools/polly/lib/Analysis/ScopBuilder.cpp:681:3
#29 0x0000000002eb1927 polly::ScopInfoRegionPass::runOnRegion(llvm::Region*, llvm::RGPassManager&) [src]/tools/polly/lib/Analysis/ScopInfo.cpp:4342:15
#30 0x0000000001b22441 llvm::RGPassManager::runOnFunction(llvm::Function&) [src]/lib/Analysis/RegionPass.cpp:97:20
#31 0x000000000226e4bf llvm::FPPassManager::runOnFunction(llvm::Function&) [src]/lib/IR/LegacyPassManager.cpp:1509:23
#32 0x000000000226e7d5 llvm::FPPassManager::runOnModule(llvm::Module&) [src]/lib/IR/LegacyPassManager.cpp:1530:16
#33 0x000000000226f3f3 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) [src]/lib/IR/LegacyPassManager.cpp:1586:23
#34 0x000000000226ea96 llvm::legacy::PassManagerImpl::run(llvm::Module&) [src]/lib/IR/LegacyPassManager.cpp:1689:16
#35 0x000000000226fef1 llvm::legacy::PassManager::run(llvm::Module&) [src]/lib/IR/LegacyPassManager.cpp:1720:3
#36 0x00000000008bbfb6 main [src]/tools/opt/opt.cpp:723:3
#37 0x00007f8ca3b3ff45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#38 0x00000000008928d4 _start ([bin]/opt+0x8928d4)
Stack dump:
0.      Program arguments: [bin]/opt -polly-process-unprofitable -polly-scops [test]/dtbmv.ll
1.      Running pass 'Function Pass Manager' on module '[test]/dtbmv.ll'.
2.      Running pass 'Region Pass Manager' on function '@dtbmv_'
3.      Running pass 'Polly - Create polyhedral description of Scops' on basic block '%for.body284'
Aborted
Comment 1 Tobias Grosser 2016-11-10 00:46:08 PST
Fixed in r286430.
Comment 2 Tobias Grosser 2016-11-10 00:49:33 PST
*** Bug 30954 has been marked as a duplicate of this bug. ***