[llvm] e9313fa - [RISCV] Simplify some code in RISCVInsertVSETVLI by calling an existing function that does the same thing. NFCI

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 17:48:37 PDT 2021


Author: Craig Topper
Date: 2021-06-03T17:31:54-07:00
New Revision: e9313fa33ae501182666101380282228fb3f4acc

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

LOG: [RISCV] Simplify some code in RISCVInsertVSETVLI by calling an existing function that does the same thing. NFCI

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index e1c7cb36669f..48124160aa26 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -177,17 +177,7 @@ class VSETVLIInfo {
         return true;
     }
 
-    // VTypes must match.
-    if (!hasSameVTYPE(Other))
-      return false;
-
-    if (hasAVLImm() != Other.hasAVLImm())
-      return false;
-
-    if (hasAVLImm())
-      return getAVLImm() == Other.getAVLImm();
-
-    return getAVLReg() == Other.getAVLReg();
+    return hasSameVTYPE(Other) && hasSameAVL(Other);
   }
 
   bool operator==(const VSETVLIInfo &Other) const {


        


More information about the llvm-commits mailing list