From d6823ced0f62d57b26312fc14871c17c5a0ee7e8 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 30 Sep 2016 18:29:37 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@282893 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/IslNodeBuilder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/CodeGen/IslNodeBuilder.cpp b/lib/CodeGen/IslNodeBuilder.cpp index cea97b78..4f2494a8 100644 --- a/lib/CodeGen/IslNodeBuilder.cpp +++ b/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); -- 2.11.4.GIT