[llvm] r240424 - [ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def

John Brawn john.brawn at arm.com
Tue Jun 23 09:02:11 PDT 2015

Author: john.brawn
Date: Tue Jun 23 11:02:11 2015
New Revision: 240424

URL: http://llvm.org/viewvc/llvm-project?rev=240424&view=rev
[ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def

When UpdateBaseRegUses sees an instruction that defines the base
register it must stop, as the base register value it is updating is no
longer live. Ideally we would already have seen the register be killed
(which is already checked for), but the kill flags may be inaccurate
and we have to account for this.

Differential Revision: http://reviews.llvm.org/D10566


Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=240424&r1=240423&r2=240424&view=diff
--- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Tue Jun 23 11:02:11 2015
@@ -444,7 +444,7 @@ ARMLoadStoreOpt::UpdateBaseRegUses(Machi
-    if (MBBI->killsRegister(Base))
+    if (MBBI->killsRegister(Base) || MBBI->definesRegister(Base))
       // Register got killed. Stop updating.

More information about the llvm-commits mailing list