From c2b8d6ac6588067f720df48ae89d86045a62101f Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 29 Mar 2011 20:27:38 +0000 Subject: [PATCH] Check early if this is an unsupported opcode, so that we can avoid needlessly instantiating the base register in some cases. llvm-svn: 128481 --- lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 0dab835f7c8..838f20f4b77 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -308,6 +308,10 @@ ARMLoadStoreOpt::MergeOps(MachineBasicBlock &MBB, // 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.