This is an archive of the discontinued LLVM Phabricator instance.

Don't tail-duplicate blocks that contain convergent instructions.
ClosedPublic

Authored by jlebar on Feb 16 2016, 5:04 PM.

Details

Summary

Convergent instrs shouldn't be made control-dependent on other values,
but this is basically the whole point of tail duplication. So just bail
if we see a convergent instruction.

Diff Detail

Event Timeline

jlebar updated this revision to Diff 48136.Feb 16 2016, 5:04 PM
jlebar retitled this revision from to Don't tail-duplicate blocks that contain convergent instructions..
jlebar updated this object.
jlebar added a reviewer: iteratee.
jlebar added subscribers: llvm-commits, jingyue, tra and 2 others.
iteratee edited edge metadata.Feb 17 2016, 2:45 PM

Small comment nit, but other than that it looks good.

For your todo, I'd prefer to see that logic inside of MI.isConvergent() rather than scattered.

lib/CodeGen/TailDuplication.cpp
593

I think one of your TODOs is done.

jlebar updated this revision to Diff 48254.Feb 17 2016, 3:55 PM
jlebar marked an inline comment as done.
jlebar edited edge metadata.

Move TODO into MachineInstr.h.

lib/CodeGen/TailDuplication.cpp
593

Yeah, thanks. I nuked this and moved the one about convergent MIs into MachineInstr::isConvergent, where it belongs.

jlebar updated this revision to Diff 48424.Feb 18 2016, 4:27 PM

Remove comment in MachineInstr.h.

I have a different way of attacking this, see D17423.

This revision was automatically updated to reflect the committed changes.