@@ -8956,8 +8956,7 @@ OpenMPIRBuilder::createAtomicWrite(const LocationDescription &Loc,
89568956OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createAtomicUpdate (
89578957 const LocationDescription &Loc, InsertPointTy AllocaIP, AtomicOpValue &X,
89588958 Value *Expr, AtomicOrdering AO, AtomicRMWInst::BinOp RMWOp,
8959- AtomicUpdateCallbackTy &UpdateOp, bool IsXBinopExpr,
8960- bool IsIgnoreDenormalMode, bool IsFineGrainedMemory, bool IsRemoteMemory) {
8959+ AtomicUpdateCallbackTy &UpdateOp, bool IsXBinopExpr) {
89618960 assert (!isConflictIP (Loc.IP , AllocaIP) && " IPs must not be ambiguous" );
89628961 if (!updateToLocation (Loc))
89638962 return Loc.IP ;
@@ -8975,9 +8974,9 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createAtomicUpdate(
89758974 " OpenMP atomic does not support LT or GT operations" );
89768975 });
89778976
8978- Expected<std::pair<Value *, Value *>> AtomicResult = emitAtomicUpdate (
8979- AllocaIP, X.Var , X.ElemTy , Expr, AO, RMWOp, UpdateOp, X. IsVolatile ,
8980- IsXBinopExpr, IsIgnoreDenormalMode, IsFineGrainedMemory, IsRemoteMemory );
8977+ Expected<std::pair<Value *, Value *>> AtomicResult =
8978+ emitAtomicUpdate ( AllocaIP, X.Var , X.ElemTy , Expr, AO, RMWOp, UpdateOp,
8979+ X. IsVolatile , IsXBinopExpr );
89818980 if (!AtomicResult)
89828981 return AtomicResult.takeError ();
89838982 checkAndEmitFlushAfterAtomic (Loc, AO, AtomicKind::Update);
@@ -9024,8 +9023,7 @@ Value *OpenMPIRBuilder::emitRMWOpAsInstruction(Value *Src1, Value *Src2,
90249023Expected<std::pair<Value *, Value *>> OpenMPIRBuilder::emitAtomicUpdate (
90259024 InsertPointTy AllocaIP, Value *X, Type *XElemTy, Value *Expr,
90269025 AtomicOrdering AO, AtomicRMWInst::BinOp RMWOp,
9027- AtomicUpdateCallbackTy &UpdateOp, bool VolatileX, bool IsXBinopExpr,
9028- bool IsIgnoreDenormalMode, bool IsFineGrainedMemory, bool IsRemoteMemory) {
9026+ AtomicUpdateCallbackTy &UpdateOp, bool VolatileX, bool IsXBinopExpr) {
90299027 // TODO: handle the case where XElemTy is not byte-sized or not a power of 2
90309028 // or a complex datatype.
90319029 bool emitRMWOp = false ;
@@ -9048,20 +9046,7 @@ Expected<std::pair<Value *, Value *>> OpenMPIRBuilder::emitAtomicUpdate(
90489046
90499047 std::pair<Value *, Value *> Res;
90509048 if (emitRMWOp) {
9051- AtomicRMWInst *RMWInst =
9052- Builder.CreateAtomicRMW (RMWOp, X, Expr, llvm::MaybeAlign (), AO);
9053- if (T.isAMDGPU ()) {
9054- if (IsIgnoreDenormalMode)
9055- RMWInst->setMetadata (" amdgpu.ignore.denormal.mode" ,
9056- llvm::MDNode::get (Builder.getContext (), {}));
9057- if (!IsFineGrainedMemory)
9058- RMWInst->setMetadata (" amdgpu.no.fine.grained.memory" ,
9059- llvm::MDNode::get (Builder.getContext (), {}));
9060- if (!IsRemoteMemory)
9061- RMWInst->setMetadata (" amdgpu.no.remote.memory" ,
9062- llvm::MDNode::get (Builder.getContext (), {}));
9063- }
9064- Res.first = RMWInst;
9049+ Res.first = Builder.CreateAtomicRMW (RMWOp, X, Expr, llvm::MaybeAlign (), AO);
90659050 // not needed except in case of postfix captures. Generate anyway for
90669051 // consistency with the else part. Will be removed with any DCE pass.
90679052 // AtomicRMWInst::Xchg does not have a coressponding instruction.
@@ -9193,8 +9178,7 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createAtomicCapture(
91939178 const LocationDescription &Loc, InsertPointTy AllocaIP, AtomicOpValue &X,
91949179 AtomicOpValue &V, Value *Expr, AtomicOrdering AO,
91959180 AtomicRMWInst::BinOp RMWOp, AtomicUpdateCallbackTy &UpdateOp,
9196- bool UpdateExpr, bool IsPostfixUpdate, bool IsXBinopExpr,
9197- bool IsIgnoreDenormalMode, bool IsFineGrainedMemory, bool IsRemoteMemory) {
9181+ bool UpdateExpr, bool IsPostfixUpdate, bool IsXBinopExpr) {
91989182 if (!updateToLocation (Loc))
91999183 return Loc.IP ;
92009184
@@ -9213,9 +9197,9 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createAtomicCapture(
92139197 // If UpdateExpr is 'x' updated with some `expr` not based on 'x',
92149198 // 'x' is simply atomically rewritten with 'expr'.
92159199 AtomicRMWInst::BinOp AtomicOp = (UpdateExpr ? RMWOp : AtomicRMWInst::Xchg);
9216- Expected<std::pair<Value *, Value *>> AtomicResult = emitAtomicUpdate (
9217- AllocaIP, X.Var , X.ElemTy , Expr, AO, AtomicOp, UpdateOp, X. IsVolatile ,
9218- IsXBinopExpr, IsIgnoreDenormalMode, IsFineGrainedMemory, IsRemoteMemory );
9200+ Expected<std::pair<Value *, Value *>> AtomicResult =
9201+ emitAtomicUpdate ( AllocaIP, X.Var , X.ElemTy , Expr, AO, AtomicOp, UpdateOp,
9202+ X. IsVolatile , IsXBinopExpr );
92199203 if (!AtomicResult)
92209204 return AtomicResult.takeError ();
92219205 Value *CapturedVal =
0 commit comments