From cf6e29a818d8acb4a01519621111879cd7e5b97d Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Thu, 4 Mar 2010 21:04:38 +0000 Subject: pr6480: Don't try producing ld/st-multiple instructions when the address is an undef value. This is only going to come up for bugpoint-reduced tests -- correct programs will not access memory at undefined addresses -- so it's not worth the effort of doing anything more aggressive. llvm-svn: 97745 --- llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp') diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 5b4f02d6b75..19f1e3ba12c 100644 --- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -761,6 +761,11 @@ static bool isMemoryOp(const MachineInstr *MI) { MI->getOperand(0).isUndef()) return false; + // Likewise don't mess with references to undefined addresses. + if (MI->getNumOperands() > 1 && MI->getOperand(1).isReg() && + MI->getOperand(1).isUndef()) + return false; + int Opcode = MI->getOpcode(); switch (Opcode) { default: break; -- cgit v1.2.3