[mlir] Use llvm::is_contained (NFC) (#140467)

This commit is contained in:
Kazu Hirata 2025-05-19 06:18:46 -07:00 committed by GitHub
parent 25da043c55
commit 52ca511f64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -195,8 +195,7 @@ void mlir::populateMemRefToEmitCTypeConversion(TypeConverter &typeConverter) {
[&](MemRefType memRefType) -> std::optional<Type> {
if (!memRefType.hasStaticShape() ||
!memRefType.getLayout().isIdentity() || memRefType.getRank() == 0 ||
llvm::any_of(memRefType.getShape(),
[](int64_t dim) { return dim == 0; })) {
llvm::is_contained(memRefType.getShape(), 0)) {
return {};
}
Type convertedElementType =

View File

@ -5045,8 +5045,7 @@ OpFoldResult AffineLinearizeIndexOp::fold(FoldAdaptor adaptor) {
if (getMultiIndex().size() == 1)
return getMultiIndex().front();
if (llvm::any_of(adaptor.getMultiIndex(),
[](Attribute a) { return a == nullptr; }))
if (llvm::is_contained(adaptor.getMultiIndex(), nullptr))
return nullptr;
if (!adaptor.getDynamicBasis().empty())