AMDGPU: Directly emit m0 initialization with s_mov_b32
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 14 Apr 2016 21:58:15 +0000 (21:58 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 14 Apr 2016 21:58:15 +0000 (21:58 +0000)
commit4ac341c8b31ab34c7cb90eda91a91e78a11a8baf
tree195717ee1a4094630e5031af4dcf161e748169f8
parent7900334dd530416b70fb04c8abb6f8c2c65da86d
AMDGPU: Directly emit m0 initialization with s_mov_b32

Currently what comes out of instruction selection is a
register initialized to -1, and then copied to m0.
MachineCSE doesn't consider copies, but we want these
to be CSEed. This isn't much of a problem currently,
because SIFoldOperands is run immediately after.

This avoids regressions when SIFoldOperands is run later
from leaving all copies to m0.

llvm-svn: 266377
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td