summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/CalledValuePropagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/CalledValuePropagation.cpp')
-rw-r--r--lib/Transforms/IPO/CalledValuePropagation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/CalledValuePropagation.cpp b/lib/Transforms/IPO/CalledValuePropagation.cpp
index d642445b35de..de62cfc0c1db 100644
--- a/lib/Transforms/IPO/CalledValuePropagation.cpp
+++ b/lib/Transforms/IPO/CalledValuePropagation.cpp
@@ -345,6 +345,9 @@ private:
void visitInst(Instruction &I,
DenseMap<CVPLatticeKey, CVPLatticeVal> &ChangedValues,
SparseSolver<CVPLatticeKey, CVPLatticeVal> &SS) {
+ // Simply bail if this instruction has no user.
+ if (I.use_empty())
+ return;
auto RegI = CVPLatticeKey(&I, IPOGrouping::Register);
ChangedValues[RegI] = getOverdefinedVal();
}