[PATCH] D156383: [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions for narrow types

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 15:59:52 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp:38
+    // make sure it's a power of 2.
+    if (DstSize < 8 || DstSize >= 2 * XLen || !isPowerOf2_32(DstSize))
+      return false;
----------------
Shouldn't that be `DstSize > Xlen` not `DstSize >= 2 * XLen`? Thought it won't make a difference since anything between XLen and XLen*2 isn't a power of 2 so the `!isPowerOf2_32(DstSize)` will reject it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156383



More information about the llvm-commits mailing list