[llvm] [ISel/RISCV] Refactor isPromotedOpNeedingSplit (NFC) (PR #146059)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 04:14:06 PDT 2025


https://github.com/artagnon created https://github.com/llvm/llvm-project/pull/146059

None

>From d477aef13257533c6cbb4ca762520fba45793b96 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
Date: Fri, 27 Jun 2025 12:03:47 +0100
Subject: [PATCH] [ISel/RISCV] Refactor isPromotedOpNeedingSplit (NFC)

---
 llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index c1212a8b1cf17..63167018e9d59 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -7044,13 +7044,10 @@ static unsigned getRISCVVLOp(SDValue Op) {
 
 static bool isPromotedOpNeedingSplit(SDValue Op,
                                      const RISCVSubtarget &Subtarget) {
-  if (Op.getValueType() == MVT::nxv32f16 &&
-      (Subtarget.hasVInstructionsF16Minimal() &&
-       !Subtarget.hasVInstructionsF16()))
-    return true;
-  if (Op.getValueType() == MVT::nxv32bf16)
-    return true;
-  return false;
+  return (Op.getValueType() == MVT::nxv32f16 &&
+          (Subtarget.hasVInstructionsF16Minimal() &&
+           !Subtarget.hasVInstructionsF16())) ||
+         Op.getValueType() == MVT::nxv32bf16;
 }
 
 static SDValue SplitVectorOp(SDValue Op, SelectionDAG &DAG) {



More information about the llvm-commits mailing list