Author: Armin Rigo <ar...@tunes.org> Branch: c7-refactor Changeset: r777:b5c61f587a33 Date: 2014-02-19 09:44 +0100 http://bitbucket.org/pypy/stmgc/changeset/b5c61f587a33/
Log: Add an LLVM patch. It might not be needed on simple examples, but I fear that it will be needed to compile large programs. diff --git a/c7/llvmfix/no-memset-creation-with-addrspace.diff b/c7/llvmfix/no-memset-creation-with-addrspace.diff new file mode 100644 --- /dev/null +++ b/c7/llvmfix/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 diff --git a/c7/stm/core.h b/c7/stm/core.h --- a/c7/stm/core.h +++ b/c7/stm/core.h @@ -123,6 +123,8 @@ static inline void _duck(void) { /* put a call to _duck() between two instructions that set 0 into a %gs-prefixed address and that may otherwise be replaced with - llvm.memset --- it fails later because of the prefix... */ + llvm.memset --- it fails later because of the prefix... + This is not needed any more after applying the patch + llvmfix/no-memset-creation-with-addrspace.diff. */ asm("/* workaround for llvm bug */"); } _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit