[llvm] [InstCombine][X86] Fold blendv(x, y, shuffle(bitcast(sext(m)))) -> select(shuffle(m),x,y) (PR #96882)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 03:53:09 PDT 2024
================
@@ -2809,11 +2826,26 @@ X86TTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
BoolVec->getType()->getScalarSizeInBits() == 1) {
auto *MaskTy = cast<FixedVectorType>(Mask->getType());
auto *OpTy = cast<FixedVectorType>(II.getType());
+ unsigned NumMaskElts = MaskTy->getNumElements();
+ unsigned NumOperandElts = OpTy->getNumElements();
+
+ // If we peeked through a shuffle, reapply the shuffle to the bool vector.
+ if (MaskSrc) {
+ unsigned NumMaskSrcElts =
+ cast<FixedVectorType>(MaskSrc->getType())->getNumElements();
+ NumMaskElts = (ShuffleMask.size() * NumMaskElts) / NumMaskSrcElts;
----------------
RKSimon wrote:
IR can have different result and argument vector widths (this patch is mainly to help extract subvector style shuffles after all) - only DAG is fixed
https://github.com/llvm/llvm-project/pull/96882
More information about the llvm-commits
mailing list