[llvm] [SelectOpt] Add handling for Select-like operations. (PR #77284)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 06:56:12 PST 2024


================
@@ -378,6 +378,15 @@ class TargetTransformInfoImplBase {
 
   bool enableSelectOptimize() const { return true; }
 
+  bool shouldTreatInstructionLikeSelect(Instruction *I) {
----------------
davemgreen wrote:

The new select-like `or(zext(c), x)` is currently only enabled for AArch64. I haven't verified the performance on any other systems. The default is still currently just selects, minus the "logical-and/or" from https://reviews.llvm.org/D138490. I think that adding the option to disable the new or(zext) sounds like a good idea, I've added it for AArch64. Let me know if you thing this should add another option to enable it more generally in this function too.

https://github.com/llvm/llvm-project/pull/77284


More information about the llvm-commits mailing list