diff options
author | Nirav Dave <niravd@google.com> | 2018-12-04 17:59:43 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2018-12-04 17:59:43 +0000 |
commit | ce26c27b2a7fe1c11885223ed0c150859270391b (patch) | |
tree | 1e337e6ae4212a23f0e9256712de4b944b5b1a53 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | edaf2bcc77c730739d90493865f1a90fb377b34d (diff) | |
download | bcm5719-llvm-ce26c27b2a7fe1c11885223ed0c150859270391b.tar.gz bcm5719-llvm-ce26c27b2a7fe1c11885223ed0c150859270391b.zip |
[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.
llvm-svn: 348288
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 82d86204d80..33dad187d4a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -2998,8 +2998,11 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, /// Returns true (and the GlobalValue and the offset) if the node is a /// GlobalAddress + offset. -bool TargetLowering::isGAPlusOffset(SDNode *N, const GlobalValue *&GA, +bool TargetLowering::isGAPlusOffset(SDNode *WN, const GlobalValue *&GA, int64_t &Offset) const { + + SDNode *N = unwrapAddress(SDValue(WN, 0)).getNode(); + if (auto *GASD = dyn_cast<GlobalAddressSDNode>(N)) { GA = GASD->getGlobal(); Offset += GASD->getOffset(); |