Skip to content

Commit

Permalink
VPlan/Builder: inline VPBuilder::createICmp (NFC) (llvm#105650)
Browse files Browse the repository at this point in the history
Inline VPBuilder::createICmp in the header, in line with the other
VPBuilder functions.
  • Loading branch information
artagnon authored Sep 13, 2024
1 parent b659abe commit 75a57ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 6 additions & 1 deletion llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75a57ed

Please sign in to comment.