[llvm] [SLP][REVEC] Make Instruction::Select support vector instructions. (PR #100507)
    Alexey Bataev via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Jul 26 11:35:41 PDT 2024
    
    
  
================
@@ -13196,6 +13207,15 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
           False = Builder.CreateIntCast(False, VecTy, GetOperandSignedness(2));
       }
 
+      unsigned CondNumElements = getNumElements(Cond->getType());
+      unsigned TrueNumElements = getNumElements(True->getType());
+      if (CondNumElements != TrueNumElements) {
+        // When the return type is i1 but the source is fixed vector type, we
+        // need to duplicate the condition value.
+        Cond = Builder.CreateShuffleVector(
+            Cond, createReplicatedMask(TrueNumElements / CondNumElements,
----------------
alexey-bataev wrote:
Add assertion
https://github.com/llvm/llvm-project/pull/100507
    
    
More information about the llvm-commits
mailing list