This is an archive of the discontinued LLVM Phabricator instance.

Do not remove implicit defs in BranchFolder
ClosedPublic

Authored by kparzysz on Oct 11 2016, 8:48 AM.

Details

Summary

BranchFolder removes implicit defs from blocks where they are the only instructions, potentially aside from an unconditional branch. This can lead to the liveness information becoming incorrect.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz updated this revision to Diff 74261.Oct 11 2016, 8:48 AM
kparzysz retitled this revision from to Do not remove implicit defs in BranchFolder.
kparzysz updated this object.
kparzysz added a reviewer: MatzeB.
kparzysz set the repository for this revision to rL LLVM.
kparzysz added a reviewer: qcolombet.
kparzysz added a subscriber: llvm-commits.
MatzeB edited edge metadata.Oct 11 2016, 2:30 PM

Heh, this obviously solves the problems of the broken/missing liveness updates :)

The next question of course is whether this will degrade codegen quality. Do the jumps in those empty-but-implicit-defs blocks removed so we just have a fall-through? Does MachineBlockPlacement help with that?
I think a convincing answer would require diffing assembly generated with/without this patch on a set of benchmarks. test-suite with -save-temps=obj flag maybe?.

I built test-suite with and without this patch. Out 466 .s files, there were differences in 3:

MultiSource/Benchmarks/MiBench/consumer-typeset/z23.s

Clicked the wrong button. Once again:

I built test-suite with and without this patch. Out 466 .s files, there were differences in 3:
MultiSource/Benchmarks/MiBench/consumer-typeset/z23.s
MultiSource/Benchmarks/MiBench/consumer-typeset/z37.s
MultiSource/Benchmarks/MiBench/consumer-typeset/z44.s

I looked at the actual differences:

z23.s: one small block is located in a different place. It's not on a fall-through (either in or out) path in either case.
z37.s: block numbering differences, no codegen differences
z44.s: same as z37.s, i.e. no codegen differences

MatzeB accepted this revision.Oct 12 2016, 12:56 PM
MatzeB edited edge metadata.

I looked at the actual differences:

z23.s: one small block is located in a different place. It's not on a fall-through (either in or out) path in either case.
z37.s: block numbering differences, no codegen differences
z44.s: same as z37.s, i.e. no codegen differences

Sounds good to me.

This revision is now accepted and ready to land.Oct 12 2016, 12:56 PM
This revision was automatically updated to reflect the committed changes.