diff options
author | Philip Reames <listmail@philipreames.com> | 2019-02-19 23:19:51 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-02-19 23:19:51 +0000 |
commit | 322eb7660ed5447dba8529deeb0366b5aa2d6ca1 (patch) | |
tree | a2e3cec37888040827f3ec9b179af66dfb8e8970 /llvm/lib/Transforms/Utils/VNCoercion.cpp | |
parent | ee04d4d840374028e8f791738c652ea353a39d45 (diff) | |
download | bcm5719-llvm-322eb7660ed5447dba8529deeb0366b5aa2d6ca1.tar.gz bcm5719-llvm-322eb7660ed5447dba8529deeb0366b5aa2d6ca1.zip |
[GVN] Fix a non-integral pointer bug w/vector types
GVN generally doesn't forward structs or array types, but it *will* forward vector types to non-vectors and vice versa. As demonstrated in tests, we need to inhibit the same set of transforms for vector of non-integral pointers as for non-integral pointers themselves.
llvm-svn: 354401
Diffstat (limited to 'llvm/lib/Transforms/Utils/VNCoercion.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/VNCoercion.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/VNCoercion.cpp b/llvm/lib/Transforms/Utils/VNCoercion.cpp index 74572eb2d46..8e21472f2c1 100644 --- a/llvm/lib/Transforms/Utils/VNCoercion.cpp +++ b/llvm/lib/Transforms/Utils/VNCoercion.cpp @@ -31,8 +31,8 @@ bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy, return false; // Don't coerce non-integral pointers to integers or vice versa. - if (DL.isNonIntegralPointerType(StoredVal->getType()) != - DL.isNonIntegralPointerType(LoadTy)) { + if (DL.isNonIntegralPointerType(StoredVal->getType()->getScalarType()) != + DL.isNonIntegralPointerType(LoadTy->getScalarType())) { // As a special case, allow coercion of memset used to initialize // an array w/null. Despite non-integral pointers not generally having a // specific bit pattern, we do assume null is zero. |