This is an archive of the discontinued LLVM Phabricator instance.

StructurizeCFG: Add an option for skipping regions with only uniform branches
ClosedPublic

Authored by tstellarAMD on Jan 26 2016, 1:57 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to StructurizeCFG: Add an option for skipping regions with only uniform branches.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm added inline comments.Jan 29 2016, 8:39 PM
lib/Transforms/Scalar/StructurizeCFG.cpp
264 ↗(On Diff #46050)

This should not be a required analysis. Even with the false option, it will force running the analysis. I think if the target pass config explicitly adds the analysis pass before StructurizeCFG it should work

arsenm edited edge metadata.Jan 29 2016, 8:57 PM

Do we need to worry about updating the DivergenceAnalysis as the control flow is changed in the non-uniform regions? Sometimes it introduces new xor instructions which won't be in DA's value map.

tstellarAMD edited edge metadata.

Only require DivergenceAnalysis when skipping uniform regions is enabled.

Do we need to worry about updating the DivergenceAnalysis as the control flow is changed in the non-uniform regions? Sometimes it introduces new xor instructions which won't be in DA's value map.

I don't think this would be a problem, because we don't use the DivergenceAnalysis any more, once we have started to structurize a region.

lib/Transforms/Scalar/StructurizeCFG.cpp
264 ↗(On Diff #47285)

Explicitly adding DivergenceAnalysis in TargetPassConfig doesn't seem to work, so I've made DivergenceAnalysis required only when SkipUniformRegions is true.

arsenm accepted this revision.Feb 8 2016, 6:53 PM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Feb 8 2016, 6:53 PM
This revision was automatically updated to reflect the committed changes.