Handle empty functions with debug info in load/store opt pass
authorPablo Barrio <pablo.barrio@arm.com>
Fri, 26 Aug 2016 13:00:39 +0000 (13:00 +0000)
committerPablo Barrio <pablo.barrio@arm.com>
Fri, 26 Aug 2016 13:00:39 +0000 (13:00 +0000)
commitb8ec6305835c3dab8e3de2224840bd404b982e89
tree00ac96be597c477b70d460f5b3bbc658386bc447
parentfdb0f39ae27e41116b0cb1dc81af608b3b39df29
Handle empty functions with debug info in load/store opt pass

Summary:
In fuctions that contained debug info but were empty otherwise,
the ARM load/store optimizer could abort. This was because
function MergeReturnIntoLDM handled the special case where a
Machine Basic BLock is empty by calling MBB.empty(). However, this
returns false in presence of debug info, although the function
should be considered empty in the eyes of the load/store optimizer.
This has been fixed by handling the case where searching through the
block finds only debug instructions.

Reviewers: rengolin, dexonsmith, llvm-commits, jmolloy

Subscribers: t.p.northover, aemerson, rengolin, samparker

Differential Revision: https://reviews.llvm.org/D23847

llvm-svn: 279820
llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/test/CodeGen/ARM/2016-08-24-ARM-LDST-dbginfo-bug.ll [new file with mode: 0644]