summarylogtreecommitdiffstats
path: root/no-memset-creation-with-addrspace.diff
blob: c7442785f4ea8d5ca867751ad403744d46bd8d2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Index: lib/Transforms/Scalar/MemCpyOptimizer.cpp
===================================================================
--- lib/Transforms/Scalar/MemCpyOptimizer.cpp	(revision 201645)
+++ lib/Transforms/Scalar/MemCpyOptimizer.cpp	(working copy)
@@ -368,6 +368,11 @@
                                              Value *StartPtr, Value *ByteVal) {
   if (TD == 0) return 0;
 
+  // We have to check for address space < 256, since llvm.memset only supports
+  // user defined address spaces.
+  if (cast<PointerType>(StartPtr->getType())->getAddressSpace() >= 256)
+    return 0;
+
   // Okay, so we now have a single store that can be splatable.  Scan to find
   // all subsequent stores of the same value to offset from the same pointer.
   // Join these together into ranges, so we can decide whether contiguous blocks