[PATCH] D143283: [AArch64][SVE]: custom lower AVGFloor/AVGCeil.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 04:52:27 PST 2023


sdesmalen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1034
+
+  if ((ExtOpA.getOpcode() == ISD::ZERO_EXTEND ||
+       ExtOpA.getOpcode() == ISD::SIGN_EXTEND) &&
----------------
hassnaa-arm wrote:
> sdesmalen wrote:
> > This is probably better added as a separate DAGCombine that folds away the sign-extend-in-regs explicitly, because that is already performed by the avgfloor operation.
> > 
> >   avgfloors(sextinreg(x), sextinreg(y)) -> avgfloors(x, y)
> Sorry, I don't understand this comment, may you clarify if more ?
> Why did you mention sign-extend-in-regs ? why is it related to this code ?
The truncate + sign-extend will be combined into a sign-extend-in-reg. You can see that if you disable the code you added below on lines 1046-1055, and run the test `@hadd8_sext_asr`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143283



More information about the llvm-commits mailing list