[PATCH] D120231: [SelectOpti][3/5] Base Heuristics

Bradley Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 08:01:35 PDT 2022


bsmith added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:179-181
+  // If even a predictable select is cheap, then a branch cannot be cheaper.
+  if (!TLI->isPredictableSelectExpensive())
+    return false;
----------------
Is this the correct thing to check for here?

Even if a select is cheap, the true/false values feeding it may not be, and given the later change you have that can sink these values when converted to a branch, this check may cause us to miss some cases where this pass is still useful. (Although perhaps changing this should be deferred to the patch that does the sinking).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120231



More information about the llvm-commits mailing list