projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify assertion in XCoreInstPrinter.
[oota-llvm.git]
/
lib
/
CodeGen
/
CodePlacementOpt.cpp
diff --git
a/lib/CodeGen/CodePlacementOpt.cpp
b/lib/CodeGen/CodePlacementOpt.cpp
index 91a9536e7757c250634194021496e691f4937fb5..4486cc10b9c89f6f4bebabbfb6d9ad4aa5ceb282 100644
(file)
--- a/
lib/CodeGen/CodePlacementOpt.cpp
+++ b/
lib/CodeGen/CodePlacementOpt.cpp
@@
-7,21
+7,21
@@
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
-// This file implements the pass that optimize
code placement and align
loop
-// headers to target
specific alignment boundary
.
+// This file implements the pass that optimize
s code placement and aligns
loop
+// headers to target
-specific alignment boundaries
.
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "code-placement"
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "code-placement"
-#include "llvm/CodeGen/MachineLoopInfo.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/Passes.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineLoopInfo.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
using namespace llvm;
STATISTIC(NumLoopsAligned, "Number of loops aligned");
using namespace llvm;
STATISTIC(NumLoopsAligned, "Number of loops aligned");
@@
-39,9
+39,6
@@
namespace {
CodePlacementOpt() : MachineFunctionPass(ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
CodePlacementOpt() : MachineFunctionPass(ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
- virtual const char *getPassName() const {
- return "Code Placement Optimizater";
- }
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<MachineLoopInfo>();
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<MachineLoopInfo>();
@@
-69,9
+66,9
@@
namespace {
char CodePlacementOpt::ID = 0;
} // end anonymous namespace
char CodePlacementOpt::ID = 0;
} // end anonymous namespace
-FunctionPass *llvm::createCodePlacementOptPass() {
- return new CodePlacementOpt();
-}
+char &llvm::CodePlacementOptID = CodePlacementOpt::ID;
+INITIALIZE_PASS(CodePlacementOpt, "code-placement",
+ "Code Placement Optimizer", false, false)
/// HasFallthrough - Test whether the given branch has a fallthrough, either as
/// a plain fallthrough or as a fallthrough case of a conditional branch.
/// HasFallthrough - Test whether the given branch has a fallthrough, either as
/// a plain fallthrough or as a fallthrough case of a conditional branch.
@@
-204,7
+201,7
@@
bool CodePlacementOpt::EliminateUnconditionalJumpsToTop(MachineFunction &MF,
// fallthrough edge.
if (!Prior->isSuccessor(End))
goto next_pred;
// fallthrough edge.
if (!Prior->isSuccessor(End))
goto next_pred;
- // Otherwise we can stop scanning and proce
de
to move the blocks.
+ // Otherwise we can stop scanning and proce
ed
to move the blocks.
break;
}
// If we hit a switch or something complicated, don't move anything
break;
}
// If we hit a switch or something complicated, don't move anything
@@
-254,7
+251,7
@@
bool CodePlacementOpt::MoveDiscontiguousLoopBlocks(MachineFunction &MF,
// Determine a position to move orphaned loop blocks to. If TopMBB is not
// entered via fallthrough and BotMBB is exited via fallthrough, prepend them
// Determine a position to move orphaned loop blocks to. If TopMBB is not
// entered via fallthrough and BotMBB is exited via fallthrough, prepend them
- // to the top of the loop to avoid lo
o
sing that fallthrough. Otherwise append
+ // to the top of the loop to avoid losing that fallthrough. Otherwise append
// them to the bottom, even if it previously had a fallthrough, on the theory
// that it's worth an extra branch to keep the loop contiguous.
MachineFunction::iterator InsertPt =
// them to the bottom, even if it previously had a fallthrough, on the theory
// that it's worth an extra branch to keep the loop contiguous.
MachineFunction::iterator InsertPt =
@@
-376,7
+373,7
@@
bool CodePlacementOpt::OptimizeIntraLoopEdges(MachineFunction &MF) {
///
bool CodePlacementOpt::AlignLoops(MachineFunction &MF) {
const Function *F = MF.getFunction();
///
bool CodePlacementOpt::AlignLoops(MachineFunction &MF) {
const Function *F = MF.getFunction();
- if (F->
hasFnAttr(Attribute
::OptimizeForSize))
+ if (F->
getFnAttributes().hasAttribute(Attributes
::OptimizeForSize))
return false;
unsigned Align = TLI->getPrefLoopAlignment();
return false;
unsigned Align = TLI->getPrefLoopAlignment();