This is an archive of the discontinued LLVM Phabricator instance.

[SimpleLoopUnswitch] Form dedicated exits after trivial unswitches.
ClosedPublic

Authored by asbirlea on Aug 28 2018, 12:28 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.Aug 28 2018, 12:28 PM
xbolva00 added inline comments.
test/Transforms/SimpleLoopUnswitch/formDedicatedAfterTrivial3.ll
1 ↗(On Diff #162931)

opt < %s

1 ↗(On Diff #162931)

avoid -O3

FileCheck?

fedor.sergeev added inline comments.Aug 28 2018, 1:24 PM
test/Transforms/SimpleLoopUnswitch/formDedicatedAfterTrivial3.ll
1 ↗(On Diff #162931)

I would rather use a somewhat reduced version of it (getting IR dump just before the failing simple-loop-unswitch) - https://pastebin.com/5qYNZvxa

fails with just:

opt < %s -simple-loop-unswitch
fedor.sergeev accepted this revision.Aug 28 2018, 1:26 PM

source changes LGTM.
comments and suggested test change - up to your discretion.

lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
308 ↗(On Diff #162931)

instead of "trivial switches" I would say something like:

"after trivial unswitching it is possible to get new non-dedicated exits out of parent loop"

This revision is now accepted and ready to land.Aug 28 2018, 1:26 PM
asbirlea updated this revision to Diff 162944.Aug 28 2018, 1:38 PM

Updated test, thank you for the comments!

This revision was automatically updated to reflect the committed changes.