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:
8360174
)
[LCSSA] Skip updating users in unreachable blocks.
author
Florian Hahn
<flo@fhahn.com>
Fri, 26 Aug 2022 14:09:46 +0000
(15:09 +0100)
committer
Florian Hahn
<flo@fhahn.com>
Fri, 26 Aug 2022 14:09:46 +0000
(15:09 +0100)
Don't waste time trying to update users in unreachable blocks.
llvm/lib/Transforms/Utils/LCSSA.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Utils/LCSSA.cpp
b/llvm/lib/Transforms/Utils/LCSSA.cpp
index
6de59f9
..
020a40b
100644
(file)
--- a/
llvm/lib/Transforms/Utils/LCSSA.cpp
+++ b/
llvm/lib/Transforms/Utils/LCSSA.cpp
@@
-111,6
+111,10
@@
bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
Instruction *User = cast<Instruction>(U.getUser());
BasicBlock *UserBB = User->getParent();
+ // Skip uses in unreachable blocks.
+ if (!DT.isReachableFromEntry(UserBB))
+ continue;
+
// For practical purposes, we consider that the use in a PHI
// occurs in the respective predecessor block. For more info,
// see the `phi` doc in LangRef and the LCSSA doc.