ARM load/store optimizer: Don't materialize a new base register with
authorMoritz Roth <moritz.roth@arm.com>
Tue, 16 Sep 2014 16:25:07 +0000 (16:25 +0000)
committerMoritz Roth <moritz.roth@arm.com>
Tue, 16 Sep 2014 16:25:07 +0000 (16:25 +0000)
commit9753aab7040ce195b334fb32fdf3225565c2cdfc
treefbc2436a40ddd0601d077f967793d1ce70016f73
parent8be86aaf826e1a2d2a7d5b2d0054fed20a936fce
ARM load/store optimizer: Don't materialize a new base register with
ADDS/SUBS unless it's safe to clobber the condition flags.

If the merged instructions are in a range where the CPSR is live,
e.g. between a CMP -> Bcc, we can't safely materialize a new base
register.

This problem is quite rare, I couldn't come up with a test case and I've
never actually seen this happen in the tests I'm running - there is a
potential trigger for this in LNT/oggenc (spills being inserted between
a CMP/Bcc), but at the moment this isn't being merged. I'll try to
reduce that into a small test case once I've committed my upcoming patch
to make merging less conservative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217881 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMLoadStoreOptimizer.cpp