[PATCH] D140883: [AMDGPU] Simplify getNumFlatOffsetBits. NFC.

Ivan Kosarev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 05:42:20 PST 2023


kosarev added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:7961
+  const unsigned NumBits = AMDGPU::getNumFlatOffsetBits(ST) - 1;
+  if (AllowNegative) {
     // Use signed division by a power of two to truncate towards 0.
----------------
Is this actually an improvement? Wouldn't it be conceptually simpler to pass `FlatVariant` and get the actual width and, if needed, signedness?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140883



More information about the llvm-commits mailing list