This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] Use different, convergent MIs for convergent calls.
ClosedPublic

Authored by jlebar on Feb 18 2016, 4:21 PM.

Details

Summary

Calls sometimes need to be convergent. This is already handled at the
LLVM IR level, but it also needs to be handled at the MI level.

Ideally we'd propagate convergence from instructions, down through the
selection DAG, and into MIs. But this is Hard, and would affect
optimizations in the SDNs -- right now only SDNs with two operands have
any flags at all.

Instead, here's a much simpler hack: Add new opcodes for NVPTX for
convergent calls, and generate these when lowering convergent LLVM
calls.

Diff Detail

Event Timeline

jlebar updated this revision to Diff 48422.Feb 18 2016, 4:21 PM
jlebar retitled this revision from to [NVPTX] Use different, convergent MIs for convergent calls..
jlebar updated this object.
jlebar added a reviewer: jholewinski.
jlebar added subscribers: llvm-commits, tra, jhen and 2 others.

Friendly ping. I know I have some big reviews outstanding from you, but the issue addressed here is a fairly critical correctness fix. I'm also happy to have tra or someone review this, but just wanted to respect your ownership and expertise here.

mehdi_amini accepted this revision.Feb 29 2016, 5:47 PM
mehdi_amini added a reviewer: mehdi_amini.

If no one else chime in, this LGTM.
(it would be better to have someone more familiar with NVPTX to double check )

This revision is now accepted and ready to land.Feb 29 2016, 5:47 PM
jholewinski accepted this revision.Feb 29 2016, 5:56 PM
jholewinski edited edge metadata.

Looks reasonable to me. Thanks!

This revision was automatically updated to reflect the committed changes.