You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (condition1)
C1
else
C2
end if
if (condition2)
C1
else
C2
end if
Now we have a path where we have redundancy of C1 when both conditions are true. However llvm is unable to optimize this and computes C1 again. Godbolt example: https://godbolt.org/z/nvYq7dcee
Clubbing the conditions solves this problem
if (condition1)
C1
if (condition2)
C1
else
C2
end if
else
C2
if (condition2)
C1
else
C2
end if
end if
Consider this case
Now we have a path where we have redundancy of C1 when both conditions are true. However llvm is unable to optimize this and computes C1 again. Godbolt example: https://godbolt.org/z/nvYq7dcee
Clubbing the conditions solves this problem
in this case, the values can be stored in registers.
Refer to section 2 in https://www.brainkart.com/article/Partial-Redundancy-Elimination_8195/ for elaboration:
The text was updated successfully, but these errors were encountered: