From 8590a35ef9003189bfe29f7abe8e33e7427b28b2 Mon Sep 17 00:00:00 2001 From: Yeting Kuo Date: Fri, 1 Jul 2022 15:25:54 +0800 Subject: [PATCH] [RISCV][NFC] Simplify condition of IsTU. Just simplify code. Reviewed By: khchen Differential Revision: https://reviews.llvm.org/D128972 --- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp index 1d14d76..b065170 100644 --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -1364,7 +1364,7 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { unsigned CurOp = 2; // Masked intrinsic only have TU version pseduo instructions. - bool IsTU = IsMasked || (!IsMasked && !Node->getOperand(CurOp).isUndef()); + bool IsTU = IsMasked || !Node->getOperand(CurOp).isUndef(); SmallVector Operands; if (IsTU) Operands.push_back(Node->getOperand(CurOp++)); @@ -1416,9 +1416,8 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { // The riscv_vlm intrinsic are always tail agnostic and no passthru operand. bool HasPassthruOperand = IntNo != Intrinsic::riscv_vlm; // Masked intrinsic only have TU version pseduo instructions. - bool IsTU = - HasPassthruOperand && - ((!IsMasked && !Node->getOperand(CurOp).isUndef()) || IsMasked); + bool IsTU = HasPassthruOperand && + (IsMasked || !Node->getOperand(CurOp).isUndef()); SmallVector Operands; if (IsTU) Operands.push_back(Node->getOperand(CurOp++)); @@ -1451,7 +1450,7 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { unsigned CurOp = 2; // Masked intrinsic only have TU version pseduo instructions. - bool IsTU = IsMasked || (!IsMasked && !Node->getOperand(CurOp).isUndef()); + bool IsTU = IsMasked || !Node->getOperand(CurOp).isUndef(); SmallVector Operands; if (IsTU) Operands.push_back(Node->getOperand(CurOp++)); -- 2.7.4