Rename isa_nonnull to isa_and_nonnull to match the upstream llvm name.

--

PiperOrigin-RevId: 244928036
This commit is contained in:
River Riddle 2019-04-23 14:38:26 -07:00 committed by Mehdi Amini
parent a2e7775441
commit 1423acc03c
6 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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>();
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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.

View File

@ -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();
}
}