@@ -670,15 +670,11 @@ void InstrProfiling::lowerValueProfileInst(InstrProfValueProfileInst *Ind) {
670
670
SmallVector<OperandBundleDef, 1 > OpBundles;
671
671
Ind->getOperandBundlesAsDefs (OpBundles);
672
672
if (!IsMemOpSize) {
673
- Value *Args[3 ] = {Ind->getTargetValue (),
674
- Builder.CreateBitCast (DataVar, Builder.getPtrTy ()),
675
- Builder.getInt32 (Index)};
673
+ Value *Args[3 ] = {Ind->getTargetValue (), DataVar, Builder.getInt32 (Index)};
676
674
Call = Builder.CreateCall (getOrInsertValueProfilingCall (*M, *TLI), Args,
677
675
OpBundles);
678
676
} else {
679
- Value *Args[3 ] = {Ind->getTargetValue (),
680
- Builder.CreateBitCast (DataVar, Builder.getPtrTy ()),
681
- Builder.getInt32 (Index)};
677
+ Value *Args[3 ] = {Ind->getTargetValue (), DataVar, Builder.getInt32 (Index)};
682
678
Call = Builder.CreateCall (
683
679
getOrInsertValueProfilingCall (*M, *TLI, ValueProfilingCallType::MemOp),
684
680
Args, OpBundles);
@@ -1484,10 +1480,10 @@ void InstrProfiling::emitRegistration() {
1484
1480
IRBuilder<> IRB (BasicBlock::Create (M->getContext (), " " , RegisterF));
1485
1481
for (Value *Data : CompilerUsedVars)
1486
1482
if (!isa<Function>(Data))
1487
- IRB.CreateCall (RuntimeRegisterF, IRB. CreateBitCast ( Data, VoidPtrTy) );
1483
+ IRB.CreateCall (RuntimeRegisterF, Data);
1488
1484
for (Value *Data : UsedVars)
1489
1485
if (Data != NamesVar && !isa<Function>(Data))
1490
- IRB.CreateCall (RuntimeRegisterF, IRB. CreateBitCast ( Data, VoidPtrTy) );
1486
+ IRB.CreateCall (RuntimeRegisterF, Data);
1491
1487
1492
1488
if (NamesVar) {
1493
1489
Type *ParamTypes[] = {VoidPtrTy, Int64Ty};
@@ -1496,8 +1492,7 @@ void InstrProfiling::emitRegistration() {
1496
1492
auto *NamesRegisterF =
1497
1493
Function::Create (NamesRegisterTy, GlobalVariable::ExternalLinkage,
1498
1494
getInstrProfNamesRegFuncName (), M);
1499
- IRB.CreateCall (NamesRegisterF, {IRB.CreateBitCast (NamesVar, VoidPtrTy),
1500
- IRB.getInt64 (NamesSize)});
1495
+ IRB.CreateCall (NamesRegisterF, {NamesVar, IRB.getInt64 (NamesSize)});
1501
1496
}
1502
1497
1503
1498
IRB.CreateRetVoid ();
0 commit comments