AMDGPU: Don't run mode switches with exec 0
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 2 Jun 2020 01:37:13 +0000 (21:37 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 2 Jun 2020 17:47:48 +0000 (13:47 -0400)
commit452e0d9023ca9a747a3646a42cea13d66b689de7
tree61d19745932be503fa2e7ab8bee763e484e653fa
parent635cde6e8c082af1b499a84745f48f5ec59853b5
AMDGPU: Don't run mode switches with exec 0

These are scalar instructions that change vector instructions, so they
should not be executed without any active lanes.

The implementation of -amdgpu-skip-threshold also seem to be backwards
from expected, since decreasing it prevents removal.
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.h
llvm/test/CodeGen/AMDGPU/remove-short-exec-branches-mode-def.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/skip-if-dead.ll