[CodeGen] Add assertion for indirect array index expression generation. NFC.
authorMichael Kruse <llvm@meinersbur.de>
Fri, 30 Sep 2016 18:29:37 +0000 (18:29 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Fri, 30 Sep 2016 18:29:37 +0000 (18:29 +0000)
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

polly/lib/CodeGen/IslNodeBuilder.cpp

index cea97b7..4f2494a 100644 (file)
@@ -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);