[PATCH] D108324: [RISCV] Reduce duplicate code for calling SimplifyDemandedBits.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 07:31:52 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5974
+  // Caller should return SDValue(N, 0) if this returns true.
+  auto SimplifyDemandedLowBitsHelper = [&](unsigned OpNo, unsigned LowBits) {
+    SDValue Op = N->getOperand(OpNo);
----------------
luismarques wrote:
> Nit: it's not really important, and to some extent a matter of style, but things like "Helper" aren't very semantically descriptive. IMO it's best to, when possible, say instead in what way it's helping, e.g. `SimplifyOpDemandedLowBits`.
I guess I was focusing on the work list management when I called it Helper. That made it different than just a version of SimplifyDemandedBits that takes a bit count instead of a mask.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108324



More information about the llvm-commits mailing list