Skip to content

[StructurizeCFG] Remove one SSAUpdater::AddAvailableValue. NFCI. #115472

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

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Nov 8, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Nov 8, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Jay Foad (jayfoad)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/115472.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Scalar/StructurizeCFG.cpp (-1)
diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
index 2a0f0423bbc8f6..6eb292e34fd93c 100644
--- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
@@ -616,7 +616,6 @@ void StructurizeCFG::insertConditions(bool Loops) {
     BasicBlock *SuccFalse = Term->getSuccessor(1);
 
     PhiInserter.Initialize(Boolean, "");
-    PhiInserter.AddAvailableValue(&Func->getEntryBlock(), Default);
     PhiInserter.AddAvailableValue(Loops ? SuccFalse : Parent, Default);
 
     BBPredicates &Preds = Loops ? LoopPreds[SuccFalse] : Predicates[SuccTrue];

@jayfoad
Copy link
Contributor Author

jayfoad commented Nov 8, 2024

Found by experimentation. Does anyone know this code well enough to say for sure whether it is redundant? Or are we missing test coverage?

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this would only be needed if there were an unconditional branch from the entry block. But in that case, it would never be necessary to insert a phi there so this seems fine

@jayfoad jayfoad merged commit b535e4e into llvm:main Nov 8, 2024
10 checks passed
@jayfoad jayfoad deleted the structurizer-remove-addavailablevalue branch November 8, 2024 17:20
Groverkss pushed a commit to iree-org/llvm-project that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants