[arm load/store optimizer] When trying to merge a base update load/store, make
authorChad Rosier <mcrosier@apple.com>
Mon, 25 Mar 2013 16:29:20 +0000 (16:29 +0000)
committerChad Rosier <mcrosier@apple.com>
Mon, 25 Mar 2013 16:29:20 +0000 (16:29 +0000)
sure the base register and would-be writeback register don't conflict for
stores.  This was already being done for loads.

Unfortunately, it is rather difficult to create a test case for this issue.  It
was exposed in 450.soplex at LTO and requires unlucky register allocation.
<rdar://13394908>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177874 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMLoadStoreOptimizer.cpp

index 98bd6c168eaf3ac0de234a39da6b38e69a32bc86..e4e683c2a023ef332fe8388caa710e5beae11b81 100644 (file)
@@ -865,7 +865,7 @@ bool ARMLoadStoreOpt::MergeBaseUpdateLoadStore(MachineBasicBlock &MBB,
   bool isLd = isi32Load(Opcode) || Opcode == ARM::VLDRS || Opcode == ARM::VLDRD;
   // Can't do the merge if the destination register is the same as the would-be
   // writeback register.
-  if (isLd && MI->getOperand(0).getReg() == Base)
+  if (MI->getOperand(0).getReg() == Base)
     return false;
 
   unsigned PredReg = 0;