[llvm] [RISCV][VLOPT] Remove dead passthru check in getOperandLog2EEW. NFC (PR #123911)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 01:02:25 PST 2025


https://github.com/lukel97 created https://github.com/llvm/llvm-project/pull/123911

We already bail if the user is tied in checkUsers, which is true for all passthrus. Remove the check in getOperandLog2EEW so that it only worries about computing the OperandInfo, and leaves the passthru correctness to checkUsers.


>From c0acea6298ab79582f4af292648421b7d99f5bee Mon Sep 17 00:00:00 2001
From: Luke Lau <luke at igalia.com>
Date: Wed, 22 Jan 2025 16:57:38 +0800
Subject: [PATCH] [RISCV][VLOPT] Remove dead passthru check in
 getOperandLog2EEW. NFC

We already bail if the user is tied in checkUsers, which is true for all passthrus. Remove the check in getOperandLog2EEW so that it only worries about computing the OperandInfo, and leaves the passthru correctness to checkUsers.
---
 llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp b/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
index 54ca8ccd8d9e90..2213339472c6ba 100644
--- a/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+++ b/llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
@@ -208,13 +208,6 @@ getOperandLog2EEW(const MachineOperand &MO, const MachineRegisterInfo *MRI) {
   const bool HasPassthru = RISCVII::isFirstDefTiedToFirstUse(MI.getDesc());
   const bool IsTied = RISCVII::isTiedPseudo(MI.getDesc().TSFlags);
 
-  // We bail out early for instructions that have passthru with non NoRegister,
-  // which means they are using TU policy. We are not interested in these
-  // since they must preserve the entire register content.
-  if (HasPassthru && MO.getOperandNo() == MI.getNumExplicitDefs() &&
-      (MO.getReg() != RISCV::NoRegister))
-    return std::nullopt;
-
   bool IsMODef = MO.getOperandNo() == 0;
 
   // All mask operands have EEW=1



More information about the llvm-commits mailing list