[PATCH] D104921: [RISCV] Lower more BUILD_VECTOR sequences to RVV's VID

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 07:16:24 PDT 2021


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1416
+      // it's consistent across the entire sequence.
+      int64_t Diff = Val - PrevElt->first;
+      // The difference must cleanly divide the element span.
----------------
This may overflow here e.g. `0 - INT64_MIN`.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1434
+    if (SeqStep) {
+      int64_t Addend = Val - (Idx * *SeqStep);
+      if (!SeqAddend)
----------------
This may also overflow


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104921



More information about the llvm-commits mailing list