[llvm] [VPlan] Use DomTreeUpdater to automatically update DT for vector loop. (PR #92525)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 12:20:54 PDT 2024


fhahn wrote:

> I'm surprised by the simplicity of this patch. Not that it's wrong, just that it sounds simpler than the previous code that was meant to avoid complexity. :)
> 
> IIUC, instead of doing the full analysis at the end (in `updateDomintorTree`) you do it at the BB creation time (`BB::execute`) and wrapping time (`VP::execute`). That avoids the need for a whole update in the end, which is great.
> 

Yes, that's the nice thing about the updater, all you need is to tell it which changes to the CFG has been made, it will efficiently apply those updates to the dominator tree. It's heavily used across various parts of LLVM, including common helpers like `SplitBlockImpl`  (https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp#L1056) and many others in that file and elsewhere

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


More information about the llvm-commits mailing list