[Mlir-commits] [mlir] 53e5a60 - [NFC] Fix some comments and only look at terminators when looking for ReturnLike ops

Rahul Joshi llvmlistbot at llvm.org
Tue Jul 20 08:06:33 PDT 2021


Author: Rahul Joshi
Date: 2021-07-20T08:05:20-07:00
New Revision: 53e5a60fd53df755f6342c23791c8bb6cd6ec47e

URL: https://github.com/llvm/llvm-project/commit/53e5a60fd53df755f6342c23791c8bb6cd6ec47e
DIFF: https://github.com/llvm/llvm-project/commit/53e5a60fd53df755f6342c23791c8bb6cd6ec47e.diff

LOG: [NFC] Fix some comments and only look at terminators when looking for ReturnLike ops

Differential Revision: https://reviews.llvm.org/D106326

Added: 
    

Modified: 
    mlir/include/mlir/Analysis/BufferViewFlowAnalysis.h
    mlir/lib/Analysis/BufferViewFlowAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Analysis/BufferViewFlowAnalysis.h b/mlir/include/mlir/Analysis/BufferViewFlowAnalysis.h
index 69561bf8e2aba..ab208fc0ecff7 100644
--- a/mlir/include/mlir/Analysis/BufferViewFlowAnalysis.h
+++ b/mlir/include/mlir/Analysis/BufferViewFlowAnalysis.h
@@ -39,10 +39,10 @@ class BufferViewFlowAnalysis {
   /// Returns the end iterator that can be used in combination with find.
   ValueMapT::const_iterator end() const { return dependencies.end(); }
 
-  /// Find all immediate and indirect views upong this value. This will find all
+  /// Find all immediate and indirect views upon this value. This will find all
   /// dependencies on this value that can potentially be later in the execution
   /// of the program, but will not return values that this alias might have been
-  /// created from (such as if `value is created by a subview, this will not
+  /// created from (such as if the value is created by a subview, this will not
   /// return the parent view if there is no cyclic behavior). Note that the
   /// resulting set will also contain the value provided as it is an alias of
   /// itself.

diff  --git a/mlir/lib/Analysis/BufferViewFlowAnalysis.cpp b/mlir/lib/Analysis/BufferViewFlowAnalysis.cpp
index 994542e9a2da6..bdf7bbae0318d 100644
--- a/mlir/lib/Analysis/BufferViewFlowAnalysis.cpp
+++ b/mlir/lib/Analysis/BufferViewFlowAnalysis.cpp
@@ -104,10 +104,10 @@ void BufferViewFlowAnalysis::build(Operation *op) {
         // Iterate over all immediate terminator operations and wire the
         // successor inputs with the operands of each terminator.
         for (Block &block : region) {
-          for (Operation &operation : block) {
-            if (operation.hasTrait<OpTrait::ReturnLike>())
-              registerDependencies(operation.getOperands(),
-                                   successorRegion.getSuccessorInputs());
+          Operation &terminator = *block.getTerminator();
+          if (terminator.hasTrait<OpTrait::ReturnLike>()) {
+            registerDependencies(terminator.getOperands(),
+                                 successorRegion.getSuccessorInputs());
           }
         }
       }


        


More information about the Mlir-commits mailing list