Skip to content

Commit b0d40dc

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 156bd92: Enable encoding more imm16 cases directly to BFN.
Ignore constant pool for immediates that can fit into imm16, so they can be encoded into instruction directly.
1 parent e5df3df commit b0d40dc

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4619,29 +4619,19 @@ namespace IGC
46194619
pattern->sources[1] = GetSource(s1, false, false, IsSourceOfSample(&I));
46204620
pattern->sources[2] = GetSource(s2, false, false, IsSourceOfSample(&I));
46214621

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;
46244623
// 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) )
46264625
{
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;
46324627
}
46334628
if (dyn_cast<ConstantInt>(s1))
46344629
{
4635-
AddToConstantPool(I.getParent(), s1);
4636-
pattern->sources[1].fromConstantPool = true;
4630+
AddToConstantPool(I.getParent(), s1); pattern->sources[1].fromConstantPool = true;
46374631
}
4638-
if (ConstantInt *CI = dyn_cast<ConstantInt>(s2))
4632+
if (dyn_cast<ConstantInt>(s2) && !s2->getType()->isIntegerTy(16))
46394633
{
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;
46454635
}
46464636

46474637
AddPattern(pattern);

0 commit comments

Comments
 (0)