Extended Description
In the following test, the presence of the DBG_VALUE will prevent the loads from being paired. The AArch64LoadStoreOptimizer should treat DBG_VALUE instructions specially since e.g. they can be moved down with the newly paired load in this case.
See https://reviews.llvm.org/D45878 for similar DBG_VALUE handling in MachineCopyPropagation.
Test case:
RUN: llc -mtriple=aarch64 -run-pass aarch64-ldst-opt -verify-machineinstrs -o - %s | FileCheck %s
name: test_LDdbg
body: |
bb.0.entry:
liveins: $x0, $x3
$x1 = LDRXui $x0, 0 :: (load 8)
DBG_VALUE debug-use $x1, debug-use $noreg
$x2 = ADDXri $x3, 1, 0
$x3 = LDRXui $x0, 1 :: (load 8)
RET_ReallyLR implicit $x1