[llvm] [AMDGPU][GlobalISel] Fix BITOP3 selecting B16 opcode for 32-bit vector types (PR #217048)

Arseniy Obolenskiy via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 10:54:04 PDT 2026


================
@@ -4462,7 +4462,10 @@ bool AMDGPUInstructionSelector::selectBITOP3(MachineInstr &MI) const {
   if (NumOpcodes < 2 || Src.empty())
     return false;
 
-  const bool IsB32 = MRI->getType(DstReg) == LLT::scalar(32);
+  unsigned Size = MRI->getType(DstReg).getSizeInBits();
+  if (Size != 16 && Size != 32)
+    return false;
+  const bool IsB32 = Size == 32;
----------------
aobolensk wrote:

Tried this, but a 64-bit G_OR isn't selectable outside selectBITOP3 at all

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


More information about the llvm-commits mailing list