[PATCH] D95422: [RISCV] Copy isUnneededShiftMask from X86.

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 06:31:16 PST 2021


luismarques added a comment.

This looks good but it would be nice to have targeted regression tests.



================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:738-739
+bool RISCVDAGToDAGISel::isUnneededShiftMask(SDNode *N, unsigned Width) const {
+  assert(N->getOpcode() == ISD::AND && "Unexpected opcode");
+  const APInt &Val = N->getConstantOperandAPInt(1);
+
----------------
Maybe add an assertion that operand 1 has the appropriate type?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95422



More information about the llvm-commits mailing list