[llvm] aa9e4f0 - [RISCV] Refactor mask check in performCombineVMergeAndVOps. NFC
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 7 23:19:42 PDT 2024
Author: Luke Lau
Date: 2024-07-08T14:19:25+08:00
New Revision: aa9e4f0bc93fc735e83ea8b5269e699f31fb9d28
URL: https://github.com/llvm/llvm-project/commit/aa9e4f0bc93fc735e83ea8b5269e699f31fb9d28
DIFF: https://github.com/llvm/llvm-project/commit/aa9e4f0bc93fc735e83ea8b5269e699f31fb9d28.diff
LOG: [RISCV] Refactor mask check in performCombineVMergeAndVOps. NFC
Added:
Modified:
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
index 7bdd4f8f4dbc3..ce6a396e9ced9 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -3737,6 +3737,7 @@ bool RISCVDAGToDAGISel::performCombineVMergeAndVOps(SDNode *N) {
Info = RISCV::getMaskedPseudoInfo(TrueOpc);
IsMasked = true;
}
+ assert(!(IsMasked && !HasTiedDest) && "Expected tied dest");
if (!Info)
return false;
@@ -3756,11 +3757,10 @@ bool RISCVDAGToDAGISel::performCombineVMergeAndVOps(SDNode *N) {
// If True is masked then the vmerge must have an all 1s mask, since we're
// going to keep the mask from True.
- if (IsMasked) {
- assert(HasTiedDest && "Expected tied dest");
+ if (IsMasked && Mask) {
// FIXME: Support mask agnostic True instruction which would have an
// undef merge operand.
- if (Mask && !usesAllOnesMask(Mask, Glue))
+ if (!usesAllOnesMask(Mask, Glue))
return false;
}
More information about the llvm-commits
mailing list