[PATCH] D153502: [DAGCombiner] Change foldAndOrOfSETCC() to optimize and/or patterns

Konstantina Mitropoulou via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 13:30:33 PDT 2023


kmitropoulou added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6081
+      TLI.isOperationLegal(ISD::SMAX, OpVT) &&
+      TargetPreference == AndOrSETCCFoldKind::None &&
+      AreSameCMPsAndHaveCommonOperand(LHS, RHS)) {
----------------
foad wrote:
> It seems wrong to check TargetPreference here. TargetPreference currently only controls the desired combine behaviour for a combination of eq or ne comparisons. Your new combine does not overlap with this, since it only works for non-eq/ne comparisons. So why would you only do it if the target does *not* want to combine eq/ne comparisons?
Thank you :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153502



More information about the llvm-commits mailing list