This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Force skip over s_sendmsg and exp instructions
ClosedPublic

Authored by nhaehnle on Jun 21 2018, 7:14 AM.

Details

Summary

These instructions interact with hardware blocks outside the shader core,
and they can have "scalar" side effects even when EXEC = 0. We don't
want these scalar side effects to occur when all lanes want to skip
these instructions, so always add the execz skip branch instruction
for basic blocks that contain them.

Change-Id: Ieaeb58352e2789ffd64745603c14970c60819d44

Diff Detail

Event Timeline

nhaehnle created this revision.Jun 21 2018, 7:14 AM

We really need to invert how this pass works

We really need to invert how this pass works

Yes. Although the code itself is really fine, isn't it? One way to think about it is that SI_MASK_BRANCH has different semantics before this pass and after this pass, and we should split it into two pseudo instructions to express this difference in semantics.

Anyway, I'd say that should be a separate change.

We really need to invert how this pass works

Yes. Although the code itself is really fine, isn't it? One way to think about it is that SI_MASK_BRANCH has different semantics before this pass and after this pass, and we should split it into two pseudo instructions to express this difference in semantics.

Anyway, I'd say that should be a separate change.

I can see it being useful in the future to factor this condition into a TII->hasEffectsWhenEXECEmpty() or something like that predicate function

nhaehnle updated this revision to Diff 152650.Jun 25 2018, 3:45 AM

Factor out SIInstrInfo::hasUnwantedEffectsWhenEXECEmpty

arsenm accepted this revision.Jul 6 2018, 11:31 AM

LGTM

This revision is now accepted and ready to land.Jul 6 2018, 11:31 AM
This revision was automatically updated to reflect the committed changes.