[AMDGPU][GISel] Enable Selection of ADD3 for G_PTR_ADD
authorPierre van Houtryve <pierre.vanhoutryve@amd.com>
Wed, 24 Aug 2022 12:13:04 +0000 (12:13 +0000)
committerPierre van Houtryve <pierre.vanhoutryve@amd.com>
Wed, 24 Aug 2022 14:44:19 +0000 (14:44 +0000)
commit59cf9dd92337214d15d4b04f299832a328de195b
tree96623e4cada7613ab32dcd4942ffc147cb12d283
parent8187b8c42b07354995f89baeb5583ffb9f83f82e
[AMDGPU][GISel] Enable Selection of ADD3 for G_PTR_ADD

Allows things like `(G_PTR_ADD (G_PTR_ADD a, b), c)` to be
simplified into a single ADD3 instruction instead of two adds.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D131254
llvm/include/llvm/Target/GenericOpcodes.td
llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
llvm/include/llvm/Target/TargetSelectionDAG.td
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
llvm/lib/Target/AMDGPU/VOP3Instructions.td
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-pattern-add3.mir
llvm/test/CodeGen/AMDGPU/flat-scratch-svs.ll
llvm/utils/TableGen/CodeGenInstruction.cpp
llvm/utils/TableGen/CodeGenInstruction.h
llvm/utils/TableGen/GlobalISelEmitter.cpp