[PATCH] D129402: [RISCV] Teach shouldConvertConstantLoadToIntImm that constant materialization can use constant pools.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 15:51:24 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1169
+  unsigned BitSize = Ty->getIntegerBitWidth();
+  if (BitSize == 0 || BitSize > Subtarget.getXLen())
+    return false;
----------------
luismarques wrote:
> Why do we gate this for `BitSize == 0`? (I know other targets do the same)
That's a really good question. I don't think you can have a 0 sized IntegerType. Some other targets call getPrimitiveSizeInBits which can return 0, but they also assert `isIntegerTy`. I used getIntegerBitWidth because it avoids the switch in `getPrimitiveSizeInBits`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129402



More information about the llvm-commits mailing list