[polly] r282893 - [CodeGen] Add assertion for indirect array index expression generation. NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 11:29:37 PDT 2016


Author: meinersbur
Date: Fri Sep 30 13:29:37 2016
New Revision: 282893

URL: http://llvm.org/viewvc/llvm-project?rev=282893&view=rev
Log:
[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.

Modified:
    polly/trunk/lib/CodeGen/IslNodeBuilder.cpp

Modified: polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslNodeBuilder.cpp?rev=282893&r1=282892&r2=282893&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslNodeBuilder.cpp (original)
+++ polly/trunk/lib/CodeGen/IslNodeBuilder.cpp Fri Sep 30 13:29:37 2016
@@ -720,6 +720,9 @@ IslNodeBuilder::createNewAccesses(ScopSt
     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);
 




More information about the llvm-commits mailing list