forked from OSchip/llvm-project
BlockGenerator: Do not store 'store' statements in BBMap
A store statement has no return value and can consequently not be referenced from another statement. llvm-svn: 244576
This commit is contained in:
parent
07f31d92ca
commit
c186ac7aea
|
@ -406,9 +406,9 @@ protected:
|
|||
ValueMapT &BBMap, ValueMapT &GlobalMap,
|
||||
LoopToScevMapT <S);
|
||||
|
||||
Value *generateScalarStore(ScopStmt &Stmt, const StoreInst *store,
|
||||
ValueMapT &BBMap, ValueMapT &GlobalMap,
|
||||
LoopToScevMapT <S);
|
||||
void generateScalarStore(ScopStmt &Stmt, const StoreInst *store,
|
||||
ValueMapT &BBMap, ValueMapT &GlobalMap,
|
||||
LoopToScevMapT <S);
|
||||
|
||||
/// @brief Copy a single PHI instruction.
|
||||
///
|
||||
|
|
|
@ -230,20 +230,16 @@ Value *BlockGenerator::generateScalarLoad(ScopStmt &Stmt, const LoadInst *Load,
|
|||
return ScalarLoad;
|
||||
}
|
||||
|
||||
Value *BlockGenerator::generateScalarStore(ScopStmt &Stmt,
|
||||
const StoreInst *Store,
|
||||
ValueMapT &BBMap,
|
||||
ValueMapT &GlobalMap,
|
||||
LoopToScevMapT <S) {
|
||||
void BlockGenerator::generateScalarStore(ScopStmt &Stmt, const StoreInst *Store,
|
||||
ValueMapT &BBMap, ValueMapT &GlobalMap,
|
||||
LoopToScevMapT <S) {
|
||||
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(ScopStmt &Stmt, const Instruction *Inst,
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue