[PATCH] D131117: [X86] Teach PostprocessISelDAG to fold ANDrm+TESTrr when chain result is used.

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 19:25:32 PDT 2022


LuoYuanke added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1490
         N->getOperand(0) == N->getOperand(1) &&
-        N->isOnlyUserOf(N->getOperand(0).getNode()) &&
+        N->getOperand(0)->hasNUsesOfValue(2, N->getOperand(0).getResNo()) &&
         N->getOperand(0).isMachineOpcode()) {
----------------
`AND32rm` has 3 output. This check 1st output, should we also check 2nd output (EFLAGS) and only leave the 3rd (chain) output be used freely?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131117



More information about the llvm-commits mailing list