Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit a7480ba

Browse files
committed
[EarlyCSE] Change LoadValue field Value *Data to Instruction *Inst. NFC.
Made in preparation for adding MemorySSA support to EarlyCSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267893 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 361c970 commit a7480ba

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/Transforms/Scalar/EarlyCSE.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ class EarlyCSE {
279279
/// present the table; it is the responsibility of the consumer to inspect
280280
/// the atomicity/volatility if needed.
281281
struct LoadValue {
282-
Value *Data;
282+
Instruction *Inst;
283283
unsigned Generation;
284284
int MatchingId;
285285
bool IsAtomic;
286286
LoadValue()
287-
: Data(nullptr), Generation(0), MatchingId(-1), IsAtomic(false) {}
288-
LoadValue(Value *Data, unsigned Generation, unsigned MatchingId,
287+
: Inst(nullptr), Generation(0), MatchingId(-1), IsAtomic(false) {}
288+
LoadValue(Instruction *Inst, unsigned Generation, unsigned MatchingId,
289289
bool IsAtomic)
290-
: Data(Data), Generation(Generation), MatchingId(MatchingId),
290+
: Inst(Inst), Generation(Generation), MatchingId(MatchingId),
291291
IsAtomic(IsAtomic) {}
292292
};
293293
typedef RecyclingAllocator<BumpPtrAllocator,
@@ -597,16 +597,16 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
597597
// If we have an available version of this load, and if it is the right
598598
// generation, replace this instruction.
599599
LoadValue InVal = AvailableLoads.lookup(MemInst.getPointerOperand());
600-
if (InVal.Data != nullptr && InVal.Generation == CurrentGeneration &&
600+
if (InVal.Inst != nullptr && InVal.Generation == CurrentGeneration &&
601601
InVal.MatchingId == MemInst.getMatchingId() &&
602602
// We don't yet handle removing loads with ordering of any kind.
603603
!MemInst.isVolatile() && MemInst.isUnordered() &&
604604
// We can't replace an atomic load with one which isn't also atomic.
605605
InVal.IsAtomic >= MemInst.isAtomic()) {
606-
Value *Op = getOrCreateResult(InVal.Data, Inst->getType());
606+
Value *Op = getOrCreateResult(InVal.Inst, Inst->getType());
607607
if (Op != nullptr) {
608608
DEBUG(dbgs() << "EarlyCSE CSE LOAD: " << *Inst
609-
<< " to: " << *InVal.Data << '\n');
609+
<< " to: " << *InVal.Inst << '\n');
610610
if (!Inst->use_empty())
611611
Inst->replaceAllUsesWith(Op);
612612
Inst->eraseFromParent();
@@ -674,8 +674,8 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
674674
// the store originally was.
675675
if (MemInst.isValid() && MemInst.isStore()) {
676676
LoadValue InVal = AvailableLoads.lookup(MemInst.getPointerOperand());
677-
if (InVal.Data &&
678-
InVal.Data == getOrCreateResult(Inst, InVal.Data->getType()) &&
677+
if (InVal.Inst &&
678+
InVal.Inst == getOrCreateResult(Inst, InVal.Inst->getType()) &&
679679
InVal.Generation == CurrentGeneration &&
680680
InVal.MatchingId == MemInst.getMatchingId() &&
681681
// We don't yet handle removing stores with ordering of any kind.

0 commit comments

Comments
 (0)