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

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 18 03:17:20 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()) {
----------------
pfusik wrote:

Would that be more readable? Faster?

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


More information about the llvm-commits mailing list