[all-commits] [llvm/llvm-project] 188582: [RISCV] Considering existing offset in the alignme...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Jul 1 11:19:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 188582b7e0f357bb9b137b995f773d114472a9c4
      https://github.com/llvm/llvm-project/commit/188582b7e0f357bb9b137b995f773d114472a9c4
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-07-01 (Fri, 01 Jul 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

  Log Message:
  -----------
  [RISCV] Considering existing offset in the alignment when folding ADDIs into load/store.

getPointerAlignment and ConstantPoolSDNode::getAlign only consider
the alignment of the object. If we already have a non-zero offset
into the offset that may have reduced the alignment.

Since the base pointer will become an LUI with the old offset, we
need to be sure the new offset fits in the alignment of the address
that will be used to create the LUI immediate.

I'm not sure it is possible to have a non-zero offset in the
GlobalAddressSDNode or ConstantPoolSDNode at this point today so this
may only be a theoretical bug.

Differential Revision: https://reviews.llvm.org/D129006




More information about the All-commits mailing list