diff --git a/lib/Transforms/Scalar/EarlyCSE.cpp b/lib/Transforms/Scalar/EarlyCSE.cpp index cea158992eb..123064d2ae9 100644 --- a/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/lib/Transforms/Scalar/EarlyCSE.cpp @@ -279,15 +279,15 @@ public: /// present the table; it is the responsibility of the consumer to inspect /// the atomicity/volatility if needed. struct LoadValue { - Value *Data; + Instruction *Inst; unsigned Generation; int MatchingId; bool IsAtomic; LoadValue() - : Data(nullptr), Generation(0), MatchingId(-1), IsAtomic(false) {} - LoadValue(Value *Data, unsigned Generation, unsigned MatchingId, + : Inst(nullptr), Generation(0), MatchingId(-1), IsAtomic(false) {} + LoadValue(Instruction *Inst, unsigned Generation, unsigned MatchingId, bool IsAtomic) - : Data(Data), Generation(Generation), MatchingId(MatchingId), + : Inst(Inst), Generation(Generation), MatchingId(MatchingId), IsAtomic(IsAtomic) {} }; typedef RecyclingAllocator= MemInst.isAtomic()) { - Value *Op = getOrCreateResult(InVal.Data, Inst->getType()); + Value *Op = getOrCreateResult(InVal.Inst, Inst->getType()); if (Op != nullptr) { DEBUG(dbgs() << "EarlyCSE CSE LOAD: " << *Inst - << " to: " << *InVal.Data << '\n'); + << " to: " << *InVal.Inst << '\n'); if (!Inst->use_empty()) Inst->replaceAllUsesWith(Op); Inst->eraseFromParent(); @@ -674,8 +674,8 @@ bool EarlyCSE::processNode(DomTreeNode *Node) { // the store originally was. if (MemInst.isValid() && MemInst.isStore()) { LoadValue InVal = AvailableLoads.lookup(MemInst.getPointerOperand()); - if (InVal.Data && - InVal.Data == getOrCreateResult(Inst, InVal.Data->getType()) && + if (InVal.Inst && + InVal.Inst == getOrCreateResult(Inst, InVal.Inst->getType()) && InVal.Generation == CurrentGeneration && InVal.MatchingId == MemInst.getMatchingId() && // We don't yet handle removing stores with ordering of any kind.