From 75486dbf4e9611f2070bf13b874f78a5587ed7ff Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 10 Aug 2010 21:38:11 +0000 Subject: [PATCH] Turn optimize compares back on with fix. We needed to test that a machine op was a register before checking if it was defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110733 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PeepholeOptimizer.cpp | 2 +- lib/Target/ARM/ARMBaseInstrInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/PeepholeOptimizer.cpp b/lib/CodeGen/PeepholeOptimizer.cpp index 7ed41f4011f..96a2b6edf99 100644 --- a/lib/CodeGen/PeepholeOptimizer.cpp +++ b/lib/CodeGen/PeepholeOptimizer.cpp @@ -54,7 +54,7 @@ STATISTIC(NumReuse, "Number of extension results reused"); // Optimize Comparisons static cl::opt -EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); +EnableOptCmps("enable-optimize-cmps", cl::init(true), cl::Hidden); STATISTIC(NumEliminated, "Number of compares eliminated"); diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index 7e1c84e1a67..5881a121a9d 100644 --- a/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -1386,7 +1386,7 @@ ConvertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { const MachineOperand &MO = Instr.getOperand(IO); - if (!MO.isDef() || !MO.isReg()) continue; + if (!MO.isReg() || !MO.isDef()) continue; // This instruction modifies CPSR before the one we want to change. We // can't do this transformation. -- 2.34.1