[llvm] [CodeGen] Remove an unnecessary cast (NFC) (PR #151280)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 23:21:06 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/151280

LoopValStage is already of int.


>From 69dcfa56b635f98ecf6fda53fd7ea55b1f992f7f Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 29 Jul 2025 08:59:01 -0700
Subject: [PATCH] [CodeGen] Remove an unnecessary cast (NFC)

LoopValStage is already of int.
---
 llvm/lib/CodeGen/ModuloSchedule.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp
index 0f742c46fd1b3..21bf052d1fdaf 100644
--- a/llvm/lib/CodeGen/ModuloSchedule.cpp
+++ b/llvm/lib/CodeGen/ModuloSchedule.cpp
@@ -423,7 +423,7 @@ void ModuloScheduleExpander::generateExistingPhis(
     // potentially define two values.
     unsigned MaxPhis = PrologStage + 2;
     if (!InKernel && (int)PrologStage <= LoopValStage)
-      MaxPhis = std::max((int)MaxPhis - (int)LoopValStage, 1);
+      MaxPhis = std::max((int)MaxPhis - LoopValStage, 1);
     unsigned NumPhis = std::min(NumStages, MaxPhis);
 
     Register NewReg;



More information about the llvm-commits mailing list