================
@@ -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) {
+      return ST.isXNACKEnabled() && MMO->getAlign().value() < Width;
----------------
jayfoad wrote:

This doesn't look right since `Width` is in units of dwords here.

https://github.com/llvm/llvm-project/pull/96162
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to