Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
avevad committed May 29, 2024
1 parent c6fee41 commit 8278540
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ydb/library/yql/minikql/comp_nodes/mkql_wide_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ TBaseComputation::TGenerateResult GenFetchProcess(Value* statePtrVal, const TCod
auto maybeResultVal = PHINode::Create(TMaybeFetchResult::LLVMType(context), 3, "maybe_res", pass);

auto stateVal = new LoadInst(statePtrVal->getType()->getPointerElementType(), statePtrVal, "state", block);
auto needFetchCond = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, ConstantInt::get(stateVal->getType(), 1), stateVal, "need_fetch", block);
auto needFetchCond = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, GetTrue(context), stateVal, "need_fetch", block);
maybeResultVal->addIncoming(TMaybeFetchResult(EFetchResult::Finish).LLVMConst(context), block);
BranchInst::Create(fetch, pass, needFetchCond, block);

Expand All @@ -275,7 +275,7 @@ TBaseComputation::TGenerateResult GenFetchProcess(Value* statePtrVal, const TCod

block = check;
auto predicateCond = GenGetPredicate<false>(ctx, fetchGetters, block);
auto newStateVal = SelectInst::Create(predicateCond, ConstantInt::get(stateVal->getType(), 0), ConstantInt::get(stateVal->getType(), 1), "new_state", block);
auto newStateVal = SelectInst::Create(predicateCond, GetFalse(context), GetTrue(context), "new_state", block);
new StoreInst(newStateVal, statePtrVal, block);
auto retOneCond = Inclusive ? ConstantInt::getTrue(context) : predicateCond;
auto retStatusVal = SelectInst::Create(retOneCond, TMaybeFetchResult(EFetchResult::One).LLVMConst(context), TMaybeFetchResult(EFetchResult::Finish).LLVMConst(context), "ret_status", block);
Expand Down Expand Up @@ -339,7 +339,7 @@ using TBaseComputation = TSimpleStatefulWideFlowCodegeneratorNode<TWideSkipWhile

auto [fetchResVal, fetchGetters] = fetchGenerator(ctx, block);
auto stateVal = new LoadInst(statePtrVal->getType()->getPointerElementType(), statePtrVal, "state", block);
auto needCheckCond = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, ConstantInt::get(stateVal->getType(), 1), stateVal, "need_check", block);
auto needCheckCond = CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, GetTrue(context), stateVal, "need_check", block);
auto oneCond = CmpInst::Create(Instruction::ICmp, CmpInst::ICMP_EQ, ConstantInt::get(fetchResVal->getType(), static_cast<i32>(EFetchResult::One)), fetchResVal, "one", block);
auto willCheckCond = BinaryOperator::Create(Instruction::And, needCheckCond, oneCond, "will_check", block);
maybeResultVal->addIncoming(TMaybeFetchResult::LLVMFromFetchResult(fetchResVal, "fetch_res_ext", block), block);
Expand All @@ -351,7 +351,7 @@ using TBaseComputation = TSimpleStatefulWideFlowCodegeneratorNode<TWideSkipWhile
BranchInst::Create(pass, save, predicateCond, block);

block = save;
new StoreInst(ConstantInt::get(stateVal->getType(), 1), statePtrVal, block);
new StoreInst(GetTrue(context), statePtrVal, block);
maybeResultVal->addIncoming((Inclusive ? TMaybeFetchResult::None() : TMaybeFetchResult(EFetchResult::One)).LLVMConst(context), block);
BranchInst::Create(pass, block);

Expand Down

0 comments on commit 8278540

Please sign in to comment.