diff options
Diffstat (limited to 'lib/Target/BPF/BPFISelLowering.cpp')
| -rw-r--r-- | lib/Target/BPF/BPFISelLowering.cpp | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/BPF/BPFISelLowering.cpp b/lib/Target/BPF/BPFISelLowering.cpp index 6897161c903c..cc7a7c3849bc 100644 --- a/lib/Target/BPF/BPFISelLowering.cpp +++ b/lib/Target/BPF/BPFISelLowering.cpp @@ -132,6 +132,10 @@ BPFTargetLowering::BPFTargetLowering(const TargetMachine &TM,    MaxStoresPerMemmove = MaxStoresPerMemmoveOptSize = 128;  } +bool BPFTargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const { +  return false; +} +  SDValue BPFTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {    switch (Op.getOpcode()) {    case ISD::BR_CC: @@ -496,8 +500,11 @@ const char *BPFTargetLowering::getTargetNodeName(unsigned Opcode) const {  SDValue BPFTargetLowering::LowerGlobalAddress(SDValue Op,                                                SelectionDAG &DAG) const { +  auto N = cast<GlobalAddressSDNode>(Op); +  assert(N->getOffset() == 0 && "Invalid offset for global address"); +    SDLoc DL(Op); -  const GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal(); +  const GlobalValue *GV = N->getGlobal();    SDValue GA = DAG.getTargetGlobalAddress(GV, DL, MVT::i64);    return DAG.getNode(BPFISD::Wrapper, DL, MVT::i64, GA);  | 
