[llvm] [NVPTX] Attempt to load params using symbol addition node directly (PR #119935)
Kevin McAfee via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 8 14:54:26 PST 2025
================
@@ -2473,17 +2473,27 @@ bool NVPTXDAGToDAGISel::SelectDirectAddr(SDValue N, SDValue &Address) {
}
// symbol+offset
-bool NVPTXDAGToDAGISel::SelectADDRsi_imp(
- SDNode *OpNode, SDValue Addr, SDValue &Base, SDValue &Offset, MVT mvt) {
- if (Addr.getOpcode() == ISD::ADD) {
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
- SDValue base = Addr.getOperand(0);
- if (SelectDirectAddr(base, Base)) {
- Offset = CurDAG->getTargetConstant(CN->getZExtValue(), SDLoc(OpNode),
- mvt);
- return true;
+bool NVPTXDAGToDAGISel::SelectADDRsi_imp(SDNode *OpNode, SDValue Addr,
+ SDValue &Base, SDValue &Offset,
+ MVT mvt) {
+ std::function<std::optional<uint64_t>(SDValue, uint64_t)>
+ FindRootAddressAndTotalOffset =
+ [&](SDValue Addr,
+ uint64_t AccumulatedOffset) -> std::optional<uint64_t> {
----------------
kalxr wrote:
I wish, but `error: variable 'FindRootAddressAndTotalOffset' declared with deduced type 'auto' cannot appear in its own initializer` suggests otherwise :(
https://github.com/llvm/llvm-project/pull/119935
More information about the llvm-commits
mailing list