forked from OSchip/llvm-project
[InstCombine] Remove unnecessary intrinsics demanded elts handling
As discussed on D28777 - we don't need to handle 'all element' shuffles inside InstCombiner::visitCallInst as InstCombiner::SimplifyDemandedVectorElts will do everything we need. llvm-svn: 292365
This commit is contained in:
parent
a92d6230da
commit
a22c3a1c0f
|
@ -2327,40 +2327,20 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
|||
|
||||
case Intrinsic::x86_ssse3_pshuf_b_128:
|
||||
case Intrinsic::x86_avx2_pshuf_b:
|
||||
case Intrinsic::x86_avx512_pshuf_b_512: {
|
||||
case Intrinsic::x86_avx512_pshuf_b_512:
|
||||
if (Value *V = simplifyX86pshufb(*II, *Builder))
|
||||
return replaceInstUsesWith(*II, V);
|
||||
|
||||
unsigned VWidth = II->getType()->getVectorNumElements();
|
||||
APInt UndefElts(VWidth, 0);
|
||||
APInt DemandedElts = APInt::getAllOnesValue(VWidth);
|
||||
if (Value *V = SimplifyDemandedVectorElts(II, DemandedElts, UndefElts)) {
|
||||
if (V != II)
|
||||
return replaceInstUsesWith(*II, V);
|
||||
return II;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Intrinsic::x86_avx_vpermilvar_ps:
|
||||
case Intrinsic::x86_avx_vpermilvar_ps_256:
|
||||
case Intrinsic::x86_avx512_vpermilvar_ps_512:
|
||||
case Intrinsic::x86_avx_vpermilvar_pd:
|
||||
case Intrinsic::x86_avx_vpermilvar_pd_256:
|
||||
case Intrinsic::x86_avx512_vpermilvar_pd_512: {
|
||||
case Intrinsic::x86_avx512_vpermilvar_pd_512:
|
||||
if (Value *V = simplifyX86vpermilvar(*II, *Builder))
|
||||
return replaceInstUsesWith(*II, V);
|
||||
|
||||
unsigned VWidth = II->getType()->getVectorNumElements();
|
||||
APInt UndefElts(VWidth, 0);
|
||||
APInt DemandedElts = APInt::getAllOnesValue(VWidth);
|
||||
if (Value *V = SimplifyDemandedVectorElts(II, DemandedElts, UndefElts)) {
|
||||
if (V != II)
|
||||
return replaceInstUsesWith(*II, V);
|
||||
return II;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Intrinsic::x86_avx2_permd:
|
||||
case Intrinsic::x86_avx2_permps:
|
||||
|
|
Loading…
Reference in New Issue