forked from OSchip/llvm-project
[GlobalOpt] Avoid early exit before dead constant check
In a similar vein to 236fbf571d
,
make sure we don't early-exit before the dead constant check.
This commit is contained in:
parent
f52927c122
commit
1652c3b80c
|
@ -352,14 +352,10 @@ static bool collectSRATypes(DenseMap<uint64_t, Type *> &Types, GlobalValue *GV,
|
||||||
while (!Worklist.empty()) {
|
while (!Worklist.empty()) {
|
||||||
Use *U = Worklist.pop_back_val();
|
Use *U = Worklist.pop_back_val();
|
||||||
User *V = U->getUser();
|
User *V = U->getUser();
|
||||||
if (isa<BitCastOperator>(V) || isa<AddrSpaceCastOperator>(V)) {
|
|
||||||
AppendUses(V);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto *GEP = dyn_cast<GEPOperator>(V)) {
|
auto *GEP = dyn_cast<GEPOperator>(V);
|
||||||
if (!GEP->hasAllConstantIndices())
|
if (isa<BitCastOperator>(V) || isa<AddrSpaceCastOperator>(V) ||
|
||||||
return false;
|
(GEP && GEP->hasAllConstantIndices())) {
|
||||||
AppendUses(V);
|
AppendUses(V);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue