AMDGPU: Relax restriction on folding immediates into physregs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 20 Jul 2020 02:57:24 +0000 (22:57 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 29 Jul 2020 18:01:53 +0000 (14:01 -0400)
commit766cb615a3b96025192707f4670cdf171da84034
tree839fddbe8c783e83b1c28825447ddca0e216441a
parentf05308a277b758462c91da7799f23eb4ede30c0c
AMDGPU: Relax restriction on folding immediates into physregs

I never completed the work on the patches referenced by
f8bf7d7f42f28fa18144091022236208e199f331, but this was intended to
avoid folding immediate writes into m0 which the coalescer doesn't
understand very well. Relax this to allow simple SGPR immediates to
fold directly into VGPR copies. This pattern shows up routinely in
current GlobalISel code since nothing is smart enough to emit VGPR
constants yet.
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.kernarg.segment.ptr.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/zextload.ll
llvm/test/CodeGen/AMDGPU/fold-imm-copy.mir