[PATCH] D61810: [BPF] add new intrinsics preserve_{array,union,struct}_access_index

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 18:36:15 PDT 2019


efriedma added a comment.

> intrinsics causing less optimal codes which may contributes 5% performance loss for a relative small routines, for a large routines, I have see the loss is more than 20%.

Could you clarify what, exactly, the issue is here?  Is the problem extra arithmetic?  Extra memory operations?  Something else?  You could probably mitigate the impact here with a few small changes to optimizations.  Or maybe you could make the intrinsic return the relevant offset, rather than actually performing the GEP itself.  (The key here is that you have to make sure the offset is opaque to the optimizer, so it doesn't make illegal transforms.)

There's probably some fundamental performance loss involved in making the struct offsets opaque values, no matter how that is represented in the IR.

> intrinsics impact inline decision and less inlining has negative impacts on the performance.

This is something you can probably fix with a trivial tweak to the inlining heuristics.  The inliner asks the target for the cost of a call using TargetTransformInfo.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61810/new/

https://reviews.llvm.org/D61810





More information about the llvm-commits mailing list