[PATCH] D127831: BasicBlockUtils: Add a new way for CreateControlFlowHub()

Brendon Cahoon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 30 09:24:49 PDT 2022


bcahoon added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:1807
+                         const BBSetVector &Outgoing, const StringRef Prefix,
+                         Optional<unsigned> MaxControlFlowBooleans) {
+  BBPredicates GuardPredicates;
----------------
sameerds wrote:
> This is  more curiosity than comment ... what is the advantage of using an Optional here? How does it compare to just using ~0 as the (maximum) default value?
My first instinct was to use ~0U since I'm used to that. But, then I ended up using Optional since it makes it explicit that the value may not be set and the code doesn't rely on a sentinel value. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127831/new/

https://reviews.llvm.org/D127831



More information about the llvm-commits mailing list