summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Mem2Reg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/Mem2Reg.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Mem2Reg.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
index aa1e35ddba0..8b70cb80539 100644
--- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
@@ -59,13 +59,13 @@ INITIALIZE_PASS_END(PromotePass, "mem2reg", "Promote Memory to Register",
false, false)
bool PromotePass::runOnFunction(Function &F) {
+ if (skipFunction(F))
+ return false;
+
std::vector<AllocaInst*> Allocas;
BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
- if (F.hasFnAttribute(Attribute::OptimizeNone))
- return false;
-
bool Changed = false;
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
OpenPOWER on IntegriCloud