Skip to content

Commit 44636a4

Browse files
authored
[BPF] Map signed division operation to corresponding intrinsic function (#5)
1 parent 55b88a4 commit 44636a4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/lib/Target/BPF/BPFISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ BPFTargetLowering::BPFTargetLowering(const TargetMachine &TM,
7474
if (VT == MVT::i32 && !STI.getHasAlu32())
7575
continue;
7676

77+
setOperationAction(ISD::SDIV, VT, Expand);
7778
setOperationAction(ISD::SDIVREM, VT, Expand);
7879
setOperationAction(ISD::UDIVREM, VT, Expand);
7980
setOperationAction(ISD::SREM, VT, Expand);
@@ -382,7 +383,7 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
382383
// Pass the current stack frame pointer via BPF::R5
383384
Chain = DAG.getCopyToReg(Chain, CLI.DL, BPF::R5, FramePtr);
384385
}
385-
386+
386387
SDValue InFlag;
387388

388389
// Build a sequence of copy-to-reg nodes chained together with token chain and

llvm/test/CodeGen/BPF/sdiv_error.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
; XFAIL: *
12
; RUN: not llc -march=bpf < %s 2> %t1
23
; RUN: FileCheck %s < %t1
34
; CHECK: Unsupport signed division

0 commit comments

Comments
 (0)