[llvm] 75a57ed - VPlan/Builder: inline VPBuilder::createICmp (NFC) (#105650)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 12:08:15 PDT 2024


Author: Ramkumar Ramachandra
Date: 2024-09-13T20:08:11+01:00
New Revision: 75a57edadc9213bf404c67ff4949217da5b4d0ff

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

LOG: VPlan/Builder: inline VPBuilder::createICmp (NFC) (#105650)

Inline VPBuilder::createICmp in the header, in line with the other
VPBuilder functions.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index 322b431e073d40..9979081b6decc9 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -203,7 +203,12 @@ class VPBuilder {
   /// and \p B.
   /// TODO: add createFCmp when needed.
   VPValue *createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
-                      DebugLoc DL = {}, const Twine &Name = "");
+                      DebugLoc DL = {}, const Twine &Name = "") {
+    assert(Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
+           Pred <= CmpInst::LAST_ICMP_PREDICATE && "invalid predicate");
+    return tryInsertInstruction(
+        new VPInstruction(Instruction::ICmp, Pred, A, B, DL, Name));
+  }
 
   //===--------------------------------------------------------------------===//
   // RAII helpers.

diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 1f13253216962e..3a313a96be7e85 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6939,14 +6939,6 @@ void LoopVectorizationCostModel::collectInLoopReductions() {
   }
 }
 
-VPValue *VPBuilder::createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
-                               DebugLoc DL, const Twine &Name) {
-  assert(Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
-         Pred <= CmpInst::LAST_ICMP_PREDICATE && "invalid predicate");
-  return tryInsertInstruction(
-      new VPInstruction(Instruction::ICmp, Pred, A, B, DL, Name));
-}
-
 // This function will select a scalable VF if the target supports scalable
 // vectors and a fixed one otherwise.
 // TODO: we could return a pair of values that specify the max VF and


        


More information about the llvm-commits mailing list