diff --git a/src/midend/SysYIRPrinter.cpp b/src/midend/SysYIRPrinter.cpp index 9a0f427..fba6abd 100644 --- a/src/midend/SysYIRPrinter.cpp +++ b/src/midend/SysYIRPrinter.cpp @@ -299,7 +299,12 @@ void SysYPrinter::printInst(Instruction *pInst) { // Types and operands std::cout << " "; - printType(binInst->getType()); + // For comparison operations, print operand types instead of result type + if (pInst->getKind() >= Kind::kICmpEQ && pInst->getKind() <= Kind::kFCmpGE) { + printType(binInst->getLhs()->getType()); + } else { + printType(binInst->getType()); + } std::cout << " "; printValue(binInst->getLhs()); std::cout << ", ";