[PATCH] D147078: [LICM][BPF] Disable hoistMinMax() optimization for BPF target
Andrii Nakryiko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 28 15:50:13 PDT 2023
anakryiko added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:990
// expression out of the loop.
- if (hoistMinMax(I, *CurLoop, *SafetyInfo, MSSAU)) {
+ if (!TTI->isBPFTarget() && hoistMinMax(I, *CurLoop, *SafetyInfo, MSSAU)) {
++NumMinMaxHoisted;
----------------
instead of hard-coding "isBPFTarget" checks, would it be possible to instead have target-specific "isOptimizationEnabled()" callback, which different architectures could override. For such optional optimizations we can have an enum specifying what kind of transformation/optimization it is, and then BPF target could decided whether optimization should or should not be done.
This will keep optimization code target-agnostic. We'll just have optional optimizations and related generic checks before trying to perform them?
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