[AMDGPU] Fix opcode comparison logic for G_INTRINSIC (#156008)
The check `(Opc < TargetOpcode::GENERIC_OP_END)` incorrectly includes `G_INTRINSIC` (129), which is less than `GENERIC_OP_END` (313), leading to logically dead code. This patch reorders the conditionals to first check for `G_INTRINSIC`, ensuring correct handling of the `amdgcn_fdot2` intrinsic.
This commit is contained in:
parent
e6cff75362
commit
6012aa1d44
@ -4990,14 +4990,14 @@ public:
|
||||
const MachineInstr *MI = MRI.getVRegDef(Reg);
|
||||
unsigned Opc = MI->getOpcode();
|
||||
|
||||
if (Opc < TargetOpcode::GENERIC_OP_END) {
|
||||
// Keep same for generic op.
|
||||
HasNeg = true;
|
||||
} else if (Opc == TargetOpcode::G_INTRINSIC) {
|
||||
if (Opc == TargetOpcode::G_INTRINSIC) {
|
||||
Intrinsic::ID IntrinsicID = cast<GIntrinsic>(*MI).getIntrinsicID();
|
||||
// Only float point intrinsic has neg & neg_hi bits.
|
||||
if (IntrinsicID == Intrinsic::amdgcn_fdot2)
|
||||
HasNeg = true;
|
||||
} else if (TargetInstrInfo::isGenericOpcode(Opc)) {
|
||||
// Keep same for generic op.
|
||||
HasNeg = true;
|
||||
}
|
||||
}
|
||||
bool checkOptions(SrcStatus Stat) const {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user