Author: Armin Rigo <[email protected]>
Branch:
Changeset: r982:a58bb2fa06ad
Date: 2014-03-12 16:52 +0100
http://bitbucket.org/pypy/stmgc/changeset/a58bb2fa06ad/
Log: This patch to LLVM seems to get me farther.
diff --git a/c7/llvmfix/no-introduce-bogus-cast-in-combine.diff
b/c7/llvmfix/no-introduce-bogus-cast-in-combine.diff
new file mode 100644
--- /dev/null
+++ b/c7/llvmfix/no-introduce-bogus-cast-in-combine.diff
@@ -0,0 +1,22 @@
+Index: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+===================================================================
+--- lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (revision
199602)
++++ lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (working copy)
+@@ -295,6 +295,17 @@
+
+ Type *SrcPTy = SrcTy->getElementType();
+
++ // XXX note that we might end up with a bogus cast: if the original
++ // cast in 'load (cast P)' is between "foo addrspace1 **" and "foo
++ // addrspace2 **", then we cannot re-express the two operations as
++ // 'cast (load P)' because that would be casting a "foo addrspace1 *"
++ // to "foo addrspace2 *". While nothing is really wrong about that
++ // cast, llvm forbids it even in internally-generated operations.
++ if (SrcPTy->isPointerTy() && DestPTy->isPointerTy() &&
++ cast<PointerType>(DestPTy)->getAddressSpace() !=
++ cast<PointerType>(SrcPTy)->getAddressSpace())
++ return 0;
++
+ if (DestPTy->isIntegerTy() || DestPTy->isPointerTy() ||
+ DestPTy->isVectorTy()) {
+ // If the source is an array, the code below will not succeed. Check to
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit