[PATCH] D25523: AMDGPU/SI: Don't allow unaligned scratch access

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 10:37:42 PDT 2016


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:456-460
+  if (!Subtarget->hasUnalignedScratchAccess() &&
+      (AddrSpace == AMDGPUAS::PRIVATE_ADDRESS ||
+       AddrSpace == AMDGPUAS::FLAT_ADDRESS)) {
+    return false;
+  }
----------------
We shouldn't have to do this for flat if it is known to never access private memory, but I guess this function has no context for where it is being used to check for that. Maybe there should be a version with function context, but then that would require updating all of the uses to pass it in. I guess that can be a fixme for now


================
Comment at: test/CodeGen/AMDGPU/scratch-buffer.ll:112-127
+; CHECK-LABEL: scratch_unaligned_load:
+; CHECK: buffer_load_ubyte
+; CHECK: buffer_load_ubyte
+; CHECK: buffer_load_ubyte
+; CHECK: buffer_load_ubyte
+define void @scratch_unaligned_load() {
+  %scratch = alloca i32
----------------
wrong check prefix


https://reviews.llvm.org/D25523





More information about the llvm-commits mailing list