AMDGPU: Force skip over s_sendmsg and exp instructions
authorNicolai Haehnle <nhaehnle@gmail.com>
Mon, 30 Jul 2018 09:23:59 +0000 (09:23 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Mon, 30 Jul 2018 09:23:59 +0000 (09:23 +0000)
commit7f0d05d53219716394760dd16af9562d36ab96d6
tree93c11edced8112089d1101876a7b8743876b4051
parenta692120cb76b25d1a683f7479b7549b455015951
AMDGPU: Force skip over s_sendmsg and exp instructions

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.

Also ensure that we skip scalar stores / atomics, though we don't
code-gen those yet.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D48431

Change-Id: Ieaeb58352e2789ffd64745603c14970c60819d44
llvm-svn: 338235
llvm/lib/Target/AMDGPU/SIInsertSkips.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.h
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.sendmsg.ll
llvm/test/CodeGen/AMDGPU/skip-if-dead.ll