Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions llvm/lib/Target/BPF/BPF.td
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ def MisalignedMemAccess : SubtargetFeature<"allows-misaligned-mem-access",
"AllowsMisalignedMemAccess", "true",
"Allows misaligned memory access">;

def AllowBuiltinCall : SubtargetFeature<"allow-builtin-calls",
"AllowBuiltinCalls", "true",
"Allow calls to builtin functions">;

def : Proc<"generic", []>;
def : Proc<"v1", []>;
def : Proc<"v2", []>;
Expand Down
23 changes: 3 additions & 20 deletions llvm/lib/Target/BPF/BPFISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ BPFTargetLowering::BPFTargetLowering(const TargetMachine &TM,
HasMovsx = STI.hasMovsx();

AllowsMisalignedMemAccess = STI.getAllowsMisalignedMemAccess();
AllowBuiltinCalls = STI.getAllowBuiltinCalls();
}

bool BPFTargetLowering::allowsMisalignedMemoryAccesses(EVT VT, unsigned, Align,
Expand Down Expand Up @@ -568,10 +567,9 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
} else if (ExternalSymbolSDNode *E = dyn_cast<ExternalSymbolSDNode>(Callee)) {
if (StringRef(E->getSymbol()) != BPF_TRAP) {
Callee = DAG.getTargetExternalSymbol(E->getSymbol(), PtrVT, 0);
if (!AllowBuiltinCalls)
fail(CLI.DL, DAG,
Twine("A call to built-in function '" + StringRef(E->getSymbol()) +
"' is not supported."));
fail(CLI.DL, DAG,
Twine("A call to built-in function '" + StringRef(E->getSymbol()) +
"' is not supported."));
}
}

Expand Down Expand Up @@ -1198,18 +1196,3 @@ bool BPFTargetLowering::isLegalAddressingMode(const DataLayout &DL,

return true;
}

bool BPFTargetLowering::shouldSignExtendTypeInLibCall(Type *Ty,
bool IsSigned) const {
return IsSigned || Ty->isIntegerTy(32);
}

bool BPFTargetLowering::CanLowerReturn(
CallingConv::ID CallConv, MachineFunction &MF, bool IsVarArg,
const SmallVectorImpl<ISD::OutputArg> &Outs, LLVMContext &Context,
const Type *RetTy) const {
// At minimal return Outs.size() <= 1, or check valid types in CC.
SmallVector<CCValAssign, 16> RVLocs;
CCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
return CCInfo.CheckReturn(Outs, getHasAlu32() ? RetCC_BPF32 : RetCC_BPF64);
}
10 changes: 0 additions & 10 deletions llvm/lib/Target/BPF/BPFISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ class BPFTargetLowering : public TargetLowering {
// Allows Misalignment
bool AllowsMisalignedMemAccess;

bool AllowBuiltinCalls;

SDValue LowerSDIVSREM(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
Expand Down Expand Up @@ -165,14 +163,6 @@ class BPFTargetLowering : public TargetLowering {
MachineBasicBlock *
EmitInstrWithCustomInserterLDimm64(MachineInstr &MI,
MachineBasicBlock *BB) const;

// Returns true if arguments should be sign-extended in lib calls.
bool shouldSignExtendTypeInLibCall(Type *Ty, bool IsSigned) const override;

bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
bool IsVarArg,
const SmallVectorImpl<ISD::OutputArg> &Outs,
LLVMContext &Context, const Type *RetTy) const override;
};
}

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Target/BPF/BPFSubtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void BPFSubtarget::initializeEnvironment() {
HasLoadAcqStoreRel = false;
HasGotox = false;
AllowsMisalignedMemAccess = false;
AllowBuiltinCalls = false;
}

void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
Expand Down
3 changes: 0 additions & 3 deletions llvm/lib/Target/BPF/BPFSubtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class BPFSubtarget : public BPFGenSubtargetInfo {
bool HasLdsx, HasMovsx, HasBswap, HasSdivSmod, HasGotol, HasStoreImm,
HasLoadAcqStoreRel, HasGotox;

bool AllowBuiltinCalls;

std::unique_ptr<CallLowering> CallLoweringInfo;
std::unique_ptr<InstructionSelector> InstSelector;
std::unique_ptr<LegalizerInfo> Legalizer;
Expand Down Expand Up @@ -103,7 +101,6 @@ class BPFSubtarget : public BPFGenSubtargetInfo {
bool hasStoreImm() const { return HasStoreImm; }
bool hasLoadAcqStoreRel() const { return HasLoadAcqStoreRel; }
bool hasGotox() const { return HasGotox; }
bool getAllowBuiltinCalls() const { return AllowBuiltinCalls; }

bool isLittleEndian() const { return IsLittleEndian; }

Expand Down
2 changes: 2 additions & 0 deletions llvm/test/CodeGen/BPF/atomic-oversize.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
; RUN: llc -mtriple=bpf < %s | FileCheck %s
; XFAIL: *
; Doesn't currently build, with error 'only small returns supported'.

define void @test(ptr %a) nounwind {
; CHECK-LABEL: test:
Expand Down
39 changes: 0 additions & 39 deletions llvm/test/CodeGen/BPF/builtin_calls.ll

This file was deleted.

2 changes: 1 addition & 1 deletion llvm/test/CodeGen/BPF/struct_ret1.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; RUN: not llc -mtriple=bpf < %s 2> %t1
; RUN: FileCheck %s < %t1
; CHECK: error: <unknown>:0:0: in function bar { i64, i32 } (i32, i32, i32, i32, i32): stack arguments are not supported
; CHECK: error: <unknown>:0:0: in function bar { i64, i32 } (i32, i32, i32, i32, i32): aggregate returns are not supported

%struct.S = type { i32, i32, i32 }

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/BPF/struct_ret2.ll
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; RUN: not llc -mtriple=bpf < %s 2> %t1
; RUN: FileCheck %s < %t1
; CHECK: too many arguments
; CHECK: only small returns

; Function Attrs: nounwind uwtable
define { i64, i32 } @foo(i32 %a, i32 %b, i32 %c) #0 {
Expand Down