@@ -1073,9 +1073,8 @@ void CGOpenMPRuntimeGPU::emitGenericVarsProlog(CodeGenFunction &CGF,
1073
1073
CGM.getContext ().getTargetInfo ().getNewAlign () / 8 ));
1074
1074
1075
1075
// Cast the void pointer and get the address of the globalized variable.
1076
- llvm::PointerType *VarPtrTy = CGF.ConvertTypeForMem (VarTy)->getPointerTo ();
1077
1076
llvm::Value *CastedVoidPtr = Bld.CreatePointerBitCastOrAddrSpaceCast (
1078
- VoidPtr, VarPtrTy , VD->getName () + " _on_stack" );
1077
+ VoidPtr, Bld. getPtrTy ( 0 ) , VD->getName () + " _on_stack" );
1079
1078
LValue VarAddr =
1080
1079
CGF.MakeNaturalAlignPointeeRawAddrLValue (CastedVoidPtr, VarTy);
1081
1080
Rec.second .PrivateAddr = VarAddr.getAddress ();
@@ -1930,7 +1929,7 @@ llvm::Function *CGOpenMPRuntimeGPU::createParallelDataSharingWrapper(
1930
1929
if (isOpenMPLoopBoundSharingDirective (D.getDirectiveKind ())) {
1931
1930
Address Src = Bld.CreateConstInBoundsGEP (SharedArgListAddress, Idx);
1932
1931
Address TypedAddress = Bld.CreatePointerBitCastOrAddrSpaceCast (
1933
- Src, CGF. SizeTy -> getPointerTo ( ), CGF.SizeTy );
1932
+ Src, Bld. getPtrTy ( 0 ), CGF.SizeTy );
1934
1933
llvm::Value *LB = CGF.EmitLoadOfScalar (
1935
1934
TypedAddress,
1936
1935
/* Volatile=*/ false ,
@@ -1939,8 +1938,8 @@ llvm::Function *CGOpenMPRuntimeGPU::createParallelDataSharingWrapper(
1939
1938
Args.emplace_back (LB);
1940
1939
++Idx;
1941
1940
Src = Bld.CreateConstInBoundsGEP (SharedArgListAddress, Idx);
1942
- TypedAddress = Bld.CreatePointerBitCastOrAddrSpaceCast (
1943
- Src, CGF. SizeTy -> getPointerTo (), CGF.SizeTy );
1941
+ TypedAddress = Bld.CreatePointerBitCastOrAddrSpaceCast (Src, Bld. getPtrTy ( 0 ),
1942
+ CGF.SizeTy );
1944
1943
llvm::Value *UB = CGF.EmitLoadOfScalar (
1945
1944
TypedAddress,
1946
1945
/* Volatile=*/ false ,
@@ -2079,7 +2078,7 @@ Address CGOpenMPRuntimeGPU::getAddressOfLocalVariable(CodeGenFunction &CGF,
2079
2078
GV->setAlignment (Align.getAsAlign ());
2080
2079
return Address (
2081
2080
CGF.Builder .CreatePointerBitCastOrAddrSpaceCast (
2082
- GV, VarTy-> getPointerTo (CGM.getContext ().getTargetAddressSpace (
2081
+ GV, CGF. Builder . getPtrTy (CGM.getContext ().getTargetAddressSpace (
2083
2082
VD->getType ().getAddressSpace ()))),
2084
2083
VarTy, Align);
2085
2084
}
0 commit comments