[llvm] [DomTreeUpdater] Handle critical edge splitting (PR #100856)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 00:44:35 PDT 2024


================
@@ -146,8 +152,25 @@ class GenericDomTreeUpdater {
   /// 2. It is illegal to submit any update that has already been submitted,
   /// i.e., you are supposed not to insert an existent edge or delete a
   /// nonexistent edge.
+  /// 3. This kind updates are incompatible with critical edge splitting
+  /// updates, call this method will apply all critical edge updates in
+  /// lazy mode. It is not recommended to interleave applyUpdates and
+  /// applyUpdatesForCriticalEdgeSplitting.
----------------
paperchalice wrote:

A critical splitting update can be expressed as insert two new edges and delete old critical edge.
Current CFG codes rely on the dichotomy of `UpdateKind`, a new update kind makes old match not exhaustive.
Some CFG related codes need to be updated, e.g. `LegalizeUpdates` which is not easy to update, because it assumes `cfg::Update` only has two pointer fields...

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


More information about the llvm-commits mailing list