diff options
author | Geoff Berry <gberry@codeaurora.org> | 2016-04-28 15:22:37 +0000 |
---|---|---|
committer | Geoff Berry <gberry@codeaurora.org> | 2016-04-28 15:22:37 +0000 |
commit | 5ae272c2c15db8843d660b818d7f0434cf5d0780 (patch) | |
tree | 0a034f3cd42e353411768602bc3ad1c5feecff9e | |
parent | 7456af5a287d37cef73b0f2b1728657bee2d5aef (diff) | |
download | bcm5719-llvm-5ae272c2c15db8843d660b818d7f0434cf5d0780.tar.gz bcm5719-llvm-5ae272c2c15db8843d660b818d7f0434cf5d0780.zip |
[EarlyCSE] Change LoadValue field Value *Data to Instruction *Inst. NFC.
Made in preparation for adding MemorySSA support to EarlyCSE.
llvm-svn: 267893
-rw-r--r-- | llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp index cea158992eb..123064d2ae9 100644 --- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/llvm/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<BumpPtrAllocator, @@ -597,16 +597,16 @@ bool EarlyCSE::processNode(DomTreeNode *Node) { // If we have an available version of this load, and if it is the right // generation, replace this instruction. LoadValue InVal = AvailableLoads.lookup(MemInst.getPointerOperand()); - if (InVal.Data != nullptr && InVal.Generation == CurrentGeneration && + if (InVal.Inst != nullptr && InVal.Generation == CurrentGeneration && InVal.MatchingId == MemInst.getMatchingId() && // We don't yet handle removing loads with ordering of any kind. !MemInst.isVolatile() && MemInst.isUnordered() && // We can't replace an atomic load with one which isn't also atomic. InVal.IsAtomic >= 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. |