Skip to content

Commit aa9e4f0

Browse files
committed
[RISCV] Refactor mask check in performCombineVMergeAndVOps. NFC
1 parent ef465bf commit aa9e4f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -3737,6 +3737,7 @@ bool RISCVDAGToDAGISel::performCombineVMergeAndVOps(SDNode *N) {
37373737
Info = RISCV::getMaskedPseudoInfo(TrueOpc);
37383738
IsMasked = true;
37393739
}
3740+
assert(!(IsMasked && !HasTiedDest) && "Expected tied dest");
37403741

37413742
if (!Info)
37423743
return false;
@@ -3756,11 +3757,10 @@ bool RISCVDAGToDAGISel::performCombineVMergeAndVOps(SDNode *N) {
37563757

37573758
// If True is masked then the vmerge must have an all 1s mask, since we're
37583759
// going to keep the mask from True.
3759-
if (IsMasked) {
3760-
assert(HasTiedDest && "Expected tied dest");
3760+
if (IsMasked && Mask) {
37613761
// FIXME: Support mask agnostic True instruction which would have an
37623762
// undef merge operand.
3763-
if (Mask && !usesAllOnesMask(Mask, Glue))
3763+
if (!usesAllOnesMask(Mask, Glue))
37643764
return false;
37653765
}
37663766

0 commit comments

Comments
 (0)