Skip to content

Commit

Permalink
[CGOpenMPRuntimeGPU] Remove no-op ptr-to-ptr bitcasts (NFC)
Browse files Browse the repository at this point in the history
Opaque ptr cleanup effort
  • Loading branch information
JOE1994 committed Nov 25, 2023
1 parent fa23d2b commit bc6b632
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,12 +1837,7 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenModule &CGM,
{llvm::Constant::getNullValue(CGM.Int64Ty), WarpID});
// Casting to actual data type.
// MediumPtr = (CopyType*)MediumPtrAddr;
Address MediumPtr(
Bld.CreateBitCast(
MediumPtrVal,
CopyType->getPointerTo(
MediumPtrVal->getType()->getPointerAddressSpace())),
CopyType, Align);
Address MediumPtr(MediumPtrVal, CopyType, Align);

// elem = *elemptr
//*MediumPtr = elem
Expand Down Expand Up @@ -1889,12 +1884,7 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenModule &CGM,
TransferMedium->getValueType(), TransferMedium,
{llvm::Constant::getNullValue(CGM.Int64Ty), ThreadID});
// SrcMediumVal = *SrcMediumPtr;
Address SrcMediumPtr(
Bld.CreateBitCast(
SrcMediumPtrVal,
CopyType->getPointerTo(
SrcMediumPtrVal->getType()->getPointerAddressSpace())),
CopyType, Align);
Address SrcMediumPtr(SrcMediumPtrVal, CopyType, Align);

// TargetElemPtr = (CopyType*)(SrcDataAddr[i]) + I
Address TargetElemPtrPtr = Bld.CreateConstArrayGEP(LocalReduceList, Idx);
Expand Down

0 comments on commit bc6b632

Please sign in to comment.