This is an archive of the discontinued LLVM Phabricator instance.

[gvn] PRE needs to skip convergent intrinsics/calls.
ClosedPublic

Authored by hliao on Oct 29 2020, 6:26 AM.

Details

Summary
  • As convergent intrinsics/calls could only be moved to control-equivalent blocks, or more precisely the same divergent branch, PRE needs to skip them.

Diff Detail

Event Timeline

hliao created this revision.Oct 29 2020, 6:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2020, 6:26 AM
hliao requested review of this revision.Oct 29 2020, 6:26 AM
hliao updated this revision to Diff 301599.Oct 29 2020, 6:38 AM

Revise the comment.

mkazantsev added inline comments.Oct 29 2020, 10:15 PM
llvm/test/Transforms/GVN/pre-skip-convergent.ll
1

Please commit this test without your patch with auto-generated checks (utils/update_test_checks.py), then rebase on top of it to show what your patch changes.

jdoerfert added inline comments.Oct 29 2020, 10:31 PM
llvm/test/Transforms/GVN/pre-skip-convergent.ll
1

You probably also want to add a run line for the new pass manager -passes=..., assuming we run this code in the new PM. (Ignore this if we don't).

hliao updated this revision to Diff 301900.Oct 30 2020, 8:02 AM

Revise the test following reviewers' comments.

hliao marked 2 inline comments as done.Oct 30 2020, 8:02 AM
hliao added inline comments.Oct 30 2020, 8:05 AM
llvm/test/Transforms/GVN/pre-skip-convergent.ll
1

with this patch, we won't PRE that call into convergent intrinsic @llvm.convergent in merge block into pre block as it won't function correctly.

This revision is now accepted and ready to land.Oct 30 2020, 8:14 AM
This revision was landed with ongoing or failed builds.Oct 30 2020, 8:24 AM
This revision was automatically updated to reflect the committed changes.