[Polly][PATCH 6/8] [Fix] Expression builder loads isl access expressions

Johannes Doerfert doerfert at cs.uni-saarland.de
Sun Aug 10 00:50:27 PDT 2014


---
 lib/CodeGen/BlockGenerators.cpp | 1 +
 lib/CodeGen/IslExprBuilder.cpp  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lib/CodeGen/BlockGenerators.cpp b/lib/CodeGen/BlockGenerators.cpp
index 52c8ce0..4e6d638 100644
--- a/lib/CodeGen/BlockGenerators.cpp
+++ b/lib/CodeGen/BlockGenerators.cpp
@@ -186,6 +186,7 @@ Value *BlockGenerator::getNewAccessOperand(const MemoryAccess &MA) {
   PWAccRel = isl_pw_multi_aff_pullback_pw_multi_aff(PWAccRel, PWSchedule);
 
   Expr = isl_ast_build_access_from_pw_multi_aff(Build, PWAccRel);
+  Expr = isl_ast_expr_addr_of(Expr);
 
   return ExprBuilder->create(Expr);
 }
diff --git a/lib/CodeGen/IslExprBuilder.cpp b/lib/CodeGen/IslExprBuilder.cpp
index 5eeab39..9ecb8ae 100644
--- a/lib/CodeGen/IslExprBuilder.cpp
+++ b/lib/CodeGen/IslExprBuilder.cpp
@@ -135,6 +135,7 @@ Value *IslExprBuilder::createOpAccess(isl_ast_expr *Expr) {
          "generation.");
 
   Access = Builder.CreateGEP(Base, Indices, "polly.access." + Base->getName());
+  Access = Builder.CreateLoad(Access, "polly.access.load");
 
   isl_ast_expr_free(Expr);
   return Access;
-- 
2.0.4




More information about the llvm-commits mailing list