[llvm] ddc2e36 - [X86] getSHUFPDImm - allow general shuffle mask size

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 05:33:55 PST 2024


Author: Simon Pilgrim
Date: 2024-11-20T13:33:38Z
New Revision: ddc2e364aace37ce614106dcfaf4cffd2ec85f70

URL: https://github.com/llvm/llvm-project/commit/ddc2e364aace37ce614106dcfaf4cffd2ec85f70
DIFF: https://github.com/llvm/llvm-project/commit/ddc2e364aace37ce614106dcfaf4cffd2ec85f70.diff

LOG: [X86] getSHUFPDImm - allow general shuffle mask size

#116419 assumed that getSHUFPDImm incorrectly hardcoded the mask size to 4 (cut+pasta typo from getV4X86ShuffleImm).

Waiting on reduced test case from @metaflow

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index dfaa9dc7fe94df..3f71ebef0818c9 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -9937,7 +9937,8 @@ static unsigned getSHUFPDImm(ArrayRef<int> Mask) {
   // If the mask only uses one non-undef element, then fully 'splat' it to
   // improve later broadcast matching.
   int FirstIndex = find_if(Mask, [](int M) { return M >= 0; }) - Mask.begin();
-  assert(0 <= FirstIndex && FirstIndex < 4 && "All undef shuffle mask");
+  assert(0 <= FirstIndex && FirstIndex < Mask.size() &&
+         "All undef shuffle mask");
 
   int FirstElt = Mask[FirstIndex];
   if (all_of(Mask, [FirstElt](int M) { return M < 0 || M == FirstElt; }) &&


        


More information about the llvm-commits mailing list