Open dlee992 opened 1 month ago
found another llvm issue related to this: https://github.com/llvm/llvm-project/issues/47011.
This makes me a bit confused. If we didn't specify disable interleave, why the debug msg tells me it's disabled by pass manager? need to figure out. Perhaps it's related to optimization level. However, I did rerun my test case with setting NUMBA_OPT
to max
, the log still shows disabled.
Looks like PassManagerBuilder has a lot of new options: https://github.com/llvm-mirror/llvm/blob/2c4ca6832fa6b306ee6a7010bfb80a3f2596f824/lib/Transforms/IPO/PassManagerBuilder.cpp#L150-L177 Update: This is LLVM10
hm... LLVM14 actual have it on by default: https://github.com/llvm/llvm-project/blob/f28c006a5895fc0e329fe15fead81e37457cb1d1/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp#L194-L223
Thanks for digging. After your digging, this is more interesting to me, since I did use LLVM 14.0.6 to locally build llvmlite, I strictly followed the llvm14 recipe provided by llvmlite. I suppose I have to provide a simple reproducer to prove myself.. Will try.
Looks like llvmlite doesn't support enabling
interleave
for Loop optimization for now.In clang, it can support this style:
more details can be found: https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations
I saw it can get some benefits in one discussion: https://discourse.llvm.org/t/external-vectorizer-vplan/73634
And when debugging my code with this debug setting, as numba doc suggested:
I did see some logs like:
BTW, sometimes, I also saw
LV: Loop hints: force=? width=0 interleave=1
, I didn't find a source code location that numba or llvmlite sets it to1
, not sure where1
comes from. I guess LLVM will choose between0
or1
internally?After discussions with numba devs, if we agree it's good, I can contribute a PR to support this feature request.
tag @gmarkall