summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDaniel Neilson <dneilson@azul.com>2018-01-30 14:43:41 +0000
committerDaniel Neilson <dneilson@azul.com>2018-01-30 14:43:41 +0000
commit594f443b06728e6236e2a7db157f5b300e386d23 (patch)
tree15eeb12535b2b84331a059c1e2d4ed6957c1ba4d /llvm/lib/Transforms
parent26fa1f2be3eb931ee7aeab231fe048e7a7782089 (diff)
downloadbcm5719-llvm-594f443b06728e6236e2a7db157f5b300e386d23.tar.gz
bcm5719-llvm-594f443b06728e6236e2a7db157f5b300e386d23.zip
[RS4GC] Handle call/invoke instructions as base defining values of vectors
Summary: There's an asymmetry in the definitions of findBaseDefiningValueOfVector() and findBaseDefiningValue() of RS4GC. The later handles call and invoke instructions, and the former does not. This appears to be simple oversight. This patch remedies the oversight by adding the call and invoke cases to findBaseDefiningValueOfVector(). Reviewers: DaniilSuchkov, anna Reviewed By: anna Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42653 llvm-svn: 323764
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index c7acdef2713..99073ae527b 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -476,6 +476,12 @@ findBaseDefiningValueOfVector(Value *I) {
if (auto *BC = dyn_cast<BitCastInst>(I))
return findBaseDefiningValue(BC->getOperand(0));
+ // We assume that functions in the source language only return base
+ // pointers. This should probably be generalized via attributes to support
+ // both source language and internal functions.
+ if (isa<CallInst>(I) || isa<InvokeInst>(I))
+ return BaseDefiningValueResult(I, true);
+
// 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)) &&
OpenPOWER on IntegriCloud