[PATCH] D128738: [RISCV] Match RISCVISD::ADD_LO in SelectAddrRegImm.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 10:56:33 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2282
-    // Ditto.
-    Align Alignment = CP->getAlign();
-    if (Offset2 != 0 && Alignment <= Offset2)
----------------
reames wrote:
> This seems like we should be able to write a test for this.
> 
> Maybe a large constant which is used twice - once in full, and then the second using only some upper bits?
> 
> If you don't mind, I'd prefer to have the deletion of untested code done in a separate change than the move of the global handling.  Just for clarity of revert attribution if needed.
I'm not sure we share constant pools like that. When a constant pool is created in SelectionDAG, the offset is provided by the caller. It's not calculated based on there being some other constant pool entry with the same bit pattern in upper bits.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128738



More information about the llvm-commits mailing list