[PATCH] D111919: [RISCV][WebAssembly][TargetLowering] Allow expandCTLZ/expandCTTZ to rely on CTPOP expansion for vectors.
    Thomas Lively via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Oct 19 17:08:23 PDT 2021
    
    
  
tlively added a comment.
Thanks, the WebAssembly portion LGTM. The TargetLowering.cpp change LGTM as well, modulo that one comment.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7075
   // Only expand vector types if we have the appropriate vector bit operations.
+  // This includes the operations needed to expand CTPOP if it isn't supported.
   if (VT.isVector() && (!isPowerOf2_32(NumBitsPerElt) ||
----------------
Would it make sense to extract this part into a separate variable called `CanLowerCTPOP` or similar? Then if the ctpop lowering ever changes it will be easier to know what to update here.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111919/new/
https://reviews.llvm.org/D111919
    
    
More information about the llvm-commits
mailing list