[llvm] [NVPTX] Attempt to load params using symbol addition node directly (PR #119935)

Justin Fargnoli via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 12:15:17 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) {
----------------
justinfargnoli wrote:

```suggestion
                                         MVT VT) {
```

https://github.com/llvm/llvm-project/pull/119935


More information about the llvm-commits mailing list