diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-09-18 22:35:49 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-09-18 22:35:49 +0000 |
commit | 5d034499ad2b0cd99833dd66e9359bf17088fa11 (patch) | |
tree | c7c7349c462240747f9fcdd168666acfcc8464c5 /llvm/lib/Transforms/Scalar/TailDuplication.cpp | |
parent | 3d8f8625967ac153e80ff100ac88a3393631df24 (diff) | |
download | bcm5719-llvm-5d034499ad2b0cd99833dd66e9359bf17088fa11.tar.gz bcm5719-llvm-5d034499ad2b0cd99833dd66e9359bf17088fa11.zip |
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
Reviewed by Dan Gohman.
llvm-svn: 82300
Diffstat (limited to 'llvm/lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/TailDuplication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp index 4bad7081166..8345175e137 100644 --- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp +++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp @@ -28,6 +28,7 @@ #include "llvm/Type.h" #include "llvm/Support/CFG.h" #include "llvm/Analysis/ConstantFolding.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" @@ -129,7 +130,7 @@ bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI, if (isa<CallInst>(I) || isa<InvokeInst>(I)) return false; // Allso alloca and malloc. - if (isa<AllocationInst>(I)) return false; + if (isa<AllocationInst>(I) || isMalloc(I)) return false; // Some vector instructions can expand into a number of instructions. if (isa<ShuffleVectorInst>(I) || isa<ExtractElementInst>(I) || |