From 5e8def2f14151655b0cfdb5d3ad591e3b4771e7d Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 17 Jan 2024 19:29:22 +0700 Subject: [PATCH] Revert "[RISCV] Remove dead early exit in performCombineVMergeAndVOps. NFC" This reverts commit cee60a80101dbc2494865910fc7acef4fcab42bd. This change is not NFC because there is also an additional check for isImplicitDef in the branch above. --- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp index df5766a294c982..0d8688ba2eaeaf 100644 --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -3545,6 +3545,9 @@ bool RISCVDAGToDAGISel::performCombineVMergeAndVOps(SDNode *N) { if (IsMasked) { assert(HasTiedDest && "Expected tied dest"); + // The vmerge instruction must be TU. + if (isImplicitDef(Merge)) + return false; // The vmerge instruction must have an all 1s mask since we're going to keep // the mask from the True instruction. // FIXME: Support mask agnostic True instruction which would have an