[llvm-commits] [llvm] r128481 - /llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp

Owen Anderson resistor at mac.com
Tue Mar 29 13:27:38 PDT 2011


Author: resistor
Date: Tue Mar 29 15:27:38 2011
New Revision: 128481

URL: http://llvm.org/viewvc/llvm-project?rev=128481&view=rev
Log:
Check early if this is an unsupported opcode, so that we can avoid needlessly instantiating the base register in some cases.

Modified:
    llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=128481&r1=128480&r2=128481&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Tue Mar 29 15:27:38 2011
@@ -308,6 +308,10 @@
     // VLDM/VSTM do not support DB mode without also updating the base reg.
     Mode = ARM_AM::db;
   else if (Offset != 0) {
+    // Check if this is a supported opcode before we insert instructions to
+    // calculate a new base register.
+    if (!getLoadStoreMultipleOpcode(Opcode, Mode)) return false;
+
     // If starting offset isn't zero, insert a MI to materialize a new base.
     // But only do so if it is cost effective, i.e. merging more than two
     // loads / stores.





More information about the llvm-commits mailing list