[clang] [llvm] [openmp] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

Ethan Luis McDonough via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 12:18:06 PST 2024


================
@@ -2067,6 +2067,10 @@ Constant *ConstantExpr::getBitCast(Constant *C, Type *DstTy,
 
 Constant *ConstantExpr::getAddrSpaceCast(Constant *C, Type *DstTy,
                                          bool OnlyIfReduced) {
+  // Skip cast if types are identical
----------------
EthanLuisMcDonough wrote:

`CastInst::castIsValid` returns false for addrspace casts if two pointers share the same addrspace.

https://github.com/llvm/llvm-project/blob/2de269a641e4ffbb7a44e559c4c0a91bb66df823/llvm/lib/IR/Instructions.cpp#L3802-L3805

https://github.com/llvm/llvm-project/pull/76587


More information about the cfe-commits mailing list