Skip to content

Commit 804467d

Browse files
Use isNegative (NFC)
1 parent fcc04de commit 804467d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
15141514
InstructionCost Cost = (ActiveBits + PopCount - 2) *
15151515
thisT()->getArithmeticInstrCost(
15161516
Instruction::FMul, RetTy, CostKind);
1517-
if (RHSC->getSExtValue() < 0)
1517+
if (RHSC->isNegative())
15181518
Cost += thisT()->getArithmeticInstrCost(Instruction::FDiv, RetTy,
15191519
CostKind);
15201520
return Cost;

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
13051305
// not a multiple of element size then behavior is undefined.
13061306
if (auto *AMI = dyn_cast<AtomicMemIntrinsic>(II))
13071307
if (ConstantInt *NumBytes = dyn_cast<ConstantInt>(AMI->getLength()))
1308-
if (NumBytes->getSExtValue() < 0 ||
1308+
if (NumBytes->isNegative() ||
13091309
(NumBytes->getZExtValue() % AMI->getElementSizeInBytes() != 0)) {
13101310
CreateNonTerminatorUnreachable(AMI);
13111311
assert(AMI->getType()->isVoidTy() &&

mlir/lib/Dialect/Affine/IR/AffineOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,7 @@ ParseResult AffineForOp::parse(OpAsmParser &parser, OperationState &result) {
20262026
result.attributes))
20272027
return failure();
20282028

2029-
if (stepAttr.getValue().getSExtValue() < 0)
2029+
if (stepAttr.getValue().isNegative())
20302030
return parser.emitError(
20312031
stepLoc,
20322032
"expected step to be representable as a positive signed integer");

0 commit comments

Comments
 (0)