From: Michael Kruse Date: Fri, 30 Sep 2016 18:29:37 +0000 (+0000) Subject: [CodeGen] Add assertion for indirect array index expression generation. NFC. X-Git-Tag: llvmorg-4.0.0-rc1~8466 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b0c5aea7856eacf0e309360a3e72cf96cf602e9;p=platform%2Fupstream%2Fllvm.git [CodeGen] Add assertion for indirect array index expression generation. NFC. Currently Polly cannot generate code for index expressions if the base pointer is computed within the scop. The base pointer must be generated as well, but there is no code that triggers that. Add an assertion to detect when this would occur and miscompile. The IR verifier should catch it as well. llvm-svn: 282893 --- diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index cea97b7..4f2494a 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -720,6 +720,9 @@ IslNodeBuilder::createNewAccesses(ScopStmt *Stmt, if (!MA->hasNewAccessRelation()) continue; + assert(!MA->getLatestScopArrayInfo()->getBasePtrOriginSAI() && + "Generating new index expressions to indirect arrays not working"); + auto Schedule = isl_ast_build_get_schedule(Build); auto PWAccRel = MA->applyScheduleToAccessRelation(Schedule);