Skip to content

[AArch64][AArch64LoadStoreOptimizer][DebugInfo] load store optimizer generates different code when debug info present #36619

@llvmbot

Description

@llvmbot
Bugzilla Link 37271
Version 6.0
OS All
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@francisvm,@pogo59,@TNorthover

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions