[llvm] [X86] Sink NOT to be fold into ANDN (PR #172329)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 17 04:53:41 PST 2025


================
@@ -7198,6 +7198,28 @@ bool X86TTIImpl::isProfitableToSinkOperands(Instruction *I,
                                             SmallVectorImpl<Use *> &Ops) const {
   using namespace llvm::PatternMatch;
 
+  if (I->getOpcode() == Instruction::And &&
+      (ST->hasBMI() || (I->getType()->isVectorTy() && ST->hasSSE2()))) {
+    for (auto &Op : I->operands()) {
----------------
RKSimon wrote:

Feasible to add a `PatternMatch::m_Use(Use *&U)` matcher?

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


More information about the llvm-commits mailing list