[clang] [RISCV][NFC] Remove SegInstSEW for unused function (PR #199598)

Jianjian Guan via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 00:38:45 PDT 2026


================
@@ -250,17 +250,19 @@ void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) {
     OS << "  TWiden = " << RVVI->getTWiden() << ";\n";
 
   OS << "  PolicyAttrs = " << RVVI->getPolicyAttrsBits() << ";\n";
-  unsigned IndexedLoadStorePtrIdx = getIndexedLoadStorePtrIdx(RVVI);
-  if (IndexedLoadStorePtrIdx != UnknownIndex) {
-    OS << "  {\n";
-    OS << "    auto PointeeType = E->getArg(" << IndexedLoadStorePtrIdx
-       << ")->getType()->getPointeeType();\n";
-    OS << "    SegInstSEW = "
-          "llvm::Log2_64(getContext().getTypeSize(PointeeType));\n";
-    OS << "  }\n";
-  } else {
-    OS << "  SegInstSEW = " << getSegInstLog2SEW(RVVI->getOverloadedName())
-       << ";\n";
+  if (RVVI->getManualCodegen().contains("SegInstSEW")) {
----------------
jacquesguan wrote:

Added field `HasSegInstSEW` to mark it.

https://github.com/llvm/llvm-project/pull/199598


More information about the cfe-commits mailing list