Skip to content

Commit 75a57ed

Browse files
authored
VPlan/Builder: inline VPBuilder::createICmp (NFC) (#105650)
Inline VPBuilder::createICmp in the header, in line with the other VPBuilder functions.
1 parent b659abe commit 75a57ed

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ class VPBuilder {
203203
/// and \p B.
204204
/// TODO: add createFCmp when needed.
205205
VPValue *createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
206-
DebugLoc DL = {}, const Twine &Name = "");
206+
DebugLoc DL = {}, const Twine &Name = "") {
207+
assert(Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
208+
Pred <= CmpInst::LAST_ICMP_PREDICATE && "invalid predicate");
209+
return tryInsertInstruction(
210+
new VPInstruction(Instruction::ICmp, Pred, A, B, DL, Name));
211+
}
207212

208213
//===--------------------------------------------------------------------===//
209214
// RAII helpers.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -6939,14 +6939,6 @@ void LoopVectorizationCostModel::collectInLoopReductions() {
69396939
}
69406940
}
69416941

6942-
VPValue *VPBuilder::createICmp(CmpInst::Predicate Pred, VPValue *A, VPValue *B,
6943-
DebugLoc DL, const Twine &Name) {
6944-
assert(Pred >= CmpInst::FIRST_ICMP_PREDICATE &&
6945-
Pred <= CmpInst::LAST_ICMP_PREDICATE && "invalid predicate");
6946-
return tryInsertInstruction(
6947-
new VPInstruction(Instruction::ICmp, Pred, A, B, DL, Name));
6948-
}
6949-
69506942
// This function will select a scalable VF if the target supports scalable
69516943
// vectors and a fixed one otherwise.
69526944
// TODO: we could return a pair of values that specify the max VF and

0 commit comments

Comments
 (0)