[llvm] [TTI][BPF]: Undo specific transform-preventing passes and add one TTI hook (PR #97073)
Dmitry Spikhalsky via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 21:09:22 PDT 2024
Spikhalskiy wrote:
You are right, https://reviews.llvm.org/D147968 looks pretty much rejected and I don’t expect this draft to be accepted as-is.
Unfortunately we, as end users (we develop a module with BPF), struggling quite a bit and wasting a lot of time on situations where LLVM transforms the code in the opposite direction from what would be understood by BPF Verifier.
Meanwhile, it looks like improvements of these rough edges are stuck between a rock and a rough place:
1. Linux kernel devs don’t want to overcomplicate the verifier and even when improvements are done, they will take many years to get into mainstream commercial distributions. For example, we use 5.4 in production atm. So they point that LLVM may be a better place to address some of the issues.
2. While patches into LLVM are getting stuck by what looks to me as visionary and “purity” reasons. Like BPF target shouldn’t disqualify some types of transformations.
I personally don’t see many ways for us to solve our struggles with LLVM producing “unexpected” bytecode other than making our own LLVM fork and applying the rejected patches. It’s not what we would like to do, but we will get the relief we need while LLVM and BPF core devs find an approach that works.
So I will rebase some of these patches and leave them as drafts for visibility and to make things easier for other devs who decide that they have to go this route too.
Feel free to close these drafts if you don’t want them dangling for whatever reason though.
https://github.com/llvm/llvm-project/pull/97073
More information about the llvm-commits
mailing list