We used to dyn_cast<Constant> in the recursive call, but cast<> in the
initial one, and there can be non-Constant initial users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233346
91177308-0d34-0410-b5e6-
96231b3b80d8
// To be a got equivalent, at least one of its users need to be a constant
// expression used by another global variable.
for (auto *U : GV->users())
- NumGOTEquivUsers += getNumGlobalVariableUses(cast<Constant>(U));
+ NumGOTEquivUsers += getNumGlobalVariableUses(dyn_cast<Constant>(U));
return NumGOTEquivUsers > 0;
}
to i32), %a
ret i32 %x
}
+
+; Also test direct instruction uses.
+define i32** @t1() {
+ ret i32** @bargotequiv
+}