[CodeGen] Change 'Scalar' to 'Array' in method names. NFC.

generateScalarLoad() and generateScalarStore() are used for explicit (MK_Array)
memory accesses, therefore the method names were misleading. The names also
were similar to generateScalarLoads() and generateScalarStores() (plural forms)
which indeed handle scalar accesses. Presumbly, they were originally named to
contrast VectorBlockGenerator::generateLoad().

Rename the two methods to generateArrayLoad(),
respectively generateArrayStore().

llvm-svn: 282861
This commit is contained in:
Michael Kruse 2016-09-30 14:34:05 +00:00
parent cde78361d9
commit 888ab55140
2 changed files with 14 additions and 15 deletions

View File

@ -545,16 +545,15 @@ protected:
/// @param NewAccesses A map from memory access ids to new ast expressions,
/// which may contain new access expressions for certain
/// memory accesses.
Value *generateScalarLoad(ScopStmt &Stmt, LoadInst *load, ValueMapT &BBMap,
LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses);
Value *generateArrayLoad(ScopStmt &Stmt, LoadInst *load, ValueMapT &BBMap,
LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses);
/// @param NewAccesses A map from memory access ids to new ast expressions,
/// which may contain new access expressions for certain
/// memory accesses.
void generateScalarStore(ScopStmt &Stmt, StoreInst *store, ValueMapT &BBMap,
LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses);
void generateArrayStore(ScopStmt &Stmt, StoreInst *store, ValueMapT &BBMap,
LoopToScevMapT &LTS, isl_id_to_ast_expr *NewAccesses);
/// Copy a single PHI instruction.
///

View File

@ -229,9 +229,9 @@ Loop *BlockGenerator::getLoopForStmt(const ScopStmt &Stmt) const {
return LI.getLoopFor(StmtBB);
}
Value *BlockGenerator::generateScalarLoad(ScopStmt &Stmt, LoadInst *Load,
ValueMapT &BBMap, LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses) {
Value *BlockGenerator::generateArrayLoad(ScopStmt &Stmt, LoadInst *Load,
ValueMapT &BBMap, LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses) {
if (Value *PreloadLoad = GlobalMap.lookup(Load))
return PreloadLoad;
@ -247,9 +247,9 @@ Value *BlockGenerator::generateScalarLoad(ScopStmt &Stmt, LoadInst *Load,
return ScalarLoad;
}
void BlockGenerator::generateScalarStore(ScopStmt &Stmt, StoreInst *Store,
ValueMapT &BBMap, LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses) {
void BlockGenerator::generateArrayStore(ScopStmt &Stmt, StoreInst *Store,
ValueMapT &BBMap, LoopToScevMapT &LTS,
isl_id_to_ast_expr *NewAccesses) {
Value *NewPointer =
generateLocationAccessed(Stmt, Store, BBMap, LTS, NewAccesses);
Value *ValueOperand = getNewValue(Stmt, Store->getValueOperand(), BBMap, LTS,
@ -281,7 +281,7 @@ void BlockGenerator::copyInstruction(ScopStmt &Stmt, Instruction *Inst,
return;
if (auto *Load = dyn_cast<LoadInst>(Inst)) {
Value *NewLoad = generateScalarLoad(Stmt, Load, BBMap, LTS, NewAccesses);
Value *NewLoad = generateArrayLoad(Stmt, Load, BBMap, LTS, NewAccesses);
// Compute NewLoad before its insertion in BBMap to make the insertion
// deterministic.
BBMap[Load] = NewLoad;
@ -289,7 +289,7 @@ void BlockGenerator::copyInstruction(ScopStmt &Stmt, Instruction *Inst,
}
if (auto *Store = dyn_cast<StoreInst>(Inst)) {
generateScalarStore(Stmt, Store, BBMap, LTS, NewAccesses);
generateArrayStore(Stmt, Store, BBMap, LTS, NewAccesses);
return;
}
@ -845,7 +845,7 @@ void VectorBlockGenerator::generateLoad(
if (!VectorType::isValidElementType(Load->getType())) {
for (int i = 0; i < getVectorWidth(); i++)
ScalarMaps[i][Load] =
generateScalarLoad(Stmt, Load, ScalarMaps[i], VLTS[i], NewAccesses);
generateArrayLoad(Stmt, Load, ScalarMaps[i], VLTS[i], NewAccesses);
return;
}