[clang] 1cb3827 - [Clang][RISCV] Avoid generating MaskedPrototype if the intrinsic does not have a masked version. NFC

via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 3 10:20:49 PDT 2023


Author: eopXD
Date: 2023-06-03T10:20:04-07:00
New Revision: 1cb382718a35f55f51cf3a8e3fa7d627bfa63e85

URL: https://github.com/llvm/llvm-project/commit/1cb382718a35f55f51cf3a8e3fa7d627bfa63e85
DIFF: https://github.com/llvm/llvm-project/commit/1cb382718a35f55f51cf3a8e3fa7d627bfa63e85.diff

LOG: [Clang][RISCV] Avoid generating MaskedPrototype if the intrinsic does not have a masked version. NFC

The function should not be called if an intrinsic does not have a masked version.

Signed-off by: eop Chen <eop.chen at sifive.com>

Added: 
    

Modified: 
    clang/utils/TableGen/RISCVVEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp
index 35b2203cecf34..a20d7f5eba385 100644
--- a/clang/utils/TableGen/RISCVVEmitter.cpp
+++ b/clang/utils/TableGen/RISCVVEmitter.cpp
@@ -533,9 +533,11 @@ void RVVEmitter::createRVVIntrinsics(
         BasicPrototype, /*IsMasked=*/false,
         /*HasMaskedOffOperand=*/false, HasVL, NF, UnMaskedPolicyScheme,
         DefaultPolicy, IsTuple);
-    auto MaskedPrototype = RVVIntrinsic::computeBuiltinTypes(
-        BasicPrototype, /*IsMasked=*/true, HasMaskedOffOperand, HasVL, NF,
-        MaskedPolicyScheme, DefaultPolicy, IsTuple);
+    llvm::SmallVector<PrototypeDescriptor> MaskedPrototype;
+    if (HasMasked)
+      MaskedPrototype = RVVIntrinsic::computeBuiltinTypes(
+          BasicPrototype, /*IsMasked=*/true, HasMaskedOffOperand, HasVL, NF,
+          MaskedPolicyScheme, DefaultPolicy, IsTuple);
 
     // Create Intrinsics for each type and LMUL.
     for (char I : TypeRange) {


        


More information about the cfe-commits mailing list