Skip to content

Commit 5796d4f

Browse files
fangliu2020sys_zuul
authored andcommitted
Don't do mad if thre are more than 1 immediate source
Change-Id: Ief942d1f12b4179aa672f2ac041d7b177f3876a5
1 parent 3912307 commit 5796d4f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,20 @@ namespace IGC
20162016
}
20172017
}
20182018

2019+
if (found)
2020+
{
2021+
uint8_t numConstant = 0;
2022+
for (int i = 0; i < 3; i++)
2023+
{
2024+
if (isa<Constant>(sources[i]))
2025+
numConstant++;
2026+
2027+
// Only one immediate is supported
2028+
if (numConstant > 1)
2029+
return false;
2030+
}
2031+
}
2032+
20192033
// Check integer mad profitability.
20202034
if (found && !isFpMad(I))
20212035
{

0 commit comments

Comments
 (0)