AMDGPU: Use PatFrags to allow selecting custom nodes or intrinsics
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 9 Sep 2019 18:10:31 +0000 (18:10 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 9 Sep 2019 18:10:31 +0000 (18:10 +0000)
commit6ebf605851db3627bdf51a89b0a36147729014c2
treec0301623aea4a6201503aaaa9e20a4b6aa6112cb
parent5ebd0a6e88a5c70805ec5077289e602c8e16a83f
AMDGPU: Use PatFrags to allow selecting custom nodes or intrinsics

This enables GlobalISel to handle various intrinsics. The custom node
pattern will be ignored, and the intrinsic will work. This will also
allow SelectionDAG to directly select the intrinsics, but as they are
all custom lowered to the nodes, this ends up leaving dead code in the
table.

Eventually either GlobalISel should add the equivalent of custom nodes
equivalent, or intrinsics should be directly used. These each have
different tradeoffs.

There are a few more to handle, but these are easy to handle
ones. Some others fail for other reasons.

llvm-svn: 371432
16 files changed:
llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.cos.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.cos.s16.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.fract.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.fract.s16.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.ldexp.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.ldexp.s16.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rcp.legacy.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rcp.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rcp.s16.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rsq.clamp.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rsq.legacy.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rsq.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.rsq.s16.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.sin.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-amdgcn.sin.s16.mir [new file with mode: 0644]