@@ -171,7 +171,6 @@ struct InterestingMemoryAccess {
171
171
Value *Addr = nullptr ;
172
172
bool IsWrite;
173
173
Type *AccessTy;
174
- uint64_t TypeSize;
175
174
Value *MaybeMask = nullptr ;
176
175
};
177
176
@@ -194,7 +193,7 @@ class MemProfiler {
194
193
void instrumentMop (Instruction *I, const DataLayout &DL,
195
194
InterestingMemoryAccess &Access);
196
195
void instrumentAddress (Instruction *OrigIns, Instruction *InsertBefore,
197
- Value *Addr, uint32_t TypeSize, bool IsWrite);
196
+ Value *Addr, bool IsWrite);
198
197
void instrumentMaskedLoadOrStore (const DataLayout &DL, Value *Mask,
199
198
Instruction *I, Value *Addr, Type *AccessTy,
200
199
bool IsWrite);
@@ -375,15 +374,13 @@ MemProfiler::isInterestingMemoryAccess(Instruction *I) const {
375
374
}
376
375
377
376
const DataLayout &DL = I->getModule ()->getDataLayout ();
378
- Access.TypeSize = DL.getTypeStoreSizeInBits (Access.AccessTy );
379
377
return Access;
380
378
}
381
379
382
380
void MemProfiler::instrumentMaskedLoadOrStore (const DataLayout &DL, Value *Mask,
383
381
Instruction *I, Value *Addr,
384
382
Type *AccessTy, bool IsWrite) {
385
383
auto *VTy = cast<FixedVectorType>(AccessTy);
386
- uint64_t ElemTypeSize = DL.getTypeStoreSizeInBits (VTy->getScalarType ());
387
384
unsigned Num = VTy->getNumElements ();
388
385
auto *Zero = ConstantInt::get (IntptrTy, 0 );
389
386
for (unsigned Idx = 0 ; Idx < Num; ++Idx) {
@@ -408,8 +405,7 @@ void MemProfiler::instrumentMaskedLoadOrStore(const DataLayout &DL, Value *Mask,
408
405
IRBuilder<> IRB (InsertBefore);
409
406
InstrumentedAddress =
410
407
IRB.CreateGEP (VTy, Addr, {Zero, ConstantInt::get (IntptrTy, Idx)});
411
- instrumentAddress (I, InsertBefore, InstrumentedAddress, ElemTypeSize,
412
- IsWrite);
408
+ instrumentAddress (I, InsertBefore, InstrumentedAddress, IsWrite);
413
409
}
414
410
}
415
411
@@ -436,13 +432,13 @@ void MemProfiler::instrumentMop(Instruction *I, const DataLayout &DL,
436
432
// Since the access counts will be accumulated across the entire allocation,
437
433
// we only update the shadow access count for the first location and thus
438
434
// don't need to worry about alignment and type size.
439
- instrumentAddress (I, I, Access.Addr , Access.TypeSize , Access. IsWrite );
435
+ instrumentAddress (I, I, Access.Addr , Access.IsWrite );
440
436
}
441
437
}
442
438
443
439
void MemProfiler::instrumentAddress (Instruction *OrigIns,
444
440
Instruction *InsertBefore, Value *Addr,
445
- uint32_t TypeSize, bool IsWrite) {
441
+ bool IsWrite) {
446
442
IRBuilder<> IRB (InsertBefore);
447
443
Value *AddrLong = IRB.CreatePointerCast (Addr, IntptrTy);
448
444
0 commit comments