forked from OSchip/llvm-project
[NFC][OMP] Fix 'unused' warning
This commit is contained in:
parent
f5bde3d476
commit
676a789a5b
|
@ -2386,15 +2386,18 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createAtomicUpdate(
|
||||||
if (!updateToLocation(Loc))
|
if (!updateToLocation(Loc))
|
||||||
return Loc.IP;
|
return Loc.IP;
|
||||||
|
|
||||||
Type *XTy = X.Var->getType();
|
LLVM_DEBUG({
|
||||||
assert(XTy->isPointerTy() && "OMP Atomic expects a pointer to target memory");
|
Type *XTy = X.Var->getType();
|
||||||
Type *XElemTy = XTy->getPointerElementType();
|
assert(XTy->isPointerTy() &&
|
||||||
assert((XElemTy->isFloatingPointTy() || XElemTy->isIntegerTy() ||
|
"OMP Atomic expects a pointer to target memory");
|
||||||
XElemTy->isPointerTy()) &&
|
Type *XElemTy = XTy->getPointerElementType();
|
||||||
"OMP atomic update expected a scalar type");
|
assert((XElemTy->isFloatingPointTy() || XElemTy->isIntegerTy() ||
|
||||||
assert((RMWOp != AtomicRMWInst::Max) && (RMWOp != AtomicRMWInst::Min) &&
|
XElemTy->isPointerTy()) &&
|
||||||
(RMWOp != AtomicRMWInst::UMax) && (RMWOp != AtomicRMWInst::UMin) &&
|
"OMP atomic update expected a scalar type");
|
||||||
"OpenMP atomic does not support LT or GT operations");
|
assert((RMWOp != AtomicRMWInst::Max) && (RMWOp != AtomicRMWInst::Min) &&
|
||||||
|
(RMWOp != AtomicRMWInst::UMax) && (RMWOp != AtomicRMWInst::UMin) &&
|
||||||
|
"OpenMP atomic does not support LT or GT operations");
|
||||||
|
});
|
||||||
|
|
||||||
emitAtomicUpdate(AllocIP, X.Var, Expr, AO, RMWOp, UpdateOp, X.IsVolatile,
|
emitAtomicUpdate(AllocIP, X.Var, Expr, AO, RMWOp, UpdateOp, X.IsVolatile,
|
||||||
IsXLHSInRHSPart);
|
IsXLHSInRHSPart);
|
||||||
|
@ -2536,14 +2539,17 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createAtomicCapture(
|
||||||
if (!updateToLocation(Loc))
|
if (!updateToLocation(Loc))
|
||||||
return Loc.IP;
|
return Loc.IP;
|
||||||
|
|
||||||
Type *XTy = X.Var->getType();
|
LLVM_DEBUG({
|
||||||
assert(XTy->isPointerTy() && "OMP Atomic expects a pointer to target memory");
|
Type *XTy = X.Var->getType();
|
||||||
Type *XElemTy = XTy->getPointerElementType();
|
assert(XTy->isPointerTy() &&
|
||||||
assert((XElemTy->isFloatingPointTy() || XElemTy->isIntegerTy() ||
|
"OMP Atomic expects a pointer to target memory");
|
||||||
XElemTy->isPointerTy()) &&
|
Type *XElemTy = XTy->getPointerElementType();
|
||||||
"OMP atomic capture expected a scalar type");
|
assert((XElemTy->isFloatingPointTy() || XElemTy->isIntegerTy() ||
|
||||||
assert((RMWOp != AtomicRMWInst::Max) && (RMWOp != AtomicRMWInst::Min) &&
|
XElemTy->isPointerTy()) &&
|
||||||
"OpenMP atomic does not support LT or GT operations");
|
"OMP atomic capture expected a scalar type");
|
||||||
|
assert((RMWOp != AtomicRMWInst::Max) && (RMWOp != AtomicRMWInst::Min) &&
|
||||||
|
"OpenMP atomic does not support LT or GT operations");
|
||||||
|
});
|
||||||
|
|
||||||
// If UpdateExpr is 'x' updated with some `expr` not based on 'x',
|
// If UpdateExpr is 'x' updated with some `expr` not based on 'x',
|
||||||
// 'x' is simply atomically rewritten with 'expr'.
|
// 'x' is simply atomically rewritten with 'expr'.
|
||||||
|
|
Loading…
Reference in New Issue