[llvm] AMDGPU/GlobalISel: add RegBankLegalize rules for bitfield extract (PR #132381)

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 24 13:17:53 PDT 2025


================
@@ -225,6 +228,103 @@ void RegBankLegalizeHelper::lower(MachineInstr &MI,
     MI.eraseFromParent();
     break;
   }
+  case Div_BFE: {
+    Register Dst = MI.getOperand(0).getReg();
+    assert(MRI.getType(Dst) == LLT::scalar(64));
+    bool Signed = isa<GIntrinsic>(MI) ? MI.getOperand(1).getIntrinsicID() ==
+                                            Intrinsic::amdgcn_sbfe
+                                      : MI.getOpcode() == AMDGPU::G_SBFX;
----------------
nhaehnle wrote:

Considering that the next line also inspects the exact type of MI, I'm not convinced that this would make things cleaner.

https://github.com/llvm/llvm-project/pull/132381


More information about the llvm-commits mailing list