[llvm] [BPF] Use mul for certain div/mod operations (PR #110712)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 12:17:17 PDT 2024


================
@@ -118,7 +118,9 @@ class BPFTargetLowering : public TargetLowering {
     return Op.size() >= 8 ? MVT::i64 : MVT::i32;
   }
 
-  bool isIntDivCheap(EVT VT, AttributeList Attr) const override { return true; }
+  bool isIntDivCheap(EVT VT, AttributeList Attr) const override {
+    return false;
----------------
yonghong-song wrote:

@eddyz87 From @4ast the point is that even a single divide is expensive than multiplication/shift/... etc. The number of insns is not a criteria here.

https://github.com/llvm/llvm-project/pull/110712


More information about the llvm-commits mailing list