[llvm-commits] [llvm] r150091 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/Passes.cpp lib/CodeGen/TailDuplication.cpp lib/Target/PTX/PTXTargetMachine.cpp
Andrew Trick
atrick at apple.com
Wed Feb 8 13:22:30 PST 2012
Author: atrick
Date: Wed Feb 8 15:22:30 2012
New Revision: 150091
URL: http://llvm.org/viewvc/llvm-project?rev=150091&view=rev
Log:
Move pass configuration out of pass constructors: TailDuplicate::PreRegAlloc
Modified:
llvm/trunk/include/llvm/CodeGen/Passes.h
llvm/trunk/lib/CodeGen/Passes.cpp
llvm/trunk/lib/CodeGen/TailDuplication.cpp
llvm/trunk/lib/Target/PTX/PTXTargetMachine.cpp
Modified: llvm/trunk/include/llvm/CodeGen/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=150091&r1=150090&r2=150091&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/Passes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/Passes.h Wed Feb 8 15:22:30 2012
@@ -272,7 +272,7 @@
/// TailDuplicate Pass - Duplicate blocks with unconditional branches
/// into tails of their predecessors.
- FunctionPass *createTailDuplicatePass(bool PreRegAlloc = false);
+ FunctionPass *createTailDuplicatePass();
/// IfConverter Pass - This pass performs machine code if conversion.
FunctionPass *createIfConverterPass();
Modified: llvm/trunk/lib/CodeGen/Passes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Passes.cpp?rev=150091&r1=150090&r2=150091&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Passes.cpp (original)
+++ llvm/trunk/lib/CodeGen/Passes.cpp Wed Feb 8 15:22:30 2012
@@ -178,7 +178,7 @@
// Pre-ra tail duplication.
if (getOptLevel() != CodeGenOpt::None && !DisableEarlyTailDup) {
- PM.add(createTailDuplicatePass(true));
+ PM.add(createTailDuplicatePass());
printAndVerify("After Pre-RegAlloc TailDuplicate");
}
@@ -250,7 +250,7 @@
// Tail duplication.
if (getOptLevel() != CodeGenOpt::None && !DisableTailDuplicate) {
- PM.add(createTailDuplicatePass(false));
+ PM.add(createTailDuplicatePass());
printNoVerify("After TailDuplicate");
}
Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=150091&r1=150090&r2=150091&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original)
+++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Wed Feb 8 15:22:30 2012
@@ -56,10 +56,10 @@
namespace {
/// TailDuplicatePass - Perform tail duplication.
class TailDuplicatePass : public MachineFunctionPass {
- bool PreRegAlloc;
const TargetInstrInfo *TII;
MachineModuleInfo *MMI;
MachineRegisterInfo *MRI;
+ bool PreRegAlloc;
// SSAUpdateVRs - A list of virtual registers for which to update SSA form.
SmallVector<unsigned, 16> SSAUpdateVRs;
@@ -70,8 +70,8 @@
public:
static char ID;
- explicit TailDuplicatePass(bool PreRA) :
- MachineFunctionPass(ID), PreRegAlloc(PreRA) {}
+ explicit TailDuplicatePass() :
+ MachineFunctionPass(ID), PreRegAlloc(false) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Tail Duplication"; }
@@ -118,14 +118,15 @@
char TailDuplicatePass::ID = 0;
}
-FunctionPass *llvm::createTailDuplicatePass(bool PreRegAlloc) {
- return new TailDuplicatePass(PreRegAlloc);
+FunctionPass *llvm::createTailDuplicatePass() {
+ return new TailDuplicatePass();
}
bool TailDuplicatePass::runOnMachineFunction(MachineFunction &MF) {
TII = MF.getTarget().getInstrInfo();
MRI = &MF.getRegInfo();
MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+ PreRegAlloc = MRI->isSSA();
bool MadeChange = false;
while (TailDuplicateBlocks(MF))
@@ -823,7 +824,7 @@
SmallVector<MachineOperand, 4> PriorCond;
// This has to check PrevBB->succ_size() because EH edges are ignored by
// AnalyzeBranch.
- if (PrevBB->succ_size() == 1 &&
+ if (PrevBB->succ_size() == 1 &&
!TII->AnalyzeBranch(*PrevBB, PriorTBB, PriorFBB, PriorCond, true) &&
PriorCond.empty() && !PriorTBB && TailBB->pred_size() == 1 &&
!TailBB->hasAddressTaken()) {
Modified: llvm/trunk/lib/Target/PTX/PTXTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXTargetMachine.cpp?rev=150091&r1=150090&r2=150091&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PTX/PTXTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PTX/PTXTargetMachine.cpp Wed Feb 8 15:22:30 2012
@@ -284,7 +284,7 @@
// Pre-ra tail duplication.
if (getOptLevel() != CodeGenOpt::None) {
- PM.add(createTailDuplicatePass(true));
+ PM.add(createTailDuplicatePass());
printAndVerify("After Pre-RegAlloc TailDuplicate");
}
@@ -365,7 +365,7 @@
// Tail duplication.
if (getOptLevel() != CodeGenOpt::None) {
- PM.add(createTailDuplicatePass(false));
+ PM.add(createTailDuplicatePass());
printNoVerify("After TailDuplicate");
}
More information about the llvm-commits
mailing list