C++: Use GVN for base case.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-07-16 11:00:14 +01:00
parent 575fbd2578
commit d539ce0a01

View File

@@ -40,7 +40,10 @@ predicate isGuarded(SubExpr sub, Expr left, Expr right) {
*/
Expr exprIsLeftOrLessBase(SubExpr sub) {
interestingSubExpr(sub, _) and // Manual magic
result = sub.getLeftOperand()
exists(Expr e | globalValueNumber(e).getAnExpr() = sub.getLeftOperand() |
// result = sub.getLeftOperand() so result <= sub.getLeftOperand()
result = e
)
}
/**