[PATCH] D149842: Scalarizer: limit scalarization for small element types
    Nicolai Hähnle via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri May  5 02:52:25 PDT 2023
    
    
  
nhaehnle marked 2 inline comments as done.
nhaehnle added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/Scalarizer.cpp:67-69
+    "scalarize-min-bits", cl::init(0), cl::Hidden,
+    cl::desc("Instruct the scalarizer pass to attempt to keep values of a "
+             "minimum number of bits"));
----------------
arsenm wrote:
> Should this go based on legal vector operations from TTI?
> 
> Alternatively, would we just scalarize everything and then run SLPVectorizer?
I wouldn't want to rely on SLPVectorizer. Even assuming that it is able to undo all the scalarization (which would need to be investigated), I expect that it would increase compile-time cost.
As for TTI -- I'm not a fan of it in general. Going by legal instructions is tricky, because which legal instructions do you look at? And adding yet another hook isn't great. Also, the ScalarizerPass is not included in any default pass builder pipeline as far as I can see. We use it in LLPC, where we are well aware of the target and can just explicitly pass options to the pass constructor, and I assume all other users are analogous.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149842/new/
https://reviews.llvm.org/D149842
    
    
More information about the llvm-commits
mailing list