diff options
author | eopXD <yueh.ting.chen@gmail.com> | 2023-01-14 07:06:21 -0800 |
---|---|---|
committer | eopXD <yueh.ting.chen@gmail.com> | 2023-01-24 02:25:25 -0800 |
commit | 5a1c6ec1041f19806f3e94c3cb750b9072087c14 (patch) | |
tree | 97369fec35754583e0057ade0b1c361f27dbab3d /clang/utils | |
parent | 728d817becaa53cc9db1a440becc5c269a55ace2 (diff) | |
download | llvm-5a1c6ec1041f19806f3e94c3cb750b9072087c14.tar.gz |
[8/15][Clang][RISCV][NFC] Always emit PolicyAttr in riscv_vector_builtin_cg.inc
The extra logic here is redundant. Also sneaked in an one-liner for
emitting `IsMasked`.
This is the 8th commit of a patch-set that aims to change the default policy
for RVV intrinsics from TAMU to TAMA.
Please refer to the cover letter in the 1st commit (D141573) for an
overview.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D141762
Diffstat (limited to 'clang/utils')
-rw-r--r-- | clang/utils/TableGen/RISCVVEmitter.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp index 59a250aa29c9..39925cc5c24b 100644 --- a/clang/utils/TableGen/RISCVVEmitter.cpp +++ b/clang/utils/TableGen/RISCVVEmitter.cpp @@ -163,18 +163,11 @@ void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) { 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; |