This should be a perfectly reasonable operation for scalable vectors.
Currently, it only works for zeroinitializer values of
ScalableVectorType, but the fundamental operation is sound and it should
be possible to make it work for other splats
|90 ms||windows > LLVM.Analysis/ConstantFolding::vscale.ll|
Script: -- : 'RUN: at line 2'; c:\ws\w6\llvm-project\premerge-checks\build\bin\opt.exe < C:\ws\w6\llvm-project\premerge-checks\llvm\test\Analysis\ConstantFolding\vscale.ll -constprop -S -verify | c:\ws\w6\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w6\llvm-project\premerge-checks\llvm\test\Analysis\ConstantFolding\vscale.ll
Not sure if you mean the test code itself or the assertion for the tests? llvm/utils/ is probably the spot to find/add scripts that help with testing.
This should be handled more specifically with "-constprop" (don't need the full power of -instcombine).
Use the standard "utils/update_test_checks.py" to auto-generate the CHECK lines? Can also pre-commit the baseline tests, then update here so we just have diffs for the assertion lines.