@@ -4619,29 +4619,19 @@ namespace IGC
4619
4619
pattern->sources [1 ] = GetSource (s1, false , false , IsSourceOfSample (&I));
4620
4620
pattern->sources [2 ] = GetSource (s2, false , false , IsSourceOfSample (&I));
4621
4621
4622
- // BFN can use imm16 in src0 and src2 (not src1).
4623
- // Directly pass such immediates (or when lossless conversion is possible);
4622
+ // BFN can use imm16 in src0 and src2, check for those;
4624
4623
// otherwise try to add to constant pool even int32.
4625
- if (ConstantInt *CI = dyn_cast<ConstantInt>(s0))
4624
+ if (dyn_cast<ConstantInt>(s0) && !s0-> getType ()-> isIntegerTy ( 16 ) )
4626
4625
{
4627
- if (!s0->getType ()->isIntegerTy (16 ) && !CI->getValue ().isIntN (16 ))
4628
- {
4629
- AddToConstantPool (I.getParent (), s0);
4630
- pattern->sources [0 ].fromConstantPool = true ;
4631
- }
4626
+ AddToConstantPool (I.getParent (), s0); pattern->sources [0 ].fromConstantPool = true ;
4632
4627
}
4633
4628
if (dyn_cast<ConstantInt>(s1))
4634
4629
{
4635
- AddToConstantPool (I.getParent (), s1);
4636
- pattern->sources [1 ].fromConstantPool = true ;
4630
+ AddToConstantPool (I.getParent (), s1); pattern->sources [1 ].fromConstantPool = true ;
4637
4631
}
4638
- if (ConstantInt *CI = dyn_cast<ConstantInt>(s2))
4632
+ if (dyn_cast<ConstantInt>(s2) && !s2-> getType ()-> isIntegerTy ( 16 ))
4639
4633
{
4640
- if (!s2->getType ()->isIntegerTy (16 ) && !CI->getValue ().isIntN (16 ))
4641
- {
4642
- AddToConstantPool (I.getParent (), s2);
4643
- pattern->sources [2 ].fromConstantPool = true ;
4644
- }
4634
+ AddToConstantPool (I.getParent (), s2); pattern->sources [2 ].fromConstantPool = true ;
4645
4635
}
4646
4636
4647
4637
AddPattern (pattern);
0 commit comments