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:
0851970
)
[ValueTracking] Replace dyn_cast with dyn_cast_or_null to account for getTerminator...
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 8 Feb 2022 13:29:49 +0000
(13:29 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Tue, 8 Feb 2022 13:33:26 +0000
(13:33 +0000)
Noticed while running checks on D117995 - a hexagon regression test was managing to return a block without a terminator
llvm/lib/Analysis/ValueTracking.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Analysis/ValueTracking.cpp
b/llvm/lib/Analysis/ValueTracking.cpp
index
c14bdb8
..
a93430c
100644
(file)
--- a/
llvm/lib/Analysis/ValueTracking.cpp
+++ b/
llvm/lib/Analysis/ValueTracking.cpp
@@
-5125,10
+5125,10
@@
static bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
auto *TI = Dominator->getBlock()->getTerminator();
Value *Cond = nullptr;
- if (auto BI = dyn_cast<BranchInst>(TI)) {
+ if (auto BI = dyn_cast
_or_null
<BranchInst>(TI)) {
if (BI->isConditional())
Cond = BI->getCondition();
- } else if (auto SI = dyn_cast<SwitchInst>(TI)) {
+ } else if (auto SI = dyn_cast
_or_null
<SwitchInst>(TI)) {
Cond = SI->getCondition();
}