AMDGPU: Split block for si_end_cf
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 3 Apr 2019 20:53:20 +0000 (20:53 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 3 Apr 2019 20:53:20 +0000 (20:53 +0000)
commit396653f8a1fb5db910599e29557a47cfd85ca119
tree716d00da0da7375e59933aa073e833320c385016
parent060bf99f493ea5515fa09dec8dc949dc6d57db09
AMDGPU: Split block for si_end_cf

Relying on no spill or other code being inserted before this was
precarious. It relied on code diligently checking isBasicBlockPrologue
which is likely to be forgotten.

Ideally this could be done earlier, but this doesn't work because of
phis. Any other instruction can't be placed before them, so we have to
accept the position being incorrect during SSA.

This avoids regressions in the fast register allocator rewrite from
inverting the direction.

llvm-svn: 357634
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
llvm/test/CodeGen/AMDGPU/collapse-endcf.mir
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.ordered.swap.ll