[llvm] CallPromotionUtils: Correctly use IndexSize when determining the bit width of pointer offsets. (PR #119483)
Owen Anderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 10 18:57:41 PST 2024
================
@@ -712,7 +712,12 @@ bool llvm::tryPromoteCall(CallBase &CB) {
VTablePtrLoad, VTablePtrLoad->getParent(), BBI, 0, nullptr, nullptr);
if (!VTablePtr)
return false; // No vtable found.
- APInt VTableOffsetGVBase(DL.getTypeSizeInBits(VTablePtr->getType()), 0);
+
+ // VTablePtr may not actually have a pointer type, so we can't find the
+ // address space through it. However, we know that the address space must be
+ // the same one used to load from the vtable in VTablePtrLoad.
----------------
resistor wrote:
Revised to implement this fix instead.
https://github.com/llvm/llvm-project/pull/119483
More information about the llvm-commits
mailing list