[llvm] Fix the doc about the returned value of DominanceFrontierBase::compare (PR #81352)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 10 01:25:43 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: None (bvlgah)

<details>
<summary>Changes</summary>

This is a trivial fix ( I guess it has not been noticed because of no use). Currently, the doc says the function returns `true` if two instances of `DominanceFrontierBase` matches, otherwise `false` is returned. I have checked the implementation

https://github.com/llvm/llvm-project/blob/9308d6688c673606fee1625d777a52539ae72015/llvm/include/llvm/Analysis/DominanceFrontierImpl.h#L71-L94

which examines whether two dominance frontier mappings are equal, and the actual value it returns contradicts the description in the doc.

---
Full diff: https://github.com/llvm/llvm-project/pull/81352.diff


1 Files Affected:

- (modified) llvm/include/llvm/Analysis/DominanceFrontier.h (+2-2) 


``````````diff
diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index b65cdc9cdb3c4f..772fdc9ddee02a 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -101,8 +101,8 @@ class DominanceFrontierBase {
   /// return true;
   bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const;
 
-  /// compare - Return true if the other dominance frontier base matches
-  /// this dominance frontier base. Otherwise return false.
+  /// compare - Return false if the other dominance frontier base matches
+  /// this dominance frontier base. Otherwise return true.
   bool compare(DominanceFrontierBase &Other) const;
 
   /// print - Convert to human readable form

``````````

</details>


https://github.com/llvm/llvm-project/pull/81352


More information about the llvm-commits mailing list