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()) {
|
||||
Use *U = Worklist.pop_back_val();
|
||||
User *V = U->getUser();
|
||||
if (isa<BitCastOperator>(V) || isa<AddrSpaceCastOperator>(V)) {
|
||||
AppendUses(V);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto *GEP = dyn_cast<GEPOperator>(V)) {
|
||||
if (!GEP->hasAllConstantIndices())
|
||||
return false;
|
||||
auto *GEP = dyn_cast<GEPOperator>(V);
|
||||
if (isa<BitCastOperator>(V) || isa<AddrSpaceCastOperator>(V) ||
|
||||
(GEP && GEP->hasAllConstantIndices())) {
|
||||
AppendUses(V);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue