forked from OSchip/llvm-project
[SelectionDAG] Redefine isGAPlusOffset in terms of unwrapAddress. NFCI.
llvm-svn: 348288
This commit is contained in:
parent
edaf2bcc77
commit
ce26c27b2a
|
@ -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();
|
||||
|
|
|
@ -30169,21 +30169,6 @@ SDValue X86TargetLowering::unwrapAddress(SDValue N) const {
|
|||
return N;
|
||||
}
|
||||
|
||||
/// Returns true (and the GlobalValue and the offset) if the node is a
|
||||
/// GlobalAddress + offset.
|
||||
bool X86TargetLowering::isGAPlusOffset(SDNode *N,
|
||||
const GlobalValue* &GA,
|
||||
int64_t &Offset) const {
|
||||
if (N->getOpcode() == X86ISD::Wrapper) {
|
||||
if (isa<GlobalAddressSDNode>(N->getOperand(0))) {
|
||||
GA = cast<GlobalAddressSDNode>(N->getOperand(0))->getGlobal();
|
||||
Offset = cast<GlobalAddressSDNode>(N->getOperand(0))->getOffset();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return TargetLowering::isGAPlusOffset(N, GA, Offset);
|
||||
}
|
||||
|
||||
// Attempt to match a combined shuffle mask against supported unary shuffle
|
||||
// instructions.
|
||||
// TODO: Investigate sharing more of this with shuffle lowering.
|
||||
|
|
|
@ -877,9 +877,6 @@ namespace llvm {
|
|||
|
||||
SDValue unwrapAddress(SDValue N) const override;
|
||||
|
||||
bool isGAPlusOffset(SDNode *N, const GlobalValue* &GA,
|
||||
int64_t &Offset) const override;
|
||||
|
||||
SDValue getReturnAddressFrameIndex(SelectionDAG &DAG) const;
|
||||
|
||||
bool ExpandInlineAsm(CallInst *CI) const override;
|
||||
|
|
Loading…
Reference in New Issue