Skip to content

Commit

Permalink
Merge pull request #5 from slangbot/format-6077-acheney/ifelse2
Browse files Browse the repository at this point in the history
Format code for PR #6077
  • Loading branch information
cheneym2 authored Jan 14, 2025
2 parents d2f55a3 + b42f6b3 commit 8dc571a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/slang/slang-ir-simplify-cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ static bool trySimplifyIfElse(IRBuilder& builder, IRIfElse* ifElseInst)
// If either branch of `if-else` is a trivial jump into after block,
// we can get rid of the entire conditional branch and replace it
// with a jump into the after block.
IRUnconditionalBranch* termInst = as<IRUnconditionalBranch>(ifElseInst->getTrueBlock()->getTerminator());
IRUnconditionalBranch* termInst =
as<IRUnconditionalBranch>(ifElseInst->getTrueBlock()->getTerminator());
if (!termInst || (termInst->getTargetBlock() != ifElseInst->getAfterBlock()))
{
termInst = as<IRUnconditionalBranch>(ifElseInst->getFalseBlock()->getTerminator());
Expand Down

0 comments on commit 8dc571a

Please sign in to comment.