[PATCH] D11602: AMDGPU/SI: Use ComplexPatterns for SMRD addressing modes

Tom Stellard thomas.stellard at amd.com
Thu Jul 30 18:26:24 PDT 2015


tstellarAMD added inline comments.

================
Comment at: lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:1164-1167
@@ -1155,1 +1163,6 @@
 
+static bool isLegalSMRDImmOffset(const AMDGPUSubtarget *ST, int64_t Offset) {
+  return ST->getGeneration() < AMDGPUSubtarget::VOLCANIC_ISLANDS ?
+     isUInt<8>(Offset) : isUInt<20>(Offset);
+}
+
----------------
arsenm wrote:
> I don't think this is accurate for VI. On VI, these instructions are called SMEM format instead of SMRD, so the function name isn't quite right. More importantly, I thought the 20-bit offset on VI was in bytes and dwords on SI/CI.
The value passed to the function is the encoded value, so it is already in the correct units for the target.  SMRD was renamed to SMEM, but the load instructions are still identical, and we call them SMRD in  a few other places.


http://reviews.llvm.org/D11602







More information about the llvm-commits mailing list