From 3bcb327e9cd4725a7d5e50abfe29cf1f459724e8 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 26 Sep 2008 21:30:20 +0000 Subject: [PATCH] Mark lea fi# as being really rematerializable. llvm-svn: 56698 --- lib/Target/X86/X86InstrInfo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index c19628b81b5..c275418ddd8 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -819,11 +819,12 @@ X86InstrInfo::isReallyTriviallyReMaterializable(const MachineInstr *MI) const { case X86::LEA32r: case X86::LEA64r: { - if (MI->getOperand(1).isRegister() && - MI->getOperand(2).isImmediate() && + if (MI->getOperand(2).isImmediate() && MI->getOperand(3).isRegister() && MI->getOperand(3).getReg() == 0 && !MI->getOperand(4).isRegister()) { // lea fi#, lea GV, etc. are all rematerializable. + if (!MI->getOperand(1).isRegister()) + return true; unsigned BaseReg = MI->getOperand(1).getReg(); if (BaseReg == 0) return true;