[PATCH] D155864: [AMDGPU] Allow 8,16 bit sources in calculateSrcByte

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 16:59:34 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:10212
 
+  auto SrcSize = Op.getValueSizeInBits();
+  if (SrcSize != 8 && SrcSize != 16 && SrcSize != 32)
----------------
Calling this "Src" is a bit confusing given you handle cast operations here and this is the Dest for them


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:10380
+    auto BitWidth = Op.getScalarValueSizeInBits();
+    if (BitWidth % 8)
+      return std::nullopt;
----------------
I'd hope this is unreachable


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:10475
+
+  auto TempOp = Op.getOpcode() == ISD::BITCAST ? Op.getOperand(0) : Op;
+  auto TempOtherOp =
----------------
there are stripBitcast helpers around


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:10677
+        assert(
+            !(Op.getValueSizeInBits() % 8 || OtherOp.getValueSizeInBits() % 8));
+        if (Op.getValueSizeInBits() < 32)
----------------
I think isByteSized works


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155864



More information about the llvm-commits mailing list