[llvm-branch-commits] [llvm] [AMDGPU][SILoadStoreOptimizer] Merge constrained sloads (PR #96162)

Jay Foad via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jul 1 03:56:19 PDT 2024


================
@@ -1700,19 +1725,30 @@ unsigned SILoadStoreOptimizer::getNewOpcode(const CombineInfo &CI,
     case 8:
       return AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM;
     }
-  case S_LOAD_IMM:
+  case S_LOAD_IMM: {
+    // If XNACK is enabled, use the constrained opcodes when the first load is
+    // under-aligned.
+    const MachineMemOperand *MMO = *CI.I->memoperands_begin();
+    auto NeedsConstrainedOpc = [&MMO, Width](const GCNSubtarget &ST) {
----------------
jayfoad wrote:

This doesn't need to be a lambda. It is always called, with identical arguments. Just calculate the result as a `bool` here.

https://github.com/llvm/llvm-project/pull/96162


More information about the llvm-branch-commits mailing list