Author: Youngsuk Kim
Date: 2023-11-18T04:17:46-06:00
New Revision: b4db24e33008660d11d703c19d8affaf5f9a843e

URL: 
https://github.com/llvm/llvm-project/commit/b4db24e33008660d11d703c19d8affaf5f9a843e
DIFF: 
https://github.com/llvm/llvm-project/commit/b4db24e33008660d11d703c19d8affaf5f9a843e.diff

LOG: [CGOpenMPRuntimeGPU] Replace unneeded use of 
CreatePointerBitCastOrAddrSpaceCast (NFC)

Opaque ptr cleanup effort (NFC)

Added: 
    

Modified: 
    clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp 
b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
index abecf5250f4cf96..2f7dd83bd2d65c9 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
@@ -1418,9 +1418,7 @@ static llvm::Value *castValueToType(CodeGenFunction &CGF, 
llvm::Value *Val,
     return CGF.Builder.CreateIntCast(Val, LLVMCastTy,
                                      CastTy->hasSignedIntegerRepresentation());
   Address CastItem = CGF.CreateMemTemp(CastTy);
-  Address ValCastItem = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
-      CastItem, Val->getType()->getPointerTo(CastItem.getAddressSpace()),
-      Val->getType());
+  Address ValCastItem = CastItem.withElementType(Val->getType());
   CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy,
                         LValueBaseInfo(AlignmentSource::Type),
                         TBAAAccessInfo());


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to