Skip to content

Commit

Permalink
[LVI] Don't push both sides of and/or at once
Browse files Browse the repository at this point in the history
Same as the change in d5db2cd,
but for condition handling. The same issue could occur here as well.
  • Loading branch information
nikic committed Jan 2, 2024
1 parent d5db2cd commit a3e8e86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/Analysis/LazyValueInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,9 +1283,11 @@ LazyValueInfoImpl::getValueFromCondition(Value *Val, Value *Cond,

std::optional<ValueLatticeElement> LV =
getValueFromCondition(Val, L, IsTrueDest, UseBlockValue, Depth);
if (!LV)
return std::nullopt;
std::optional<ValueLatticeElement> RV =
getValueFromCondition(Val, R, IsTrueDest, UseBlockValue, Depth);
if (!LV || !RV)
if (!RV)
return std::nullopt;

// if (L && R) -> intersect L and R
Expand Down

0 comments on commit a3e8e86

Please sign in to comment.