@@ -279,15 +279,15 @@ class EarlyCSE {
279
279
// / present the table; it is the responsibility of the consumer to inspect
280
280
// / the atomicity/volatility if needed.
281
281
struct LoadValue {
282
- Value *Data ;
282
+ Instruction *Inst ;
283
283
unsigned Generation;
284
284
int MatchingId;
285
285
bool IsAtomic;
286
286
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,
289
289
bool IsAtomic)
290
- : Data(Data ), Generation(Generation), MatchingId(MatchingId),
290
+ : Inst(Inst ), Generation(Generation), MatchingId(MatchingId),
291
291
IsAtomic (IsAtomic) {}
292
292
};
293
293
typedef RecyclingAllocator<BumpPtrAllocator,
@@ -597,16 +597,16 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
597
597
// If we have an available version of this load, and if it is the right
598
598
// generation, replace this instruction.
599
599
LoadValue InVal = AvailableLoads.lookup (MemInst.getPointerOperand ());
600
- if (InVal.Data != nullptr && InVal.Generation == CurrentGeneration &&
600
+ if (InVal.Inst != nullptr && InVal.Generation == CurrentGeneration &&
601
601
InVal.MatchingId == MemInst.getMatchingId () &&
602
602
// We don't yet handle removing loads with ordering of any kind.
603
603
!MemInst.isVolatile () && MemInst.isUnordered () &&
604
604
// We can't replace an atomic load with one which isn't also atomic.
605
605
InVal.IsAtomic >= MemInst.isAtomic ()) {
606
- Value *Op = getOrCreateResult (InVal.Data , Inst->getType ());
606
+ Value *Op = getOrCreateResult (InVal.Inst , Inst->getType ());
607
607
if (Op != nullptr ) {
608
608
DEBUG (dbgs () << " EarlyCSE CSE LOAD: " << *Inst
609
- << " to: " << *InVal.Data << ' \n ' );
609
+ << " to: " << *InVal.Inst << ' \n ' );
610
610
if (!Inst->use_empty ())
611
611
Inst->replaceAllUsesWith (Op);
612
612
Inst->eraseFromParent ();
@@ -674,8 +674,8 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
674
674
// the store originally was.
675
675
if (MemInst.isValid () && MemInst.isStore ()) {
676
676
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 ()) &&
679
679
InVal.Generation == CurrentGeneration &&
680
680
InVal.MatchingId == MemInst.getMatchingId () &&
681
681
// We don't yet handle removing stores with ordering of any kind.
0 commit comments