[AMDGPU] Move code sinking before structurizer
authorPiotr Sobczak <Piotr.Sobczak@amd.com>
Tue, 11 May 2021 10:45:04 +0000 (12:45 +0200)
committerPiotr Sobczak <Piotr.Sobczak@amd.com>
Tue, 11 May 2021 12:07:23 +0000 (14:07 +0200)
commit09fe84abb4ee71f707c3ec8e960a42d8292f6211
treee2f82845c836a2c17d44c827e3705c1d3f0f9f97
parent13ea238b1e1db96ef5fd409e869d9a8ebeef1332
[AMDGPU] Move code sinking before structurizer

Moving code sinking pass before structurizer creates more sinking
opportunities.

The extra flow edges introduced by the structurizer can have adverse
effects on sinking, because the sinking pass prefers moving instructions
to blocks with unique predecessors and the structurizer destroys that
property in some cases.

A notable example is moving high-latency image instructions across kills.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D101115
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
llvm/test/CodeGen/AMDGPU/loop_exit_with_xor.ll
llvm/test/CodeGen/AMDGPU/multilevel-break.ll
llvm/test/CodeGen/AMDGPU/sink-image-sample.ll [new file with mode: 0644]