[llvm] d1cdcdd - [llvm][OMPIRBuilder] Remove no-op ptr-to-ptr bitcast (NFC)
Youngsuk Kim via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 13:09:37 PST 2023
Author: Youngsuk Kim
Date: 2023-12-04T15:06:07-06:00
New Revision: d1cdcddcc2ef712c4e2ab61c6e4ca83350e7e9e3
URL: https://github.com/llvm/llvm-project/commit/d1cdcddcc2ef712c4e2ab61c6e4ca83350e7e9e3
DIFF: https://github.com/llvm/llvm-project/commit/d1cdcddcc2ef712c4e2ab61c6e4ca83350e7e9e3.diff
LOG: [llvm][OMPIRBuilder] Remove no-op ptr-to-ptr bitcast (NFC)
Opaque ptr cleanup effort
Added:
Modified:
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 690d6cbaa67b3..d54da0267f7ed 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -5580,14 +5580,11 @@ OpenMPIRBuilder::createAtomicWrite(const LocationDescription &Loc,
XSt->setAtomic(AO);
} else {
// We need to bitcast and perform atomic op as integers
- unsigned Addrspace = cast<PointerType>(XTy)->getAddressSpace();
IntegerType *IntCastTy =
IntegerType::get(M.getContext(), XElemTy->getScalarSizeInBits());
- Value *XBCast = Builder.CreateBitCast(
- X.Var, IntCastTy->getPointerTo(Addrspace), "atomic.dst.int.cast");
Value *ExprCast =
Builder.CreateBitCast(Expr, IntCastTy, "atomic.src.int.cast");
- StoreInst *XSt = Builder.CreateStore(ExprCast, XBCast, X.IsVolatile);
+ StoreInst *XSt = Builder.CreateStore(ExprCast, X.Var, X.IsVolatile);
XSt->setAtomic(AO);
}
More information about the llvm-commits
mailing list