summarylogtreecommitdiffstats
path: root/no-memset-creation-with-addrspace.diff
diff options
context:
space:
mode:
authorJiachen Yang2015-06-13 23:06:23 +0900
committerJiachen Yang2015-06-13 23:06:23 +0900
commitc106a40e0e6f2fcc2abff925d937c3f4084d1c2f (patch)
tree56edb3ad368dc5591ebb1ace2b3d648905c5d621 /no-memset-creation-with-addrspace.diff
downloadaur-c106a40e0e6f2fcc2abff925d937c3f4084d1c2f.tar.gz
init llvm-pypy-stm
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 00000000000..c7442785f4e
--- /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