[PATCH] D111571: [X86] `detectAVGPattern()`: support basic case of PAVG chaining (PR52131)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 12:08:41 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:46855
           return SDValue();
-        Operands[j] = Operands[j].getOperand(0);
+        Operands[j] = DAG.getNode(ISD::TRUNCATE, DL, VT, Operands[j]);
       }
----------------
Will this introduce a potentially costly truncate if the input is just an AND with the right mask and not another pavg pattern? Can you add a test for that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111571



More information about the llvm-commits mailing list