[PATCH] D157529: [NFC][GuardUtils] Add util to extract widenable conditions

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 12:29:01 PDT 2023


anna added inline comments.


================
Comment at: llvm/lib/Analysis/GuardUtils.cpp:133
     }
-    Callback(Check);
+    if (!Callback(Check))
+      break;
----------------
Can you pls rename `Callback` to `recordCheckOrWidenableCond` ?


================
Comment at: llvm/lib/Analysis/GuardUtils.cpp:162
+  parseCondition(Condition, [&](Value *Check) {
+    if (isWidenableCondition(Check) && Check->hasOneUse()) {
+      WidenableCondition = Check;
----------------
Why do you need the oneUse check here? the `extractWidenableCondition` API and following patches only talk about extracting widenable condition. Pls move this additional check to the patch where this context applies. 


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

https://reviews.llvm.org/D157529



More information about the llvm-commits mailing list