-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[IR] Convert check to assertion in PredIterator (NFC) #137931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
After llvm#137799 and llvm#137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it.
@llvm/pr-subscribers-llvm-ir Author: Nikita Popov (nikic) ChangesAfter #137799 and #137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it. This is a small compile-time improvement: https://llvm-compile-time-tracker.com/compare.php?from=a618ae2c729152133440315f7b2f23e4612b39f8&to=5a60dadb74fa0c5f68642a184ed3d592c185c421&stat=instructions:u Full diff: https://github.com/llvm/llvm-project/pull/137931.diff 1 Files Affected:
diff --git a/llvm/include/llvm/IR/CFG.h b/llvm/include/llvm/IR/CFG.h
index f8ec0971517a9..7c7e988fa9e8f 100644
--- a/llvm/include/llvm/IR/CFG.h
+++ b/llvm/include/llvm/IR/CFG.h
@@ -54,9 +54,10 @@ class PredIterator {
inline void advancePastNonTerminators() {
// Loop to ignore non-terminator uses (for example BlockAddresses).
while (!It.atEnd()) {
- if (auto *Inst = dyn_cast<Instruction>(*It))
- if (Inst->isTerminator())
- break;
+ if (auto *Inst = dyn_cast<Instruction>(*It)) {
+ assert(Inst->isTerminator() && "BasicBlock used in non-terminator");
+ break;
+ }
++It;
}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/19255 Here is the relevant piece of the build log for the reference
|
After llvm#137799 and llvm#137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it.
After llvm#137799 and llvm#137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it.
After llvm#137799 and llvm#137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it.
After llvm#137799 and llvm#137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it.
After #137799 and #137816, instruction uses of BasicBlocks are always terminators, so assert that instead of checking it.
This is a small compile-time improvement: https://llvm-compile-time-tracker.com/compare.php?from=a618ae2c729152133440315f7b2f23e4612b39f8&to=5a60dadb74fa0c5f68642a184ed3d592c185c421&stat=instructions:u