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

Nitin John Raj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 10:42:17 PDT 2023


nitinjohnraj marked 2 inline comments as done.
nitinjohnraj 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;
----------------
craig.topper wrote:
> 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.
I think you're right. 


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