[PATCH] D71205: [NFC] Add a SDValue overload for SelectionDAG::getMemBasePlusOffset()

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 13:46:39 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rGea8888d1af3a: [NFC] Add a SDValue overload for SelectionDAG::getMemBasePlusOffset() (authored by Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71205

Files:
  llvm/include/llvm/CodeGen/SelectionDAG.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5735,7 +5735,14 @@
 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Base, int64_t Offset,
                                            const SDLoc &DL) {
   EVT VT = Base.getValueType();
-  return getNode(ISD::ADD, DL, VT, Base, getConstant(Offset, DL, VT));
+  return getMemBasePlusOffset(Base, getConstant(Offset, DL, VT), DL);
+}
+
+SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
+                                           const SDLoc &DL) {
+  assert(Offset.getValueType().isInteger());
+  EVT BasePtrVT = Ptr.getValueType();
+  return getNode(ISD::ADD, DL, BasePtrVT, Ptr, Offset);
 }
 
 /// Returns true if memcpy source is constant data.
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
===================================================================
--- llvm/include/llvm/CodeGen/SelectionDAG.h
+++ llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -1140,6 +1140,7 @@
   /// Returns sum of the base pointer and offset.
   /// Unlike getObjectPtrOffset this does not set NoUnsignedWrap by default.
   SDValue getMemBasePlusOffset(SDValue Base, int64_t Offset, const SDLoc &DL);
+  SDValue getMemBasePlusOffset(SDValue Base, SDValue Offset, const SDLoc &DL);
 
   SDValue getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Base,
                         SDValue Offset, SDValue Mask, SDValue Src0, EVT MemVT,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71205.233871.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191213/11d947b1/attachment-0001.bin>


More information about the llvm-commits mailing list