[AMDGPU] Fix vccz after v_readlane/v_readfirstlane to vcc_lo/hi
authorJay Foad <jay.foad@amd.com>
Wed, 30 Oct 2019 12:18:51 +0000 (12:18 +0000)
committerJay Foad <jay.foad@amd.com>
Tue, 28 Jan 2020 10:52:17 +0000 (10:52 +0000)
commit4a331beadc3aaeb24a88853d2703f4ac7d513df1
tree4799a8a73093a1f18ee60a2566ffd44ef1a38159
parent00efeae34f22e81ccbcf8cf9b46f314d8101063b
[AMDGPU] Fix vccz after v_readlane/v_readfirstlane to vcc_lo/hi

Summary:
Up to gfx9, writes to vcc_lo and vcc_hi by instructions like
v_readlane and v_readfirstlane do not update vccz to reflect the new
value of vcc. Fix it by reusing part of the existing vccz bug handling
code, which inserts an "s_mov_b64 vcc, vcc" instruction to restore vccz
just before an instruction that needs the correct value.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69661
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
llvm/test/CodeGen/AMDGPU/vccz-corrupt-bug-workaround.mir