[AMDGPU] Keep skip branch for ds instructions
authorSebastian Neubauer <sebastian.neubauer@amd.com>
Thu, 4 Mar 2021 09:39:42 +0000 (10:39 +0100)
committerSebastian Neubauer <sebastian.neubauer@amd.com>
Fri, 5 Mar 2021 11:34:09 +0000 (12:34 +0100)
commite0e73714fbfeacad1a3adc0c6c8dbedcebc53ebc
tree85c9b6c64f5f660c2b4e09d25b0356b6328c400c
parent9b302513f6d82f0ca989b3bb1f5ffc592ed866b7
[AMDGPU] Keep skip branch for ds instructions

Same as other memory instructions, ds instructions add latency even if
exec is zero. Jumping over them if exec=0 is cheaper than executing
them.
With this change, the branch instruction that skips over a basic block
if exec=0 is not removed when the block contains a ds instruction.

Differential Revision: https://reviews.llvm.org/D97922
llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp
llvm/test/CodeGen/AMDGPU/branch-condition-and.ll
llvm/test/CodeGen/AMDGPU/insert-skips-flat-vmem-ds.mir [moved from llvm/test/CodeGen/AMDGPU/insert-skips-flat-vmem.mir with 71% similarity]
llvm/test/CodeGen/AMDGPU/ret_jump.ll
llvm/test/CodeGen/AMDGPU/si-lower-control-flow-unreachable-block.ll