AMDGPU/GlobalISel: Fix combine crash because LI is not set in prelegalizer
authorPetar Avramovic <Petar.Avramovic@amd.com>
Tue, 8 Nov 2022 09:32:04 +0000 (10:32 +0100)
committerPetar Avramovic <Petar.Avramovic@amd.com>
Tue, 8 Nov 2022 11:46:16 +0000 (12:46 +0100)
commit838d5d371ac817538896b6a5505ee36341143a28
treec63a4e830cd99bc2f651cc0e9d0531663614d174
parent57ad3f1dc63890c96e9c1565489e1da65b0fb032
AMDGPU/GlobalISel: Fix combine crash because LI is not set in prelegalizer

Caused by legacy min/max combines (select + cmp) asking for legalizer info
in prelegalizer (D135047 added combine to all_combines).
Combine still does not work for AMDGPU since destination opcode is custom,
not legal. Similar combine works on DAG since it asks for legal or custom.

Differential Revision: https://reviews.llvm.org/D137274
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/select-to-fmin-fmax.ll [new file with mode: 0644]