[PATCH] D147078: [LICM][BPF] Disable hoistMinMax() optimization for BPF target

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 10:00:38 PDT 2023


fhahn added a comment.

In D147078#4231270 <https://reviews.llvm.org/D147078#4231270>, @anakryiko wrote:

>> If so, I think it would make the most sense to add an undo transform in the BPF backend.
>
> Genuine curiosity (and keep in mind I'm no compiler expert at all), but why doing transformation and then customly undoing it in specific BPF backend would be a preferable solution to allowing backends to turn off some known-to-hurt transformations in the first place? It seems more complicated and error-prone to do the dance of undoing, rather than have a generic interface to prevent transformation in the first place.
>
> Note, this is not the only transformation that hurts BPF verification, @yonghong-song previously added "undo transformation" logic, but it seems like a not very sustainable and very convoluted solution. So we are asking if we can have a simpler and more reliable opt-out for some small set of transformations.

One goal of LICM is to target-independently canonicalise the IR to enable other IR optimizations, so IMO it would be preferable to avoid disabling parts via target hooks. Also, the currently proposed hook is not really scalable, e.g. what if another target wants to opt out as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147078



More information about the llvm-commits mailing list