We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed25d37 commit 7717667Copy full SHA for 7717667
IGC/Compiler/CISACodeGen/PatternMatchPass.cpp
@@ -2017,10 +2017,15 @@ namespace IGC
2017
}
2018
2019
// Check integer mad profitability.
2020
- if (found && !isFpMad(I)) {
+ if (found && !isFpMad(I))
2021
+ {
2022
auto isByteOrWordValue = [](Value* V) -> bool {
- if (isa<Constant>(V))
2023
- return true;
+ if (isa<ConstantInt>(V))
2024
2025
+ // only 16-bit int immediate is supported
2026
+ APInt val = dyn_cast<ConstantInt>(V)->getValue();
2027
+ return val.sge(SHRT_MIN) && val.sle(SHRT_MAX);
2028
+ }
2029
// Trace the def-use chain and return the first non up-cast related value.
2030
while (isa<ZExtInst>(V) || isa<SExtInst>(V) || isa<BitCastInst>(V))
2031
V = cast<Instruction>(V)->getOperand(0);
0 commit comments