This patch is the second in a series of patches related to the RFC - A new dominator tree updater for LLVM.
It aims to convert some existing passes without dependencies to "local.h" and "BasicBlockUtils.h" to use the DomTreeUpdater.
Paths
| Differential D48919
[Dominators] Convert existing passes to use DomTreeUpdater - 1 AbandonedPublic Authored by NutshellySima on Jul 4 2018, 1:27 AM.
Details
Diff Detail Event TimelineComment Actions One thing that is not clear to me is whether it's work to replace plain updates (DT->insert/deleteEdge, DT->applyUpdates) with DTU when it's clear that both are going to be functionally the same. The overhead of constructing DTU is probably negligible, but it's more verbose and I'm not sure what benefit it brings. It definitely makes sense to use DTU when you are updating both DT and PDT, and when you can use the lazy strategy, or use some other functions that take DTU. Do you think it's worth to replace it everywhere for some other reason?
Comment Actions
Hi @kuhar, I was hoping all instances of DT were replaced with DTU for the following reasons:
It's my hope, unless I'm missing something here, to eventually see very few parameterized method/function calls containing a DT/PDT pointer in llvm. Comment Actions
Hi @brzycki, thanks for pointing them out. It is good to see passes getting easier DT/PDT preservation by replacing (DT->insert/deleteEdge, DT->applyUpdates) to corresponding ones in DTU and adding PDT to the object. I'll add them back in https://reviews.llvm.org/D48967.
Revision Contents
Diff 154061 lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/LoopInterchange.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/LoopRotationUtils.cpp
lib/Transforms/Utils/LoopUtils.cpp
|
Maybe use it directly from the constructor without creating a local variable -- like below?
I think either is fine - this should be easier to debug, the latter is more concise, but I think it's better to be somewhat consistent. What do you think?