[llvm] [NFC] Fix wrong comment in insertFastDivAndRem (PR #230879)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 19:30:43 PDT 2026


https://github.com/andreww0210 created https://github.com/llvm/llvm-project/pull/230879

The branch checks that the divisor IS a constant, not the opposite.


>From e68b99236668728cae793b89387b7cb61f138737 Mon Sep 17 00:00:00 2001
From: yinghao <itsyinghao at gmail.com>
Date: Sun, 11 Oct 2026 10:22:51 +0800
Subject: [PATCH] [NFC] Fix wrong comment in insertFastDivAndRem

---
 llvm/lib/Transforms/Utils/BypassSlowDivision.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp b/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp
index 54d3790ee3442..8b6aa08492989 100644
--- a/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp
+++ b/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp
@@ -411,7 +411,7 @@ std::optional<QuotRemPair> FastDivInsertionTask::insertFastDivAndRem() {
   }
 
   if (isa<ConstantInt>(Divisor)) {
-    // If the divisor is not a constant, DAGCombiner will convert it to a
+    // If the divisor is a constant, DAGCombiner will convert it to a
     // multiplication by a magic constant.  It isn't clear if it is worth
     // introducing control flow to get a narrower multiply.
     return std::nullopt;



More information about the llvm-commits mailing list