diff options
author | James Molloy <james.molloy@arm.com> | 2015-12-11 13:36:59 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2015-12-11 13:36:59 +0000 |
commit | 1bb6ea5e2d3a7ae89e48af43fb63574ea39c9b6d (patch) | |
tree | 18ebb304b5ef7af3687c8a318ea72cf19b815921 /llvm/lib/Transforms/Utils/Mem2Reg.cpp | |
parent | 027158fad7a335400d4b1bd08225316ecf971e0f (diff) | |
download | bcm5719-llvm-1bb6ea5e2d3a7ae89e48af43fb63574ea39c9b6d.tar.gz bcm5719-llvm-1bb6ea5e2d3a7ae89e48af43fb63574ea39c9b6d.zip |
[Mem2Reg] Respect optnone
Mem2Reg shouldn't be optimizing a function that is marked
optnone. There is a test checking this that fails when mem2reg is
explicitly added to the standard pass pipeline.
llvm-svn: 255336
Diffstat (limited to 'llvm/lib/Transforms/Utils/Mem2Reg.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Mem2Reg.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp index 00cf4e6c01c..aa1e35ddba0 100644 --- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp +++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp @@ -63,6 +63,9 @@ bool PromotePass::runOnFunction(Function &F) { 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(); |