[PATCH] D100149: [AMDGPU][GlobalISel] Legalize and select G_SBFX and G_UBFX

Brendon Cahoon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 1 11:15:42 PDT 2021


bcahoon updated this revision to Diff 342165.
bcahoon added a comment.

Added ability to use G_SBFX/G_UBFX in end-to-end cases.
This enables additional test cases. To do this, this patch moves
the AArch64 code that creates G_SBFX for shift+sext_inreg to
CombinerHelper.cpp so that it can be used by AMDGPU (and
other targets). Also, added the ability to create G_UBFX from
shift+and in CombinerHelper.cpp. This works on cases when
the offset and width are constants, since the general case is
not supported on AArch64.

The ability to generate G_SBFX/G_UBFX causes multiple existing
global-isel test cases to change. These test cases have been updated.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100149/new/

https://reviews.llvm.org/D100149

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.h
  llvm/test/CodeGen/AMDGPU/GlobalISel/ashr.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/cvt_f32_ubyte.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement-stack-lower.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.i8.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.i8.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-sbfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-ubfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-sbfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ubfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.ubfe.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.workitem.id.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-sbfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-ubfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-sbfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-ubfx.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/saddsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/sbfx.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/ssubsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/uaddsat.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/ubfx.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/usubsat.ll



More information about the llvm-commits mailing list