[llvm-branch-commits] [llvm] [AMDGPU][SILoadStoreOptimizer] Include constrained buffer load variants (PR #101619)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 2 09:15:07 PDT 2024


================
@@ -1735,8 +1735,10 @@ unsigned SILoadStoreOptimizer::getNewOpcode(const CombineInfo &CI,
   case UNKNOWN:
     llvm_unreachable("Unknown instruction class");
   case S_BUFFER_LOAD_IMM: {
+    // If XNACK is enabled, use the constrained opcodes when the first load is
+    // under-aligned.
     const MachineMemOperand *MMO = *CI.I->memoperands_begin();
-    bool NeedsConstrainedOpc = needsConstraintedOpcode(*STM, MMO, Width);
+    bool NeedsConstrainedOpc = MMO && needsConstrainedOpcode(*STM, MMO, Width);
----------------
arsenm wrote:

This is an invalid way of checking for no mmo. This is dereferencing the end iterator. 

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


More information about the llvm-branch-commits mailing list