[PATCH] D146287: [AMDGPU][GISel] Add inverse ballot intrinsic

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 06:28:49 PDT 2023


arsenm added a comment.

Drop the "[GISel]" from the description, this isn't adding existing functionality to it. Obsoletes D57748 <https://reviews.llvm.org/D57748>?



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:2540
+    default:
+      llvm_unreachable_internal("Unsupported size for inverse ballot mask.");
+    }
----------------
Should let it fall through to fail to select instead


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:1363-1364
+  const unsigned Size = MRI->getType(MaskReg).getSizeInBits();
+  assert(Size == STI.getWavefrontSize() &&
+         "Mask is not the same size as wavefront.");
+  const bool Is32 = Size == 32 && STI.isWave32();
----------------
This isn't enforced by the verifier


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:4480
   }
+  case AMDGPU::S_INVERSE_BALLOT_U32:
+  case AMDGPU::S_INVERSE_BALLOT_U64: {
----------------
Why do you have to go through selecting the pseudo? Can't you do this split during the select?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146287



More information about the llvm-commits mailing list