GlobalISel: Try to fold G_SEXT_INREG to G_AND with mask
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 15 Nov 2022 22:07:07 +0000 (14:07 -0800)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 19 Nov 2022 00:51:34 +0000 (16:51 -0800)
commit3c36de55f5e60dee8f1bc04bd201f6dd762b3423
tree8ffe001108d0fcaf77d8c0c737164966d3f0b4e1
parent56c166017055595a9f26933e85bfd89e30c528d0
GlobalISel: Try to fold G_SEXT_INREG to G_AND with mask

Copies the same transform from the DAG. Helps eliminate some codegen
diffs to allowed shared checks in a future change.

Not sure if apply supports anything better than C++ fragments for
the result. It's also not really reasonable that every combine has
to set the default insertion point.
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/test/CodeGen/AMDGPU/GlobalISel/prelegalizer-combiner-sext_inreg-to-and.mir [new file with mode: 0644]