[llvm] ef16f7a - [CodeGenPrepare] Add missing `static` decl on `matchIncrement()`; NFC

Noah Goldstein via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 01:42:40 PDT 2024


Author: Noah Goldstein
Date: 2024-06-21T16:41:03+08:00
New Revision: ef16f7ac1b3267e11bad464b4116d34396e7967f

URL: https://github.com/llvm/llvm-project/commit/ef16f7ac1b3267e11bad464b4116d34396e7967f
DIFF: https://github.com/llvm/llvm-project/commit/ef16f7ac1b3267e11bad464b4116d34396e7967f.diff

LOG: [CodeGenPrepare] Add missing `static` decl on `matchIncrement()`; NFC

Added: 
    

Modified: 
    llvm/lib/CodeGen/CodeGenPrepare.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index f8fdba2e35dd7..900c33b580f15 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -1499,8 +1499,8 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI,
 // Match a simple increment by constant operation.  Note that if a sub is
 // matched, the step is negated (as if the step had been canonicalized to
 // an add, even though we leave the instruction alone.)
-bool matchIncrement(const Instruction *IVInc, Instruction *&LHS,
-                    Constant *&Step) {
+static bool matchIncrement(const Instruction *IVInc, Instruction *&LHS,
+                           Constant *&Step) {
   if (match(IVInc, m_Add(m_Instruction(LHS), m_Constant(Step))) ||
       match(IVInc, m_ExtractValue<0>(m_Intrinsic<Intrinsic::uadd_with_overflow>(
                        m_Instruction(LHS), m_Constant(Step)))))


        


More information about the llvm-commits mailing list