aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-24 05:28:38 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-24 05:28:38 +0000
commite856f8e9a8d7e55f68162038b80c2d9d603fa7dc (patch)
treeed2f6fd80d03a005b5e5930ade6fce659fdf024d /lib
parent394f6bcb45d25f2685dc2b54b0b211c0b35e2737 (diff)
downloadexternal_llvm-e856f8e9a8d7e55f68162038b80c2d9d603fa7dc.zip
external_llvm-e856f8e9a8d7e55f68162038b80c2d9d603fa7dc.tar.gz
external_llvm-e856f8e9a8d7e55f68162038b80c2d9d603fa7dc.tar.bz2
Temporarily disabling memset forming optimization. Add an option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48720 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index a3a3323..a9445dd 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -32,6 +32,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Target/TargetData.h"
@@ -41,6 +42,12 @@ STATISTIC(NumGVNInstr, "Number of instructions deleted");
STATISTIC(NumGVNLoad, "Number of loads deleted");
STATISTIC(NumMemSetInfer, "Number of memsets inferred");
+namespace {
+ cl::opt<bool>
+ FormMemSet("form-memset-from-stores",
+ cl::desc("Transform straight-line stores to memsets"),
+ cl::init(false), cl::Hidden);
+}
//===----------------------------------------------------------------------===//
// ValueTable Class
@@ -1102,6 +1109,7 @@ static bool IsPointerAtOffset(Value *Ptr1, Value *Ptr2, uint64_t Offset,
/// neighboring locations of memory. If it sees enough consequtive ones
/// (currently 4) it attempts to merge them together into a memcpy/memset.
bool GVN::processStore(StoreInst *SI, SmallVectorImpl<Instruction*> &toErase) {
+ if (!FormMemSet) return false;
if (SI->isVolatile()) return false;
// There are two cases that are interesting for this code to handle: memcpy