[PATCH] D105053: [INSTCOMBINE] Tramsform reduction(shuffle V, poison,  unique_mask) to reduction(V).
    Roman Lebedev via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Jun 28 13:09:19 PDT 2021
    
    
  
lebedev.ri added a comment.
Is this really true for FP reductions? Don't they need `reassoc` flag for this?
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2000-2001
+  case Intrinsic::vector_reduce_fmul: {
+    // After SLP + LTO we can have reduction(shuffle V, poison, unique_mask),
+    // which can be folded just to reduction(V).
+    const unsigned ArgIdx = (IID == Intrinsic::vector_reduce_fadd ||
----------------
Not very useful comment
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2014
+        SmallBitVector UsedIndeces(Mask.size());
+        for (int Idx : Mask) {
+          if (Idx == UndefMaskElem || UsedIndeces.test(Idx))
----------------
This doesn't deal with non-canonical shuffle variant properly (and the test is missing)
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105053/new/
https://reviews.llvm.org/D105053
    
    
More information about the llvm-commits
mailing list