[PATCH] D79690: [RISCV] Fold ADDIs into load/stores with nonzero offsets

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 10:15:43 PDT 2020


luismarques marked an inline comment as done.
luismarques added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:231
+      // Check if off2 falls within that margin; if so off1+off2 can't overflow.
+      unsigned Alignment = GA->getGlobal()->getAlignment();
+      if (Offset2 != 0 && Offset2 >= Alignment)
----------------
efriedma wrote:
> FYI, D80368 removes GlobalValue::getAlignment().  Value::getPointerAlignment() is the suggested replacement.
Thanks for the heads-up. I guess in this case we want `GlobalObject::getAlignment()`? If I understand correctly, that's the one that gives the alignment of the variable itself, which is what we need to rely upon to obtain the margin of safety before the 12-bit immediate overflow can occur.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79690





More information about the llvm-commits mailing list