diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp index e1c7cb36669fe..48124160aa268 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 {