[PATCH] D86260: [CodeGen] Postprocess PHI nodes for callbr
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 29 15:35:43 PDT 2020
jyknight added inline comments.
Herald added a subscriber: danielkiss.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:10075
+
+ if (CI) {
+ if (Preprocess) {
----------------
This seems a bit confusing.
I think it would probably be clearer to make the body of this loop into a separate function which handles a single successor BasicBlock. Call that function directly on the default successor from visitCallBr, and move the loop over successors with the callbr default-successor-exclusion into visit().
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:10150
ConstantsOut.clear();
}
----------------
This is problematical if we're calling this function multiple times now. A constant will be emitted redundantly, if it's present both in indirect and default successor phi branches. Oddly enough, this is a member variable instead of a local, even though it's only used in this function. I think you can just move this call to clear() to the end of visit(), and that solves the problem.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86260/new/
https://reviews.llvm.org/D86260
More information about the llvm-commits
mailing list