[AMDGPU][GlobalISel] Avoid selecting S_PACK with constants
authorMirko Brkusanin <Mirko.Brkusanin@amd.com>
Wed, 20 Jan 2021 10:38:05 +0000 (11:38 +0100)
committerMirko Brkusanin <Mirko.Brkusanin@amd.com>
Wed, 20 Jan 2021 10:54:53 +0000 (11:54 +0100)
commita6a72dfdf2e132d64ea73ddbbc0d3431b6483724
tree4d9f3f6d2ebad98efc73c499f07db27031ed276e
parent2ab5fd2c8567ac89d7e7639563babdfc78dbcf78
[AMDGPU][GlobalISel] Avoid selecting S_PACK with constants

If constants are hidden behind G_ANYEXT we can treat them same way as G_SEXT.
For that purpose we extend getConstantVRegValWithLookThrough with option
to handle G_ANYEXT same way as G_SEXT.

Differential Revision: https://reviews.llvm.org/D92219
llvm/include/llvm/CodeGen/GlobalISel/Utils.h
llvm/lib/CodeGen/GlobalISel/Utils.cpp
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-build-vector-trunc.v2s16.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.fdot2.ll