[PATCH] D157603: [RISCV] zextOrTrunc constants to EleSize when combine store of BUILD_VECTOR

Wang Pengcheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 22:18:29 PDT 2023


wangpc added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:13486
           continue;
-        NewC.insertBits(Val.getConstantOperandAPInt(i),
-                        i * Val.getScalarValueSizeInBits());
+        NewC.insertBits(Val.getConstantOperandAPInt(i).zextOrTrunc(EleSize),
+                        i * EleSize);
----------------
craig.topper wrote:
> Why does it need to be `zextOrTrunc`? Can it just be `trunc`? It never need to be extended right?
Actually I don't know, here is just defensive programming.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157603



More information about the llvm-commits mailing list