summarylogtreecommitdiffstats
path: root/no-memset-creation-with-addrspace.diff
diff options
context:
space:
mode:
Diffstat (limited to 'no-memset-creation-with-addrspace.diff')
-rw-r--r--no-memset-creation-with-addrspace.diff16
1 files changed, 16 insertions, 0 deletions
diff --git a/no-memset-creation-with-addrspace.diff b/no-memset-creation-with-addrspace.diff
new file mode 100644
index 000000000000..c7442785f4ea
--- /dev/null
+++ b/no-memset-creation-with-addrspace.diff
@@ -0,0 +1,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