diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp --- a/clang/utils/TableGen/RISCVVEmitter.cpp +++ b/clang/utils/TableGen/RISCVVEmitter.cpp @@ -163,18 +163,11 @@ OS << " ID = Intrinsic::riscv_" + RVVI->getIRName() + ";\n"; if (RVVI->getNF() >= 2) OS << " NF = " + utostr(RVVI->getNF()) + ";\n"; - // We had initialized PolicyAttrs as TU/TUMU in CodeGen function. - if (!RVVI->getPolicyAttrs().isTUPolicy() && - !RVVI->getPolicyAttrs().isTUMUPolicy() && !RVVI->hasPassthruOperand() && - !RVVI->hasManualCodegen() && RVVI->hasVL()) - OS << " PolicyAttrs = " << RVVI->getPolicyAttrsBits() << ";\n"; + + OS << " PolicyAttrs = " << RVVI->getPolicyAttrsBits() << ";\n"; if (RVVI->hasManualCodegen()) { - OS << " PolicyAttrs = " << RVVI->getPolicyAttrsBits() << ";\n"; - if (RVVI->isMasked()) - OS << "IsMasked = true;\n"; - else - OS << "IsMasked = false;\n"; + OS << "IsMasked = " << (RVVI->isMasked() ? "true" : "false") << ";\n"; OS << RVVI->getManualCodegen(); OS << "break;\n"; return;