projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f52927c
)
[GlobalOpt] Avoid early exit before dead constant check
author
Nikita Popov
<npopov@redhat.com>
Tue, 1 Feb 2022 14:56:42 +0000
(15:56 +0100)
committer
Nikita Popov
<npopov@redhat.com>
Tue, 1 Feb 2022 14:57:19 +0000
(15:57 +0100)
In a similar vein to
236fbf571dc6cebcb81ac5187a170c8de6d5bc0e
,
make sure we don't early-exit before the dead constant check.
llvm/lib/Transforms/IPO/GlobalOpt.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index
d3cac3e
..
a29d4f6
100644
(file)
--- a/
llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/
llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@
-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;
}