Rename isa_nonnull to isa_and_nonnull to match the upstream llvm name.
authorRiver Riddle <riverriddle@google.com>
Tue, 23 Apr 2019 21:38:26 +0000 (14:38 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:03:14 +0000 (22:03 -0700)
--

PiperOrigin-RevId: 244928036

mlir/examples/Linalg/Linalg1/lib/SliceOp.cpp
mlir/include/mlir/IR/Operation.h
mlir/lib/AffineOps/AffineOps.cpp
mlir/lib/Analysis/AffineAnalysis.cpp
mlir/lib/StandardOps/Ops.cpp
mlir/lib/Transforms/LoopFusion.cpp

index 818a770..b7337a1 100644 (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;
index 7007f81..aacf9ee 100644 (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>();
 }
 
index 0ff7db2..63c2b89 100644 (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);
   }
index 53120af..ad9a87b 100644 (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;
     }
index 38a86c4..99f93d1 100644 (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.
index 011423b..a69836c 100644 (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();
     }
   }