@@ -692,14 +692,14 @@ bool llvm::tryPromoteCall(CallBase &CB) {
692692 if (!VTableEntryLoad)
693693 return false ; // Not a vtable entry load.
694694 Value *VTableEntryPtr = VTableEntryLoad->getPointerOperand ();
695- APInt VTableOffset (DL.getIndexTypeSizeInBits (VTableEntryPtr->getType ()), 0 );
695+ APInt VTableOffset (DL.getTypeSizeInBits (VTableEntryPtr->getType ()), 0 );
696696 Value *VTableBasePtr = VTableEntryPtr->stripAndAccumulateConstantOffsets (
697697 DL, VTableOffset, /* AllowNonInbounds */ true );
698698 LoadInst *VTablePtrLoad = dyn_cast<LoadInst>(VTableBasePtr);
699699 if (!VTablePtrLoad)
700700 return false ; // Not a vtable load.
701701 Value *Object = VTablePtrLoad->getPointerOperand ();
702- APInt ObjectOffset (DL.getIndexTypeSizeInBits (Object->getType ()), 0 );
702+ APInt ObjectOffset (DL.getTypeSizeInBits (Object->getType ()), 0 );
703703 Value *ObjectBase = Object->stripAndAccumulateConstantOffsets (
704704 DL, ObjectOffset, /* AllowNonInbounds */ true );
705705 if (!(isa<AllocaInst>(ObjectBase) && ObjectOffset == 0 ))
@@ -712,7 +712,7 @@ bool llvm::tryPromoteCall(CallBase &CB) {
712712 VTablePtrLoad, VTablePtrLoad->getParent (), BBI, 0 , nullptr , nullptr );
713713 if (!VTablePtr)
714714 return false ; // No vtable found.
715- APInt VTableOffsetGVBase (DL.getIndexTypeSizeInBits (VTablePtr->getType ()), 0 );
715+ APInt VTableOffsetGVBase (DL.getTypeSizeInBits (VTablePtr->getType ()), 0 );
716716 Value *VTableGVBase = VTablePtr->stripAndAccumulateConstantOffsets (
717717 DL, VTableOffsetGVBase, /* AllowNonInbounds */ true );
718718 GlobalVariable *GV = dyn_cast<GlobalVariable>(VTableGVBase);
0 commit comments