VPlan/Builder: inline VPBuilder::createICmp (NFC)#105650
Merged
Conversation
Inline VPBuilder::createICmp in the header, in line with the other VPBuilder functions.
Member
|
@llvm/pr-subscribers-llvm-transforms Author: Ramkumar Ramachandra (artagnon) ChangesInline VPBuilder::createICmp in the header, in line with the other VPBuilder functions. Full diff: https://github.com/llvm/llvm-project/pull/105650.diff 2 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index 3bb7a8e651a3f6..968cab7bd77b15 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -200,7 +200,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 2145bb8c9ca872..6c9810b1df87fb 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6903,14 +6903,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
|
Contributor
Author
|
Gentle ping. This change should be straightforward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inline VPBuilder::createICmp in the header, in line with the other VPBuilder functions.