diff options
author | Daniel Neilson <dneilson@azul.com> | 2017-10-13 15:59:13 +0000 |
---|---|---|
committer | Daniel Neilson <dneilson@azul.com> | 2017-10-13 15:59:13 +0000 |
commit | fa14ebd138d81b4b988ce24a538bc64f06ee23ba (patch) | |
tree | 6f0a6232161fac33c57dca27706cef7cf967cbae /llvm/lib/Transforms | |
parent | 8ff311b54ad08a244dbd9b0b14c4f0701fb316d3 (diff) | |
download | bcm5719-llvm-fa14ebd138d81b4b988ce24a538bc64f06ee23ba.tar.gz bcm5719-llvm-fa14ebd138d81b4b988ce24a538bc64f06ee23ba.zip |
[RS4GC] Look through vector bitcasts when looking for base pointer
Summary:
In RS4GC it is possible that a base pointer is contained in a vector that
has undergone a bitcast from one element-pointertype to another. We teach
RS4GC how to look through bitcasts of vector types when looking for a base
pointer.
Reviewers: anna
Reviewed By: anna
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38849
llvm-svn: 315694
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 4b8ddb7cc24..1ca77cfec32 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -421,6 +421,11 @@ findBaseDefiningValueOfVector(Value *I) { if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) return findBaseDefiningValue(GEP->getPointerOperand()); + // If the pointer comes through a bitcast of a vector of pointers to + // a vector of another type of pointer, then look through the bitcast + if (auto *BC = dyn_cast<BitCastInst>(I)) + return findBaseDefiningValue(BC->getOperand(0)); + // A PHI or Select is a base defining value. The outer findBasePointer // algorithm is responsible for constructing a base value for this BDV. assert((isa<SelectInst>(I) || isa<PHINode>(I)) && |