This is an archive of the discontinued LLVM Phabricator instance.

Disable Jump Threading for the targets with divergent control flow
ClosedPublic

Authored by alex-t on Dec 15 2020, 8:17 AM.

Details

Summary

Details: Jump Threading does not make sense for the targets with divergent CF

since they do not use branch prediction for speculative execution.
Also in the high level IR there is no enough information to conclude that the branch is divergent or uniform.
This may cause errors in further CF lowering.

Diff Detail

Event Timeline

alex-t created this revision.Dec 15 2020, 8:17 AM
alex-t requested review of this revision.Dec 15 2020, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2020, 8:17 AM

Needs test in Transforms/JumpThreading.
Typo in the commit message "unniform".

Otherwise LGTM.

alex-t updated this revision to Diff 312246.Dec 16 2020, 9:55 AM

Test that ensures optimization disabled for the target with divergent CF and enabled otherwise.

nikic added a subscriber: nikic.Dec 16 2020, 9:57 AM
nikic added inline comments.
llvm/test/Transforms/JumpThreading/divergent-target-test.ll
3

You probably need some REQUIRES for x86 & amdgpu here, otherwise the test may fail if these targets are not built.

alex-t updated this revision to Diff 312299.Dec 16 2020, 2:00 PM

REUIRES x86 && amdgpu clause added in test

alex-t marked an inline comment as done.Dec 16 2020, 2:01 PM
rampitec accepted this revision.Dec 16 2020, 2:03 PM

LGTM, but please fix typo in the commit message before submit: "unniform".

This revision is now accepted and ready to land.Dec 16 2020, 2:03 PM
alex-t edited the summary of this revision. (Show Details)Dec 16 2020, 2:07 PM
This revision was landed with ongoing or failed builds.Dec 16 2020, 3:45 PM
This revision was automatically updated to reflect the committed changes.