Skip to content
Snippets Groups Projects
Commit 17895702 authored by Chris Lattner's avatar Chris Lattner
Browse files

Wrap code at 80 columns

llvm-svn: 9073
parent f0bf7cb7
No related branches found
No related tags found
No related merge requests found
...@@ -38,12 +38,14 @@ ...@@ -38,12 +38,14 @@
#include <algorithm> #include <algorithm>
namespace { namespace {
cl::opt<bool> DisablePromotion("disable-licm-promotion", cl::Hidden, cl::opt<bool>
cl::desc("Disable memory promotion in LICM pass")); DisablePromotion("disable-licm-promotion", cl::Hidden,
cl::desc("Disable memory promotion in LICM pass"));
Statistic<> NumHoisted("licm", "Number of instructions hoisted out of loop"); Statistic<> NumHoisted("licm", "Number of instructions hoisted out of loop");
Statistic<> NumHoistedLoads("licm", "Number of load insts hoisted"); Statistic<> NumHoistedLoads("licm", "Number of load insts hoisted");
Statistic<> NumPromoted("licm", "Number of memory locations promoted to registers"); Statistic<> NumPromoted("licm",
"Number of memory locations promoted to registers");
struct LICM : public FunctionPass, public InstVisitor<LICM> { struct LICM : public FunctionPass, public InstVisitor<LICM> {
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
...@@ -98,8 +100,9 @@ namespace { ...@@ -98,8 +100,9 @@ namespace {
/// ///
void hoist(Instruction &I); void hoist(Instruction &I);
/// SafeToHoist - Only hoist an instruction if it is not a trapping instruction /// SafeToHoist - Only hoist an instruction if it is not a trapping
/// or if it is a trapping instruction and is guaranteed to execute /// instruction or if it is a trapping instruction and is guaranteed to
/// execute.
/// ///
bool SafeToHoist(Instruction &I); bool SafeToHoist(Instruction &I);
...@@ -140,7 +143,8 @@ namespace { ...@@ -140,7 +143,8 @@ namespace {
/// ///
friend class InstVisitor<LICM>; friend class InstVisitor<LICM>;
void visitBinaryOperator(Instruction &I) { void visitBinaryOperator(Instruction &I) {
if (isLoopInvariant(I.getOperand(0)) && isLoopInvariant(I.getOperand(1)) && SafeToHoist(I)) if (isLoopInvariant(I.getOperand(0)) &&
isLoopInvariant(I.getOperand(1)) && SafeToHoist(I))
hoist(I); hoist(I);
} }
void visitCastInst(CastInst &CI) { void visitCastInst(CastInst &CI) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment