projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
APInt: udivrem should use machine instructions for single-word APInts
[oota-llvm.git]
/
lib
/
CodeGen
/
OptimizePHIs.cpp
diff --git
a/lib/CodeGen/OptimizePHIs.cpp
b/lib/CodeGen/OptimizePHIs.cpp
index 4973802aa05fc184136b35f2d6d5ce81dcb47956..a1042e720c37585c1299abe47c14d751a25091cd 100644
(file)
--- a/
lib/CodeGen/OptimizePHIs.cpp
+++ b/
lib/CodeGen/OptimizePHIs.cpp
@@
-12,7
+12,6
@@
//
//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "phi-opt"
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
@@
-21,8
+20,11
@@
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
using namespace llvm;
using namespace llvm;
+#define DEBUG_TYPE "phi-opt"
+
STATISTIC(NumPHICycles, "Number of PHI cycles replaced");
STATISTIC(NumDeadPHICycles, "Number of dead PHI cycles");
STATISTIC(NumPHICycles, "Number of PHI cycles replaced");
STATISTIC(NumDeadPHICycles, "Number of dead PHI cycles");
@@
-61,8
+63,11
@@
INITIALIZE_PASS(OptimizePHIs, "opt-phis",
"Optimize machine instruction PHIs", false, false)
bool OptimizePHIs::runOnMachineFunction(MachineFunction &Fn) {
"Optimize machine instruction PHIs", false, false)
bool OptimizePHIs::runOnMachineFunction(MachineFunction &Fn) {
+ if (skipOptnoneFunction(*Fn.getFunction()))
+ return false;
+
MRI = &Fn.getRegInfo();
MRI = &Fn.getRegInfo();
- TII = Fn.get
T
arget().getInstrInfo();
+ TII = Fn.get
Subt
arget().getInstrInfo();
// Find dead PHI cycles and PHI cycles that can be replaced by a single
// value. InstCombine does these optimizations, but DAG legalization may
// Find dead PHI cycles and PHI cycles that can be replaced by a single
// value. InstCombine does these optimizations, but DAG legalization may
@@
-87,7
+92,7
@@
bool OptimizePHIs::IsSingleValuePHICycle(MachineInstr *MI,
unsigned DstReg = MI->getOperand(0).getReg();
// See if we already saw this register.
unsigned DstReg = MI->getOperand(0).getReg();
// See if we already saw this register.
- if (!PHIsInCycle.insert(MI))
+ if (!PHIsInCycle.insert(MI)
.second
)
return true;
// Don't scan crazily complex things.
return true;
// Don't scan crazily complex things.
@@
-132,7
+137,7
@@
bool OptimizePHIs::IsDeadPHICycle(MachineInstr *MI, InstrSet &PHIsInCycle) {
"PHI destination is not a virtual register");
// See if we already saw this register.
"PHI destination is not a virtual register");
// See if we already saw this register.
- if (!PHIsInCycle.insert(MI))
+ if (!PHIsInCycle.insert(MI)
.second
)
return true;
// Don't scan crazily complex things.
return true;
// Don't scan crazily complex things.