Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=Off builds after D65958 and D70450
diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
index 1bf882b..296115c 100644
--- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
@@ -906,6 +906,7 @@
         };
     forAllMIsUntilDef(*I, RegToRename, TRI, LdStLimit, UpdateMIs);
 
+#if !defined(NDEBUG)
     // Make sure the register used for renaming is not used between the paired
     // instructions. That would trash the content before the new paired
     // instruction.
@@ -919,6 +920,7 @@
                     }) &&
              "Rename register used between paired instruction, trashing the "
              "content");
+#endif
   }
 
   // Insert our new paired instruction after whichever of the paired