[llvm] [X86] lowerShuffleAsBroadcast - use isShuffleEquivalent to search for a hidden broadcast pattern (PR #126517)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 02:11:49 PST 2025


================
@@ -9799,6 +9799,24 @@ static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,
         MaskSize == (int)ExpectedOp.getNumOperands())
       return Op.getOperand(Idx) == ExpectedOp.getOperand(ExpectedIdx);
     break;
+  case ISD::BITCAST:
+    if (Op == ExpectedOp && (int)VT.getVectorNumElements() == MaskSize) {
+      SDValue Src = peekThroughBitcasts(Op);
----------------
phoebewang wrote:

Do we have more than one bitcast adjacent? Can we use `getOperand(0)`?

https://github.com/llvm/llvm-project/pull/126517


More information about the llvm-commits mailing list