[polly] r244576 - BlockGenerator: Do not store 'store' statements in BBMap

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 01:13:15 PDT 2015


Author: grosser
Date: Tue Aug 11 03:13:15 2015
New Revision: 244576

URL: http://llvm.org/viewvc/llvm-project?rev=244576&view=rev
Log:
BlockGenerator: Do not store 'store' statements in BBMap

A store statement has no return value and can consequently not be referenced
from another statement.

Modified:
    polly/trunk/include/polly/CodeGen/BlockGenerators.h
    polly/trunk/lib/CodeGen/BlockGenerators.cpp

Modified: polly/trunk/include/polly/CodeGen/BlockGenerators.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/CodeGen/BlockGenerators.h?rev=244576&r1=244575&r2=244576&view=diff
==============================================================================
--- polly/trunk/include/polly/CodeGen/BlockGenerators.h (original)
+++ polly/trunk/include/polly/CodeGen/BlockGenerators.h Tue Aug 11 03:13:15 2015
@@ -406,9 +406,9 @@ protected:
                             ValueMapT &BBMap, ValueMapT &GlobalMap,
                             LoopToScevMapT &LTS);
 
-  Value *generateScalarStore(ScopStmt &Stmt, const StoreInst *store,
-                             ValueMapT &BBMap, ValueMapT &GlobalMap,
-                             LoopToScevMapT &LTS);
+  void generateScalarStore(ScopStmt &Stmt, const StoreInst *store,
+                           ValueMapT &BBMap, ValueMapT &GlobalMap,
+                           LoopToScevMapT &LTS);
 
   /// @brief Copy a single PHI instruction.
   ///

Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=244576&r1=244575&r2=244576&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Tue Aug 11 03:13:15 2015
@@ -230,20 +230,16 @@ Value *BlockGenerator::generateScalarLoa
   return ScalarLoad;
 }
 
-Value *BlockGenerator::generateScalarStore(ScopStmt &Stmt,
-                                           const StoreInst *Store,
-                                           ValueMapT &BBMap,
-                                           ValueMapT &GlobalMap,
-                                           LoopToScevMapT &LTS) {
+void BlockGenerator::generateScalarStore(ScopStmt &Stmt, const StoreInst *Store,
+                                         ValueMapT &BBMap, ValueMapT &GlobalMap,
+                                         LoopToScevMapT &LTS) {
   const Value *Pointer = Store->getPointerOperand();
   Value *NewPointer =
       generateLocationAccessed(Stmt, Store, Pointer, BBMap, GlobalMap, LTS);
   Value *ValueOperand = getNewValue(Stmt, Store->getValueOperand(), BBMap,
                                     GlobalMap, LTS, getLoopForInst(Store));
 
-  Value *NewStore = Builder.CreateAlignedStore(ValueOperand, NewPointer,
-                                               Store->getAlignment());
-  return NewStore;
+  Builder.CreateAlignedStore(ValueOperand, NewPointer, Store->getAlignment());
 }
 
 void BlockGenerator::copyInstruction(ScopStmt &Stmt, const Instruction *Inst,
@@ -275,10 +271,7 @@ void BlockGenerator::copyInstruction(Sco
   }
 
   if (const StoreInst *Store = dyn_cast<StoreInst>(Inst)) {
-    Value *NewStore = generateScalarStore(Stmt, Store, BBMap, GlobalMap, LTS);
-    // Compute NewStore before its insertion in BBMap to make the insertion
-    // deterministic.
-    BBMap[Store] = NewStore;
+    generateScalarStore(Stmt, Store, BBMap, GlobalMap, LTS);
     return;
   }
 




More information about the llvm-commits mailing list