forked from OSchip/llvm-project
Rename isa_nonnull to isa_and_nonnull to match the upstream llvm name.
-- PiperOrigin-RevId: 244928036
This commit is contained in:
parent
a2e7775441
commit
1423acc03c
|
@ -93,7 +93,7 @@ void linalg::SliceOp::print(OpAsmPrinter *p) {
|
|||
*p << "*";
|
||||
} else {
|
||||
auto *v = getIndexing();
|
||||
if (isa_nonnull<RangeOp>(v->getDefiningOp())) {
|
||||
if (isa_and_nonnull<RangeOp>(v->getDefiningOp())) {
|
||||
*p << *v << "..";
|
||||
} else {
|
||||
*p << *v;
|
||||
|
|
|
@ -532,9 +532,9 @@ template <typename T> T dyn_cast_or_null(Operation *op) {
|
|||
return op ? op->dyn_cast<T>() : T();
|
||||
}
|
||||
|
||||
/// Provide isa_nonnull functionality for Operation casts, i.e. if the operation
|
||||
/// is non-null and a class of 'T'.
|
||||
template <typename T> bool isa_nonnull(Operation *op) {
|
||||
/// Provide isa_and_nonnull functionality for Operation casts, i.e. if the
|
||||
/// operation is non-null and a class of 'T'.
|
||||
template <typename T> bool isa_and_nonnull(Operation *op) {
|
||||
return op && op->isa<T>();
|
||||
}
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ static llvm::SetVector<unsigned>
|
|||
indicesFromAffineApplyOp(ArrayRef<Value *> operands) {
|
||||
llvm::SetVector<unsigned> res;
|
||||
for (auto en : llvm::enumerate(operands))
|
||||
if (isa_nonnull<AffineApplyOp>(en.value()->getDefiningOp()))
|
||||
if (isa_and_nonnull<AffineApplyOp>(en.value()->getDefiningOp()))
|
||||
res.insert(en.index());
|
||||
return res;
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ static void composeAffineMapAndOperands(AffineMap *map,
|
|||
void mlir::fullyComposeAffineMapAndOperands(
|
||||
AffineMap *map, SmallVectorImpl<Value *> *operands) {
|
||||
while (llvm::any_of(*operands, [](Value *v) {
|
||||
return isa_nonnull<AffineApplyOp>(v->getDefiningOp());
|
||||
return isa_and_nonnull<AffineApplyOp>(v->getDefiningOp());
|
||||
})) {
|
||||
composeAffineMapAndOperands(map, operands);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ void mlir::getReachableAffineApplyOps(
|
|||
auto *opInst = state.value->getDefiningOp();
|
||||
// Note: getDefiningOp will return nullptr if the operand is not an
|
||||
// Operation (i.e. block argument), which is a terminator for the search.
|
||||
if (!isa_nonnull<AffineApplyOp>(opInst)) {
|
||||
if (!isa_and_nonnull<AffineApplyOp>(opInst)) {
|
||||
worklist.pop_back();
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -1094,7 +1094,7 @@ struct SimplifyDeadDealloc : public RewritePattern {
|
|||
// Check that the memref operand's defining operation is an AllocOp.
|
||||
Value *memref = dealloc.getMemRef();
|
||||
Operation *defOp = memref->getDefiningOp();
|
||||
if (!isa_nonnull<AllocOp>(defOp))
|
||||
if (!isa_and_nonnull<AllocOp>(defOp))
|
||||
return matchFailure();
|
||||
|
||||
// Check that all of the uses of the AllocOp are other DeallocOps.
|
||||
|
|
|
@ -2243,7 +2243,7 @@ public:
|
|||
continue;
|
||||
// Use list expected to match the dep graph info.
|
||||
auto *op = memref->getDefiningOp();
|
||||
if (isa_nonnull<AllocOp>(op))
|
||||
if (isa_and_nonnull<AllocOp>(op))
|
||||
op->erase();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue