AMDGPU: Fix i16 arithmetic pattern redundancy
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 8 Oct 2019 17:36:38 +0000 (17:36 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 8 Oct 2019 17:36:38 +0000 (17:36 +0000)
commit190a17bbd1c24f677ba0fdca6df97d9cd208e131
tree49d12f3730a16ae34ae37d15cb8f2909bf3b91fe
parent9912232b461ab76b08497021019084360b137060
AMDGPU: Fix i16 arithmetic pattern redundancy

There were 2 problems here. First, these patterns were duplicated to
handle the inverted shift operands instead of using the commuted
PatFrags.

Second, the point of the zext folding patterns don't apply to the
non-0ing high subtargets. They should be skipped instead of inserting
the extension. The zeroing high code would be emitted when necessary
anyway. This was also emitting unnecessary zexts in cases where the
high bits were undefined.

llvm-svn: 374092
llvm/lib/Target/AMDGPU/VOP2Instructions.td
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-ashr.s16.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-lshr.s16.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-shl.s16.mir
llvm/test/CodeGen/AMDGPU/idot2.ll
llvm/test/CodeGen/AMDGPU/idot4s.ll
llvm/test/CodeGen/AMDGPU/idot4u.ll
llvm/test/CodeGen/AMDGPU/idot8s.ll
llvm/test/CodeGen/AMDGPU/idot8u.ll
llvm/test/CodeGen/AMDGPU/preserve-hi16.ll
llvm/test/CodeGen/AMDGPU/sdwa-peephole.ll