Skip to content

Commit

Permalink
[BPF] Map signed division operation to corresponding intrinsic functi…
Browse files Browse the repository at this point in the history
…on (#5)
  • Loading branch information
dmakarov authored Feb 26, 2021
1 parent 55b88a4 commit 44636a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Target/BPF/BPFISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ BPFTargetLowering::BPFTargetLowering(const TargetMachine &TM,
if (VT == MVT::i32 && !STI.getHasAlu32())
continue;

setOperationAction(ISD::SDIV, VT, Expand);
setOperationAction(ISD::SDIVREM, VT, Expand);
setOperationAction(ISD::UDIVREM, VT, Expand);
setOperationAction(ISD::SREM, VT, Expand);
Expand Down Expand Up @@ -382,7 +383,7 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
// Pass the current stack frame pointer via BPF::R5
Chain = DAG.getCopyToReg(Chain, CLI.DL, BPF::R5, FramePtr);
}

SDValue InFlag;

// Build a sequence of copy-to-reg nodes chained together with token chain and
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/BPF/sdiv_error.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; XFAIL: *
; RUN: not llc -march=bpf < %s 2> %t1
; RUN: FileCheck %s < %t1
; CHECK: Unsupport signed division
Expand Down

0 comments on commit 44636a4

Please sign in to comment.