Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackCounter adds if-check when all BB have a non-zero alloca counter #142

Open
ahueck opened this issue Oct 11, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ahueck
Copy link
Contributor

ahueck commented Oct 11, 2024

Expected: if check is added when not all predecessor BBs have a non-zero counter, see

const auto all_preds_have_counter = llvm::all_of(
llvm::predecessors(I->getParent()), [&allocCounts](const auto* bb) { return allocCounts.count(bb) > 0; });
if (all_preds_have_counter) {
auto* cond = irb->CreateICmpNE(counter_load, instr_helper->getConstantFor(IType::stack_count), "__ta_cond");
auto* then_term = SplitBlockAndInsertIfThen(cond, I, false);
irb->SetInsertPoint(then_term);
}

@ahueck ahueck added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant