[llvm] [NVPTX] Attempt to load params using symbol addition node directly (PR #119935)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 8 14:39:00 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> {
----------------
Artem-B wrote:
No need for std::function here. Just use the lambda directly.
```
auto FindRootAddressAndTotalOffset = [&](SDValue Addr, uint64_t AccumulatedOffset) -> std::optional<uint64_t>
```
https://github.com/llvm/llvm-project/pull/119935
More information about the llvm-commits
mailing list