[PATCH] D138424: [TargetLowering][AArch64] Teach DemandedBits about VSCALE and SVE CNTx

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 22:29:09 PST 2022


dmgreen added a comment.

This may be better as two separate patches, one for the vscale and one for the cnt's



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1140
+      return false;
+    int64_t VScaleResultUpperbound = *MaxVScale;
+    if (auto *MulImm = dyn_cast<ConstantSDNode>(Op.getOperand(0))) {
----------------
Could this just use construct known bits of both sides and use KnownBits::mul? It might be able to get value out of the low bits then too.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1147
+    bool Negative = false;
+    if ((Negative = VScaleResultUpperbound < 0))
+      VScaleResultUpperbound = -VScaleResultUpperbound;
----------------
The `Negative =` needn't be part of the if.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138424



More information about the llvm-commits mailing list