[PATCH] D112754: X86: Fold masked merge pattern when and-not is not available

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 14:54:10 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:4621
+  /// `TargetLowering::PerformDAGCombing` callback on `ISD::OR` nodes.
+  SDValue foldMaskedMerge(SDNode *Node, SelectionDAG &DAG) const;
+
----------------
Based on the regressions you saw on other targets, do you have any thoughts on whether any other targets will be able to use this? Otherwise it might make sense to move this into X86ISelLowering.cpp until there's a need to make this generic.


================
Comment at: llvm/test/CodeGen/X86/fold-masked-merge.ll:8
+
+define i32 @masked_merge(i32 %a0, i32 %a1, i32 %a2) {
+; CHECK-LABEL: masked_merge:
----------------
Please can you add some i8/i16/i32/i64 test coverage (it might be a good idea to rename the tests to be more descriptive as well).

You probably need to add some negative tests as well? Mismatching not-ops for instance.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112754



More information about the llvm-commits mailing list