Skip to content

[llvm] Compare std::optional<T> to values directly (NFC) #143913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/ConstantFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,7 @@ static bool mayFoldConstrained(ConstrainedFPIntrinsic *CI,

// If evaluation raised FP exception, the result can depend on rounding
// mode. If the latter is unknown, folding is not possible.
if (ORM && *ORM == RoundingMode::Dynamic)
if (ORM == RoundingMode::Dynamic)
return false;

// If FP exceptions are ignored, fold the call, even if such exception is
Expand Down Expand Up @@ -2418,7 +2418,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
if (IntrinsicID == Intrinsic::experimental_constrained_rint &&
St == APFloat::opInexact) {
std::optional<fp::ExceptionBehavior> EB = CI->getExceptionBehavior();
if (EB && *EB == fp::ebStrict)
if (EB == fp::ebStrict)
return nullptr;
}
} else if (U.isSignaling()) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/IR/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Attribute Attribute::getWithCaptureInfo(LLVMContext &Context, CaptureInfo CI) {
Attribute
Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg,
const std::optional<unsigned> &NumElemsArg) {
assert(!(ElemSizeArg == 0 && NumElemsArg && *NumElemsArg == 0) &&
assert(!(ElemSizeArg == 0 && NumElemsArg == 0) &&
"Invalid allocsize arguments -- given allocsize(0, 0)");
return get(Context, AllocSize, packAllocSizeArgs(ElemSizeArg, NumElemsArg));
}
Expand Down
Loading