Skip to content

Commit eea1efe

Browse files
committed
[InstrProfiling] Avoid unnecessary bitcast (NFC)
Not needed with opaque pointers.
1 parent 208257f commit eea1efe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1495,13 +1495,11 @@ static inline bool shouldRecordVTableAddr(GlobalVariable *GV) {
14951495
// FIXME: Introduce an internal alias like what's done for functions to reduce
14961496
// the number of relocation entries.
14971497
static inline Constant *getVTableAddrForProfData(GlobalVariable *GV) {
1498-
auto *Int8PtrTy = PointerType::getUnqual(GV->getContext());
1499-
15001498
// Store a nullptr in __profvt_ if a real address shouldn't be used.
15011499
if (!shouldRecordVTableAddr(GV))
1502-
return ConstantPointerNull::get(Int8PtrTy);
1500+
return ConstantPointerNull::get(PointerType::getUnqual(GV->getContext()));
15031501

1504-
return ConstantExpr::getBitCast(GV, Int8PtrTy);
1502+
return GV;
15051503
}
15061504

15071505
void InstrLowerer::getOrCreateVTableProfData(GlobalVariable *GV) {

0 commit comments

Comments
 (0)